not a milestone

This commit is contained in:
le vieux 2020-11-10 00:50:25 +01:00
parent 538a8ffa82
commit c3c5e0dc3f
6 changed files with 43 additions and 14 deletions

View File

@ -7,6 +7,11 @@ LIBS = -lfloatimg -lpnglite -lm
OBJS = fonctions.o sfx.o crapulator.o OBJS = fonctions.o sfx.o crapulator.o
DEPS = fonctions.h crapulator.h DEPS = fonctions.h crapulator.h
all: fonderie interpolator
# ---------------------------------------------------------
fonderie: fonderie.c ${DEPS} ${OBJS} Makefile fonderie: fonderie.c ${DEPS} ${OBJS} Makefile
gcc ${COPT} $< ${OBJS} ${LIBS} -lz -o $@ gcc ${COPT} $< ${OBJS} ${LIBS} -lz -o $@
@ -21,9 +26,10 @@ sfx.o: sfx.c ${DEPS} Makefile
# --------------------------------------------------------- # ---------------------------------------------------------
# #
# another way... # another way to brotch some pics...
#
interpolator: interpolator.c Makefile interpolator: interpolator.c ${OBJS} Makefile
gcc ${COPT} $< ${LIBS} -lz -o $@ gcc ${COPT} $< ${OBJS} ${LIBS} -lz -o $@
# --------------------------------------------------------- # ---------------------------------------------------------

View File

@ -67,6 +67,12 @@ criant de documentation...
## Interpolator ## Interpolator
Un logiciel dont l'inspiration vient de Terre-Blanque, ça ne peut
pas être complètement malsain :)
## Conclusion
**Use the source, Luke** **Use the source, Luke**

View File

@ -11,7 +11,6 @@
#include "crapulator.h" #include "crapulator.h"
/* -------------------------------------------------------------- */ /* -------------------------------------------------------------- */
/* support function for the crapulator */
static int effect_3(FloatImg *image) static int effect_3(FloatImg *image)
{ {
float value; float value;
@ -76,7 +75,6 @@ if (666==count) {
switch (idFx) { switch (idFx) {
case 0: /* DO NOTHING */ case 0: /* DO NOTHING */
retval = 0; break; retval = 0; break;
case 1: case 1:
fimg_cos_01(image, image, fimg_cos_01(image, image,
fimg_get_maxvalue(image)); fimg_get_maxvalue(image));
@ -99,15 +97,12 @@ switch (idFx) {
case 6: case 6:
fimg_killcolors_a(image, 0.0); fimg_killcolors_a(image, 0.0);
break; break;
case 7: case 7:
retval = fimg_colors_mixer_a(image, 2.0); retval = fimg_colors_mixer_a(image, 2.0);
break; break;
case 8: case 8:
retval = insitu_ctr2x2(image); retval = insitu_ctr2x2(image);
break; break;
case 9: case 9:
retval = fimg_classif_trial(image, image, 0.37, 0); retval = fimg_classif_trial(image, image, 0.37, 0);
if (retval) { if (retval) {
@ -115,11 +110,13 @@ switch (idFx) {
exit(1); exit(1);
} }
break; break;
case 10: case 10:
retval = binarize(image, 0); retval = binarize(image, 0);
break; break;
case 11:
retval = trinarize(image, 0);
break;
/* --- WTF -- */
default : default :
fprintf(stderr, "%s : effect #%d invalid\n", fprintf(stderr, "%s : effect #%d invalid\n",
__func__, idFx); __func__, idFx);

View File

@ -40,6 +40,7 @@ int create_fifo(int nbslot, int w, int h, int t);
* funcs in 'sfx.c' * funcs in 'sfx.c'
*/ */
int trinarize(FloatImg *pimg, int notused);
int binarize(FloatImg *pimg, int notused); int binarize(FloatImg *pimg, int notused);
int brotche_rand48_a(FloatImg *fimg, float ratio, float mval); int brotche_rand48_a(FloatImg *fimg, float ratio, float mval);

View File

@ -14,9 +14,12 @@
#include "../floatimg.h" #include "../floatimg.h"
#include "crapulator.h"
// XXX #include "fonctions.h" // XXX #include "fonctions.h"
int verbosity; int verbosity;
int convert_to_gray; /* needed by fonctions.c */
/* -------------------------------------------------------------- */ /* -------------------------------------------------------------- */
int interpolator(char *pattern, char *outdir, int Nsteps) int interpolator(char *pattern, char *outdir, int Nsteps)
@ -63,10 +66,20 @@ for (idx=0; idx<globbuf.gl_pathc; idx++) {
continue; continue;
} }
/* here, we can insert the input filter */
/* OK try it ... */
foo = crapulator(&B, 8, 1.0);
if (foo) {
fprintf(stderr, "crapulator failure %d\n", foo);
exit(1);
}
for (step=0; step<Nsteps; step++) { for (step=0; step<Nsteps; step++) {
coef = (float)step / (float)Nsteps; coef = (float)step / (float)Nsteps;
fimg_interpolate(pSecond, pFirst, &Out, coef); fimg_interpolate(pSecond, pFirst, &Out, coef);
/* here we can insert the output filter */
sprintf(line, "%s/%05d.png", outdir, ipng); sprintf(line, "%s/%05d.png", outdir, ipng);
foo = fimg_save_as_png(&Out, line, 0); foo = fimg_save_as_png(&Out, line, 0);
if (foo) { if (foo) {
@ -84,7 +97,7 @@ for (idx=0; idx<globbuf.gl_pathc; idx++) {
pTmp = pSecond; pTmp = pSecond;
pSecond = pFirst; pSecond = pFirst;
pFirst = pTmp; pFirst = pTmp;
/* THIS CODE DON'T WORK !!! */ /* XXX THIS CODE DON'T WORK !!! */
#endif #endif
} }

View File

@ -17,6 +17,15 @@
*/ */
extern int verbosity; extern int verbosity;
/* -------------------------------------------------------------- */
int trinarize(FloatImg *pimg, int notused)
{
fprintf(stderr, "the function '%s' is not implemented\n", __func__);
exit(2);
return -1;
}
/* -------------------------------------------------------------- */ /* -------------------------------------------------------------- */
int binarize(FloatImg *pimg, int notused) int binarize(FloatImg *pimg, int notused)
{ {
@ -100,6 +109,3 @@ return 0;
} }
/* -------------------------------------------------------------- */ /* -------------------------------------------------------------- */