Do not show colorization progress when using quick render mode
authorAndreas Eversberg <jolly@eversberg.eu>
Sun, 24 May 2015 12:18:45 +0000 (14:18 +0200)
committerAndreas Eversberg <jolly@eversberg.eu>
Sat, 20 Jun 2015 04:39:35 +0000 (06:39 +0200)
lib/colorize.c
lib/colorize.h

index 96bd385..6e5db8e 100644 (file)
@@ -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;
 
index 5f77d8b..22e93c2 100644 (file)
@@ -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);