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

Comparing ray/src/px/ra_pr.c (file contents):
Revision 2.6 by greg, Sat Feb 22 02:07:28 2003 UTC vs.
Revision 2.7 by schorsch, Sun Mar 28 20:33:14 2004 UTC

# Line 9 | Line 9 | static const char      RCSid[] = "$Id$";
9   */
10  
11   #include  <stdio.h>
12
12   #include  <math.h>
14
13   #include  <time.h>
14  
15 + #include  "rtmisc.h"
16   #include  "rasterfile.h"
18
17   #include  "color.h"
20
18   #include  "resolu.h"
22
19   #include  "pic.h"
20  
21                          /* descriptor for a picture file or frame buffer */
# Line 34 | Line 30 | typedef struct {
30          } pos;                          /* position(s) */
31   } pic;
32  
37 extern pic      *openinput(), *openoutput();
33  
39 extern char     *ecalloc(), *emalloc();
40
41 extern long  ftell();
42
34   double  gamcor = 2.2;                   /* gamma correction */
44
35   int  bradj = 0;                         /* brightness adjustment */
46
36   pic     *inpic, *outpic;
48
37   char  *progname;
50
38   char  errmsg[128];
52
39   COLR    *inl;
54
40   int  xmax, ymax;
41  
42 + static void quiterr(char  *err);
43 + static pic * openinput(char  *fname, struct rasterfile  *h);
44 + static pic * openoutput(char  *fname, struct rasterfile  *h);
45 + static void pr2ra(struct rasterfile  *h);
46  
47 < main(argc, argv)
48 < int  argc;
49 < char  *argv[];
47 >
48 > int
49 > main(int  argc, char  *argv[])
50   {
51          colormap  rasmap;
52          struct rasterfile  head;
# Line 157 | Line 146 | userr:
146   }
147  
148  
149 < quiterr(err)            /* print message and exit */
150 < char  *err;
149 > static void
150 > quiterr(                /* print message and exit */
151 >        char  *err
152 > )
153   {
154          if (err != NULL) {
155                  fprintf(stderr, "%s: %s\n", progname, err);
# Line 184 | Line 175 | int code;
175   }
176  
177  
178 < pic *
179 < openinput(fname, h)             /* open RADIANCE input file */
180 < char  *fname;
181 < register struct rasterfile  *h;
178 > static pic *
179 > openinput(              /* open RADIANCE input file */
180 >        char  *fname,
181 >        register struct rasterfile  *h
182 > )
183   {
184          register pic  *p;
185  
# Line 221 | Line 213 | register struct rasterfile  *h;
213   }
214  
215  
216 < pic *
217 < openoutput(fname, h)            /* open output rasterfile */
218 < char  *fname;
219 < register struct rasterfile  *h;
216 > static pic *
217 > openoutput(             /* open output rasterfile */
218 >        char  *fname,
219 >        register struct rasterfile  *h
220 > )
221   {
222          register pic  *p;
223  
# Line 244 | Line 237 | register struct rasterfile  *h;
237   }
238  
239  
240 < pr2ra(h)                        /* pixrect file to RADIANCE file */
241 < struct rasterfile  *h;
240 > static void
241 > pr2ra(                  /* pixrect file to RADIANCE file */
242 >        struct rasterfile  *h
243 > )
244   {
245          BYTE  cmap[3][256];
246          COLR  ctab[256];
# Line 281 | Line 276 | struct rasterfile  *h;
276   }
277  
278  
279 < picreadline3(y, l3)                     /* read in 3-byte scanline */
280 < int  y;
281 < register rgbpixel  *l3;
279 > extern void
280 > picreadline3(                   /* read in 3-byte scanline */
281 >        int  y,
282 >        register rgbpixel  *l3
283 > )
284   {
285          register int    i;
286  
# Line 314 | Line 311 | register rgbpixel  *l3;
311   }
312  
313  
314 < picwriteline(y, l)                      /* write out scanline */
315 < int  y;
316 < register pixel  *l;
314 > extern void
315 > picwriteline(                   /* write out scanline */
316 >        int  y,
317 >        register pixel  *l
318 > )
319   {
320          if (outpic->nexty != y) {                       /* seek to scanline */
321                  if (outpic->bytes_line == 0) {
# Line 338 | Line 337 | register pixel  *l;
337   }
338  
339  
340 < picwritecm(cm)                  /* write out color map */
341 < colormap  cm;
340 > extern void
341 > picwritecm(                     /* write out color map */
342 >        colormap  cm
343 > )
344   {
345          register int  i, j;
346  
# Line 357 | Line 358 | colormap  cm;
358   }
359  
360  
361 < picreadcm(map)                  /* do gamma correction if requested */
362 < colormap  map;
361 > extern void
362 > picreadcm(                      /* do gamma correction if requested */
363 >        colormap  map
364 > )
365   {
366          register int  i, val;
367  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines