diff --git a/Lib/Makefile b/Lib/Makefile index c9360b9..bf12ad6 100644 --- a/Lib/Makefile +++ b/Lib/Makefile @@ -64,6 +64,7 @@ extractbits.o: extractbits.c $(DEPS) filtadapt.o: filtadapt.c $(DEPS) filtres.o: filtres.c $(DEPS) falsecolors.o: falsecolors.c $(DEPS) +functions.o: functions.c $(DEPS) # new Aug 15, 2024 gadgrect.o: gadgrect.c $(DEPS) glitch.o: glitch.c $(DEPS) @@ -153,6 +154,7 @@ OBJECTS = 7seg.o \ doublesz.o drawalpha.o drawing.o drawpatt.o \ effects.o effects2.o effects3.o extractbits.o \ filtadapt.o filtres.o falsecolors.o \ + functions.o \ gadgrect.o glitch.o gradient.o \ halfsize.o \ image.o imprime.o \ diff --git a/Lib/foo.c b/Lib/foo.c index 1cbfcc1..8759686 100644 --- a/Lib/foo.c +++ b/Lib/foo.c @@ -8,41 +8,52 @@ /* ============================== */ -int essai_false_colors(void) +/* new Wed Aug 14 19:17:20 UTC 2024 + * + * parameters : + * ip: Image_Desc * of input picture + * ix, iy: coordinate of the pixel in this pic. + * op, ox, oy : same things for output picture + */ +#define PIXEL_COPY(ip, ix, iy, op, ox, oy) \ + do { \ + \ + } while (0) + +#define SZPIC 7777 + +double tthi_dtime(void); + +void essai_pixcopy(void) { -int foo; -RGB_map luts; +Image_Desc *alice, *bob; +int x, y; +double T0, T1; +long count; -foo = Image_gen_fc_lut(27e3, 33, &luts); -fprintf(stderr, "retour gen_fc_lut = %d\n", foo); +alice = Image_alloc(SZPIC, SZPIC, IMAGE_RGB); +bob = Image_alloc(SZPIC, SZPIC, IMAGE_RGB); -return -1; +T0 = tthi_dtime(); +count = 0L; +for (y=0; y %d\n", foo); -foo = Image_plot_V_gradient("foo.tga", 900, 200); -fprintf(stderr, "plot v gradient -> %d\n", foo); -} -/* ============================== */ - int main(int argc, char *argv[]) { @@ -50,11 +61,11 @@ fprintf(stderr, "*** %s is running\n", argv[0]); if (argc > 1) { fprintf(stderr, "argument: %s\n", argv[1]); - Image_print_version(0); + Image_print_version(2); Image_print_sizeof_structs("foo"); } else { - essai_false_colors(); + essai_pixcopy(); } /* diff --git a/Lib/functions.c b/Lib/functions.c new file mode 100644 index 0000000..e3d0fd6 --- /dev/null +++ b/Lib/functions.c @@ -0,0 +1,27 @@ +/* + * miscellaneous functions + * ----------------------- + * + * new: Thu Aug 15 09:55:36 UTC 2024 + * + */ + +#include +#include + +#include "../tthimage.h" + +/* ------------------------------------------------------------------- */ +/* + * for what FSCKING reason, this func is not in the stdlib ??? + */ +double tthi_dtime(void) +{ +struct timeval t; +double d; +(void)gettimeofday(&t, NULL); +d = (double)t.tv_sec + (double)t.tv_usec / 1e6; +return d; +} +/* ------------------------------------------------------------------- */ +/* ------------------------------------------------------------------- */