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

Comparing ray/src/px/normtiff.c (file contents):
Revision 3.15 by greg, Fri Jul 19 17:37:56 2019 UTC vs.
Revision 3.17 by greg, Wed Oct 2 15:58:56 2024 UTC

# Line 21 | Line 21 | int    flags = TM_F_CAMERA;            /* tone-mapping flags */
21   RGBPRIMP        rgbp = stdprims;        /* display primaries */
22   RGBPRIMS        myprims;                /* overriding display primaries */
23   double  ldmax = 100.;                   /* maximum display luminance */
24 < double  lddyn = 32.;                    /* display dynamic range */
24 > double  lddyn = 100.;                   /* display dynamic range */
25   double  gamv = 2.2;                     /* display gamma value */
26  
27   short   ortab[8] = {            /* orientation conversion table */
# Line 44 | Line 44 | typedef struct {
44  
45   uint16  comp = COMPRESSION_NONE;        /* TIFF compression mode */
46  
47 < #define closepicture(p)         (fclose((p)->fp),free((void *)(p)))
47 > #define closepicture(p)         (fclose((p)->fp),free(p))
48  
49   static gethfunc headline;
50  
# Line 148 | Line 148 | headline(                              /* process line from header */
148          void *pp
149   )
150   {
151 <        register char   *cp;
151 >        char    *cp;
152  
153          for (cp = s; *cp; cp++)
154                  if (*cp & 0x80)
# Line 167 | Line 167 | openpicture(                   /* open/check Radiance picture file */
167   )
168   {
169          FILE    *fp;
170 <        register PICTURE        *pp;
171 <        register char   *cp;
170 >        PICTURE *pp;
171 >        char    *cp;
172                                          /* check filename suffix */
173          if (fname == NULL) return(NULL);
174          for (cp = fname; *cp; cp++)
# Line 178 | Line 178 | openpicture(                   /* open/check Radiance picture file */
178                          cp = fname;
179                          break;
180                  }
181 <        if (cp > fname && !strncmp(cp, "tif", 3))
181 >        if (cp > fname && !strncasecmp(cp, "tif", 3))
182                  return(NULL);           /* assume it's a TIFF */
183                                          /* else try opening it */
184          if ((fp = fopen(fname, "r")) == NULL)
# Line 195 | Line 195 | openpicture(                   /* open/check Radiance picture file */
195          }
196          if (!pp->fmt[0])                /* assume RGBE if unspecified */
197                  strcpy(pp->fmt, COLRFMT);
198 <        if (!globmatch(PICFMT, pp->fmt) || !fgetsresolu(&pp->rs, fp)) {
198 >        if ((!globmatch(PICFMT, pp->fmt) && strcmp(SPECFMT, pp->fmt))
199 >                        || !fgetsresolu(&pp->rs, fp)) {
200                  closepicture(pp);       /* failed test -- close file */
201                  return(NULL);
202          }
# Line 207 | Line 208 | openpicture(                   /* open/check Radiance picture file */
208   static int
209   tmap_picture(                   /* tone map Radiance picture */
210          char    *fname,
211 <        register PICTURE        *pp
211 >        PICTURE *pp
212   )
213   {
214          uint16  orient;
# Line 228 | Line 229 | tmap_picture(                  /* tone map Radiance picture */
229                          72., 72./paspect, 2, pix) != 0)
230                  return(-1);
231                                          /* free data and we're done */
232 <        free((void *)pix);
232 >        free(pix);
233          return(0);
234   }
235  
# Line 261 | Line 262 | tmap_tiff(                     /* tone map SGILOG TIFF */
262                          xres, yres, resunit, pix) != 0)
263                  return(-1);
264                                          /* free data and we're done */
265 <        free((void *)pix);
265 >        free(pix);
266          return(0);
267   }
268  
# Line 277 | Line 278 | putimage(      /* write out our image */
278          uby8    *pd
279   )
280   {
281 <        register int    y;
281 >        int     y;
282          uint32  rowsperstrip;
283  
284          TIFFSetField(tifout, TIFFTAG_COMPRESSION, COMPRESSION_NONE);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines