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

Comparing ray/src/px/pcwarp.c (file contents):
Revision 3.1 by greg, Wed Feb 5 17:29:25 1997 UTC vs.
Revision 3.4 by schorsch, Sun Mar 28 20:33:14 2004 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1997 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * Warp colors in Radiance picture to correct for input/output changes.
6   */
7  
8   #include <stdio.h>
9 +
10 + #include "resolu.h"
11   #include "color.h"
12   #include "warp3d.h"
13  
14   char    *progname;                      /* global argv[0] */
15  
16 < FILE    *infp = stdin;                  /* input stream */
16 > FILE    *infp = NULL;                   /* input stream */
17   int     xres, yres;                     /* input picture resolution */
18  
19   WARP3D  *cwarp;                         /* our warp map */
20   int     iclip = CGAMUT_UPPER;           /* input value gamut clipping */
21   int     oclip = CGAMUT_LOWER;           /* output value gamut clipping */
22  
23 + static void syserror(char *s);
24 + static void picwarp(void);
25  
26 < main(argc, argv)
27 < int     argc;
28 < char    *argv[];
26 >
27 > int
28 > main(
29 >        int     argc,
30 >        char    *argv[]
31 > )
32   {
33          static char     picfmt[LPICFMT+1] = PICFMT;
34          int     cwflags = 0;
# Line 32 | Line 36 | char   *argv[];
36          int     i;
37  
38          progname = argv[0];
39 +        infp = stdin;
40                                          /* get options */
41          for (i = 1; i < argc && argv[i][0] == '-'; i++)
42                  switch (argv[i][1]) {
# Line 90 | Line 95 | userr:
95   }
96  
97  
98 < syserror(s)                     /* print system error and exit */
99 < char    *s;
98 > static void
99 > syserror(                       /* print system error and exit */
100 >        char    *s
101 > )
102   {
103          fprintf(stderr, "%s: ", progname);
104          perror(s);
# Line 99 | Line 106 | char   *s;
106   }
107  
108  
109 < picwarp()                       /* warp our picture scanlines */
109 > static void
110 > picwarp(void)                   /* warp our picture scanlines */
111   {
112          register COLOR  *scan;
113          long    ngamut = 0;
# Line 141 | Line 149 | picwarp()                      /* warp our picture scanlines */
149                  }
150          }
151          if (ngamut >= (long)xres*yres/100)
152 <                fprintf(stderr, "%s: warning - %d%% of pixels out of gamut\n",
152 >                fprintf(stderr, "%s: warning - %ld%% of pixels out of gamut\n",
153                                  progname, 100*ngamut/((long)xres*yres));
154 <        free((char *)scan);
154 >        free((void *)scan);
155   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines