From b1cca46a8ae26f3123c93ad4da1a9d0e32dfe1bd Mon Sep 17 00:00:00 2001 From: tth Date: Sun, 14 Feb 2021 13:16:58 +0100 Subject: [PATCH] missing file, oups --- funcs/plasmas.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 funcs/plasmas.c diff --git a/funcs/plasmas.c b/funcs/plasmas.c new file mode 100644 index 0000000..ba4d97a --- /dev/null +++ b/funcs/plasmas.c @@ -0,0 +1,43 @@ +/* + PLASMAS + + Inspiration Reep : https://blog.314r.net/2021/01/10/plasma/ + +*/ + +#include +#include + +#include "../floatimg.h" + +extern int verbosity; + +/* --------------------------------------------------------------------- */ +/* --------------------------------------------------------------------- */ +int fimg_prototype_plasma(FloatImg *img, double time, int type) +{ +int x, y; +float rgb[3]; +double dx, dy; + +fprintf(stderr, ">>> %s ( %p %.3f %d )\n", __func__, + img, time, type); + +for (y=0; yheight; y++) { + dy = ((double)y/(double)img->height) - 0.5000; + + for (x=0; xwidth; x++) { + dx = ((double)x/(double)img->width) - 0.5000; + + rgb[0] = sin(dx*10 + time) + 1.0; + rgb[1] = sin(dx*12 + time) + 1.0; + rgb[2] = sin(dx*14 + time) + 1.0; + fimg_put_rgb(img, x, y, rgb); + + } + + } + +return 0; +} +/* --------------------------------------------------------------------- */