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

Comparing ray/src/util/rcrop.c (file contents):
Revision 1.13 by greg, Thu Apr 7 16:58:30 2022 UTC vs.
Revision 1.14 by greg, Tue Nov 21 02:06:14 2023 UTC

# Line 27 | Line 27 | headline(char *s, void *p)
27   {
28          if (formatval(fmt, s))
29                  return(0);
30 <        if (!strncmp(s, "NCOMP=", 6)) {
31 <                ncomp = atoi(s+6);
30 >        if (isncomp(s)) {
31 >                ncomp = ncompval(s);
32                  return(-(ncomp <= 0));
33          }
34          if (!strncmp(s, "NROWS=", 6)) {
# Line 321 | Line 321 | main(int argc, char *argv[])
321          if (gotdims)                    /* dimensions + format */
322                  printf("NROWS=%d\nNCOLS=%d\n", nrows, ncols);
323          if (ncomp)
324 <                printf("NCOMP=%d\n", ncomp);
324 >                fputncomp(ncomp, stdout);
325          fputformat(fmt, stdout);        /* will align bytes if it can */
326          fputc('\n', stdout);            /* end of new header */
327          if (!gotdims) {                 /* add resolution string? */
# Line 351 | Line 351 | main(int argc, char *argv[])
351                  asiz = -1;
352                  if (!ncomp) ncomp = 3;
353                  else ncomp *= (ncomp == 3);
354 +        } else if (!strcmp(fmt, SPECFMT)) {
355 +                asiz = ncomp+1;
356 +                ncomp = 1;              /* XXX assumes uncompressed */
357          } else if (strcasecmp(fmt, "ascii")) {
358                  fputs(progname, stderr);
359                  fputs(": unsupported format - ", stderr);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines