From 954de623ab1b4203c6b66c2fa3583ad54bbe3686 Mon Sep 17 00:00:00 2001 From: le vieux Date: Tue, 10 Nov 2020 14:00:22 +0100 Subject: [PATCH] enlarge yout glitcher --- Fonderie/glitches.c | 15 +++++++++------ Fonderie/glitches.h | 3 +-- Fonderie/interpolator.c | 12 +++++++++--- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/Fonderie/glitches.c b/Fonderie/glitches.c index 15a3af6b..5ede29ff 100644 --- a/Fonderie/glitches.c +++ b/Fonderie/glitches.c @@ -10,12 +10,12 @@ extern int verbosity; /* -------------------------------------------------------------- */ -int kill_a_random_line(FloatImg *pvictime, float fval, int notused) +int kill_a_random_line(FloatImg *pvictime, float fval, int bits) { int line, xpos, offset; #if DEBUG_LEVEL -fprintf(stderr, ">>> %s ( %p %d )\n", __func__, pvictime, notused); +fprintf(stderr, ">>> %s ( %p %d )\n", __func__, pvictime, bits); #endif line = rand() % pvictime->height; @@ -27,9 +27,12 @@ if (verbosity > 1) { offset = pvictime->width * line; for (xpos=0; xposwidth; xpos++) { - pvictime->R[offset+xpos] = fval; - pvictime->G[offset+xpos] = 0.0; - pvictime->B[offset+xpos] = fval; + if (bits & 1) pvictime->R[offset+xpos] = fval; + else pvictime->R[offset+xpos] = 0.0; + if (bits & 2) pvictime->G[offset+xpos] = fval; + else pvictime->G[offset+xpos] = 0.0; + if (bits & 4) pvictime->B[offset+xpos] = fval; + else pvictime->B[offset+xpos] = 0.0; } return 0; @@ -41,7 +44,7 @@ int idx, foo; /* Frag the pixels */ for (idx=0; idx