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.33 by greg, Fri Nov 8 16:36:36 2019 UTC vs.
Revision 2.35 by greg, Sat Dec 28 18:05:14 2019 UTC

# Line 6 | Line 6 | static const char RCSid[] = "$Id$";
6   */
7  
8   #include <stdlib.h>
9 #include <string.h>
9   #include <ctype.h>
10   #include "platform.h"
11   #include "rtio.h"
# Line 387 | Line 386 | get_input_pos(int r, int c)
386          if (outLevels > 1) {            /* block reordering */
387                  n = get_block_pos(r, c, outArray, outLevels);
388                  if (transpose) {
389 <                        r = n/no_columns;
390 <                        c = n - r*no_columns;
391 <                        n = (long)r*ni_columns + c;
389 >                        r = n/ni_rows;
390 >                        c = n - r*ni_rows;
391 >                        n = (long)c*ni_columns + r;
392                  }
393          } else if (transpose)           /* transpose only */
394                  n = (long)c*ni_columns + r;
# Line 439 | Line 438 | do_reorder(const MEMLOAD *mp)
438                          no_columns = ni_rows;
439                  if (no_rows <= 0)
440                          no_rows = ni_columns;
441 <                if ((no_rows != ni_columns) | (no_columns != ni_rows))
441 >                if (outLevels <= 1 &&
442 >                                (no_rows != ni_columns) | (no_columns != ni_rows))
443                          goto badspec;
444          } else {
445                  if (no_columns <= 0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines