Compare commits

...

2 Commits

Author SHA1 Message Date
tonton Th
e81055756e zzzz..... 2019-11-12 19:31:00 +01:00
tonton Th
24a8ff2dd7 mmmmm, non usable code commited ? 2019-11-12 14:10:45 +01:00
4 changed files with 36 additions and 9 deletions

View File

@ -2,7 +2,7 @@
# building the base library
#
COPT = -Wall -fpic -g -no-pie -DDEBUG_LEVEL=0
COPT = -Wall -fpic -g -no-pie -DDEBUG_LEVEL=1
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

View File

@ -172,7 +172,7 @@ if (foo) {
return -3;
}
if (flag & 0x01) {
if (flags & 0x01) {
/* XXX copy all the pixels's datas */
}

19
lib/runme.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
make t && ./t
for picz in src power2 squareroot
do
../tools/fimgstats -v ${picz}.fimg
../tools/fimg2pnm -v ${picz}.fimg ${picz}.pnm
convert -pointsize 36 \
-fill white -annotate +10+28 "${picz}" \
-fill black -annotate +12+30 "${picz}" \
${picz}.pnm ${picz}.png
done
convert -delay 50 *.png foo.gif

22
lib/t.c
View File

@ -71,20 +71,27 @@ return 0;
int essai_contraste(char *fname)
{
int foo;
FloatImg dessin;
FloatImg dessin, copy;
double maxi;
foo = fimg_create_from_dump(fname, &dessin);
maxi = (double)fimg_get_maxvalue(&dessin);
fprintf(stderr, "avant valeur maxi = %f\n", maxi);
foo = fimg_clone(&dessin, &copy, 0);
fimg_power_2(&dessin, NULL, maxi);
maxi = (double)fimg_get_maxvalue(&dessin);
fprintf(stderr, "apres valeur maxi = %f\n", maxi);
fprintf(stderr, "avant power_2 valeur maxi = %f\n", maxi);
fimg_power_2(&dessin, &copy, maxi);
maxi = (double)fimg_get_maxvalue(&dessin);
fprintf(stderr, "apres power_2 valeur maxi = %f\n", maxi);
fimg_dump_to_file(&copy, "power2.fimg", 0);
fimg_square_root(&dessin, &copy, maxi);
maxi = (double)fimg_get_maxvalue(&dessin);
fprintf(stderr, "apres square_root valeur maxi = %f\n", maxi);
fimg_dump_to_file(&copy, "squareroot.fimg", 0);
fimg_dump_to_file(&dessin, "dst.fimg", 0);
fimg_destroy(&dessin);
@ -110,6 +117,7 @@ while ((opt = getopt(argc, argv, "gn:v")) != -1) {
if (verbosity) fimg_print_version(0);
foo = essai_contraste("src.fimg");
fprintf(stderr, "retour essai contraste -> %d\n",
fprintf(stderr, "retour essai contraste -> %d\n", foo);
return 0;
}