Browse Source

fixed a little brotch

master
tth 10 months ago
parent
commit
f09162d4ce
  1. 6
      funcs/decomprgb.c
  2. 2
      funcs/t.c
  3. 4
      funcs/tests.c
  4. 3
      funcs/tests.h

6
funcs/decomprgb.c

@ -60,6 +60,7 @@ for (y=0; y<h2; y++) @@ -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++) @@ -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++) @@ -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;
}
}

2
funcs/t.c

@ -232,7 +232,7 @@ switch(opt) { @@ -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);

4
funcs/tests.c

@ -75,7 +75,7 @@ return 0; @@ -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) { @@ -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__);

3
funcs/tests.h

@ -6,7 +6,7 @@ @@ -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); @@ -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);

Loading…
Cancel
Save