From a450ac4291ee0828c275a894d7b68d7076a1b9b9 Mon Sep 17 00:00:00 2001 From: tonton th Date: Wed, 2 Dec 2020 19:24:54 +0100 Subject: [PATCH] gliches++ --- Fonderie/essai.sh | 17 +++++++++++++++++ Fonderie/glitches.c | 29 +++++++++++++++++++++++------ Fonderie/t.c | 19 +++++++++---------- 3 files changed, 49 insertions(+), 16 deletions(-) create mode 100755 Fonderie/essai.sh diff --git a/Fonderie/essai.sh b/Fonderie/essai.sh new file mode 100755 index 0000000..50d7ff3 --- /dev/null +++ b/Fonderie/essai.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +OUTF='/tmp/out_a*.png' + +rm $OUTF + +make t && ./t + + +A_PART=$(ls -1 $OUTF) +Z_PART=$(ls -r1 $OUTF) + +convert -delay 10 ${A_PART} ${Z_PART} foo.gif + + + + diff --git a/Fonderie/glitches.c b/Fonderie/glitches.c index 7640d3d..45dd15d 100644 --- a/Fonderie/glitches.c +++ b/Fonderie/glitches.c @@ -113,11 +113,26 @@ int poke_a_random_pixel(FloatImg *picz, float fval, int kaboo) return -1; } /* -------------------------------------------------------------- */ +/* + * used by vertical_singlitch() + */ +int x_delta(float dy, float phy) +{ +float param, fv; +param = dy + phy; +fv = 9.999*sin(param) + 6.666*sin(param*3) + 3.333*sin(param*5); +return (int)fv; +} +/* -------------------------------------------------------------- */ +/* + * please explain arguments + */ int vertical_singlitch(FloatImg *picz, int xpos, float fval, float omega, float phi) { int y, x, w, h; -double dy; +float dy; +float fv; #if DEBUG_LEVEL fprintf(stderr, ">>> %s ( %p %d %f %f )\n", __func__, picz, @@ -125,21 +140,23 @@ fprintf(stderr, ">>> %s ( %p %d %f %f )\n", __func__, picz, #endif h = picz->height; w = picz->width; -#define BB 10 +#define BB 4 for (y=BB; yBB) && (x