rien ne marche, on verra un autre jour...

This commit is contained in:
tth 2020-09-10 11:17:09 +02:00
parent 8b4603fa21
commit 607a37c901

View File

@ -1,6 +1,11 @@
/* /*
* FloatImg library * FloatImg library
* HUE - SATURATION - VALUE * HUE - SATURATION - VALUE
+---------------------------------------------+
| ce code ne fonctionne vraiment PAS ! |
+---------------------------------------------+
*/ */
#include <stdio.h> #include <stdio.h>
@ -111,9 +116,12 @@ return 0;
} }
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
/*
* expect garbage !
*/
int fimg_essai_hsv(char *fname) int fimg_essai_hsv(char *fname)
{ {
float colors[3], values[3]; float colors[3], values[3], newcols[3];
int foo, r, g, b; int foo, r, g, b;
#define INC 16 #define INC 16
@ -128,12 +136,22 @@ for (r=0; r<255; r+=INC) {
colors[2] = (float)b; colors[2] = (float)b;
foo = fimg_rgb2hsv(colors, values, 255.0); foo = fimg_rgb2hsv(colors, values, 255.0);
if (foo) { if (foo) {
fprintf(stderr, "%s: err %d in rgv->hsv\n", __func__, foo);
exit(1); exit(1);
} }
printf(" %9.5f %9.5f %9.5f\n", printf(" %8.4f %8.4f %8.4f ",
values[0], values[1], values[2]); values[0], values[1], values[2]);
foo = fimg_hsv2rgb(values, newcols, 255.0);
if (foo) {
fprintf(stderr, "%s: err %d in hsv->rgb\n", __func__, foo);
exit(1);
}
printf(" %8.4f %8.4f %8.4f\n",
newcols[0], newcols[1], newcols[2]);
} }
} }
} }