new effect 'suprbg' added to Fonderie

This commit is contained in:
tTh 2023-07-16 14:14:29 +02:00
parent d23a35849a
commit ee5e081031
3 changed files with 33 additions and 3 deletions

View File

@ -17,7 +17,7 @@ BEGIN {
#
{
name = sprintf("CR_%s", $2)
printf " { %-12s, \"%s\", %d, %f }, // #%d\n",
printf " { %-14s, \"%s\", %d, %f }, // #%d\n",
name, $2, $3, $4, $1;
}

View File

@ -250,6 +250,7 @@ static int run_decomprgbz_gray(FloatImg *img, int k)
FloatImg tmp;
int ret;
/* ugly code here */
memset(&tmp, 0, sizeof(FloatImg));
fimg_clone(img, &tmp, 0);
ret = fimg_decomp_rgbz_gray(img, &tmp, k);
@ -259,6 +260,27 @@ fimg_destroy(&tmp);
return ret;
}
/* -------------------------------------------------------------- */
/* new Sun Jul 16 11:27:43 UTC 2023 */
int run_suprbg(FloatImg *img, int notused)
{
FloatImg tmp;
int ret;
if (notused) {
fprintf(stderr, "FATAL: invalid notused in %s\n", __func__);
abort();
}
/* ugly code here */
memset(&tmp, 0, sizeof(FloatImg));
fimg_clone(img, &tmp, 0);
ret = poke_sup_rb_g(img, &tmp);
fimg_copy_data(&tmp, img);
fimg_destroy(&tmp);
return 0;
}
/* -------------------------------------------------------------- */
/*
* This is the main filter engine used both for input and
* output processing. It can be called by the filterstack
@ -454,10 +476,13 @@ switch (idFx) {
break;
case CR_fluffy:
// fprintf(stderr, "******* TO BE DONE ********\n");
retval = run_rndfluffy(image, 75);
break;
case CR_suprbg:
retval = run_suprbg(image, 0);
break;
default :
fprintf(stderr, "%s : effect #%d invalid\n",
__func__, idFx);
@ -494,7 +519,11 @@ int idx;
#define OUT stdout
if (NULL!=texte && verbosity) fprintf(OUT, "___ %s ___\n", texte);
if (verbosity) {
fprintf(stderr, "We have around %ld filters now !\n", NBCRAP);
}
if (NULL!=texte && verbosity) fprintf(OUT, "_____ %s _____\n", texte);
for (idx=0; CrapL[idx].id!=-1; idx++) {
if (verbosity) {
fprintf(OUT, " %-12s | %4d | %5d | %8.3f\n",

View File

@ -43,4 +43,5 @@
51 decrgbzg 1 99
60 gr2popcol 1 99
61 fluffy 1 0.12
62 suprbg 1 0
-1 end 1 1.0