fixed a little brotch

This commit is contained in:
tth 2021-10-25 20:49:10 +02:00
parent 8dbe6dd5c1
commit f09162d4ce
4 changed files with 8 additions and 7 deletions

View File

@ -60,6 +60,7 @@ for (y=0; y<h2; y++)
getRpix(psrc, x2+1, y2+1);
cumul /= 4, vgray = cumul;
pdst->R[pixidx(pdst,x,y)] = cumul;
pdst->R[pixidx(pdst,x+w2,y+h2)] = cumul;
cumul = getGpix(psrc, x2, y2) +
getGpix(psrc, x2, y2+1) +
@ -67,6 +68,7 @@ for (y=0; y<h2; y++)
getGpix(psrc, x2+1, y2+1);
cumul /= 4, vgray += cumul;
pdst->G[pixidx(pdst,x+w2,y)] = cumul;
pdst->G[pixidx(pdst,x+w2,y+h2)] = cumul;
cumul = getBpix(psrc, x2, y2) +
getBpix(psrc, x2, y2+1) +
@ -74,10 +76,8 @@ for (y=0; y<h2; y++)
getBpix(psrc, x2+1, y2+1);
cumul /= 4, vgray += cumul;
pdst->B[pixidx(pdst,x,y+h2)] = cumul;
pdst->B[pixidx(pdst,x+w2,y+h2)] = cumul;
idx = pixidx(pdst,x+w2,y+h2);
pdst->R[idx] = pdst->G[idx] = \
pdst->B[idx] = vgray / 3.0;
}
}

View File

@ -232,7 +232,7 @@ switch(opt) {
foo = essai_split_level(filename, outfile, 0);
break;
case DecompRgbz:
foo = essai_decomprgb(filename, outfile);
foo = essai_decomprgb_color(filename, outfile);
break;
case Rectangle:
essai_rectangle(outfile, 0);

View File

@ -75,7 +75,7 @@ return 0;
}
/* --------------------------------------------------------------------- */
/* --------------------------------------------------------------------- */
int essai_decomprgb(char *inf, char *outf)
int essai_decomprgb_color(char *inf, char *outf)
{
int foo;
FloatImg src, dst;
@ -90,7 +90,7 @@ if (0 != foo) {
}
fimg_clone(&src, &dst, 1);
foo = fimg_decomp_rgbz_gray(&src, &dst, 0);
foo = fimg_decomp_rgbz_color(&src, &dst, 0);
if (foo) {
fprintf(stderr, "%s:%s(): fail %d line %d\n",
__FILE__, __func__, foo, __LINE__);

View File

@ -6,7 +6,7 @@
int essai_plasma(char *infile, char *outfile, int ikoef, float fkoef);
int essai_miroir(char *inf, char *outf, int flags);
int essai_killrgb(char *inf, char *outf);
int essai_decomprgb(char *inf, char *outf);
int essai_decomprgb_color(char *inf, char *outf);
int essai_split_level(char *inf, char *outf, int flags);
int essai_displacement(char *infile, char *outfile);
@ -35,3 +35,4 @@ int essai_openexr(char *inf, char *outf, int flags);
int essai_pixelize(char *infile, char *outfile);
int essai_rectangle(char *outf, int k);