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.16 by greg, Sat Dec 28 18:05:14 2019 UTC

# Line 8 | Line 8 | static const char      RCSid[] = "$Id$";
8   *      8/22/88         Adapted from ra_pr.c
9   */
10  
11 #include  <stdio.h>
12 #include  <string.h>
13 #include  <time.h>
11   #include  <math.h>
12  
13   #include  "platform.h"
14 + #include  "rtio.h"
15   #include  "rtmisc.h"
16   #include  "color.h"
17   #include  "resolu.h"
# Line 27 | Line 25 | static const char      RCSid[] = "$Id$";
25   #define  my_mapType(h)  ((h)->mapType==CM_HASMAP && \
26                                  ((h)->CMapBits==24 || (h)->CMapBits==32))
27  
28 < #define  taralloc(h)    (BYTE *)emalloc((h)->x*(h)->y)
28 > #define  taralloc(h)    (uby8 *)emalloc((h)->x*(h)->y)
29  
30 < BYTE  clrtab[256][3];
30 > uby8  clrtab[256][3];
31   extern int      samplefac;
32   double  gamv = 2.2;                     /* gamv correction */
33   int  bradj = 0;                         /* brightness adjustment */
34   char  *progname;
35   char  errmsg[128];
36   COLR    *inl;
37 < BYTE    *tarData;
37 > uby8    *tarData;
38   int  xmax, ymax;
39  
40   static int getint2(FILE *fp);
# Line 48 | Line 46 | static int getrhead(struct hdStruct  *h, FILE  *fp);
46   static void tg2ra(struct hdStruct        *hp);
47   static void getmapped(int  nc, int  dith);
48   static void getgrey(int  nc);
49 < static void writetarga(struct hdStruct   *h, BYTE  *d, FILE  *fp);
50 < static void readtarga(struct hdStruct    *h, BYTE  *data, FILE  *fp);
49 > static void writetarga(struct hdStruct   *h, uby8  *d, FILE  *fp);
50 > static void readtarga(struct hdStruct    *h, uby8  *data, FILE  *fp);
51  
52  
53   int
# Line 309 | Line 307 | tg2ra(                 /* targa file to RADIANCE file */
307   )
308   {
309          union {
310 <                BYTE  c3[256][3];
311 <                BYTE  c4[256][4];
310 >                uby8  c3[256][3];
311 >                uby8  c4[256][4];
312          } map;
313          COLR  ctab[256];
314          COLR  *scanline;
# Line 410 | Line 408 | getgrey(                       /* read in and convert to greyscale image *
408   )
409   {
410          int  y;
411 <        register BYTE  *dp;
411 >        register uby8  *dp;
412          register int  x;
413  
414          setcolrgam(gamv);
# Line 441 | Line 439 | getgrey(                       /* read in and convert to greyscale image *
439   static void
440   writetarga(             /* write out targa data */
441          struct hdStruct  *h,
442 <        BYTE  *d,
442 >        uby8  *d,
443          FILE  *fp
444   )
445   {
# Line 451 | Line 449 | writetarga(            /* write out targa data */
449                  for (j = 2; j >= 0; j--)
450                          putc(clrtab[i][j], fp);
451          if (h->dataType == IM_CMAP) {           /* uncompressed */
452 <                if (fwrite((char *)d,h->x*sizeof(BYTE),h->y,fp) != h->y)
452 >                if (fwrite((char *)d,h->x*sizeof(uby8),h->y,fp) != h->y)
453                          quiterr("error writing targa file");
454                  return;
455          }
# Line 462 | Line 460 | writetarga(            /* write out targa data */
460   static void
461   readtarga(              /* read in targa data */
462          struct hdStruct  *h,
463 <        BYTE  *data,
463 >        uby8  *data,
464          FILE  *fp
465   )
466   {
467          register int  cnt, c;
468 <        register BYTE   *dp;
468 >        register uby8   *dp;
469  
470          if (h->dataType == IM_CMAP) {           /* uncompressed */
471 <                if (fread((char *)data,h->x*sizeof(BYTE),h->y,fp) != h->y)
471 >                if (fread((char *)data,h->x*sizeof(uby8),h->y,fp) != h->y)
472                          goto readerr;
473                  return;
474          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines