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) name = sprintf("CR_%s", $2)
printf " { %-12s, \"%s\", %d, %f }, // #%d\n", printf " { %-14s, \"%s\", %d, %f }, // #%d\n",
name, $2, $3, $4, $1; name, $2, $3, $4, $1;
} }

View File

@ -250,6 +250,7 @@ static int run_decomprgbz_gray(FloatImg *img, int k)
FloatImg tmp; FloatImg tmp;
int ret; int ret;
/* ugly code here */
memset(&tmp, 0, sizeof(FloatImg)); memset(&tmp, 0, sizeof(FloatImg));
fimg_clone(img, &tmp, 0); fimg_clone(img, &tmp, 0);
ret = fimg_decomp_rgbz_gray(img, &tmp, k); ret = fimg_decomp_rgbz_gray(img, &tmp, k);
@ -259,6 +260,27 @@ fimg_destroy(&tmp);
return ret; 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 * This is the main filter engine used both for input and
* output processing. It can be called by the filterstack * output processing. It can be called by the filterstack
@ -454,10 +476,13 @@ switch (idFx) {
break; break;
case CR_fluffy: case CR_fluffy:
// fprintf(stderr, "******* TO BE DONE ********\n");
retval = run_rndfluffy(image, 75); retval = run_rndfluffy(image, 75);
break; break;
case CR_suprbg:
retval = run_suprbg(image, 0);
break;
default : default :
fprintf(stderr, "%s : effect #%d invalid\n", fprintf(stderr, "%s : effect #%d invalid\n",
__func__, idFx); __func__, idFx);
@ -494,7 +519,11 @@ int idx;
#define OUT stdout #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++) { for (idx=0; CrapL[idx].id!=-1; idx++) {
if (verbosity) { if (verbosity) {
fprintf(OUT, " %-12s | %4d | %5d | %8.3f\n", fprintf(OUT, " %-12s | %4d | %5d | %8.3f\n",

View File

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