From f09162d4ced7ccd4fa125ed52a7235b82ead86d4 Mon Sep 17 00:00:00 2001 From: tth Date: Mon, 25 Oct 2021 20:49:10 +0200 Subject: [PATCH] fixed a little brotch --- funcs/decomprgb.c | 6 +++--- funcs/t.c | 2 +- funcs/tests.c | 4 ++-- funcs/tests.h | 3 ++- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/funcs/decomprgb.c b/funcs/decomprgb.c index 58ef534..55f938e 100644 --- a/funcs/decomprgb.c +++ b/funcs/decomprgb.c @@ -60,6 +60,7 @@ for (y=0; yR[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; yG[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; yB[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; } } diff --git a/funcs/t.c b/funcs/t.c index ad767f0..3734eb7 100644 --- a/funcs/t.c +++ b/funcs/t.c @@ -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); diff --git a/funcs/tests.c b/funcs/tests.c index 6ff3e50..ec0ee73 100644 --- a/funcs/tests.c +++ b/funcs/tests.c @@ -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__); diff --git a/funcs/tests.h b/funcs/tests.h index ef196d0..a4c5a09 100644 --- a/funcs/tests.h +++ b/funcs/tests.h @@ -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);