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.2 by gwlarson, Wed Jun 9 14:06:55 1999 UTC vs.
Revision 3.7 by greg, Fri Jul 19 17:37:56 2019 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>
8 > #include "rtio.h"
9 > #include "resolu.h"
10   #include "color.h"
11   #include "warp3d.h"
12  
# Line 21 | Line 19 | WARP3D *cwarp;                         /* our warp map */
19   int     iclip = CGAMUT_UPPER;           /* input value gamut clipping */
20   int     oclip = CGAMUT_LOWER;           /* output value gamut clipping */
21  
22 + static void syserror(char *s);
23 + static void picwarp(void);
24  
25 < main(argc, argv)
26 < int     argc;
27 < char    *argv[];
25 >
26 > int
27 > main(
28 >        int     argc,
29 >        char    *argv[]
30 > )
31   {
32 <        static char     picfmt[LPICFMT+1] = PICFMT;
32 >        static char     picfmt[MAXFMTLEN] = PICFMT;
33          int     cwflags = 0;
34          int     rval;
35          int     i;
# Line 85 | Line 88 | char   *argv[];
88          exit(0);
89   userr:
90          fprintf(stderr,
91 <                "Usage: %s [-i][-o][-e|-f] map.cwp [input.pic [output.pic]]\n",
91 >                "Usage: %s [-i][-o][-e|-f] map.cwp [input.hdr [output.hdr]]\n",
92                          progname);
93          exit(1);
94   }
95  
96  
97 < syserror(s)                     /* print system error and exit */
98 < char    *s;
97 > static void
98 > syserror(                       /* print system error and exit */
99 >        char    *s
100 > )
101   {
102          fprintf(stderr, "%s: ", progname);
103          perror(s);
# Line 100 | Line 105 | char   *s;
105   }
106  
107  
108 < picwarp()                       /* warp our picture scanlines */
108 > static void
109 > picwarp(void)                   /* warp our picture scanlines */
110   {
111          register COLOR  *scan;
112          long    ngamut = 0;
# Line 142 | Line 148 | picwarp()                      /* warp our picture scanlines */
148                  }
149          }
150          if (ngamut >= (long)xres*yres/100)
151 <                fprintf(stderr, "%s: warning - %d%% of pixels out of gamut\n",
151 >                fprintf(stderr, "%s: warning - %ld%% of pixels out of gamut\n",
152                                  progname, 100*ngamut/((long)xres*yres));
153 <        free((char *)scan);
153 >        free((void *)scan);
154   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines