Blender V5.0
scaling.cc File Reference
#include "BLI_math_vector.hh"
#include "BLI_task.hh"
#include "BLI_utildefines.h"
#include "MEM_guardedalloc.h"
#include "IMB_filter.hh"
#include "IMB_imbuf.hh"
#include "IMB_imbuf_types.hh"
#include "IMB_interp.hh"
#include "IMB_metadata.hh"
#include "BLI_sys_types.h"

Go to the source code of this file.

Classes

struct  ScaleDownX
struct  ScaleDownY
struct  ScaleUpX
struct  ScaleUpY

Typedefs

using ScaleFunction
using float2
using float3
using float4
using uchar4

Functions

static void alloc_scale_dst_buffers (const ImBuf *ibuf, uint newx, uint newy, uchar4 **r_dst_byte, float **r_dst_float)
static float4 load_pixel (const uchar4 *ptr)
static float4 load_pixel (const float *ptr)
static float4 load_pixel (const float2 *ptr)
static float4 load_pixel (const float3 *ptr)
static float4 load_pixel (const float4 *ptr)
static void store_pixel (float4 pix, uchar4 *ptr)
static void store_pixel (float4 pix, float *ptr)
static void store_pixel (float4 pix, float2 *ptr)
static void store_pixel (float4 pix, float3 *ptr)
static void store_pixel (float4 pix, float4 *ptr)
template<typename T>
static void instantiate_pixel_op (T &, const ImBuf *ibuf, int newx, int newy, uchar4 *dst_byte, float *dst_float, bool threaded)
static void scale_down_x_func (const ImBuf *ibuf, int newx, int newy, uchar4 *dst_byte, float *dst_float, bool threaded)
static void scale_down_y_func (const ImBuf *ibuf, int newx, int newy, uchar4 *dst_byte, float *dst_float, bool threaded)
static void scale_up_x_func (const ImBuf *ibuf, int newx, int newy, uchar4 *dst_byte, float *dst_float, bool threaded)
static void scale_up_y_func (const ImBuf *ibuf, int newx, int newy, uchar4 *dst_byte, float *dst_float, bool threaded)
static void scale_with_function (ImBuf *ibuf, int newx, int newy, ScaleFunction func, bool threaded)
static void imb_scale_box (ImBuf *ibuf, uint newx, uint newy, bool threaded)
template<typename T>
static void scale_nearest (const T *src, T *dst, int ibufx, int ibufy, int newx, int newy, blender::IndexRange y_range)
static void scale_nearest_func (const ImBuf *ibuf, int newx, int newy, uchar4 *dst_byte, float *dst_float, bool threaded)
static void scale_bilinear_func (const ImBuf *ibuf, int newx, int newy, uchar4 *dst_byte, float *dst_float, bool threaded)
bool IMB_scale (ImBuf *ibuf, uint newx, uint newy, IMBScaleFilter filter, bool threaded)
ImBufIMB_scale_into_new (const ImBuf *ibuf, uint newx, uint newy, IMBScaleFilter filter, bool threaded)

Typedef Documentation

◆ float2

Definition at line 618 of file BLI_math_vector_types.hh.

◆ float3

Definition at line 619 of file BLI_math_vector_types.hh.

◆ float4

Definition at line 620 of file BLI_math_vector_types.hh.

◆ ScaleFunction

Initial value:
void (*)(
const ImBuf *ibuf, int newx, int newy, uchar4 *dst_byte, float *dst_float, bool threaded)

Definition at line 336 of file scaling.cc.

◆ uchar4

Definition at line 599 of file BLI_math_vector_types.hh.

Function Documentation

◆ alloc_scale_dst_buffers()

void alloc_scale_dst_buffers ( const ImBuf * ibuf,
uint newx,
uint newy,
uchar4 ** r_dst_byte,
float ** r_dst_float )
static

◆ IMB_scale()

◆ imb_scale_box()

void imb_scale_box ( ImBuf * ibuf,
uint newx,
uint newy,
bool threaded )
static

◆ IMB_scale_into_new()

◆ instantiate_pixel_op()

template<typename T>
void instantiate_pixel_op ( T & ,
const ImBuf * ibuf,
int newx,
int newy,
uchar4 * dst_byte,
float * dst_float,
bool threaded )
static

◆ load_pixel() [1/5]

float4 load_pixel ( const float * ptr)
inlinestatic

Definition at line 56 of file scaling.cc.

References ptr.

◆ load_pixel() [2/5]

float4 load_pixel ( const float2 * ptr)
inlinestatic

Definition at line 60 of file scaling.cc.

References ptr.

◆ load_pixel() [3/5]

float4 load_pixel ( const float3 * ptr)
inlinestatic

Definition at line 64 of file scaling.cc.

References ptr.

◆ load_pixel() [4/5]

float4 load_pixel ( const float4 * ptr)
inlinestatic

Definition at line 68 of file scaling.cc.

References ptr.

◆ load_pixel() [5/5]

float4 load_pixel ( const uchar4 * ptr)
inlinestatic

Definition at line 52 of file scaling.cc.

References ptr.

Referenced by ScaleDownX::op(), ScaleDownY::op(), ScaleUpX::op(), and ScaleUpY::op().

◆ scale_bilinear_func()

void scale_bilinear_func ( const ImBuf * ibuf,
int newx,
int newy,
uchar4 * dst_byte,
float * dst_float,
bool threaded )
static

◆ scale_down_x_func()

void scale_down_x_func ( const ImBuf * ibuf,
int newx,
int newy,
uchar4 * dst_byte,
float * dst_float,
bool threaded )
static

Definition at line 308 of file scaling.cc.

References instantiate_pixel_op().

Referenced by imb_scale_box(), and IMB_scale_into_new().

◆ scale_down_y_func()

void scale_down_y_func ( const ImBuf * ibuf,
int newx,
int newy,
uchar4 * dst_byte,
float * dst_float,
bool threaded )
static

Definition at line 315 of file scaling.cc.

References instantiate_pixel_op().

Referenced by imb_scale_box(), and IMB_scale_into_new().

◆ scale_nearest()

template<typename T>
void scale_nearest ( const T * src,
T * dst,
int ibufx,
int ibufy,
int newx,
int newy,
blender::IndexRange y_range )
static

Definition at line 382 of file scaling.cc.

References blender::IndexRange::first(), T, UNUSED_VARS, x, and y.

Referenced by scale_nearest_func().

◆ scale_nearest_func()

void scale_nearest_func ( const ImBuf * ibuf,
int newx,
int newy,
uchar4 * dst_byte,
float * dst_float,
bool threaded )
static

◆ scale_up_x_func()

void scale_up_x_func ( const ImBuf * ibuf,
int newx,
int newy,
uchar4 * dst_byte,
float * dst_float,
bool threaded )
static

Definition at line 322 of file scaling.cc.

References instantiate_pixel_op().

Referenced by imb_scale_box(), and IMB_scale_into_new().

◆ scale_up_y_func()

void scale_up_y_func ( const ImBuf * ibuf,
int newx,
int newy,
uchar4 * dst_byte,
float * dst_float,
bool threaded )
static

Definition at line 329 of file scaling.cc.

References instantiate_pixel_op().

Referenced by imb_scale_box(), and IMB_scale_into_new().

◆ scale_with_function()

void scale_with_function ( ImBuf * ibuf,
int newx,
int newy,
ScaleFunction func,
bool threaded )
static

◆ store_pixel() [1/5]

void store_pixel ( float4 pix,
float * ptr )
inlinestatic

Definition at line 76 of file scaling.cc.

References ptr, and float4::x.

◆ store_pixel() [2/5]

void store_pixel ( float4 pix,
float2 * ptr )
inlinestatic

Definition at line 80 of file scaling.cc.

References ptr.

◆ store_pixel() [3/5]

void store_pixel ( float4 pix,
float3 * ptr )
inlinestatic

Definition at line 84 of file scaling.cc.

References ptr.

◆ store_pixel() [4/5]

void store_pixel ( float4 pix,
float4 * ptr )
inlinestatic

Definition at line 88 of file scaling.cc.

References ptr.

◆ store_pixel() [5/5]

void store_pixel ( float4 pix,
uchar4 * ptr )
inlinestatic

Definition at line 72 of file scaling.cc.

References ptr, and blender::math::round().

Referenced by ScaleDownX::op(), ScaleDownY::op(), ScaleUpX::op(), and ScaleUpY::op().