diff --git a/funcs/misc-plots.c b/funcs/misc-plots.c index 5bcfbf82..ec22d4e4 100644 --- a/funcs/misc-plots.c +++ b/funcs/misc-plots.c @@ -15,7 +15,7 @@ int fimg_test_pattern(FloatImg *fimg, int type, double dval) { int nio; int x, y; -float fr, fg, fb; +float fr, fg, fb, val; #if DEBUG_LEVEL fprintf(stderr, ">>> %s ( %p %d %g )\n", __func__, fimg, type, dval); @@ -27,39 +27,26 @@ if (fimg->type != FIMG_TYPE_RGB) { } /* rampe de primaires dans le quart du haut */ - +val = (float)dval; for (x=0; xwidth; x++) { - nio = x / (fimg->width / 8); - switch(nio) { - case 0: - fr = 0.0, fg = 0.0, fb = 0.0; break; - case 1: - fr = 1.0, fg = 0.0, fb = 0.0; break; - case 2: - fr = 0.0, fg = 1.0, fb = 0.0; break; - case 3: - fr = 1.0, fg = 1.0, fb = 0.0; break; - case 4: - fr = 0.0, fg = 0.0, fb = 1.0; break; - case 5: - fr = 1.0, fg = 0.0, fb = 1.0; break; - case 6: - fr = 0.0, fg = 1.0, fb = 1.0; break; - case 7: - fr = 1.0, fg = 1.0, fb = 1.0; break; + case 0: fr = 0.0, fg = 0.0, fb = 0.0; break; + case 1: fr = val, fg = 0.0, fb = 0.0; break; + case 2: fr = 0.0, fg = val, fb = 0.0; break; + case 3: fr = val, fg = val, fb = 0.0; break; + case 4: fr = 0.0, fg = 0.0, fb = val; break; + case 5: fr = val, fg = 0.0, fb = val; break; + case 6: fr = 0.0, fg = val, fb = val; break; + case 7: fr = val, fg = val, fb = val; break; default: - // abort(); - break; + abort(); break; } - for (y=0; yheight/4; y++) fimg_plot_rgb(fimg, x, y, fr, fg, fb); - } -return -1; +return 0; } /* --------------------------------------------------------------------- */ int fimg_draw_something(FloatImg *fimg) diff --git a/tools/mkfimg.c b/tools/mkfimg.c index 98121b80..392b4e6f 100644 --- a/tools/mkfimg.c +++ b/tools/mkfimg.c @@ -14,6 +14,7 @@ int verbosity; #define T_GRAY 3 #define T_HDEG_A 4 #define T_VDEG_A 5 +#define T_TPAT0 6 typedef struct { int code; @@ -27,7 +28,7 @@ Type types[] = { { T_GRAY, "grey" }, { T_HDEG_A, "hdeg" }, { T_VDEG_A, "vdeg" }, - + { T_TPAT0, "tpat0" }, { 0, NULL } }; @@ -128,6 +129,7 @@ switch(type) { break; case T_HDEG_A: fimg_hdeg_a(&fimg, 1.0); break; case T_VDEG_A: fimg_vdeg_a(&fimg, 1.0); break; + case T_TPAT0: fimg_test_pattern(&fimg, 0, fvalue); break; } foo = fimg_dump_to_file(&fimg, fname, 0);