From 8a68cc24c68909fc14188429ce37bfc16c94bfff Mon Sep 17 00:00:00 2001 From: tth Date: Fri, 29 Nov 2019 19:55:52 +0100 Subject: [PATCH] fine tuning fimgfx with a script --- .gitignore | 4 ++++ install.sh | 2 +- scripts/contrast-test.sh | 27 +++++++++++++++++++++++++++ tools/fimgfx.c | 19 +++++++++---------- 4 files changed, 41 insertions(+), 11 deletions(-) create mode 100755 scripts/contrast-test.sh diff --git a/.gitignore b/.gitignore index e09e3bf6..d73467d5 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,10 @@ doc/*.ind funcs/t +scripts/*.fimg +scripts/*.pnm +scripts/*.gif + v4l2/t v4l2/capture v4l2/grabvidseq diff --git a/install.sh b/install.sh index d3d50105..2a290047 100755 --- a/install.sh +++ b/install.sh @@ -4,7 +4,7 @@ cp libfloatimg.a /usr/local/lib cp floatimg.h /usr/local/include cp tools/mkfimg tools/fimg2pnm tools/fimgops \ - tools/png2fimg tools/fimgstats \ + tools/png2fimg tools/fimgstats tools/fimgfx \ /usr/local/bin cp v4l2/grabvidseq v4l2/video-infos \ diff --git a/scripts/contrast-test.sh b/scripts/contrast-test.sh new file mode 100755 index 00000000..e06557d5 --- /dev/null +++ b/scripts/contrast-test.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +GRAB="quux.fimg" +COS01="cos01.fimg" +SQRT="sqrt.fimg" +POW2="pow2.fimg" + +f2p () +{ +echo ========== $1 +fimg2pnm -v $1 $(basename $1 .fimg).pnm +} + +grabvidseq -v -n 777 -p 0.07 -o $GRAB +f2p $GRAB + +fimgfx -v pow2 $GRAB $POW2 +f2p $POW2 + +fimgfx -v sqrt $GRAB $SQRT +f2p $SQRT + +fimgfx -v cos01 $GRAB $COS01 +f2p $COS01 + +convert -delay 10 *.pnm foo.gif + diff --git a/tools/fimgfx.c b/tools/fimgfx.c index 1c4cb660..9048bb46 100644 --- a/tools/fimgfx.c +++ b/tools/fimgfx.c @@ -66,7 +66,7 @@ FloatImg src, dest; int foo; double maxval; -#if 1 +#if DEBUG_LEVEL fprintf(stderr, ">>> %s ( '%s' %d '%s' )\n", __func__, sf, act, df); #endif @@ -125,7 +125,7 @@ while ((opt = getopt(argc, argv, "hk:v")) != -1) { } } -#if 1 +#if DEBUG_LEVEL fprintf(stderr, "argc %d optind %d\n", argc, optind); for (foo=0; foo %s\n", srcname, dstname); +if (verbosity) fprintf(stderr, "%s ==> %s\n", srcname, dstname); foo = do_an_effect(srcname, action, dstname); -fprintf(stderr, "do an effect -> %d\n", foo); - - -fprintf(stderr, "\n%s [done]\n", argv[0]); +if (foo) { + fprintf(stderr, "do an effect -> %d\n", foo); + } return 0; }