--- ray/src/common/tmaptiff.c 2005/01/07 22:05:30 3.6 +++ ray/src/common/tmaptiff.c 2011/06/28 21:11:04 3.11 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: tmaptiff.c,v 3.6 2005/01/07 22:05:30 greg Exp $"; +static const char RCSid[] = "$Id: tmaptiff.c,v 3.11 2011/06/28 21:11:04 greg Exp $"; #endif /* * Perform tone mapping on TIFF input. @@ -10,6 +10,7 @@ static const char RCSid[] = "$Id: tmaptiff.c,v 3.6 200 #include "copyright.h" #include +#include #include "tiffio.h" #include "tmprivat.h" #include "tmaptiff.h" @@ -78,7 +79,7 @@ getTIFFtype(TIFF *tif) /* load and convert TIFF */ int -tmLoadTIFF(TMstruct *tms, TMbright **lpp, BYTE **cpp, +tmLoadTIFF(TMstruct *tms, TMbright **lpp, uby8 **cpp, int *xp, int *yp, char *fname, TIFF *tp) { char *funcName = fname==NULL ? "tmLoadTIFF" : fname; @@ -172,7 +173,7 @@ tmLoadTIFF(TMstruct *tms, TMbright **lpp, BYTE **cpp, case TC_RGBSHORT: if (cpp == TM_NOCHROMP) break; - *cpp = (BYTE *)malloc(width*height*3*sizeof(BYTE)); + *cpp = (uby8 *)malloc(width*height*3*sizeof(uby8)); if (*cpp == NULL) { err = TM_E_NOMEM; goto done; @@ -251,13 +252,13 @@ done: /* clean up */ * As in tmMapPicture(), grey values are also returned if flags&TM_F_BW. */ int -tmMapTIFF(BYTE **psp, int *xp, int *yp, int flags, RGBPRIMP monpri, +tmMapTIFF(uby8 **psp, int *xp, int *yp, int flags, RGBPRIMP monpri, double gamval, double Lddyn, double Ldmax, char *fname, TIFF *tp) { char *funcName = fname==NULL ? "tmMapTIFF" : fname; - TMstruct *tms; + TMstruct *tms = NULL; TMbright *lp; - BYTE *cp; + uby8 *cp; int err; /* check arguments */ if ((psp == NULL) | (xp == NULL) | (yp == NULL) | (monpri == NULL) | @@ -279,7 +280,7 @@ tmMapTIFF(BYTE **psp, int *xp, int *yp, int flags, RGB return(err); } if (cp == TM_NOCHROM) { - *psp = (BYTE *)malloc(*xp * *yp * sizeof(BYTE)); + *psp = (uby8 *)malloc(*xp * *yp * sizeof(uby8)); if (*psp == NULL) { free((MEM_PTR)lp); tmDone(tms);