From 154bf0e188ae2958cb28c0ddc064d59ad194e72b Mon Sep 17 00:00:00 2001 From: tth Date: Tue, 30 Mar 2021 19:48:55 +0200 Subject: [PATCH] a small debug func --- floatimg.h | 5 ++--- lib/fimg-core.c | 5 +++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/floatimg.h b/floatimg.h index 4d3c70f7..bba9d584 100644 --- a/floatimg.h +++ b/floatimg.h @@ -4,7 +4,7 @@ * http://la.buvette.org/photos/cumul */ -#define FIMG_VERSION 127 +#define FIMG_VERSION 128 /* * in memory descriptor @@ -15,9 +15,7 @@ typedef struct { int type; float fval; int count; - float *R, *G, *B, *A; - int reserved; } FloatImg; @@ -64,6 +62,7 @@ int fimg_type_is_valid(int type); int fimg_print_version(int k); void fimg_print_sizeof(void); void fimg_printhead(FloatImg *h); +void fimg_printdims(char *txt, FloatImg *pi); int fimg_describe(FloatImg *head, char *txt); char *fimg_str_type(int type); int fimg_plot_rgb (FloatImg *head, int x, int y, diff --git a/lib/fimg-core.c b/lib/fimg-core.c index 33856523..7ea0d46a 100644 --- a/lib/fimg-core.c +++ b/lib/fimg-core.c @@ -57,6 +57,11 @@ fprintf(stderr, " sz filehead = %lu\n", sizeof(FimgFileHead)); fprintf(stderr, " sz filter = %lu\n", sizeof(FimgFilter3x3)); } /* --------------------------------------------------------------------- */ +void fimg_printdims(char *txt, FloatImg *pi) +{ +fprintf(stderr, "# %s %dx%d\n", txt, pi->width, pi->height); +} +/* --------------------------------------------------------------------- */ void fimg_printhead(FloatImg *h) { printf("%5d %5d %2d %p %p %p %p\n", h->width, h->height, h->type,