From 737584a6d5b1248765adebeec6d3a8d4f79fd59a Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Sun, 24 May 2015 14:18:45 +0200 Subject: [PATCH] Do not show colorization progress when using quick render mode --- lib/colorize.c | 16 ++++++++++------ lib/colorize.h | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/colorize.c b/lib/colorize.c index 96bd385..6e5db8e 100644 --- a/lib/colorize.c +++ b/lib/colorize.c @@ -19,7 +19,7 @@ * second dimension = height * fourth dimension = time */ -int colorize_prepare(struct colorize *col, int alloc) +int colorize_prepare(struct colorize *col, int quick, int alloc) { int dimensions[4]; int ww, hh, kk, last_kk, d, temp, z; @@ -95,12 +95,14 @@ int colorize_prepare(struct colorize *col, int alloc) } /* generate sparse multigrid */ last_kk = kk = col->k; - printf("-> prepare sparse grid"); + if (!quick) + printf("-> prepare sparse grid"); for (d = 0, ww=col->w, hh=col->h; d < col->max_depth; d++, ww=(ww+1)>>1, hh=(hh+1)>>1) { /* create temporary arrays * copy fist array to level 0 or shrink previous level */ - printf(" #%d(w=%d h=%d k=%d)", d, ww, hh, kk); fflush(stdout); + if (!quick) + printf(" #%d(w=%d h=%d k=%d)", d, ww, hh, kk); fflush(stdout); dimensions[0] = ww; dimensions[1] = hh; dimensions[2] = last_kk; @@ -234,7 +236,8 @@ int colorize_prepare(struct colorize *col, int alloc) } darrayDestroy(luminance); luminance = NULL; - printf("\n"); + if (!quick) + printf("\n"); dimensions[0] = col->w; dimensions[1] = col->h; @@ -309,7 +312,8 @@ int colorize_solve(struct colorize *col, int quick, char **feat_names) int pixles, j; double *value_ptr, *init_ptr, *mark_ptr; - printf(" #%d(%s)", c, feat_names[c-1]); fflush(stdout); + if (!quick) + printf(" #%d(%s)", c, feat_names[c-1]); fflush(stdout); /* apply component * - copy component into value array (level 0), otherwise 0 * - use maked colors for init array, otherwise use 0 @@ -521,7 +525,7 @@ int colorize(const darray_t *image, const darray_t *image_mark, const darray_t * col = *_col; } - rc = colorize_prepare(col, alloc); + rc = colorize_prepare(col, quick, alloc); if (rc < 0) goto error; diff --git a/lib/colorize.h b/lib/colorize.h index 5f77d8b..22e93c2 100644 --- a/lib/colorize.h +++ b/lib/colorize.h @@ -22,7 +22,7 @@ struct colorize { darray_t **flows_xy; }; -int colorize_prepare(struct colorize *col, int alloc); +int colorize_prepare(struct colorize *col, int quick, int alloc); int colorize_solve(struct colorize *col, int quick, char **feat_names); void colorize_free(struct colorize *col); -- 2.13.6