add fluffy effect to the Fonderie

This commit is contained in:
tTh 2023-02-12 11:41:26 +01:00
parent 7d66b09635
commit bf239a9004
2 changed files with 22 additions and 3 deletions

View File

@ -222,7 +222,21 @@ FloatImg tmp;
int ret; int ret;
memset(&tmp, 0, sizeof(FloatImg)); memset(&tmp, 0, sizeof(FloatImg));
fimg_clone(img, &tmp, 0); fimg_clone(img, &tmp, 0);
ret = graylevel2popcolors(img, &tmp, k); ret = graylevel2popcolors(img, &tmp, k);
fimg_copy_data(&tmp, img);
fimg_destroy(&tmp);
return ret;
}
/* -------------------------------------------------------------- */
/* new Sun Feb 12 11:30:02 CET 2023 */
static int run_rndfluffy(FloatImg *img, int k)
{
FloatImg tmp;
int ret;
memset(&tmp, 0, sizeof(FloatImg));
fimg_clone(img, &tmp, 0);
ret = fimg_make_rndfluffy_lines(img, &tmp, k);
fimg_copy_data(&tmp, img); fimg_copy_data(&tmp, img);
fimg_destroy(&tmp); fimg_destroy(&tmp);
@ -441,10 +455,14 @@ switch (idFx) {
break; break;
case CR_gr2popcol: case CR_gr2popcol:
// fprintf(stderr, "******* TO BE DONE ********\n");
retval = run_gr2popcol(image, -1); retval = run_gr2popcol(image, -1);
break; break;
case CR_fluffy:
// fprintf(stderr, "******* TO BE DONE ********\n");
retval = run_rndfluffy(image, 75);
break;
default : default :
fprintf(stderr, "%s : effect #%d invalid\n", fprintf(stderr, "%s : effect #%d invalid\n",
__func__, idFx); __func__, idFx);
@ -481,7 +499,7 @@ int idx;
#define OUT stdout #define OUT stdout
if (NULL!=texte && verbosity) fprintf(OUT, "___ %s\n ___", texte); 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

@ -42,5 +42,6 @@
50 decrgbzc 1 99 50 decrgbzc 1 99
51 decrgbzg 1 99 51 decrgbzg 1 99
60 gr2popcol 1 99 60 gr2popcol 1 99
61 fluffy 1 0.12
99 message 1 1.0 99 message 1 1.0
-1 end 1 1.0 -1 end 1 1.0