ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/rcollate.c
(Generate patch)

Comparing ray/src/util/rcollate.c (file contents):
Revision 2.15 by greg, Tue Jul 8 16:39:41 2014 UTC vs.
Revision 2.16 by greg, Wed Jul 9 21:45:48 2014 UTC

# Line 274 | Line 274 | int            ni_columns = 0;                 /* number of input columns */
274   int             ni_rows = 0;                    /* number of input rows */
275   int             no_columns = 0;                 /* number of output columns */
276   int             no_rows = 0;                    /* number of output rows */
277 + int             transpose = 0;                  /* transpose rows & cols? */
278 + int             i_header = 1;                   /* input header? */
279 + int             o_header = 1;                   /* output header? */
280  
281   /* check settings and assign defaults */
282   static int
# Line 293 | Line 296 | check_sizes()
296                          return(0);
297                  }
298          }
299 +        if (transpose && (no_rows <= 0) & (no_columns <= 0)) {
300 +                if (ni_rows > 0) no_columns = ni_rows;
301 +                if (ni_columns > 0) no_rows = ni_columns;
302 +        } else if ((no_rows <= 0) & (no_columns > 0) &&
303 +                        !((ni_rows*ni_columns) % no_columns))
304 +                no_rows = ni_rows*ni_columns/no_columns;
305          if (n_comp <= 0)
306                  n_comp = 3;
307          return(1);
# Line 466 | Line 475 | headline(char *s, void *p)
475                  n_comp = n;
476                  return(0);
477          }
478 <        fputs(s, stdout);                       /* copy header info. */
478 >        if (o_header)
479 >                fputs(s, stdout);               /* copy header info. */
480          return(0);
481   }
482  
# Line 474 | Line 484 | headline(char *s, void *p)
484   int
485   main(int argc, char *argv[])
486   {
477        int     i_header = 1;                   /* input header? */
478        int     o_header = 1;                   /* output header? */
479        int     transpose = 0;                  /* transpose rows & cols? */
487          int     a;
488  
489          for (a = 1; a < argc && argv[a][0] == '-'; a++)
# Line 587 | Line 594 | main(int argc, char *argv[])
594                  return(1);
595          if (o_header) {                         /* write header */
596                  printargs(a, argv, stdout);
590                if (transpose && (no_rows <= 0) & (no_columns <= 0)) {
591                        if (ni_rows > 0) no_columns = ni_rows;
592                        if (ni_columns > 0) no_rows = ni_columns;
593                }
597                  if (no_rows > 0)
598                          printf("NROWS=%d\n", no_rows);
599                  if (no_columns > 0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines