From 1b598227c3ac1307173c68517641f2bf515d924e Mon Sep 17 00:00:00 2001 From: tTh Date: Mon, 11 Jul 2022 06:12:25 +0200 Subject: [PATCH] last commit from outerspace --- lib/Makefile | 5 ++++- lib/README.md | 4 ++++ lib/alphachan.c | 23 +++++++++++++++++++++++ lib/fimg-2gray.c | 3 ++- lib/t.c | 5 +++++ tools/cumulfimgs.c | 9 +++++++-- 6 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 lib/alphachan.c diff --git a/lib/Makefile b/lib/Makefile index 3ffea72..9fadac3 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -7,7 +7,7 @@ COPT = -Wall -Wextra -fpic -g -no-pie -DDEBUG_LEVEL=0 OBJS = fimg-core.o fimg-pnm.o fimg-file.o fimg-math.o \ fimg-timers.o operators.o fimg-2gray.o \ interpolate.o fimg-compare.o contrast.o \ - metadata.o + metadata.o alphachan.o DEPS = Makefile ../floatimg.h @@ -24,6 +24,9 @@ t: t.c ../libfloatimg.a $(DEPS) ../libfloatimg.a: $(OBJS) $(AR) r $@ $? +alphachan.o: alphachan.c $(DEPS) + gcc $(COPT) -c $< + fimg-core.o: fimg-core.c $(DEPS) gcc $(COPT) -c $< diff --git a/lib/README.md b/lib/README.md index ee05c62..1f9bb6b 100644 --- a/lib/README.md +++ b/lib/README.md @@ -2,3 +2,7 @@ Need more explanations... + + +## Converting to/from rgb or gray + diff --git a/lib/alphachan.c b/lib/alphachan.c new file mode 100644 index 0000000..0ceee38 --- /dev/null +++ b/lib/alphachan.c @@ -0,0 +1,23 @@ +/* + * alphachan.c + */ + +#include +#include +#include + +#include "../floatimg.h" + +extern int verbosity; /* must be declared around main() */ + +/* ---------------------------------------------------------------- */ +int fimg_add_alpha_chan(FloatImg *img) +{ +return -4; +} +/* ---------------------------------------------------------------- */ +int fimg_kill_alpha_chan(FloatImg *img) +{ +return -4; +} +/* ---------------------------------------------------------------- */ diff --git a/lib/fimg-2gray.c b/lib/fimg-2gray.c index 948d3d0..a83d714 100644 --- a/lib/fimg-2gray.c +++ b/lib/fimg-2gray.c @@ -1,5 +1,7 @@ /* * fimg-2gray.c + * + * This is a tricky job... */ #include @@ -29,7 +31,6 @@ else { /* ... and canonic random values */ kr = kg = kb = 1.0; } - kdiv = kr + kg + kb; /* we must check the validity of our parameters */ diff --git a/lib/t.c b/lib/t.c index 6a4b862..4ec094b 100644 --- a/lib/t.c +++ b/lib/t.c @@ -86,6 +86,11 @@ fprintf(stderr, " %f %f\n", A, B); return 0; } /* ---------------------------------------------------------------- */ +int essai_alphachan(void) +{ + +return -1984; +} /* ---------------------------------------------------------------- */ #define WI 1024 #define HI 768 diff --git a/tools/cumulfimgs.c b/tools/cumulfimgs.c index bd086a1..26efa20 100644 --- a/tools/cumulfimgs.c +++ b/tools/cumulfimgs.c @@ -1,5 +1,6 @@ /* * This thing is just a mess ! + * *************************** */ #include #include @@ -103,15 +104,19 @@ for (idx=optind; idx