From 6b95c2dba6e223f8f80a2258061a967683db865e Mon Sep 17 00:00:00 2001 From: tth Date: Sat, 10 Oct 2020 01:26:42 +0200 Subject: [PATCH] more pixel qsorting --- funcs/qsortrgb.c | 8 ++++---- funcs/t.c | 2 -- funcs/vroum.sh | 6 +++--- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/funcs/qsortrgb.c b/funcs/qsortrgb.c index 811f97d3..6a1a96a9 100644 --- a/funcs/qsortrgb.c +++ b/funcs/qsortrgb.c @@ -58,16 +58,16 @@ int x, y, szimg; pix *ppix, *ptr; float rgb[3]; -// #if DEBUG_LEVEL +#if DEBUG_LEVEL fprintf(stderr, ">>> %s ( %p %p %d )\n", __func__, psrc, pdst, notused); -// #endif +#endif szimg = pdst->width * pdst->height; fprintf(stderr, "%s : %d pixels\n", __func__, szimg); ppix = calloc(szimg, sizeof(pix)); -ptr = ppix; /* mobile pointer */ +ptr = ppix; /* mobile pointer */ for (y=0; yheight; y++) { for (x=0; xwidth; x++) { @@ -84,7 +84,7 @@ for (y=0; yheight; y++) { qsort(ppix, szimg, sizeof(pix), compare_b); -ptr = ppix; /* mobile pointer */ +ptr = ppix; /* mobile pointer */ for (y=0; yheight; y++) { for (x=0; xwidth; x++) { diff --git a/funcs/t.c b/funcs/t.c index 8e733c37..d7d543b2 100644 --- a/funcs/t.c +++ b/funcs/t.c @@ -19,8 +19,6 @@ float global_fvalue; * nouveau 7 octobre 2020 pendant sonoptic */ -// - int essai_qsort_rgb(char *infile) { FloatImg src, dst; diff --git a/funcs/vroum.sh b/funcs/vroum.sh index 4d3949b1..d0bf7ce9 100755 --- a/funcs/vroum.sh +++ b/funcs/vroum.sh @@ -6,7 +6,7 @@ out=out.fimg maxi=99 W="640" H="480" -grabopt=" -s 640x480 -v -p 0 -n 100 -c cos01 " +grabopt=" -s 640x480 -v -p 0 -n 500 -c cos01 " mkdir /tmp/V @@ -15,12 +15,12 @@ G=$(printf "%dx%d+0+0" $W $H) for foo in $(seq 0 $maxi) do - echo + echo ; echo grabvidseq -$grabopt -o $src fval=$(echo "$foo / $maxi" | bc -l) - ./t -k $fval -v qsortrgb $src + ./t -k $fval qsortrgb $src echo $foo ' = ' $fval dst=$(printf "/tmp/V/%03d.png" $foo)