Compare commits

...

6 Commits

Author SHA1 Message Date
tth
6e896ee463 dicom boilerplate: [done] 2021-11-27 00:01:37 +01:00
tth
99187104ce preparing DICOM entry 2021-11-26 23:10:29 +01:00
tth
be4e6b0dc9 oups again 2021-11-02 19:27:19 +01:00
tth
8c514ffe99 added "abs" func to fimgfx 2021-11-02 16:01:11 +01:00
tth
2a1d74a83f oups 2021-11-02 15:38:10 +01:00
tth
f09162d4ce fixed a little brotch 2021-10-25 20:49:10 +02:00
18 changed files with 259 additions and 29 deletions

View File

@ -356,7 +356,7 @@ switch (idFx) {
retval = des_bords_sombres_a(image, 160); retval = des_bords_sombres_a(image, 160);
break; break;
case CR_bsombrb: /* experiment ! */ case CR_bsombrb: /* experiment ! */
retval = des_bords_sombres_b(image, 100); retval = des_bords_sombres_b(image, 120);
break; break;
case CR_vsglitch: case CR_vsglitch:

View File

@ -53,17 +53,29 @@ return -1;
static int pixel_trinitron(FloatImg *pimg, int pos[4], float *fvals) static int pixel_trinitron(FloatImg *pimg, int pos[4], float *fvals)
{ {
int x, y, pline, off; int x, y, pline, off;
int ym;
fimg_clear_rectangle(pimg, pos); fimg_clear_rectangle(pimg, pos);
for (y=pos[1]; y<pos[1]+pos[3]; y++) { ym = pos[1]+pos[3]-1;
#define FDIM 0.60
for (y=pos[1]; y<ym; y++) {
pline = y*pimg->width; pline = y*pimg->width;
for (x=pos[0]+2; x<(pos[0]+pos[2]-2); x++) { for (x=0; x<5; x++) {
off = pline + x; off = pline + (x+pos[0]);
/* wtf i'm doing here ? */ /* wtf i'm doing here ? */
pimg->R[off] = fvals[0]; if ( (pos[1]==y) || (ym-1==y) ) {
pimg->G[off] = fvals[1]; pimg->R[off] = fvals[0] * FDIM;
pimg->B[off] = fvals[2]; pimg->G[off+5] = fvals[1] * FDIM;
pimg->B[off+10] = fvals[2] * FDIM;
}
else {
pimg->R[off] = fvals[0];
pimg->G[off+5] = fvals[1];
pimg->B[off+10] = fvals[2];
}
} }
} }
return 0; return 0;

View File

@ -16,3 +16,10 @@ printf("this is the version ZERO !!!\n");
} }
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
int init_empty_cache(int iw, int ih, int szc, int nbre)
{
return -1;
}
/* ------------------------------------------------------------ */
/* ------------------------------------------------------------ */

View File

@ -3,3 +3,5 @@
*/ */
void cachengn_print_version(int k); void cachengn_print_version(int k);
int init_empty_cache(int iw, int ih, int szc, int nbre);

View File

@ -6,11 +6,21 @@
#include "cachengn.h" #include "cachengn.h"
#define IMGW 320
#define IMGH 240
#define SIZE 20
#define NBRI 1000
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
int foo;
fprintf(stderr, "Test of the cache engin - %s %s\n", __DATE__, __TIME__); fprintf(stderr, "Test of the cache engin - %s %s\n", __DATE__, __TIME__);
cachengn_print_version(1);
foo = init_empty_cache(IMGW, IMGH, SIZE, NBRI);
fprintf(stderr, "init_empty_cache --> %d\n", foo);
return 0; return 0;
} }

View File

@ -4,7 +4,7 @@
* http://la.buvette.org/photos/cumul * http://la.buvette.org/photos/cumul
*/ */
#define FIMG_VERSION 160 #define FIMG_VERSION 163
/* /*
* in memory descriptor * in memory descriptor
@ -53,6 +53,7 @@ typedef struct {
#define FILE_TYPE_FITS 6 #define FILE_TYPE_FITS 6
#define FILE_TYPE_BMP 7 #define FILE_TYPE_BMP 7
#define FILE_TYPE_EXR 8 #define FILE_TYPE_EXR 8
#define FILE_TYPE_DICOM 9
/* lib/contrast.c */ /* lib/contrast.c */
#define CONTRAST_NONE 0 #define CONTRAST_NONE 0
@ -142,6 +143,9 @@ int fimg_killrgb_v(FloatImg *src, FloatImg *dst, int k);
int fimg_decomp_rgbz_color(FloatImg *psrc, FloatImg *pdst, int k); int fimg_decomp_rgbz_color(FloatImg *psrc, FloatImg *pdst, int k);
int fimg_decomp_rgbz_gray(FloatImg *psrc, FloatImg *pdst, int k); int fimg_decomp_rgbz_gray(FloatImg *psrc, FloatImg *pdst, int k);
int fimg_save_plane_as_dicom(FloatImg *src, char *outname,
char plane, int flags);
/* universal exporter XXX */ /* universal exporter XXX */
int fimg_export_picture(FloatImg *pic, char *fname, int flags); int fimg_export_picture(FloatImg *pic, char *fname, int flags);
@ -223,6 +227,7 @@ int fimg_to_gray(FloatImg *head);
int fimg_add_cste(FloatImg *fi, float value); int fimg_add_cste(FloatImg *fi, float value);
int fimg_mul_cste(FloatImg *fi, float value); int fimg_mul_cste(FloatImg *fi, float value);
int fimg_ajust_from_grab(FloatImg *fi, double maxima, int notused); int fimg_ajust_from_grab(FloatImg *fi, double maxima, int notused);
int fimg_absolute(FloatImg *fimg);
void fimg_drand48(FloatImg *fi, float kmul); void fimg_drand48(FloatImg *fi, float kmul);
long fimg_count_negativ(FloatImg *fi); long fimg_count_negativ(FloatImg *fi);
long fimg_clamp_negativ(FloatImg *fi); long fimg_clamp_negativ(FloatImg *fi);
@ -241,6 +246,8 @@ int fimg_multirandom(FloatImg *fimg, long nbpass);
/* file is 'funcs/utils.c' */ /* file is 'funcs/utils.c' */
void fimg_print_minmax(float minmax[6], char *titre); void fimg_print_minmax(float minmax[6], char *titre);
float *charplane2int(char plane, FloatImg *img);
int parse_WxH(char *str, int *pw, int *ph); int parse_WxH(char *str, int *pw, int *ph);
int parse_double(char *str, double *dptr); int parse_double(char *str, double *dptr);
int irand2(int offset, int modulo); int irand2(int offset, int modulo);

View File

@ -11,6 +11,7 @@ OBJS = fimg-png.o fimg-tiff.o misc-plots.o filtrage.o utils.o \
sfx0.o sfx1.o sfx2.o sfx3.o sfx4.o \ sfx0.o sfx1.o sfx2.o sfx3.o sfx4.o \
geometry.o rotate.o fimg-openexr.o \ geometry.o rotate.o fimg-openexr.o \
equalize.o fimg-fits.o saturation.o histogram.o \ equalize.o fimg-fits.o saturation.o histogram.o \
fimg-dicom.o \
hsv.o classif.o contour2x2.o qsortrgb.o exporter.o \ hsv.o classif.o contour2x2.o qsortrgb.o exporter.o \
displacement.o dithering.o plasmas.o incrustator.o \ displacement.o dithering.o plasmas.o incrustator.o \
killrgb.o recurse.o pixelize.o decomprgb.o killrgb.o recurse.o pixelize.o decomprgb.o
@ -70,6 +71,9 @@ fimg-tiff.o: fimg-tiff.c $(DEPS)
fimg-openexr.o: fimg-openexr.c $(DEPS) fimg-openexr.o: fimg-openexr.c $(DEPS)
gcc $(COPT) -c $< gcc $(COPT) -c $<
fimg-dicom.o: fimg-dicom.c $(DEPS)
gcc $(COPT) -c $<
fimg-fits.o: fimg-fits.c $(DEPS) fimg-fits.o: fimg-fits.c $(DEPS)
gcc $(COPT) -I/usr/include/cfitsio/ -c $< gcc $(COPT) -I/usr/include/cfitsio/ -c $<

View File

@ -60,6 +60,7 @@ for (y=0; y<h2; y++)
getRpix(psrc, x2+1, y2+1); getRpix(psrc, x2+1, y2+1);
cumul /= 4, vgray = cumul; cumul /= 4, vgray = cumul;
pdst->R[pixidx(pdst,x,y)] = cumul; pdst->R[pixidx(pdst,x,y)] = cumul;
pdst->R[pixidx(pdst,x+w2,y+h2)] = cumul;
cumul = getGpix(psrc, x2, y2) + cumul = getGpix(psrc, x2, y2) +
getGpix(psrc, x2, y2+1) + getGpix(psrc, x2, y2+1) +
@ -67,6 +68,7 @@ for (y=0; y<h2; y++)
getGpix(psrc, x2+1, y2+1); getGpix(psrc, x2+1, y2+1);
cumul /= 4, vgray += cumul; cumul /= 4, vgray += cumul;
pdst->G[pixidx(pdst,x+w2,y)] = cumul; pdst->G[pixidx(pdst,x+w2,y)] = cumul;
pdst->G[pixidx(pdst,x+w2,y+h2)] = cumul;
cumul = getBpix(psrc, x2, y2) + cumul = getBpix(psrc, x2, y2) +
getBpix(psrc, x2, y2+1) + getBpix(psrc, x2, y2+1) +
@ -74,10 +76,8 @@ for (y=0; y<h2; y++)
getBpix(psrc, x2+1, y2+1); getBpix(psrc, x2+1, y2+1);
cumul /= 4, vgray += cumul; cumul /= 4, vgray += cumul;
pdst->B[pixidx(pdst,x,y+h2)] = cumul; pdst->B[pixidx(pdst,x,y+h2)] = cumul;
pdst->B[pixidx(pdst,x+w2,y+h2)] = cumul;
idx = pixidx(pdst,x+w2,y+h2);
pdst->R[idx] = pdst->G[idx] = \
pdst->B[idx] = vgray / 3.0;
} }
} }

View File

@ -10,6 +10,34 @@
#include "../floatimg.h" #include "../floatimg.h"
extern int verbosity;
/* -------------------------------------------------------------------- */
int fimg_show_filter(char *title, FimgFilter3x3 *filtr)
{
float *M; /* alias of filter matrix */
int foo, idx;
float sum, value;
if (title) fprintf(stderr, "--------- %s ---------\n", title);
M = filtr->matrix; /* aliasing here */
fprintf(stderr, "%8.3f %8.3f %8.3f\n", M[0], M[1], M[2]);
fprintf(stderr, "%8.3f %8.3f %8.3f\n", M[3], M[4], M[5]);
fprintf(stderr, "%8.3f %8.3f %8.3f\n", M[6], M[7], M[8]);
sum = 0.0;
for (idx=0; idx<9; idx++) sum += M[idx];
fprintf(stderr, " sum %8.3f\n", sum);
fprintf(stderr, " mult %8.3f\n", filtr->mult);
fprintf(stderr, " offset %8.3f\n", filtr->offset);
value = (sum * filtr->mult) + filtr->offset;
fprintf(stderr, " value %8.3f ???\n", sum);
return 0;
}
/* -------------------------------------------------------------------- */ /* -------------------------------------------------------------------- */
int fimg_filter_3x3(FloatImg *src, FloatImg *dst, FimgFilter3x3 *filtr) int fimg_filter_3x3(FloatImg *src, FloatImg *dst, FimgFilter3x3 *filtr)
{ {
@ -35,6 +63,10 @@ if (fimg_images_not_compatible(src, dst)) {
return -98; return -98;
} }
if (verbosity) {
fimg_show_filter("essai", filtr);
}
/* aliasing some vars for cleaner code */ /* aliasing some vars for cleaner code */
pr = src->R; pg = src->G; pb = src->B; pr = src->R; pg = src->G; pb = src->B;
w = src->width; h = src->height; w = src->width; h = src->height;

32
funcs/fimg-dicom.c Normal file
View File

@ -0,0 +1,32 @@
/*
Digital Imaging and Communications in Medicine
nouveau Fri 26 Nov 2021 11:12:44 PM CET - allée de Dinan
*/
#include <stdio.h>
#include <stdint.h>
#include "../floatimg.h"
extern int verbosity; /* must be declared around main() */
/* --------------------------------------------------------------------- */
int fimg_save_plane_as_dicom(FloatImg *src, char *outname,
char plane, int flags)
{
int foo;
float *planeptr;
fprintf(stderr, ">>> %s ( %p %s %c %d )\n", __func__, src, outname, plane, flags);
planeptr = charplane2int(plane, src);
if (verbosity) {
fimg_describe(src, outname);
}
return -1;
}
/* --------------------------------------------------------------------- */

View File

@ -17,6 +17,12 @@
extern int verbosity; extern int verbosity;
/*
https://baillehachepascal.dev/2021/rgb_hsv.php
*/
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
/* helper functions */ /* helper functions */
static float maxi3f(float a, float b, float c) static float maxi3f(float a, float b, float c)
@ -29,7 +35,7 @@ return ((a < b)? (a < c ? a : c) : (b < c ? b : c));
} }
static int pseudoeq(float a, float b) static int pseudoeq(float a, float b)
{ {
return (fabsf(a-b)<0.00000000000001); // UGLY HACK ??? return (fabsf(a-b)<0.00000001); // UGLY HACK ???
} }
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
/* /*

View File

@ -24,7 +24,8 @@ enum nCmd { Equalize=1, Rotate, Sfx0, F3x3, MIRE, Wfits, Wpng, Wtiff,
Histo, Hsv, Classif, Ctr2x2, Qsortrgb, Histo, Hsv, Classif, Ctr2x2, Qsortrgb,
Displace, ReadPNG, Plasmas, Hilight, OpenEXR, Displace, ReadPNG, Plasmas, Hilight, OpenEXR,
Geometrie, FileType, Mirror, KillRGB, Geometrie, FileType, Mirror, KillRGB,
Pixelize,SplitLevel,DecompRgbz, Rectangle }; Pixelize,SplitLevel, DecompRgbz, DecompRgbg,
Rectangle, Dicom };
typedef struct { typedef struct {
char *name; char *name;
int Cmd; int Cmd;
@ -56,7 +57,9 @@ Command commands[] = {
{ "pixelize", Pixelize }, { "pixelize", Pixelize },
{ "spltlvl", SplitLevel }, { "spltlvl", SplitLevel },
{ "decomprgbz", DecompRgbz }, { "decomprgbz", DecompRgbz },
{ "decomprgbg", DecompRgbg },
{ "rectangle", Rectangle }, { "rectangle", Rectangle },
{ "dicom", Dicom },
{ NULL, 0 } { NULL, 0 }
} ; } ;
@ -232,11 +235,17 @@ switch(opt) {
foo = essai_split_level(filename, outfile, 0); foo = essai_split_level(filename, outfile, 0);
break; break;
case DecompRgbz: case DecompRgbz:
foo = essai_decomprgb(filename, outfile); foo = essai_decomprgb_color(filename, outfile);
break;
case DecompRgbg:
foo = essai_decomprgb_gray(filename, outfile);
break; break;
case Rectangle: case Rectangle:
essai_rectangle(outfile, 0); essai_rectangle(outfile, 0);
break; break;
case Dicom:
foo = essai_dicom(filename, outfile, 0);
break;
default: default:
fprintf(stderr, "'%s' is a bad command\n", command); fprintf(stderr, "'%s' is a bad command\n", command);

View File

@ -17,6 +17,23 @@
extern int verbosity; extern int verbosity;
/* --------------------------------------------------------------------- */
/* --------------------------------------------------------------------- */
int essai_dicom(char *inf, char *outf, int k)
{
int foo;
FloatImg img;
fprintf(stderr, ">>> %s ( %s %s %d )\n", __func__, inf, outf, k);
foo = fimg_create(&img, 320, 240, FIMG_TYPE_RGB);
fimg_drand48(&img, 1.0);
foo = fimg_save_plane_as_dicom(&img, outf, 'R', 0);
fprintf(stderr, "dicom: save a plane --> %d\n", foo);
return -1;
}
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
int essai_rectangle(char *outf, int k) int essai_rectangle(char *outf, int k)
{ {
@ -74,8 +91,7 @@ if (foo) {
return 0; return 0;
} }
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
/* --------------------------------------------------------------------- */ int essai_decomprgb_gray(char *inf, char *outf)
int essai_decomprgb(char *inf, char *outf)
{ {
int foo; int foo;
FloatImg src, dst; FloatImg src, dst;
@ -105,6 +121,39 @@ if (foo) {
fimg_destroy(&src); fimg_destroy(&dst); fimg_destroy(&src); fimg_destroy(&dst);
return 0;
}
/* --------------------------------------------------------------------- */
int essai_decomprgb_color(char *inf, char *outf)
{
int foo;
FloatImg src, dst;
fprintf(stderr, ">>> %s ( %s %s )\n", __func__, inf, outf);
foo = fimg_create_from_dump(inf, &src);
if (0 != foo) {
fprintf(stderr, "%s: err %d loading image '%s'\n", __func__,
foo, inf);
return foo;
}
fimg_clone(&src, &dst, 1);
foo = fimg_decomp_rgbz_color(&src, &dst, 0);
if (foo) {
fprintf(stderr, "%s:%s(): fail %d line %d\n",
__FILE__, __func__, foo, __LINE__);
return foo;
}
foo = fimg_export_picture(&dst, outf, 0);
if (foo) {
fprintf(stderr, "%s : err %d saving result\n", __func__, foo);
return foo;
}
fimg_destroy(&src); fimg_destroy(&dst);
return 0; return 0;
} }
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */

View File

@ -6,7 +6,8 @@
int essai_plasma(char *infile, char *outfile, int ikoef, float fkoef); int essai_plasma(char *infile, char *outfile, int ikoef, float fkoef);
int essai_miroir(char *inf, char *outf, int flags); int essai_miroir(char *inf, char *outf, int flags);
int essai_killrgb(char *inf, char *outf); int essai_killrgb(char *inf, char *outf);
int essai_decomprgb(char *inf, char *outf); int essai_decomprgb_color(char *inf, char *outf);
int essai_decomprgb_gray(char *inf, char *outf);
int essai_split_level(char *inf, char *outf, int flags); int essai_split_level(char *inf, char *outf, int flags);
int essai_displacement(char *infile, char *outfile); int essai_displacement(char *infile, char *outfile);
@ -35,3 +36,6 @@ int essai_openexr(char *inf, char *outf, int flags);
int essai_pixelize(char *infile, char *outfile); int essai_pixelize(char *infile, char *outfile);
int essai_rectangle(char *outf, int k);
int essai_dicom(char *inf, char *outf, int k);

View File

@ -21,6 +21,30 @@ fprintf(stderr, "green\t\t%10f %10f\n", minmax[2], minmax[3]);
fprintf(stderr, "blue\t\t%10f %10f\n", minmax[4], minmax[5]); fprintf(stderr, "blue\t\t%10f %10f\n", minmax[4], minmax[5]);
} }
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
/* used in fimg-fits & fimg-dicom */
float *charplane2int(char plane, FloatImg *img)
{
float *pplane = NULL;
fprintf(stderr, "get plane for '%c' in %p ", plane, img);
switch (plane) {
case 'r': case 'R':
pplane = img->R; break;
case 'g': case 'G':
pplane = img->G; break;
case 'b': case 'B':
pplane = img->B; break;
default:
pplane = NULL;
}
fprintf(stderr, "give me %p\n", pplane);
return pplane;
}
/* --------------------------------------------------------------------- */
int parse_WxH(char *str, int *pw, int *ph) int parse_WxH(char *str, int *pw, int *ph)
{ {
// char *ptr; // char *ptr;
@ -67,14 +91,15 @@ int file_type_from_name(char *name)
fprintf(stderr, ">>> %s ( '%s' )\n", __func__, name); fprintf(stderr, ">>> %s ( '%s' )\n", __func__, name);
#endif #endif
if (!strcasecmp(name, "pnm" )) return FILE_TYPE_PNM; if (!strcasecmp(name, "pnm" )) return FILE_TYPE_PNM;
if (!strcasecmp(name, "fimg")) return FILE_TYPE_FIMG; if (!strcasecmp(name, "fimg")) return FILE_TYPE_FIMG;
if (!strcasecmp(name, "tga" )) return FILE_TYPE_TGA; if (!strcasecmp(name, "tga" )) return FILE_TYPE_TGA;
if (!strcasecmp(name, "png" )) return FILE_TYPE_PNG; if (!strcasecmp(name, "png" )) return FILE_TYPE_PNG;
if (!strcasecmp(name, "tiff")) return FILE_TYPE_TIFF; if (!strcasecmp(name, "tiff")) return FILE_TYPE_TIFF;
if (!strcasecmp(name, "tif" )) return FILE_TYPE_TIFF; if (!strcasecmp(name, "tif" )) return FILE_TYPE_TIFF;
if (!strcasecmp(name, "fits")) return FILE_TYPE_FITS; if (!strcasecmp(name, "fits")) return FILE_TYPE_FITS;
if (!strcasecmp(name, "exr")) return FILE_TYPE_EXR; if (!strcasecmp(name, "exr")) return FILE_TYPE_EXR;
if (!strcasecmp(name, "dicom")) return FILE_TYPE_EXR;
return -1; return -1;
} }

View File

@ -1,5 +1,5 @@
/* /*
* fimg-core.c * fimg-math.c
* *
* *
*/ */
@ -295,6 +295,22 @@ fimg_mul_cste(fi, coef);
return 0; return 0;
} }
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */
int fimg_absolute(FloatImg *fi)
{
int surface, idx;
surface = fi->width * fi->height;
for (idx=0; idx<surface; idx++) {
fi->R[idx] = fabsf(fi->R[idx]);
fi->G[idx] = fabsf(fi->G[idx]);
fi->B[idx] = fabsf(fi->B[idx]);
}
return 0;
}
/* ---------------------------------------------------------------- */
/* Warning: this function is _very_ slow */ /* Warning: this function is _very_ slow */
void fimg_drand48(FloatImg *fi, float kmul) void fimg_drand48(FloatImg *fi, float kmul)
{ {

View File

@ -5,6 +5,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdint.h>
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>

View File

@ -27,7 +27,8 @@ typedef struct {
enum fxid { Fx_cos01=5, Fx_cos010, Fx_pow2, Fx_sqrt, Fx_gray0, Fx_halfsz0, enum fxid { Fx_cos01=5, Fx_cos010, Fx_pow2, Fx_sqrt, Fx_gray0, Fx_halfsz0,
Fx_rot90, Fx_cmixa, Fx_desat, Fx_ctr2x2, Fx_norm, Fx_rot90, Fx_cmixa, Fx_desat, Fx_ctr2x2, Fx_norm,
Fx_classtrial, Fx_mirror, Fx_shift0, Fx_trimul, Fx_classtrial, Fx_mirror, Fx_shift0, Fx_trimul,
Fx_xper, Fx_binarize, Fx_trinarize,Fx_hilight_R }; Fx_xper, Fx_binarize, Fx_trinarize, Fx_hilight_R,
Fx_absolute, Fx_clamp };
Fx fx_list[] = { Fx fx_list[] = {
{ "cos01", Fx_cos01, 0, 1 }, { "cos01", Fx_cos01, 0, 1 },
@ -49,6 +50,8 @@ Fx fx_list[] = {
{ "binarize", Fx_binarize, 0, 1 }, { "binarize", Fx_binarize, 0, 1 },
{ "trinarize", Fx_trinarize, 0, 1 }, { "trinarize", Fx_trinarize, 0, 1 },
{ "hilightr", Fx_hilight_R, 0, 1 }, { "hilightr", Fx_hilight_R, 0, 1 },
{ "abs", Fx_absolute, 0, 1 },
{ "clamp", Fx_clamp, 0, 1 },
{ NULL, 0, 0, 0 } { NULL, 0, 0, 0 }
}; };
@ -231,6 +234,17 @@ switch (action) {
foo = fimg_highlight_color(&src, &dest, 'R', 1.333); foo = fimg_highlight_color(&src, &dest, 'R', 1.333);
break; break;
case Fx_absolute:
fimg_copy_data(&src, &dest);
foo = fimg_absolute(&dest);
break;
case Fx_clamp:
fimg_copy_data(&src, &dest);
foo = fimg_clamp_negativ(&dest);
/* this func return the count of
negative pixels killed */
if (foo > 0) foo = 0;
break;
default: default:
fprintf(stderr, "%s %s : %d is bad action\n", fprintf(stderr, "%s %s : %d is bad action\n",
__FILE__, __func__, action); __FILE__, __func__, action);
@ -292,7 +306,7 @@ if (action < 0) {
exit(1); exit(1);
} }
if (verbosity) { if (verbosity > 1) {
fprintf(stderr, " global fvalue %f\n", global_fvalue); fprintf(stderr, " global fvalue %f\n", global_fvalue);
fprintf(stderr, " action %d\n", action); fprintf(stderr, " action %d\n", action);
fprintf(stderr, " verbosity %d\n", verbosity); fprintf(stderr, " verbosity %d\n", verbosity);
@ -304,7 +318,7 @@ if ((nba=fx_list[action].nbarg)) {
srcname = argv[optind+1]; srcname = argv[optind+1];
dstname = argv[optind+2]; dstname = argv[optind+2];
if (verbosity) fprintf(stderr, "%s ==> %s\n", srcname, dstname); if (verbosity > 1) fprintf(stderr, "Fx %s ==> %s\n", srcname, dstname);
foo = do_an_effect(srcname, action, dstname); foo = do_an_effect(srcname, action, dstname);
if (foo) { if (foo) {