| 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" |
| 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; |
| 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; |
| 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; |
| 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) | |
| 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); |