last commit from outerspace

This commit is contained in:
tTh 2022-07-11 06:12:25 +02:00
parent 3eed90c3e7
commit 1b598227c3
6 changed files with 45 additions and 4 deletions

View File

@ -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 \ OBJS = fimg-core.o fimg-pnm.o fimg-file.o fimg-math.o \
fimg-timers.o operators.o fimg-2gray.o \ fimg-timers.o operators.o fimg-2gray.o \
interpolate.o fimg-compare.o contrast.o \ interpolate.o fimg-compare.o contrast.o \
metadata.o metadata.o alphachan.o
DEPS = Makefile ../floatimg.h DEPS = Makefile ../floatimg.h
@ -24,6 +24,9 @@ t: t.c ../libfloatimg.a $(DEPS)
../libfloatimg.a: $(OBJS) ../libfloatimg.a: $(OBJS)
$(AR) r $@ $? $(AR) r $@ $?
alphachan.o: alphachan.c $(DEPS)
gcc $(COPT) -c $<
fimg-core.o: fimg-core.c $(DEPS) fimg-core.o: fimg-core.c $(DEPS)
gcc $(COPT) -c $< gcc $(COPT) -c $<

View File

@ -2,3 +2,7 @@
Need more explanations... Need more explanations...
## Converting to/from rgb or gray

23
lib/alphachan.c Normal file
View File

@ -0,0 +1,23 @@
/*
* alphachan.c
*/
#include <stdio.h>
#include <stdint.h>
#include <sys/time.h>
#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;
}
/* ---------------------------------------------------------------- */

View File

@ -1,5 +1,7 @@
/* /*
* fimg-2gray.c * fimg-2gray.c
*
* This is a tricky job...
*/ */
#include <stdio.h> #include <stdio.h>
@ -29,7 +31,6 @@ else {
/* ... and canonic random values */ /* ... and canonic random values */
kr = kg = kb = 1.0; kr = kg = kb = 1.0;
} }
kdiv = kr + kg + kb; kdiv = kr + kg + kb;
/* we must check the validity of our parameters */ /* we must check the validity of our parameters */

View File

@ -86,6 +86,11 @@ fprintf(stderr, " %f %f\n", A, B);
return 0; return 0;
} }
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */
int essai_alphachan(void)
{
return -1984;
}
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */
#define WI 1024 #define WI 1024
#define HI 768 #define HI 768

View File

@ -1,5 +1,6 @@
/* /*
* This thing is just a mess ! * This thing is just a mess !
* ***************************
*/ */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -103,15 +104,19 @@ for (idx=optind; idx<argc; idx++) {
compte++; compte++;
} }
/* XXX */ /* XXX */
if (experiment) { if (experiment) {
} }
/* XXX */ /* XXX */
if (to_gray) { if (to_gray) {
foo = fimg_desaturate(&accu, &accu, 0); foo = fimg_desaturate(&accu, &accu, 0);
/* ?
* but here, final picture is in RGB shape, so export give us
* also an image rgb-shaped. this is not optimal, I think.
*/
if (foo) { if (foo) {
fprintf(stderr, "desaturate: error %d\n", foo); fprintf(stderr, "desaturate: error %d\n", foo);
} }