big refactoring step 1, expect more bugs

This commit is contained in:
tth
2021-03-09 11:55:48 +01:00
parent 7ada60d113
commit b9d963dfa2
14 changed files with 179 additions and 100 deletions

View File

@@ -49,8 +49,12 @@ else {
}
foo = fimg_meanvalues(psrc, avg);
if (foo) {
fprintf(stderr, "%s: err %d on fimg_meanvalues\n", __func__, foo);
return foo;
}
if (verbosity > 1) {
fprintf(stderr, "mean values : %f %f %f\n", avg[0], avg[1], avg[2]);
fprintf(stderr, "%s: %f %f %f\n", __func__, avg[0], avg[1], avg[2]);
}
#define RP(ix, iy) ( psrc->R[((iy)*psrc->width)+(ix)] < avg[0] )

View File

@@ -38,6 +38,10 @@ if (fimg_images_not_compatible(psrc, pdst)) {
if (psrc != pdst) { /* optimize or futurbug ? */
foo = fimg_copy_data(psrc, pdst);
if (foo) {
fprintf(stderr, "%s: err %d on copy data\n", __func__, foo);
return foo;
}
}
szimg = pdst->width * pdst->height;

View File

@@ -15,7 +15,7 @@ extern int verbosity;
int fimg_rotate_90(FloatImg *src, FloatImg *dst, int notused)
{
int foo;
int x, y, j, k;
int x, y, k;
float rgb[3];
#if DEBUG_LEVEL
@@ -56,7 +56,7 @@ if ( (src->type != dst->type) ||
for (y=0; y<src->height; y++) {
for (x=0; x<src->width; x++) {
fimg_get_rgb(src, x, y, rgb);
j = (dst->height - x) - 1;
// XXX ??? j = (dst->height - x) - 1;
k = (dst->width - y) - 1;
#if DEBUG_LEVEL > 1
fprintf(stderr, "%6d %6d\n", k, j);