From 0f2b0ec916f5cd6666a169a56cab2ea8bbe7e3cd Mon Sep 17 00:00:00 2001 From: tth Date: Fri, 23 Apr 2021 23:54:47 +0200 Subject: [PATCH] added a setter, wtf ? --- Fonderie/fifo.c | 30 +++++++++++++++++++++++++----- Fonderie/fifo.h | 14 +++++++++++--- 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/Fonderie/fifo.c b/Fonderie/fifo.c index 3b998900..8de0bde5 100644 --- a/Fonderie/fifo.c +++ b/Fonderie/fifo.c @@ -79,7 +79,7 @@ return 0; /* -------------------------------------------------------------- */ /* called by 'fonderie.c' */ -int export_fifo(char *fname, int step) +int export_fifo(char *fname, int notused) { int foo, type; @@ -136,13 +136,18 @@ if (verbosity > 2) fprintf(stderr, "%s : next slot %d\n", return 0; } /* -------------------------------------------------------------- */ -int create_fifo(int nbslot, int w, int h, int t) +/* + * this function must have a lot of new parameters, + * -- filetype of exported pictures... + */ + +int create_fifo(int nbslot, int w, int h, int imgtype) { int foo, idx; #if DEBUG_LEVEL fprintf(stderr, ">>> %s ( %d %dx%d %d )\n", __func__, - nbslot, w, h, t); + nbslot, w, h, imgtype); #endif memset(&g_fifo, 0, sizeof(A_Fifo)); @@ -152,17 +157,32 @@ g_fifo.nbslots = nbslot; g_fifo.slots = calloc(nbslot, sizeof(FloatImg)); if (NULL==g_fifo.slots) abort(); for (idx=0; idx>> %s ( %d )\n", __func__, filetype); +#endif + +g_fifo.export_type = filetype; + +return -1; +} + diff --git a/Fonderie/fifo.h b/Fonderie/fifo.h index cd5a559c..7f2ca8ea 100644 --- a/Fonderie/fifo.h +++ b/Fonderie/fifo.h @@ -1,15 +1,21 @@ /* - * Machine qui fait des fils flous + * Machine qui fait des fils flous par la + * méthode de la moyenne mobile. */ /* -------------------------------------------------------------- */ typedef struct { unsigned long magic; int nbslots; /* how many pics used ? */ + FloatImg total; /* computing workspace */ FloatImg wspace; /* computing workspace */ + FloatImg *slots; /* circular buffer */ + int next; /* incremented with modulo */ + + int export_type; /* fimg/png/pnm/... */ } A_Fifo; #define MAGIC_FIFO 0xabcd9876 @@ -29,11 +35,13 @@ typedef struct { /* -------------------------------------------------------------- */ -int export_fifo(char *fname, int step); +int create_fifo(int nbslot, int w, int h, int t); +int set_fifo_output_format(int filetype); + +int export_fifo(char *fname, int notused); int insert_picture(FloatImg *src); -int create_fifo(int nbslot, int w, int h, int t); /* -------------------------------------------------------------- */ /*