diff --git a/Lib/falsecolors.c b/Lib/falsecolors.c new file mode 100644 index 0000000..5453ff5 --- /dev/null +++ b/Lib/falsecolors.c @@ -0,0 +1,39 @@ +/* + * FALSECOLORS.C + * + * new: Wed Oct 4 07:32:36 UTC 2023 + * + * see also calcluts.c + */ + +#include +#include +#include +#include +#include +#include + +#include "../tthimage.h" + +/*::------------------------------------------------------------------::*/ +/*::------------------------------------------------------------------::*/ +int Image_gen_fc_lut(float maxval, int nbslots, RGB_map *plut) +{ +int idx, ilut; +float fval; + +fprintf(stderr, ">>> %s ( %f %d %p )\n", __func__, maxval, nbslots, plut); + +/* RAZ de les luts */ +memset(plut, 0, sizeof(RGB_map)); + +for (idx=0; idx %d\n", foo); } /* ============================== */ -int essai_draw_paint_rect(char *outga) -{ -Image_Desc *img; -Image_Rect rect; -int foo, x, y; - -fprintf(stderr, ">>> %s ( '%s' )\n", __func__, outga); - -rect.x = 8; rect.y = 8; -rect.w = 6; rect.h = 6; - -if (NULL==(img=Image_alloc(64, 32, 3))) { - abort(); - } - -for (x=0; xwidth; x+=2) { - for (y=0; yheight; y+=2) { - Image_plotRGB(img, x, y, 200, 200, 200); - } - } - -foo = Image_draw_rect(img, &rect, 192, 128, 64); -if (foo) { - fprintf(stderr, "%s: err %d draw rect\n", __func__, foo); - return foo; - } - -rect.x = 24; -foo = Image_paint_rect(img, &rect, 64, 128, 192); -if (foo) { - fprintf(stderr, "%s: err %d paint rect\n", __func__, foo); - return foo; - } - -foo = Image_TGA_save(outga, img, 0); -if (foo) { - fprintf(stderr, "%s: err %d save '%s'\n", __func__, foo, outga); - return foo; - } - -return OLL_KORRECT; -} -/* ============================== */ int main(int argc, char *argv[]) { fprintf(stderr, "*** %s is running\n", argv[0]); -essai_gradients(); - -#if 0 -Image_print_version(2); -Image_print_sizeof_structs("foo"); +if (argc > 1) { + fprintf(stderr, "argument: %s\n", argv[1]); + Image_print_version(0); + Image_print_sizeof_structs("foo"); + } +else { + essai_false_colors(); + } +/* foo = essai_show_t16x24(NULL); fprintf(stderr, "essai show t16x24 --> %d\n", foo); - -foo = essai_draw_paint_rect("foo.tga"); -fprintf(stderr, "essai draw rect --> %d\n", foo); - -Image_egalise_cos01(NULL, NULL, 0); -#endif +*/ return 0; }