From 9517c8a10f1df1f1d054d020ae2bb7c897b308f2 Mon Sep 17 00:00:00 2001 From: tth Date: Tue, 23 Jun 2020 11:09:42 +0200 Subject: [PATCH] integration de fimg_colors_mixer_a dans fimgfx --- tools/essai.sh | 8 +++++++- tools/fimgfx.c | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tools/essai.sh b/tools/essai.sh index c7410d8f..caf981f4 100755 --- a/tools/essai.sh +++ b/tools/essai.sh @@ -23,7 +23,13 @@ function essai_drand48 ./fimgstats -vv $TMPF } # ----------------------------------------------------- +function essai_cmixa +{ +./mkfimg -v -t tpat0 $TMPF 800 600 +./fimgfx -v cmixa $TMPF bar.fimg +} +# ----------------------------------------------------- -essai_drand48 +essai_cmixa # ----------------------------------------------------- diff --git a/tools/fimgfx.c b/tools/fimgfx.c index 5ad91705..3345fa1b 100644 --- a/tools/fimgfx.c +++ b/tools/fimgfx.c @@ -21,7 +21,7 @@ typedef struct { } Fx; enum fxid { Fx_cos01=5, Fx_cos010, Fx_pow2, Fx_sqrt, Fx_gray0, Fx_halfsz0, - Fx_rot90, + Fx_rot90, Fx_cmixa, Fx_xper }; Fx fx_list[] = { @@ -32,6 +32,7 @@ Fx fx_list[] = { { "gray0", Fx_gray0, 0, 1 }, { "halfsz0", Fx_halfsz0, 0, 1 }, { "rot90", Fx_rot90, 0, 0 }, + { "cmixa", Fx_cmixa, 0, 1 }, { "xper", Fx_xper, 0, 1 }, { NULL, 0, 0 } }; @@ -156,6 +157,10 @@ switch (action) { case Fx_rot90: foo = fimg_rotate_90(&src, &dest, 0); break; + + case Fx_cmixa: + fimg_copy_data(&src, &dest); + foo = fimg_colors_mixer_a(&dest, 2.0); break; case Fx_halfsz0: fprintf(stderr, "halfsize was not implemented\n");