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

Comparing ray/src/common/tmapcolrs.c (file contents):
Revision 3.28 by greg, Fri Apr 22 17:06:26 2011 UTC vs.
Revision 3.29 by greg, Fri May 20 02:06:38 2011 UTC

# Line 24 | Line 24 | static const char      RCSid[] = "$Id$";
24   #define GAMTSZ  4096
25  
26   typedef struct {
27 <        BYTE            gamb[GAMTSZ];   /* gamma lookup table */
27 >        uby8            gamb[GAMTSZ];   /* gamma lookup table */
28          int             clfb[3];        /* encoded tm->clf */
29          int32           cmatb[3][3];    /* encoded color transform */
30          TMbright        inpsfb;         /* encoded tm->inpsf */
# Line 46 | Line 46 | int
46   tmCvColrs(                              /* convert RGBE/XYZE colors */
47   TMstruct        *tms,
48   TMbright        *ls,
49 < BYTE    *cs,
49 > uby8    *cs,
50   COLR    *scan,
51   int     len
52   )
# Line 180 | Line 180 | int
180   tmLoadPicture(                          /* convert Radiance picture */
181   TMstruct        *tms,
182   TMbright        **lpp,
183 < BYTE    **cpp,
183 > uby8    **cpp,
184   int     *xp,
185   int     *yp,
186   char    *fname,
# Line 224 | Line 224 | FILE   *fp
224          if (*lpp == NULL)
225                  goto done;
226          if (cpp != TM_NOCHROMP) {
227 <                *cpp = (BYTE *)malloc(3*sizeof(BYTE) * *xp * *yp);
227 >                *cpp = (uby8 *)malloc(3*sizeof(uby8) * *xp * *yp);
228                  if (*cpp == NULL)
229                          goto done;
230          }
# Line 261 | Line 261 | done:                                          /* clean up */
261   #ifdef PCOND
262   static int                                      /* run pcond to map picture */
263   dopcond(psp, xp, yp, flags, monpri, gamval, Lddyn, Ldmax, fname)
264 < BYTE    **psp;
264 > uby8    **psp;
265   int     *xp, *yp;
266   int     flags;
267   RGBPRIMP        monpri;
# Line 273 | Line 273 | char   *fname;
273          char    cmdbuf[1024];
274          FILE    *infp;
275          COLR    *scan;
276 <        BYTE    *rp;
276 >        uby8    *rp;
277          int     y;
278          int     x;
279                                          /* set up gamma correction */
# Line 312 | Line 312 | char   *fname;
312                                          /* allocate arrays */
313          scan = (COLR *)malloc(sizeof(COLR) * *xp);
314          if (flags & TM_F_BW)
315 <                rp = (BYTE *)malloc(sizeof(BYTE) * *xp * *yp);
315 >                rp = (uby8 *)malloc(sizeof(uby8) * *xp * *yp);
316          else
317 <                rp = (BYTE *)malloc(3*sizeof(BYTE) * *xp * *yp);
317 >                rp = (uby8 *)malloc(3*sizeof(uby8) * *xp * *yp);
318          if (((*psp = rp) == NULL) | (scan == NULL)) {
319                  pclose(infp);
320                  returnErr(TM_E_NOMEM);
# Line 348 | Line 348 | char   *fname;
348  
349   int                                     /* map a Radiance picture */
350   tmMapPicture(psp, xp, yp, flags, monpri, gamval, Lddyn, Ldmax, fname, fp)
351 < BYTE    **psp;
351 > uby8    **psp;
352   int     *xp, *yp;
353   int     flags;
354   RGBPRIMP        monpri;
# Line 358 | Line 358 | FILE   *fp;
358   {
359          char    *funcName = fname==NULL ? "tmMapPicture" : fname;
360          TMstruct        *tms;
361 <        BYTE    *cp;
361 >        uby8    *cp;
362          TMbright        *lp;
363          int     err;
364                                                  /* check arguments */
# Line 388 | Line 388 | FILE   *fp;
388          }
389                                                  /* allocate space for result */
390          if (flags & TM_F_BW) {
391 <                *psp = (BYTE *)malloc(sizeof(BYTE) * *xp * *yp);
391 >                *psp = (uby8 *)malloc(sizeof(uby8) * *xp * *yp);
392                  if (*psp == NULL) {
393                          free((MEM_PTR)lp);
394                          tmDone(tms);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines