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

Comparing ray/src/px/ra_t8.c (file contents):
Revision 2.13 by schorsch, Sun Mar 28 20:33:14 2004 UTC vs.
Revision 2.14 by greg, Fri May 20 02:06:39 2011 UTC

# Line 27 | Line 27 | static const char      RCSid[] = "$Id$";
27   #define  my_mapType(h)  ((h)->mapType==CM_HASMAP && \
28                                  ((h)->CMapBits==24 || (h)->CMapBits==32))
29  
30 < #define  taralloc(h)    (BYTE *)emalloc((h)->x*(h)->y)
30 > #define  taralloc(h)    (uby8 *)emalloc((h)->x*(h)->y)
31  
32 < BYTE  clrtab[256][3];
32 > uby8  clrtab[256][3];
33   extern int      samplefac;
34   double  gamv = 2.2;                     /* gamv correction */
35   int  bradj = 0;                         /* brightness adjustment */
36   char  *progname;
37   char  errmsg[128];
38   COLR    *inl;
39 < BYTE    *tarData;
39 > uby8    *tarData;
40   int  xmax, ymax;
41  
42   static int getint2(FILE *fp);
# Line 48 | Line 48 | static int getrhead(struct hdStruct  *h, FILE  *fp);
48   static void tg2ra(struct hdStruct        *hp);
49   static void getmapped(int  nc, int  dith);
50   static void getgrey(int  nc);
51 < static void writetarga(struct hdStruct   *h, BYTE  *d, FILE  *fp);
52 < static void readtarga(struct hdStruct    *h, BYTE  *data, FILE  *fp);
51 > static void writetarga(struct hdStruct   *h, uby8  *d, FILE  *fp);
52 > static void readtarga(struct hdStruct    *h, uby8  *data, FILE  *fp);
53  
54  
55   int
# Line 309 | Line 309 | tg2ra(                 /* targa file to RADIANCE file */
309   )
310   {
311          union {
312 <                BYTE  c3[256][3];
313 <                BYTE  c4[256][4];
312 >                uby8  c3[256][3];
313 >                uby8  c4[256][4];
314          } map;
315          COLR  ctab[256];
316          COLR  *scanline;
# Line 410 | Line 410 | getgrey(                       /* read in and convert to greyscale image *
410   )
411   {
412          int  y;
413 <        register BYTE  *dp;
413 >        register uby8  *dp;
414          register int  x;
415  
416          setcolrgam(gamv);
# Line 441 | Line 441 | getgrey(                       /* read in and convert to greyscale image *
441   static void
442   writetarga(             /* write out targa data */
443          struct hdStruct  *h,
444 <        BYTE  *d,
444 >        uby8  *d,
445          FILE  *fp
446   )
447   {
# Line 451 | Line 451 | writetarga(            /* write out targa data */
451                  for (j = 2; j >= 0; j--)
452                          putc(clrtab[i][j], fp);
453          if (h->dataType == IM_CMAP) {           /* uncompressed */
454 <                if (fwrite((char *)d,h->x*sizeof(BYTE),h->y,fp) != h->y)
454 >                if (fwrite((char *)d,h->x*sizeof(uby8),h->y,fp) != h->y)
455                          quiterr("error writing targa file");
456                  return;
457          }
# Line 462 | Line 462 | writetarga(            /* write out targa data */
462   static void
463   readtarga(              /* read in targa data */
464          struct hdStruct  *h,
465 <        BYTE  *data,
465 >        uby8  *data,
466          FILE  *fp
467   )
468   {
469          register int  cnt, c;
470 <        register BYTE   *dp;
470 >        register uby8   *dp;
471  
472          if (h->dataType == IM_CMAP) {           /* uncompressed */
473 <                if (fread((char *)data,h->x*sizeof(BYTE),h->y,fp) != h->y)
473 >                if (fread((char *)data,h->x*sizeof(uby8),h->y,fp) != h->y)
474                          goto readerr;
475                  return;
476          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines