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

Comparing ray/src/px/ra_t16.c (file contents):
Revision 1.3 by greg, Sun Jul 23 11:35:48 1989 UTC vs.
Revision 1.7 by greg, Fri Feb 9 13:59:21 1990 UTC

# Line 15 | Line 15 | static char SCCSid[] = "$SunId$ LBL";
15  
16   #include  "color.h"
17  
18 + #include  "random.h"
19 +
20   #include  "targa.h"
21  
22   #define  goodpic(h)     (((h)->dataType==IM_RGB || (h)->dataType==IM_CRGB) \
# Line 91 | Line 93 | char  *argv[];
93                  if (!goodpic(&head))
94                          quiterr("incompatible format");
95                                          /* put header */
96 <                printargs(argc, argv, stdout);
96 >                printargs(i, argv, stdout);
97                  putchar('\n');
98 <                printf("-Y %d +X %d\n", head.y, head.x);
98 >                fputresolu(YMAJOR|YDECR, head.x, head.y, stdout);
99                                          /* convert file */
100                  tg2ra(&head);
101          } else {
102                  getheader(stdin, NULL);
103 <                if (scanf("-Y %d +X %d\n", &head.y, &head.x) != 2)
103 >                if (fgetresolu(&head.x, &head.y, stdin) != (YMAJOR|YDECR))
104                          quiterr("bad picture file");
105                                          /* assign header */
106                  head.textSize = 0;
# Line 187 | Line 189 | register FILE  *fp;
189  
190          if (ip != NULL)
191                  if (nidbytes)
192 <                        fread(ip, nidbytes, 1, fp);
192 >                        fread((char *)ip, nidbytes, 1, fp);
193                  else
194                          *ip = '\0';
195          else if (nidbytes)
# Line 329 | Line 331 | unsigned char  *d;
331   FILE  *fp;
332   {
333          if (h->dataType == IM_RGB) {            /* uncompressed */
334 <                if (fwrite(d, 3*h->x, h->y, fp) != h->y)
334 >                if (fwrite((char *)d, 3*h->x, h->y, fp) != h->y)
335                          quiterr("error writing targa file");
336                  return;
337          }
# Line 365 | Line 367 | FILE  *fp;
367          int  r, g, b;
368  
369          if (h->dataType == IM_RGB) {            /* uncompressed */
370 <                if (fread(data, 3*h->x, h->y, fp) != h->y)
370 >                if (fread((char *)data, 3*h->x, h->y, fp) != h->y)
371                          goto readerr;
372                  return;
373          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines