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

Comparing ray/src/common/tmaptiff.c (file contents):
Revision 3.6 by greg, Fri Jan 7 22:05:30 2005 UTC vs.
Revision 3.11 by greg, Tue Jun 28 21:11:04 2011 UTC

# Line 10 | Line 10 | static const char      RCSid[] = "$Id$";
10   #include "copyright.h"
11  
12   #include <stdio.h>
13 + #include <stdlib.h>
14   #include "tiffio.h"
15   #include "tmprivat.h"
16   #include "tmaptiff.h"
# Line 78 | Line 79 | getTIFFtype(TIFF *tif)
79  
80   /* load and convert TIFF */
81   int
82 < tmLoadTIFF(TMstruct *tms, TMbright **lpp, BYTE **cpp,
82 > tmLoadTIFF(TMstruct *tms, TMbright **lpp, uby8 **cpp,
83                  int *xp, int *yp, char *fname, TIFF *tp)
84   {
85          char    *funcName = fname==NULL ? "tmLoadTIFF" : fname;
# Line 172 | Line 173 | tmLoadTIFF(TMstruct *tms, TMbright **lpp, BYTE **cpp,
173          case TC_RGBSHORT:
174                  if (cpp == TM_NOCHROMP)
175                          break;
176 <                *cpp = (BYTE *)malloc(width*height*3*sizeof(BYTE));
176 >                *cpp = (uby8 *)malloc(width*height*3*sizeof(uby8));
177                  if (*cpp == NULL) {
178                          err = TM_E_NOMEM;
179                          goto done;
# Line 251 | Line 252 | done:                                  /* clean up */
252   * As in tmMapPicture(), grey values are also returned if flags&TM_F_BW.
253   */
254   int
255 < tmMapTIFF(BYTE **psp, int *xp, int *yp, int flags, RGBPRIMP monpri,
255 > tmMapTIFF(uby8 **psp, int *xp, int *yp, int flags, RGBPRIMP monpri,
256          double gamval, double Lddyn, double Ldmax, char *fname, TIFF *tp)
257   {
258          char    *funcName = fname==NULL ? "tmMapTIFF" : fname;
259 <        TMstruct        *tms;
259 >        TMstruct        *tms = NULL;
260          TMbright        *lp;
261 <        BYTE    *cp;
261 >        uby8    *cp;
262          int     err;
263                                          /* check arguments */
264          if ((psp == NULL) | (xp == NULL) | (yp == NULL) | (monpri == NULL) |
# Line 279 | Line 280 | tmMapTIFF(BYTE **psp, int *xp, int *yp, int flags, RGB
280                  return(err);
281          }
282          if (cp == TM_NOCHROM) {
283 <                *psp = (BYTE *)malloc(*xp * *yp * sizeof(BYTE));
283 >                *psp = (uby8 *)malloc(*xp * *yp * sizeof(uby8));
284                  if (*psp == NULL) {
285                          free((MEM_PTR)lp);
286                          tmDone(tms);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines