5#include "testing/testing.h"
17 {{255, 254, 217, 216}, {230, 230, 230, 230}, {240, 160, 90, 20}},
18 {{0, 1, 2, 3}, {62, 72, 82, 92}, {126, 127, 128, 129}},
19 {{1, 2, 3, 4}, {73, 108, 153, 251}, {128, 129, 130, 131}},
22 {{255, 254, 217, 216}, {230, 230, 230, 230}, {240, 160, 90, 20}},
23 {{0, 1, 2, 3}, {62, 72, 82, 92}, {126, 127, 128, 129}},
24 {{1, 2, 3, 4}, {73, 108, 153, 251}, {128, 129, 130, 131}},
27TEST(math_interp, NearestCharExactSamples)
30 uchar4 exp1 = {73, 108, 153, 251};
38TEST(math_interp, NearestCharHalfwaySamples)
41 uchar4 exp1 = {0, 1, 2, 3};
49TEST(math_interp, NearestFloatExactSamples)
52 float4 exp1 = {73.0f, 108.0f, 153.0f, 251.0f};
60TEST(math_interp, NearestFloatHalfwaySamples)
63 float4 exp1 = {0.0f, 1.0f, 2.0f, 3.0f};
66 float4 exp2 = {255.0f, 254.0f, 217.0f, 216.0f};
71TEST(math_interp, BilinearCharExactSamples)
74 uchar4 exp1 = {73, 108, 153, 251};
82TEST(math_interp, BilinearCharHalfwayUSamples)
85 uchar4 exp1 = {31, 37, 42, 48};
93TEST(math_interp, BilinearCharHalfwayVSamples)
96 uchar4 exp1 = {1, 2, 3, 4};
104TEST(math_interp, BilinearCharSamples)
107 uchar4 exp1 = {136, 133, 132, 130};
116TEST(math_interp, BilinearFloatSamples)
119 float4 exp1 = {135.9375f, 133.28125f, 131.5625f, 129.84375f};
122 float4 exp2 = {219.36f, 191.2f, 166.64f, 142.08f};
127TEST(math_interp, BilinearCharPartiallyOutsideImageBorder)
130 uchar4 exp1 = {1, 1, 2, 2};
136 uchar4 exp3 = {173, 115, 65, 14};
141TEST(math_interp, BilinearCharPartiallyOutsideImage)
144 uint4 exp1 = {1, 2, 3, 4};
150 uint4 exp3 = {240, 160, 90, 20};
155TEST(math_interp, BilinearCharPartiallyOutsideImageWrap)
158 uchar4 exp1 = {65, 66, 67, 68};
164 uchar4 exp3 = {229, 171, 114, 64};
169TEST(math_interp, BilinearFloatPartiallyOutsideImageBorder)
172 float4 exp1 = {0.5f, 1, 1.5f, 2};
175 float4 exp2 = {8.675f, 11.325f, 14.725f, 22.1f};
178 float4 exp3 = {172.8f, 115.2f, 64.8f, 14.4f};
183TEST(math_interp, BilinearFloatPartiallyOutsideImage)
186 float4 exp1 = {1.0f, 2.0f, 3.0f, 4.0f};
189 float4 exp2 = {86.75f, 113.25f, 147.25f, 221.0f};
192 float4 exp3 = {240.0f, 160.0f, 90.0f, 20.0f};
197TEST(math_interp, BilinearFloatPartiallyOutsideImageWrap)
200 float4 exp1 = {64.5f, 65.5f, 66.5f, 67.5f};
214 float4 exp2 = {217.92502f, 202.57501f, 190.22501f, 181.85f};
228 float4 exp3 = {228.96f, 171.27998f, 114.32f, 63.84f};
243 float4 exp4 = {191.5f, 191.0f, 163.5f, 163.0f};
266TEST(math_interp, BilinearCharFullyOutsideImage)
291TEST(math_interp, BilinearFloatFullyOutsideImage)
316TEST(math_interp, CubicBSplineCharExactSamples)
319 uchar4 exp1 = {69, 90, 116, 172};
327TEST(math_interp, CubicBSplineCharSamples)
330 uchar4 exp1 = {142, 136, 131, 128};
338TEST(math_interp, CubicBSplineFloatSamples)
341 float4 exp1 = {142.14418f, 136.255798f, 130.87924f, 127.85243f};
344 float4 exp2 = {202.36082f, 177.13397f, 154.21078f, 132.30153f};
349TEST(math_interp, CubicBSplineCharPartiallyOutsideImage)
352 uchar4 exp1 = {2, 4, 6, 8};
358 uchar4 exp3 = {225, 161, 105, 49};
363TEST(math_interp, CubicBSplineFloatPartiallyOutsideImage)
366 float4 exp1 = {2.29861f, 3.92014f, 5.71528f, 8.430554f};
380 float4 exp2 = {85.41022f, 107.21497f, 135.13849f, 195.49146f};
394 float4 exp3 = {224.73579f, 160.66783f, 104.63521f, 48.60260f};
409 float4 exp4 = {122.66441f, 89.68848f, 60.85706f, 32.02566f};
421 float4 exp5 = {189.57422f, 157.32167f, 122.71796f, 95.81750f};
434TEST(math_interp, CubicMitchellCharExactSamples)
437 uchar4 exp1 = {72, 101, 140, 223};
445TEST(math_interp, CubicMitchellCharSamples)
448 uchar4 exp1 = {135, 132, 130, 127};
457TEST(math_interp, CubicMitchellFloatSamples)
460 float4 exp1 = {134.5659f, 131.91309f, 130.17685f, 126.66989f};
463 float4 exp2 = {216.27115f, 189.30673f, 166.93599f, 143.31964f};
468TEST(math_interp, CubicMitchellCharPartiallyOutsideImage)
471 uchar4 exp1 = {0, 0, 0, 0};
477 uchar4 exp3 = {239, 159, 89, 19};
482TEST(math_interp, CubicMitchellFloatPartiallyOutsideImage)
485 float4 exp1 = {0, 0, 0, 0};
488 float4 exp2 = {87.98676f, 115.63634f, 151.13014f, 228.19823f};
491 float4 exp3 = {238.6136f, 158.58293f, 88.55761f, 18.53225f};
EXPECT_EQ(BLI_expr_pylike_eval(expr, nullptr, 0, &result), EXPR_PYLIKE_INVALID)
static constexpr float float_tolerance
static constexpr int image_width
static constexpr uchar image_char[image_height][image_width][4]
static constexpr float image_fl[image_height][image_width][4]
static constexpr int image_height
uchar4 interpolate_cubic_mitchell_byte(const uchar *buffer, int width, int height, float u, float v)
uchar4 interpolate_bilinear_wrap_byte(const uchar *buffer, int width, int height, float u, float v)
uchar4 interpolate_bilinear_byte(const uchar *buffer, int width, int height, float u, float v)
void interpolate_nearest_border_fl(const float *buffer, float *output, int width, int height, int components, float u, float v)
float4 interpolate_bilinear_border_fl(const float *buffer, int width, int height, float u, float v)
float4 interpolate_bilinear_wrap_fl(const float *buffer, int width, int height, float u, float v)
float4 interpolate_cubic_bspline_fl(const float *buffer, int width, int height, float u, float v)
float4 interpolate_bilinear_fl(const float *buffer, int width, int height, float u, float v)
float4 interpolate_cubic_mitchell_fl(const float *buffer, int width, int height, float u, float v)
void interpolate_bilinear_wrapmode_fl(const float *buffer, float *output, int width, int height, int components, float u, float v, InterpWrapMode wrap_u, InterpWrapMode wrap_v)
uchar4 interpolate_cubic_bspline_byte(const uchar *buffer, int width, int height, float u, float v)
uchar4 interpolate_bilinear_border_byte(const uchar *buffer, int width, int height, float u, float v)
void interpolate_nearest_border_byte(const uchar *buffer, uchar *output, int width, int height, float u, float v)
void interpolate_cubic_bspline_wrapmode_fl(const float *buffer, float *output, int width, int height, int components, float u, float v, InterpWrapMode wrap_u, InterpWrapMode wrap_v)
VecBase< int32_t, 4 > int4
VecBase< uint32_t, 4 > uint4
TEST(compression, filter_transpose_delta)