tuning...

This commit is contained in:
2020-10-26 18:49:37 +01:00
parent 3e820c8298
commit ce02cf96bc
4 changed files with 12 additions and 10 deletions

View File

@@ -43,7 +43,6 @@ foo = fimg_get_minmax_rgb(psrc, minmax);
if (verbosity) {
fimg_print_minmax(minmax, (char *)__func__);
}
dltr = minmax[1] - minmax[0];
dltg = minmax[3] - minmax[2];
dltb = minmax[5] - minmax[4];
@@ -56,10 +55,10 @@ for (y=0; y<psrc->height; y++) {
fimg_get_rgb(psrc, x, y, rgb);
dispx = (float)x + (rgb[1]/dltg * 10.0);
dispx = (float)x + (rgb[1]/dltg * 20.0);
dispy = (float)y + (rgb[2]/dltb * 10.0);
dstx = (int)roundf(dispx - 5.0);
dsty = (int)roundf(dispy - 5.0);
dstx = (int)roundf(dispx - 10.0);
dsty = (int)roundf(dispy - 10.0);
if ( (dstx < 0) || (dsty < 0) ||
(dstx >= psrc->width) ||
@@ -69,7 +68,10 @@ for (y=0; y<psrc->height; y++) {
out++;
}
else {
rgb[1] = rgb[2] = rgb[0];
if (flags & 1) {
/* going monochrome */
rgb[1] = rgb[2] = rgb[0];
}
fimg_put_rgb(pdst, dstx, dsty, rgb);
// fprintf(stderr, "%5d %5d %f\n", dstx, dsty, rgb[1]);
in++;
@@ -82,7 +84,7 @@ for (y=0; y<psrc->height; y++) {
}
}
fprintf(stderr, "%s -------> in %d out %d\n", __func__, in, out);
if (verbosity) fprintf(stderr, "%s -> in %d out %d\n", __func__, in, out);
return 0;
}