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.3 by greg, Sat Feb 22 02:07:27 2003 UTC vs.
Revision 3.8 by greg, Fri Jun 6 19:11:21 2025 UTC

# Line 5 | Line 5 | static const char      RCSid[] = "$Id$";
5   * Warp colors in Radiance picture to correct for input/output changes.
6   */
7  
8 < #include <stdio.h>
8 > #include "paths.h"
9 > #include "rtio.h"
10 > #include "resolu.h"
11   #include "color.h"
12   #include "warp3d.h"
13  
12 char    *progname;                      /* global argv[0] */
13
14   FILE    *infp = NULL;                   /* input stream */
15   int     xres, yres;                     /* input picture resolution */
16  
# Line 18 | Line 18 | WARP3D *cwarp;                         /* our warp map */
18   int     iclip = CGAMUT_UPPER;           /* input value gamut clipping */
19   int     oclip = CGAMUT_LOWER;           /* output value gamut clipping */
20  
21 + static void syserror(char *s);
22 + static void picwarp(void);
23  
24 < main(argc, argv)
25 < int     argc;
26 < char    *argv[];
24 >
25 > int
26 > main(
27 >        int     argc,
28 >        char    *argv[]
29 > )
30   {
31 <        static char     picfmt[LPICFMT+1] = PICFMT;
31 >        static char     picfmt[MAXFMTLEN] = PICFMT;
32          int     cwflags = 0;
33          int     rval;
34          int     i;
35  
36 <        progname = argv[0];
36 >        fixargv0(argv[0]);
37          infp = stdin;
38                                          /* get options */
39          for (i = 1; i < argc && argv[i][0] == '-'; i++)
# Line 82 | Line 87 | char   *argv[];
87          exit(0);
88   userr:
89          fprintf(stderr,
90 <                "Usage: %s [-i][-o][-e|-f] map.cwp [input.pic [output.pic]]\n",
90 >                "Usage: %s [-i][-o][-e|-f] map.cwp [input.hdr [output.hdr]]\n",
91                          progname);
92          exit(1);
93   }
94  
95  
96 < syserror(s)                     /* print system error and exit */
97 < char    *s;
96 > static void
97 > syserror(                       /* print system error and exit */
98 >        char    *s
99 > )
100   {
101          fprintf(stderr, "%s: ", progname);
102          perror(s);
# Line 97 | Line 104 | char   *s;
104   }
105  
106  
107 < picwarp()                       /* warp our picture scanlines */
107 > static void
108 > picwarp(void)                   /* warp our picture scanlines */
109   {
110          register COLOR  *scan;
111          long    ngamut = 0;
# Line 139 | Line 147 | picwarp()                      /* warp our picture scanlines */
147                  }
148          }
149          if (ngamut >= (long)xres*yres/100)
150 <                fprintf(stderr, "%s: warning - %d%% of pixels out of gamut\n",
150 >                fprintf(stderr, "%s: warning - %ld%% of pixels out of gamut\n",
151                                  progname, 100*ngamut/((long)xres*yres));
152          free((void *)scan);
153   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines