Browse Source

zzzz.....

master
tonton Th 3 years ago
parent
commit
e81055756e
  1. 2
      lib/Makefile
  2. 19
      lib/runme.sh
  3. 17
      lib/t.c

2
lib/Makefile

@ -2,7 +2,7 @@ @@ -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

@ -0,0 +1,19 @@ @@ -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

17
lib/t.c

@ -71,20 +71,27 @@ return 0; @@ -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);
foo = fimg_clone(&dessin, &copy, 0);
maxi = (double)fimg_get_maxvalue(&dessin);
fprintf(stderr, "avant valeur maxi = %f\n", maxi);
fprintf(stderr, "avant power_2 valeur maxi = %f\n", maxi);
fimg_power_2(&dessin, NULL, 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 valeur maxi = %f\n", maxi);
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);

Loading…
Cancel
Save