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.3 by greg, Sat Feb 22 02:07:28 2003 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 + #ifdef MSDOS
12 + #include  <fcntl.h>
13 + #endif
14 + #include  <time.h>
15  
16   #include  "color.h"
17 + #include  "resolu.h"
18  
19  
20 < #define  NCOLS          133
20 > #define  NCOLS          133
21  
22  
23   main(argc, argv)
# Line 33 | Line 35 | char  **argv;
35                  fprintf(stderr, "%s: can't open file \"%s\"\n", argv[0], argv[1]);
36                  exit(1);
37          }
38 <        
39 <                                /* discard header */
40 <        getheader(input, NULL);
38 > #ifdef MSDOS
39 >        setmode(fileno(input), O_BINARY);
40 > #endif
41                                  /* get picture dimensions */
42 <        if (fgetresolu(&xres, &yres, input) != (YMAJOR|YDECR)) {
43 <                fprintf(stderr, "%s: bad picture size\n", argv[0]);
42 >        if (checkheader(input, COLRFMT, NULL) < 0 ||
43 >                        fgetresolu(&xres, &yres, input) < 0) {
44 >                fprintf(stderr, "%s: bad picture format\n", argv[0]);
45                  exit(1);
46          }
47          if (xres > NCOLS) {
# Line 65 | Line 68 | int
68   shade(clr)                      /* return character for color */
69   COLR  clr;
70   {
71 < #define NSHADES  13
71 > #define NSHADES  13
72  
73          static char  shadech[NSHADES+1] = " .,:;+?%&*$@#";
74  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines