#ifndef float_image_test_H #define float_image_test_H /* Tools for testing programs that deal with {float_image_t}. */ /* Last edited on 2025-01-30 08:38:37 by stolfi */ #include #include #include typedef void float_image_test_generator_t (r2_t *p, int32_t NC, int32_t NX, int32_t NY, float fs[]); /* Type of a procedure that defines a procedural image with {NC} channels, {NX} columns, and {NY} rows. More precisely, a procedure of this type must return in {fs[0..chns-1]} the value of the pixel whose center is the point {p}. Note that pixel centers have half-integer coordinates. The corners of the image have coordinates {(0,0)} and {(NX,NY)}. The procedure may be called with points {p} slightly outside this rectangle. */ void float_image_test_paint ( float_image_t *img, float_image_test_generator_t *proc, int32_t ns ); /* Paints into {img} the procedural image defined by {proc}. Does antialiazing by taking the Hann-weighted average of {ns × ns} subsampling points over each pixel and adjacent ones. */ /* IMAGE GENERATORS: */ void float_image_test_gen_stripes(r2_t *p, int32_t NC, int32_t NX, int32_t NY, float fs[]); /* Horizontal green stripes plus vertical magenta stripes. */ void float_image_test_gen_checker(r2_t *p, int32_t NC, int32_t NX, int32_t NY, float fs[]); /* A checkerboard pattern, equal to the product of two waves. */ void float_image_test_gen_bullsex(r2_t *p, int32_t NC, int32_t NX, int32_t NY, float fs[]); /* A ripple that increases frequency exponentially from center to corners. */ void float_image_test_gen_bullsqr(r2_t *p, int32_t NC, int32_t NX, int32_t NY, float fs[]); /* A ripple that increases frequency linearly from center to corners. */ void float_image_test_gen_chopsea(r2_t *p, int32_t NC, int32_t NX, int32_t NY, float fs[]); /* A sum of several waves of various frequencies and directions. */ void float_image_test_gen_ripples(r2_t *p, int32_t NC, int32_t NX, int32_t NY, float fs[]); /* A set of circular ripples centered at random points. */ void float_image_test_gen_grittie(r2_t *p, int32_t NC, int32_t NX, int32_t NY, float fs[]); /* Sum of many waves creating a gritty pseudo-noise pattern. */ void float_image_test_gen_uparrow(r2_t *p, int32_t NC, int32_t NX, int32_t NY, float fs[]); /* A large arrow pointing in the direction of incerasing row index. */ #endif