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

Comparing ray/src/px/ttyimage.c (file contents):
Revision 1.6 by greg, Fri Jan 26 08:17:41 1990 UTC vs.
Revision 2.5 by schorsch, Sun Mar 28 20:33:14 2004 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1986 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   *  ttyimage.c - program to dump pixel file to dumb terminal.
6   *
# Line 11 | Line 8 | static char SCCSid[] = "$SunId$ LBL";
8   */
9  
10   #include  <stdio.h>
11 + #include  <time.h>
12  
13 + #include  "platform.h"
14   #include  "color.h"
15 + #include  "resolu.h"
16  
17  
18 < #define  NCOLS          133
18 > #define  NCOLS          133
19  
20 + static int shade(COLR clr);
21  
22 < main(argc, argv)
23 < int  argc;
24 < char  **argv;
22 >
23 > int
24 > main(int  argc, char  **argv)
25   {
26          FILE  *input;
27          int  xres, yres;
# Line 33 | Line 34 | char  **argv;
34                  fprintf(stderr, "%s: can't open file \"%s\"\n", argv[0], argv[1]);
35                  exit(1);
36          }
37 <        
37 <                                /* discard header */
38 <        getheader(input, NULL);
37 >        SET_FILE_BINARY(input);
38                                  /* get picture dimensions */
39 <        if (fgetresolu(&xres, &yres, input) != (YMAJOR|YDECR)) {
40 <                fprintf(stderr, "%s: bad picture size\n", argv[0]);
39 >        if (checkheader(input, COLRFMT, NULL) < 0 ||
40 >                        fgetresolu(&xres, &yres, input) < 0) {
41 >                fprintf(stderr, "%s: bad picture format\n", argv[0]);
42                  exit(1);
43          }
44          if (xres > NCOLS) {
# Line 61 | Line 61 | char  **argv;
61   }
62  
63  
64 < int
65 < shade(clr)                      /* return character for color */
66 < COLR  clr;
64 > static int
65 > shade(                  /* return character for color */
66 >        COLR  clr
67 > )
68   {
69 < #define NSHADES  13
69 > #define NSHADES  13
70  
71          static char  shadech[NSHADES+1] = " .,:;+?%&*$@#";
72  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines