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

Comparing ray/src/px/x11image.c (file contents):
Revision 2.73 by greg, Mon Nov 10 19:08:19 2008 UTC vs.
Revision 2.77 by greg, Tue Sep 10 20:24:42 2024 UTC

# Line 83 | Line 83 | int  gotview = 0;                      /* got parameters from file */
83  
84   COLR  *scanline;                        /* scan line buffer */
85   TMbright  *lscan;                       /* encoded luminance scanline */
86 < BYTE  *cscan;                           /* encoded chroma scanline */
87 < BYTE  *pscan;                           /* compute pixel scanline */
86 > uby8  *cscan;                           /* encoded chroma scanline */
87 > uby8  *pscan;                           /* compute pixel scanline */
88  
89   RESOLU  inpres;                         /* input resolution and ordering */
90   int  xmax, ymax;                        /* picture dimensions */
# Line 122 | Line 122 | char  *progname;
122  
123   char  errmsg[128];
124  
125 < BYTE  clrtab[256][3];                   /* global color map */
125 > uby8  clrtab[256][3];                   /* global color map */
126  
127  
128   Display  *thedisplay;
# Line 283 | Line 283 | headline(              /* get relevant info from header */
283          void    *p
284   )
285   {
286 <        char  fmt[32];
286 >        char  fmt[MAXFMTLEN];
287  
288          if (isexpos(s))
289                  exposure *= exposval(s);
290          else if (formatval(fmt, s))
291 <                wrongformat = strcmp(fmt, COLRFMT);
292 <        else if (isview(s) && sscanview(&ourview, s) > 0)
293 <                gotview++;
291 >                wrongformat = strcmp(fmt, COLRFMT) && strcmp(fmt, SPECFMT);
292 >        else if (isview(s))
293 >                gotview += sscanview(&ourview, s);
294 >        else if (isncomp(s))
295 >                NCSAMP = ncompval(s);
296 >        else if (iswlsplit(s))
297 >                wlsplitval(WLPART, s);
298          return(0);
299   }
300  
# Line 421 | Line 425 | quiterr(               /* print message and exit */
425          register int  es;
426          int  cs;
427  
428 <        if ( (es = err != NULL) )
428 >        if ( (es = (err != NULL)) )
429                  fprintf(stderr, "%s: %s: %s\n", progname,
430                                  fname==NULL?"<stdin>":fname, err);
431          if (thedisplay != NULL)
# Line 1060 | Line 1064 | make_tonemap(void)                     /* initialize tone mapping */
1064                          goto memerr;
1065                  if (greyscale) {
1066                          cscan = TM_NOCHROM;
1067 <                        if ((pscan = (BYTE *)malloc(sizeof(BYTE)*xmax)) == NULL)
1067 >                        if ((pscan = (uby8 *)malloc(sizeof(uby8)*xmax)) == NULL)
1068                                  goto memerr;
1069 <                } else if ((pscan=cscan = (BYTE *)malloc(3*sizeof(BYTE)*xmax))
1069 >                } else if ((pscan=cscan = (uby8 *)malloc(3*sizeof(uby8)*xmax))
1070                                  == NULL)
1071                          goto memerr;
1072                                                  /* initialize tm library */
# Line 1100 | Line 1104 | tmap_colrs(            /* apply tone mapping to scanline */
1104          int  len
1105   )
1106   {
1107 <        register BYTE  *ps;
1107 >        register uby8  *ps;
1108  
1109          if (tmflags == TM_F_LINEAR) {
1110                  if (scale)
# Line 1401 | Line 1405 | skipit:
1405          } else if (scanpos != NULL && scanpos[y] == -1)
1406                  scanpos[y] = ftell(fin);
1407  
1408 <        if (freadcolrs(scanline, xmax, fin) < 0) {
1408 >        if (fread2colrs(scanline, xmax, fin, NCSAMP, WLPART) < 0) {
1409                  fprintf(stderr, "%s: %s: unfinished picture\n",
1410                                  progname, fname==NULL?"<stdin>":fname);
1411                  trunced = y;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines