62 printf(
" %+.2e",
p[chan_idx]);
63 if (
x == ti->
width-1) printf(
"\n");
72 for (
int c = 0; c < 4; c += 1) {
82 for (
int y = 0; y < ti->
height; y += 1)
84 printf(
"y = %i\n", y);
85 for (
int c = 0; c < 4; c += 1)
87 for (
int x = 0;
x < ti->
width;
x += 1)
90 printf(
" %+.2e",
p[c]);
101 for (
int c = 0; c < 3; c += 1)
118 for (
int c = 0; c < 3; c += 1)
135 ti->
name =
"all grey";
147 ti->
name =
"all black";
154 ti->
name =
"all white";
162 ti->
name =
"grey space";
166 float val = (float)(
x) / (float)(
width-1);
176 ti->
name =
"single color space";
180 float val = (float)(
x) / (float)(
width-1);
190 ti->
name =
"three color space";
194 float val = (float)(
x) / (float)(
width-1);
204 ti->
name =
"rgb space";
205 float *tmp = calloc(
width,
sizeof(
float));
209 float val = (float)(
x) / (float)(
width-1);
225 const int width = 10;
228 ti->
name =
"grey max dr";
234 case 0:
p[0] =
p[1] =
p[2] = FLT_MIN;
break;
235 case 1:
p[0] =
p[1] =
p[2] = 1e-20f;
break;
236 case 2:
p[0] =
p[1] =
p[2] = 1e-10f;
break;
237 case 3:
p[0] =
p[1] =
p[2] = 1e-5f;
break;
238 case 4:
p[0] =
p[1] =
p[2] = 1e-1f;
break;
239 case 5:
p[0] =
p[1] =
p[2] = 1.0f;
break;
240 case 6:
p[0] =
p[1] =
p[2] = 1e5f;
break;
241 case 7:
p[0] =
p[1] =
p[2] = 1e10f;
break;
242 case 8:
p[0] =
p[1] =
p[2] = 1e20f;
break;
243 case 9:
p[0] =
p[1] =
p[2] = FLT_MAX;
break;
253 ti->
name =
"grey max dr neg";
260 p[0] =
p[1] =
p[2] = -p_tmp[0];
264 p[0] =
p[1] =
p[2] = -0.0f;
273 ti->
name =
"grey with rgb clipping";
277 float val = 0.9f + (float)(
x) / (float)(
width-1) / 10.0f;
static const dt_aligned_pixel_simd_t const dt_adaptation_t const float p
static const dt_aligned_pixel_simd_t value
void testimg_print_chan(const Testimg *const ti, int chan_idx)
Testimg * testimg_gen_all_black(const int width, const int height)
void testimg_free(Testimg *const ti)
Testimg * testimg_gen_grey_max_dr_neg()
float testimg_val_to_log(const float val)
Testimg * testimg_to_log(Testimg *ti)
Testimg * testimg_gen_all_white(const int width, const int height)
Testimg * testimg_gen_three_color_space(const int width)
Testimg * testimg_gen_grey_space(const int width)
void testimg_print_by_chan(const Testimg *const ti)
Testimg * testimg_gen_grey_with_rgb_clipping(const int width)
Testimg * testimg_alloc(const int width, const int height)
void testimg_print_by_pixel(const Testimg *const ti)
Testimg * testimg_gen_grey_max_dr()
Testimg * testimg_gen_rgb_space(const int width)
Testimg * testimg_to_exp(Testimg *ti)
float testimg_val_to_exp(const float val)
Testimg * testimg_gen_single_color_space(const int width, const int color_index)
Testimg * testimg_gen_all_grey(const int width, const int height, const float value)
#define for_testimg_pixels_p_yx(ti)
float * get_pixel(const Testimg *const ti, const int x, const int y)
#define for_testimg_pixels_p_xy(ti)
#define TESTIMG_STD_DYN_RANGE_EV
#define TR_DEBUG(msg,...)