diff --git a/floatimg.h b/floatimg.h index d4b91e4f..272c0593 100644 --- a/floatimg.h +++ b/floatimg.h @@ -2,7 +2,7 @@ * floatimg.h */ -#define FIMG_VERSION 87 +#define FIMG_VERSION 88 /* * in memory descriptor @@ -57,7 +57,6 @@ int fimg_print_version(int k); void fimg_printhead(FloatImg *h); int fimg_describe(FloatImg *head, char *txt); char *fimg_str_type(int type); -int fimg_fileinfo(char *fname, int *datas); int fimg_plot_rgb (FloatImg *head, int x, int y, float r, float g, float b); int fimg_clear(FloatImg *fimg); int fimg_add_rgb(FloatImg *head, int x, int y, float r, float g, float b); @@ -91,6 +90,7 @@ int fimg_cos_01(FloatImg *s, FloatImg *d, double maxval); int fimg_cos_010(FloatImg *s, FloatImg *d, double maxval); int fimg_mk_gray_from(FloatImg *src, FloatImg*dst, int k); +int fimg_desaturate(FloatImg *src, FloatImg *dst, int k); /* module funcs/rampes.c */ int fimg_hdeg_a(FloatImg *img, double dcoef); diff --git a/lib/fimg-2gray.c b/lib/fimg-2gray.c index 70723bbf..52a774d8 100644 --- a/lib/fimg-2gray.c +++ b/lib/fimg-2gray.c @@ -52,6 +52,28 @@ for (foo=0; footype || FIMG_TYPE_RGB != dst->type) { + fprintf(stderr, "%s : bad image type\n", __func__, src->type, src); + return -18; + } + +/* entering the main processing loop */ +nbb = src->width * src->height; + +for (foo=0; fooR[foo] = dst->G[foo] = dst->B[foo] = + (src->R[foo] + src->G[foo] + src->B[foo]) / 3.0; + } + +return -99; +} +/* --------------------------------------------------------------------- */