From e81055756ef1e98c567c67cfa2f6865c349eb915 Mon Sep 17 00:00:00 2001 From: tonton Th Date: Tue, 12 Nov 2019 19:31:00 +0100 Subject: [PATCH] zzzz..... --- lib/Makefile | 2 +- lib/runme.sh | 19 +++++++++++++++++++ lib/t.c | 19 +++++++++++++------ 3 files changed, 33 insertions(+), 7 deletions(-) create mode 100755 lib/runme.sh diff --git a/lib/Makefile b/lib/Makefile index ea2e3d43..ac584143 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -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 diff --git a/lib/runme.sh b/lib/runme.sh new file mode 100755 index 00000000..89144e76 --- /dev/null +++ b/lib/runme.sh @@ -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 + diff --git a/lib/t.c b/lib/t.c index 4ed6fb71..35585942 100644 --- a/lib/t.c +++ b/lib/t.c @@ -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, ©, 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, ©, maxi); +maxi = (double)fimg_get_maxvalue(&dessin); +fprintf(stderr, "apres power_2 valeur maxi = %f\n", maxi); +fimg_dump_to_file(©, "power2.fimg", 0); + +fimg_square_root(&dessin, ©, maxi); +maxi = (double)fimg_get_maxvalue(&dessin); +fprintf(stderr, "apres square_root valeur maxi = %f\n", maxi); +fimg_dump_to_file(©, "squareroot.fimg", 0); -fimg_dump_to_file(&dessin, "dst.fimg", 0); fimg_destroy(&dessin);