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.14 by greg, Fri May 20 02:06:39 2011 UTC vs.
Revision 2.19 by greg, Sat Jun 7 05:09:46 2025 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>
15
12   #include  "platform.h"
13 + #include  "rtio.h"
14   #include  "rtmisc.h"
15   #include  "color.h"
16   #include  "resolu.h"
# Line 33 | Line 30 | uby8  clrtab[256][3];
30   extern int      samplefac;
31   double  gamv = 2.2;                     /* gamv correction */
32   int  bradj = 0;                         /* brightness adjustment */
36 char  *progname;
33   char  errmsg[128];
34   COLR    *inl;
35   uby8    *tarData;
# Line 64 | Line 60 | main(
60          int  ncolors = 256;
61          int  greyscale = 0;
62          int  i;
63 +        
64          SET_DEFAULT_BINARY();
65          SET_FILE_BINARY(stdin);
66          SET_FILE_BINARY(stdout);
67 <        progname = argv[0];
67 >        fixargv0(argv[0]);
68          samplefac = 0;
69  
70          for (i = 1; i < argc; i++)
# Line 154 | Line 151 | userr:
151  
152   static int
153   getint2(                        /* get a 2-byte positive integer */
154 <        register FILE   *fp
154 >        FILE    *fp
155   )
156   {
157 <        register int  b1, b2;
157 >        int  b1, b2;
158  
159          if ((b1 = getc(fp)) == EOF || (b2 = getc(fp)) == EOF)
160                  quiterr("read error");
# Line 168 | Line 165 | getint2(                       /* get a 2-byte positive integer */
165  
166   static void
167   putint2(                        /* put a 2-byte positive integer */
168 <        register int  i,
169 <        register FILE   *fp
168 >        int  i,
169 >        FILE    *fp
170   )
171   {
172          putc(i&0xff, fp);
# Line 191 | Line 188 | quiterr(               /* print message and exit */
188  
189  
190   void
191 < eputs(s)
195 < char *s;
191 > eputs(const char *s)
192   {
193          fputs(s, stderr);
194   }
195  
196  
197   void
198 < quit(code)
203 < int code;
198 > quit(int code)
199   {
200          exit(code);
201   }
# Line 210 | Line 205 | static int
205   getthead(               /* read header from input */
206          struct hdStruct  *hp,
207          char  *ip,
208 <        register FILE  *fp
208 >        FILE  *fp
209   )
210   {
211          int     nidbytes;
# Line 245 | Line 240 | static int
240   putthead(               /* write header to output */
241          struct hdStruct  *hp,
242          char  *ip,
243 <        register FILE  *fp
243 >        FILE  *fp
244   )
245   {
246          if (ip != NULL)
# Line 273 | Line 268 | putthead(              /* write header to output */
268  
269   static int
270   getrhead(                       /* load RADIANCE input file header */
271 <        register struct hdStruct  *h,
271 >        struct hdStruct  *h,
272          FILE  *fp
273   )
274   {
# Line 314 | Line 309 | tg2ra(                 /* targa file to RADIANCE file */
309          } map;
310          COLR  ctab[256];
311          COLR  *scanline;
312 <        register int  i, j;
312 >        int  i, j;
313  
314                                          /* get color table */
315          if ((hp->CMapBits==24 ? fread((char *)(map.c3+hp->mapOrig),
# Line 361 | Line 356 | getmapped(             /* read in and quantize image */
356   )
357   {
358          long  fpos;
359 <        register int  y;
359 >        int  y;
360  
361          setcolrgam(gamv);
362          fpos = ftell(stdin);
# Line 410 | Line 405 | getgrey(                       /* read in and convert to greyscale image *
405   )
406   {
407          int  y;
408 <        register uby8  *dp;
409 <        register int  x;
408 >        uby8  *dp;
409 >        int  x;
410  
411          setcolrgam(gamv);
412          dp = tarData+xmax*ymax;;
# Line 445 | Line 440 | writetarga(            /* write out targa data */
440          FILE  *fp
441   )
442   {
443 <        register int  i, j;
443 >        int  i, j;
444  
445          for (i = 0; i < h->mapLength; i++)      /* write color map */
446                  for (j = 2; j >= 0; j--)
# Line 466 | Line 461 | readtarga(             /* read in targa data */
461          FILE  *fp
462   )
463   {
464 <        register int  cnt, c;
465 <        register uby8   *dp;
464 >        int  cnt, c;
465 >        uby8    *dp;
466  
467          if (h->dataType == IM_CMAP) {           /* uncompressed */
468                  if (fread((char *)data,h->x*sizeof(uby8),h->y,fp) != h->y)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines