Blender V4.3
scaling.cc File Reference
#include <cmath>
#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 "BLI_sys_types.h"

Go to the source code of this file.

Classes

struct  ScaleDownX
 
struct  ScaleDownY
 
struct  ScaleUpX
 
struct  ScaleUpY
 

Typedefs

using ScaleFunction
 

Functions

static void imb_half_x_no_alloc (ImBuf *ibuf2, ImBuf *ibuf1)
 
ImBufIMB_half_x (ImBuf *ibuf1)
 
static void imb_half_y_no_alloc (ImBuf *ibuf2, ImBuf *ibuf1)
 
ImBufIMB_half_y (ImBuf *ibuf1)
 
MINLINE void straight_uchar_to_premul_ushort (ushort result[4], const uchar color[4])
 
MINLINE void premul_ushort_to_straight_uchar (uchar *result, const ushort color[4])
 
void imb_onehalf_no_alloc (ImBuf *ibuf2, ImBuf *ibuf1)
 
ImBufIMB_onehalf (ImBuf *ibuf1)
 
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)
 

Typedef Documentation

◆ ScaleFunction

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

Definition at line 650 of file scaling.cc.

Function Documentation

◆ alloc_scale_dst_buffers()

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

◆ IMB_half_x()

◆ imb_half_x_no_alloc()

static void imb_half_x_no_alloc ( ImBuf * ibuf2,
ImBuf * ibuf1 )
static

◆ IMB_half_y()

◆ imb_half_y_no_alloc()

static void imb_half_y_no_alloc ( ImBuf * ibuf2,
ImBuf * ibuf1 )
static

◆ IMB_onehalf()

◆ imb_onehalf_no_alloc()

void imb_onehalf_no_alloc ( ImBuf * ibuf2,
ImBuf * ibuf1 )

◆ IMB_scale()

◆ imb_scale_box()

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

◆ instantiate_pixel_op()

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

◆ load_pixel() [1/5]

static float4 load_pixel ( const float * ptr)
inlinestatic

Definition at line 370 of file scaling.cc.

References ptr.

◆ load_pixel() [2/5]

static float4 load_pixel ( const float2 * ptr)
inlinestatic

Definition at line 374 of file scaling.cc.

References ptr.

◆ load_pixel() [3/5]

static float4 load_pixel ( const float3 * ptr)
inlinestatic

Definition at line 378 of file scaling.cc.

References ptr.

◆ load_pixel() [4/5]

static float4 load_pixel ( const float4 * ptr)
inlinestatic

Definition at line 382 of file scaling.cc.

References ptr.

◆ load_pixel() [5/5]

static float4 load_pixel ( const uchar4 * ptr)
inlinestatic

Definition at line 366 of file scaling.cc.

References ptr.

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

◆ premul_ushort_to_straight_uchar()

MINLINE void premul_ushort_to_straight_uchar ( uchar * result,
const ushort color[4] )

Definition at line 218 of file scaling.cc.

References unit_ushort_to_uchar.

Referenced by imb_onehalf_no_alloc().

◆ scale_bilinear_func()

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

◆ scale_down_x_func()

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

Definition at line 622 of file scaling.cc.

References instantiate_pixel_op().

Referenced by imb_scale_box().

◆ scale_down_y_func()

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

Definition at line 629 of file scaling.cc.

References instantiate_pixel_op().

Referenced by imb_scale_box().

◆ scale_nearest()

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

Definition at line 696 of file scaling.cc.

References blender::IndexRange::first(), and UNUSED_VARS.

Referenced by scale_nearest_func().

◆ scale_nearest_func()

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

◆ scale_up_x_func()

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

Definition at line 636 of file scaling.cc.

References instantiate_pixel_op().

Referenced by imb_scale_box().

◆ scale_up_y_func()

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

Definition at line 643 of file scaling.cc.

References instantiate_pixel_op().

Referenced by imb_scale_box().

◆ scale_with_function()

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

◆ store_pixel() [1/5]

static void store_pixel ( float4 pix,
float * ptr )
inlinestatic

Definition at line 390 of file scaling.cc.

References ptr.

◆ store_pixel() [2/5]

static void store_pixel ( float4 pix,
float2 * ptr )
inlinestatic

Definition at line 394 of file scaling.cc.

References ptr.

◆ store_pixel() [3/5]

static void store_pixel ( float4 pix,
float3 * ptr )
inlinestatic

Definition at line 398 of file scaling.cc.

References ptr.

◆ store_pixel() [4/5]

static void store_pixel ( float4 pix,
float4 * ptr )
inlinestatic

Definition at line 402 of file scaling.cc.

References ptr.

◆ store_pixel() [5/5]

static void store_pixel ( float4 pix,
uchar4 * ptr )
inlinestatic

Definition at line 386 of file scaling.cc.

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

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

◆ straight_uchar_to_premul_ushort()

MINLINE void straight_uchar_to_premul_ushort ( ushort result[4],
const uchar color[4] )

Definition at line 208 of file scaling.cc.

Referenced by imb_onehalf_no_alloc().