adding fimg_get_minmax_rgb function
This commit is contained in:
27
lib/t.c
27
lib/t.c
@@ -55,7 +55,7 @@ int essai_interpolate(int k)
|
||||
FloatImg A, B, C;
|
||||
int foo, idx;
|
||||
char ligne[200];
|
||||
float fval;
|
||||
float fval, minmax[6];
|
||||
|
||||
foo = fimg_create(&A, WI, HI, FIMG_TYPE_RGB);
|
||||
if (foo) {
|
||||
@@ -176,6 +176,29 @@ return 0;
|
||||
|
||||
#undef TAILLE
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
int essai_get_values(char *fname)
|
||||
{
|
||||
int foo;
|
||||
FloatImg dessin;
|
||||
float vals[6];
|
||||
|
||||
foo = fimg_create_from_dump(fname, &dessin);
|
||||
if (foo) {
|
||||
fprintf(stderr, "in %s, error %d loading '%s'\n",
|
||||
__func__, foo, fname);
|
||||
return foo;
|
||||
}
|
||||
|
||||
fimg_get_minmax_rgb(&dessin, vals);
|
||||
|
||||
for (foo=0; foo<6; foo++) {
|
||||
fprintf(stderr, "%7d %17.6g\n", foo, vals[foo]);
|
||||
}
|
||||
|
||||
|
||||
return -1;
|
||||
}
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
int essai_contraste(char *fname)
|
||||
@@ -250,7 +273,7 @@ if (verbosity) fimg_print_version(0);
|
||||
// foo = essai_clone_et_copy(0);
|
||||
// fprintf(stderr, "retour essai clone'n'copy -> %d\n", foo);
|
||||
|
||||
foo = essai_interpolate(0);
|
||||
foo = essai_get_values("quux.fimg");
|
||||
fprintf(stderr, "retour essai interpolate -> %d\n", foo);
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user