diff --git a/.gitignore b/.gitignore index c4e25230..e95e0352 100644 --- a/.gitignore +++ b/.gitignore @@ -66,6 +66,7 @@ tools/*.tiff Fonderie/*.o Fonderie/*.png Fonderie/*.pnm +Fonderie/*.gif Fonderie/fonderie Fonderie/interpolator Fonderie/t diff --git a/Fonderie/Makefile b/Fonderie/Makefile index 9530ddee..67f209de 100644 --- a/Fonderie/Makefile +++ b/Fonderie/Makefile @@ -7,7 +7,7 @@ COPT = -g -fpic -no-pie -Wall -DDEBUG_LEVEL=0 -Werror=parentheses LIBS = ../libfloatimg.a -lpnglite -lm OBJS = fonctions.o sfx.o crapulator.o glitches.o metriques.o -DEPS = fonctions.h crapulator.h metriques.h glitches.h +DEPS = fonctions.h crapulator.h metriques.h glitches.h sfx.h all: fonderie interpolator t diff --git a/Fonderie/crapulator.c b/Fonderie/crapulator.c index 2ac41bbb..97ea2fdc 100644 --- a/Fonderie/crapulator.c +++ b/Fonderie/crapulator.c @@ -10,6 +10,7 @@ #include "fonctions.h" #include "crapulator.h" #include "glitches.h" +#include "sfx.h" /* -------------------------------------------------------------- */ static int effect_3(FloatImg *image) @@ -122,13 +123,16 @@ switch (idFx) { case 11: retval = trinarize(image, 0); break; + case 12: + retval = fimg_lissage_2x2(image); + break; case 24: /* experiment ! */ retval = des_bords_sombres_a(image, 160); break; case 25: /* please make this function more tweakable */ - retval = vertical_singlitch(image, 290+rand()%35, - fval, 0.18, 0); + retval = vertical_singlitch(image, 290+rand()%45, + fval, 0.19, 0); break; default : fprintf(stderr, "%s : effect #%d invalid\n", diff --git a/Fonderie/fonctions.h b/Fonderie/fonctions.h index 3a9baab3..523ca736 100644 --- a/Fonderie/fonctions.h +++ b/Fonderie/fonctions.h @@ -37,16 +37,5 @@ int create_fifo(int nbslot, int w, int h, int t); /* -------------------------------------------------------------- */ /* - * funcs in 'sfx.c' + * funcs in 'sfx.c' ---> sfx.h */ - -int des_bords_sombres_a(FloatImg *pimg, int offset); -int trinarize(FloatImg *pimg, int notused); -int binarize(FloatImg *pimg, int notused); - -int brotche_rand48_a(FloatImg *fimg, float ratio, float mval); -int brotche_rand48_b(FloatImg *fimg, float ratio, float mval); -int colors_brotcher(FloatImg *fimg, float fval); - -/* -------------------------------------------------------------- */ - diff --git a/Fonderie/sfx.c b/Fonderie/sfx.c index fe6b75d3..0d49249e 100644 --- a/Fonderie/sfx.c +++ b/Fonderie/sfx.c @@ -8,9 +8,10 @@ #include #include -#include +#include "../floatimg.h" #include "fonctions.h" +#include "sfx.h" /* -------------------------------------------------------------- */ /* here are global vars exported by the main module @@ -72,25 +73,23 @@ mBb = (mm[5] - mm[4]) * 0.66666; size = pimg->width * pimg->height; -#define VAL (255.0) - for (foo=0; fooR; if (fptr[foo] < mRa || fptr[foo] > mRb) - fptr[foo] = 0.0; + fptr[foo] = mm[0]; else fptr[foo] = mm[1]; fptr = pimg->G; if (fptr[foo] < mGa || fptr[foo] > mGb) - fptr[foo] = 0.0; + fptr[foo] = mm[2]; else fptr[foo] = mm[3]; fptr = pimg->B; if (fptr[foo] < mBa || fptr[foo] > mBb) - fptr[foo] = 0.0; + fptr[foo] = mm[4]; else fptr[foo] = mm[5]; diff --git a/Fonderie/sfx.h b/Fonderie/sfx.h new file mode 100644 index 00000000..9e14405a --- /dev/null +++ b/Fonderie/sfx.h @@ -0,0 +1,15 @@ +/* + * sfx.h - special effects for fonderie & interpolator + */ + + +int des_bords_sombres_a(FloatImg *pimg, int offset); + +int trinarize(FloatImg *pimg, int notused); // in sfx.c + +int binarize(FloatImg *pimg, int notused); + +int brotche_rand48_a(FloatImg *fimg, float ratio, float mval); +int brotche_rand48_b(FloatImg *fimg, float ratio, float mval); +int colors_brotcher(FloatImg *fimg, float fval); +