From ee5e081031d8b5858ecf8d4ada953c05c62c00dc Mon Sep 17 00:00:00 2001 From: tTh Date: Sun, 16 Jul 2023 14:14:29 +0200 Subject: [PATCH] new effect 'suprbg' added to Fonderie --- Fonderie/craplist2str.awk | 2 +- Fonderie/crapulator.c | 33 +++++++++++++++++++++++++++++++-- Fonderie/crapulors.liste | 1 + 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/Fonderie/craplist2str.awk b/Fonderie/craplist2str.awk index 2507946..8587c13 100755 --- a/Fonderie/craplist2str.awk +++ b/Fonderie/craplist2str.awk @@ -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; } diff --git a/Fonderie/crapulator.c b/Fonderie/crapulator.c index 0758950..db9b949 100644 --- a/Fonderie/crapulator.c +++ b/Fonderie/crapulator.c @@ -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", diff --git a/Fonderie/crapulors.liste b/Fonderie/crapulors.liste index b1b2704..5296528 100644 --- a/Fonderie/crapulors.liste +++ b/Fonderie/crapulors.liste @@ -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