zzzz.....

This commit is contained in:
tonton Th 2019-11-12 19:31:00 +01:00
parent 24a8ff2dd7
commit e81055756e
3 changed files with 33 additions and 7 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

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

19
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);