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.15 by greg, Tue Mar 20 18:45:04 2018 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines