Blender V4.3
IMB_scaling_performance_test.cc File Reference
#include "testing/testing.h"
#include "IMB_imbuf.hh"
#include "BLI_math_base.hh"
#include "BLI_math_matrix.hh"
#include "BLI_timeit.hh"

Go to the source code of this file.

Functions

static ImBufcreate_src_image (bool use_float)
 
static void imb_scale_via_transform (ImBuf *&src, int width, int height, eIMBInterpolationFilterMode filter)
 
static void imb_xform_nearest (ImBuf *&src, int width, int height)
 
static void imb_xform_bilinear (ImBuf *&src, int width, int height)
 
static void imb_xform_box (ImBuf *&src, int width, int height)
 
static void imb_scale_nearest_st (ImBuf *&src, int width, int height)
 
static void imb_scale_nearest (ImBuf *&src, int width, int height)
 
static void imb_scale_bilinear_st (ImBuf *&src, int width, int height)
 
static void imb_scale_bilinear (ImBuf *&src, int width, int height)
 
static void imb_scale_box_st (ImBuf *&src, int width, int height)
 
static void imb_scale_box (ImBuf *&src, int width, int height)
 
static void scale_perf_impl (const char *name, bool use_float, void(*func)(ImBuf *&src, int width, int height))
 
static void test_scaling_perf (bool use_float)
 
 TEST (imbuf_scaling, scaling_perf_byte)
 
 TEST (imbuf_scaling, scaling_perf_float)
 

Variables

static constexpr int SRC_X = 5123
 
static constexpr int SRC_Y = 4091
 
static constexpr int DST_SMALLER_X = int(SRC_X * 0.21f)
 
static constexpr int DST_SMALLER_Y = int(SRC_Y * 0.67f)
 
static constexpr int DST_LARGER_X = int(SRC_X * 1.19f)
 
static constexpr int DST_LARGER_Y = int(SRC_Y * 2.13f)
 

Function Documentation

◆ create_src_image()

◆ imb_scale_bilinear()

static void imb_scale_bilinear ( ImBuf *& src,
int width,
int height )
static

Definition at line 91 of file IMB_scaling_performance_test.cc.

References Bilinear, and IMB_scale().

Referenced by test_scaling_perf().

◆ imb_scale_bilinear_st()

static void imb_scale_bilinear_st ( ImBuf *& src,
int width,
int height )
static

Definition at line 87 of file IMB_scaling_performance_test.cc.

References Bilinear, and IMB_scale().

Referenced by test_scaling_perf().

◆ imb_scale_box()

static void imb_scale_box ( ImBuf *& src,
int width,
int height )
static

Definition at line 99 of file IMB_scaling_performance_test.cc.

References Box, and IMB_scale().

Referenced by test_scaling_perf().

◆ imb_scale_box_st()

static void imb_scale_box_st ( ImBuf *& src,
int width,
int height )
static

Definition at line 95 of file IMB_scaling_performance_test.cc.

References Box, and IMB_scale().

Referenced by test_scaling_perf().

◆ imb_scale_nearest()

static void imb_scale_nearest ( ImBuf *& src,
int width,
int height )
static

Definition at line 83 of file IMB_scaling_performance_test.cc.

References IMB_scale(), and Nearest.

Referenced by test_scaling_perf().

◆ imb_scale_nearest_st()

static void imb_scale_nearest_st ( ImBuf *& src,
int width,
int height )
static

Definition at line 79 of file IMB_scaling_performance_test.cc.

References IMB_scale(), and Nearest.

Referenced by test_scaling_perf().

◆ imb_scale_via_transform()

◆ imb_xform_bilinear()

static void imb_xform_bilinear ( ImBuf *& src,
int width,
int height )
static

Definition at line 67 of file IMB_scaling_performance_test.cc.

References IMB_FILTER_BILINEAR, and imb_scale_via_transform().

Referenced by test_scaling_perf().

◆ imb_xform_box()

static void imb_xform_box ( ImBuf *& src,
int width,
int height )
static

◆ imb_xform_nearest()

static void imb_xform_nearest ( ImBuf *& src,
int width,
int height )
static

Definition at line 63 of file IMB_scaling_performance_test.cc.

References IMB_FILTER_NEAREST, and imb_scale_via_transform().

Referenced by test_scaling_perf().

◆ scale_perf_impl()

static void scale_perf_impl ( const char * name,
bool use_float,
void(* func )(ImBuf *&src, int width, int height) )
static

◆ TEST() [1/2]

TEST ( imbuf_scaling ,
scaling_perf_byte  )

Definition at line 134 of file IMB_scaling_performance_test.cc.

References test_scaling_perf().

◆ TEST() [2/2]

TEST ( imbuf_scaling ,
scaling_perf_float  )

Definition at line 139 of file IMB_scaling_performance_test.cc.

References test_scaling_perf().

◆ test_scaling_perf()

Variable Documentation

◆ DST_LARGER_X

int DST_LARGER_X = int(SRC_X * 1.19f)
staticconstexpr

Definition at line 21 of file IMB_scaling_performance_test.cc.

Referenced by scale_perf_impl().

◆ DST_LARGER_Y

int DST_LARGER_Y = int(SRC_Y * 2.13f)
staticconstexpr

Definition at line 22 of file IMB_scaling_performance_test.cc.

Referenced by scale_perf_impl().

◆ DST_SMALLER_X

int DST_SMALLER_X = int(SRC_X * 0.21f)
staticconstexpr

Definition at line 18 of file IMB_scaling_performance_test.cc.

Referenced by scale_perf_impl().

◆ DST_SMALLER_Y

int DST_SMALLER_Y = int(SRC_Y * 0.67f)
staticconstexpr

Definition at line 19 of file IMB_scaling_performance_test.cc.

Referenced by scale_perf_impl().

◆ SRC_X

int SRC_X = 5123
staticconstexpr

Definition at line 15 of file IMB_scaling_performance_test.cc.

Referenced by create_src_image(), and scale_perf_impl().

◆ SRC_Y

int SRC_Y = 4091
staticconstexpr

Definition at line 16 of file IMB_scaling_performance_test.cc.

Referenced by create_src_image(), and scale_perf_impl().