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

Comparing ray/src/px/pvalue.c (file contents):
Revision 2.11 by greg, Wed Jan 8 08:00:23 1997 UTC vs.
Revision 2.19 by schorsch, Sun Jun 8 12:03:10 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1992 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   *  pvalue.c - program to print pixel values.
6   *
7   *     4/23/86
8   */
9  
10 < #include  "standard.h"
10 > #include  <time.h>
11  
12 + #include  "standard.h"
13 + #include  "platform.h"
14   #include  "color.h"
16
15   #include  "resolu.h"
16  
17 + typedef unsigned short uint16;  /* sizeof (uint16) must == 2 */
18 +
19   #define  min(a,b)               ((a)<(b)?(a):(b))
20  
21                                  /* what to put out (also RED, GRN, BLU) */
22   #define  ALL            3
23   #define  BRIGHT         4
24  
25 #define  brightonly     (putprim==BRIGHT)
26
25   RESOLU  picres;                 /* resolution of picture */
26  
27   int  uniq = 0;                  /* print only unique values? */
# Line 43 | Line 41 | int  header = 1;               /* do header? */
41  
42   long  skipbytes = 0;            /* skip bytes in input? */
43  
44 + int  swapbytes = 0;             /* swap bytes in 16-bit words? */
45 +
46 + int  interleave = 1;            /* file is interleaved? */
47 +
48   int  resolution = 1;            /* put/get resolution string? */
49  
50   int  original = 0;              /* convert to original values? */
# Line 63 | Line 65 | FILE  *fin2 = NULL, *fin3 = NULL;      /* for other color c
65  
66   int  (*getval)(), (*putval)();
67  
68 + double
69 + rgb_bright(clr)
70 + COLOR  clr;
71 + {
72 +        return(bright(clr));
73 + }
74  
75 + double
76 + xyz_bright(clr)
77 + COLOR  clr;
78 + {
79 +        return(clr[CIEY]);
80 + }
81 +
82 + double  (*mybright)() = &rgb_bright;
83 +
84 +
85   main(argc, argv)
86   int  argc;
87   char  **argv;
# Line 119 | Line 137 | char  **argv;
137                          case 'r':               /* reverse conversion */
138                                  reverse = argv[i][0] == '-';
139                                  break;
140 +                        case 'n':               /* non-interleaved RGB */
141 +                                interleave = argv[i][0] == '+';
142 +                                break;
143                          case 'b':               /* brightness values */
144                                  putprim = argv[i][0] == '-' ? BRIGHT : ALL;
145                                  break;
# Line 147 | Line 168 | char  **argv;
168                                          format = 'b';
169                                          fmtid = "byte";
170                                          break;
171 +                                case 'W':               /* 16-bit swapped */
172 +                                        swapbytes = 1;
173 +                                case 'w':               /* 16-bit */
174 +                                        dataonly = 1;
175 +                                        format = 'w';
176 +                                        fmtid = "16-bit";
177 +                                        break;
178                                  case 'f':               /* float */
179                                          dataonly = 1;
180                                          format = 'f';
# Line 165 | Line 193 | char  **argv;
193                          case 'X':               /* x resolution */
194                                  resolution = 0;
195                                  if (argv[i][0] == '-')
196 <                                        picres.or |= XDECR;
196 >                                        picres.rt |= XDECR;
197                                  picres.xr = atoi(argv[++i]);
198                                  break;
199                          case 'y':               /* y resolution */
200                          case 'Y':               /* y resolution */
201                                  resolution = 0;
202                                  if (argv[i][0] == '-')
203 <                                        picres.or |= YDECR;
203 >                                        picres.rt |= YDECR;
204                                  if (picres.xr == 0)
205 <                                        picres.or |= YMAJOR;
205 >                                        picres.rt |= YMAJOR;
206                                  picres.yr = atoi(argv[++i]);
207                                  break;
208                          default:
# Line 188 | Line 216 | unkopt:
216                          break;
217                                          /* recognize special formats */
218          if (dataonly && format == 'b')
219 <                if (brightonly)
219 >                if (putprim == ALL)
220 >                        fmtid = "24-bit_rgb";
221 >                else
222                          fmtid = "8-bit_grey";
223 +        if (dataonly && format == 'w')
224 +                if (putprim == ALL)
225 +                        fmtid = "48-bit_rgb";
226                  else
227 <                        fmtid = "24-bit_rgb";
227 >                        fmtid = "16-bit_grey";
228                                          /* assign reverse ordering */
229          rord[ord[0]] = 0;
230          rord[ord[1]] = 1;
# Line 205 | Line 238 | unkopt:
238                                                  progname, argv[i]);
239                          quit(1);
240                  }
241 <                if (skipbytes && fseek(fin, skipbytes, 0))
209 <                        goto seekerr;
210 <                if (reverse && !brightonly && i == argc-3) {
241 >                if (reverse && putprim != BRIGHT && i == argc-3) {
242                          if ((fin2 = fopen(argv[i+1], "r")) == NULL) {
243                                  fprintf(stderr, "%s: can't open file \"%s\"\n",
244                                                  progname, argv[i+1]);
# Line 218 | Line 249 | unkopt:
249                                                  progname, argv[i+2]);
250                                  quit(1);
251                          }
252 <                        if (skipbytes && (fseek(fin2, skipbytes, 0) ||
222 <                                        fseek(fin3, skipbytes, 0)))
223 <                                goto seekerr;
252 >                        interleave = -1;
253                  } else if (i != argc-1)
254                          fin = NULL;
255 +                if (reverse && putprim != BRIGHT && !interleave) {
256 +                        fin2 = fopen(argv[i], "r");
257 +                        fin3 = fopen(argv[i], "r");
258 +                }
259 +                if (skipbytes && (fseek(fin, skipbytes, 0) || (fin2 != NULL &&
260 +                                (fseek(fin2, skipbytes, 0) ||
261 +                                fseek(fin3, skipbytes, 0))))) {
262 +                        fprintf(stderr, "%s: cannot skip %ld bytes on input\n",
263 +                                        progname, skipbytes);
264 +                        quit(1);
265 +                }
266          }
267          if (fin == NULL) {
268                  fprintf(stderr, "%s: bad # file arguments\n", progname);
269                  quit(1);
270          }
271  
232        set_io();
233
272          if (reverse) {
273 < #ifdef MSDOS
274 <                setmode(fileno(stdout), O_BINARY);
273 > #ifdef _WIN32
274 >                SET_FILE_BINARY(stdout);
275                  if (format != 'a' && format != 'i')
276 <                        setmode(fileno(fin), O_BINARY);
276 >                        SET_FILE_BINARY(fin);
277   #endif
278                                          /* get header */
279                  if (header) {
# Line 259 | Line 297 | unkopt:
297                  if (resolution && fin2 != NULL) {
298                          RESOLU  pres2;
299                          if (!fgetsresolu(&pres2, fin2) ||
300 <                                        pres2.or != picres.or ||
300 >                                        pres2.rt != picres.rt ||
301                                          pres2.xr != picres.xr ||
302                                          pres2.yr != picres.yr ||
303                                          !fgetsresolu(&pres2, fin3) ||
304 <                                        pres2.or != picres.or ||
304 >                                        pres2.rt != picres.rt ||
305                                          pres2.xr != picres.xr ||
306                                          pres2.yr != picres.yr) {
307                                  fprintf(stderr, "%s: resolution mismatch\n",
# Line 280 | Line 318 | unkopt:
318                  fputsresolu(&picres, stdout);   /* always put resolution */
319                  valtopix();
320          } else {
321 < #ifdef MSDOS
322 <                setmode(fileno(fin), O_BINARY);
321 > #ifdef _WIN32
322 >                SET_FILE_BINARY(fin);
323                  if (format != 'a' && format != 'i')
324 <                        setmode(fileno(stdout), O_BINARY);
324 >                        SET_FILE_BINARY(stdout);
325   #endif
326                                                  /* get header */
327                  getheader(fin, checkhead, NULL);
328                  if (wrongformat) {
329 <                        fprintf(stderr, "%s: input not a Radiance picture\n",
329 >                        fprintf(stderr,
330 >                                "%s: input not a Radiance RGBE picture\n",
331                                          progname);
332                          quit(1);
333                  }
# Line 309 | Line 348 | unkopt:
348          }
349  
350          quit(0);
312 seekerr:
313        fprintf(stderr, "%s: cannot skip %ld bytes on input\n",
314                        progname, skipbytes);
315        quit(1);
351   }
352  
353  
354 + int
355   checkhead(line)                         /* deal with line from header */
356   char  *line;
357   {
# Line 323 | Line 359 | char  *line;
359          double  d;
360          COLOR   ctmp;
361  
362 <        if (formatval(fmt, line))
363 <                wrongformat = strcmp(fmt, COLRFMT);
364 <        else if (original && isexpos(line)) {
362 >        if (formatval(fmt, line)) {
363 >                if (!strcmp(fmt, CIEFMT)) {
364 >                        mybright = &xyz_bright;
365 >                        if (original) {
366 >                                scalecolor(exposure, 1./WHTEFFICACY);
367 >                                doexposure++;
368 >                        }
369 >                } else if (!strcmp(fmt, COLRFMT))
370 >                        mybright = &rgb_bright;
371 >                else
372 >                        wrongformat++;
373 >        } else if (original && isexpos(line)) {
374                  d = 1.0/exposval(line);
375                  scalecolor(exposure, d);
376                  doexposure++;
# Line 337 | Line 382 | char  *line;
382                  doexposure++;
383          } else if (header)
384                  fputs(line, stdout);
385 +        return(0);
386   }
387  
388  
# Line 346 | Line 392 | pixtoval()                             /* convert picture to values */
392          int  dogamma;
393          COLOR  lastc;
394          FLOAT  hv[2];
395 +        int  startprim, endprim;
396 +        long  startpos;
397          int  y;
398          register int  x;
399  
# Line 355 | Line 403 | pixtoval()                             /* convert picture to values */
403                  quit(1);
404          }
405          dogamma = gamcor < .95 || gamcor > 1.05;
406 <        setcolor(lastc, 0.0, 0.0, 0.0);
407 <        for (y = 0; y < numscans(&picres); y++) {
408 <                if (freadscan(scanln, scanlen(&picres), fin) < 0) {
409 <                        fprintf(stderr, "%s: read error\n", progname);
406 >        if (putprim == ALL && !interleave) {
407 >                startprim = RED; endprim = BLU;
408 >                startpos = ftell(fin);
409 >        } else {
410 >                startprim = putprim; endprim = putprim;
411 >        }
412 >        for (putprim = startprim; putprim <= endprim; putprim++) {
413 >                if (putprim != startprim && fseek(fin, startpos, 0)) {
414 >                        fprintf(stderr, "%s: seek error on input file\n",
415 >                                        progname);
416                          quit(1);
417                  }
418 <                for (x = 0; x < scanlen(&picres); x++) {
419 <                        if (uniq)
420 <                                if (    colval(scanln[x],RED) ==
421 <                                                colval(lastc,RED) &&
422 <                                        colval(scanln[x],GRN) ==
369 <                                                colval(lastc,GRN) &&
370 <                                        colval(scanln[x],BLU) ==
371 <                                                colval(lastc,BLU)       )
372 <                                        continue;
373 <                                else
374 <                                        copycolor(lastc, scanln[x]);
375 <                        if (doexposure)
376 <                                multcolor(scanln[x], exposure);
377 <                        if (dogamma)
378 <                                setcolor(scanln[x],
379 <                                pow(colval(scanln[x],RED), 1.0/gamcor),
380 <                                pow(colval(scanln[x],GRN), 1.0/gamcor),
381 <                                pow(colval(scanln[x],BLU), 1.0/gamcor));
382 <                        if (!dataonly) {
383 <                                pix2loc(hv, &picres, x, y);
384 <                                printf("%7d %7d ", (int)(hv[0]*picres.xr),
385 <                                                (int)(hv[1]*picres.yr));
386 <                        }
387 <                        if ((*putval)(scanln[x]) < 0) {
388 <                                fprintf(stderr, "%s: write error\n", progname);
418 >                set_io();
419 >                setcolor(lastc, 0.0, 0.0, 0.0);
420 >                for (y = 0; y < numscans(&picres); y++) {
421 >                        if (freadscan(scanln, scanlen(&picres), fin) < 0) {
422 >                                fprintf(stderr, "%s: read error\n", progname);
423                                  quit(1);
424                          }
425 +                        for (x = 0; x < scanlen(&picres); x++) {
426 +                                if (uniq)
427 +                                        if (    colval(scanln[x],RED) ==
428 +                                                        colval(lastc,RED) &&
429 +                                                colval(scanln[x],GRN) ==
430 +                                                        colval(lastc,GRN) &&
431 +                                                colval(scanln[x],BLU) ==
432 +                                                        colval(lastc,BLU)       )
433 +                                                continue;
434 +                                        else
435 +                                                copycolor(lastc, scanln[x]);
436 +                                if (doexposure)
437 +                                        multcolor(scanln[x], exposure);
438 +                                if (dogamma)
439 +                                        setcolor(scanln[x],
440 +                                        pow(colval(scanln[x],RED), 1.0/gamcor),
441 +                                        pow(colval(scanln[x],GRN), 1.0/gamcor),
442 +                                        pow(colval(scanln[x],BLU), 1.0/gamcor));
443 +                                if (!dataonly) {
444 +                                        pix2loc(hv, &picres, x, y);
445 +                                        printf("%7d %7d ",
446 +                                                        (int)(hv[0]*picres.xr),
447 +                                                        (int)(hv[1]*picres.yr));
448 +                                }
449 +                                if ((*putval)(scanln[x]) < 0) {
450 +                                        fprintf(stderr, "%s: write error\n",
451 +                                                        progname);
452 +                                        quit(1);
453 +                                }
454 +                        }
455                  }
456          }
457 <        free((char *)scanln);
457 >        free((void *)scanln);
458   }
459  
460  
# Line 407 | Line 471 | valtopix()                     /* convert values to a pixel file */
471                  quit(1);
472          }
473          dogamma = gamcor < .95 || gamcor > 1.05;
474 +        set_io();
475          for (y = 0; y < numscans(&picres); y++) {
476                  for (x = 0; x < scanlen(&picres); x++) {
477                          if (!dataonly) {
# Line 433 | Line 498 | valtopix()                     /* convert values to a pixel file */
498                          quit(1);
499                  }
500          }
501 <        free((char *)scanln);
501 >        free((void *)scanln);
502   }
503  
504  
505 + void
506   quit(code)
507   int  code;
508   {
# Line 444 | Line 510 | int  code;
510   }
511  
512  
513 + swap16(wp, n)           /* swap n 16-bit words */
514 + register uint16  *wp;
515 + int  n;
516 + {
517 +        while (n-- > 0) {
518 +                *wp = *wp << 8 | ((*wp >> 8) & 0xff);
519 +                wp++;
520 +        }
521 + }
522 +
523   getcascii(col)          /* get an ascii color value from stream(s) */
524   COLOR  col;
525   {
# Line 541 | Line 617 | COLOR  col;
617   }
618  
619  
620 + getcword(col)           /* get a 16-bit color value from stream(s) */
621 + COLOR  col;
622 + {
623 +        uint16  vw[3];
624 +
625 +        if (fin2 == NULL) {
626 +                if (fread((char *)vw, sizeof(uint16), 3, fin) != 3)
627 +                        return(-1);
628 +        } else {
629 +                if (fread((char *)vw, sizeof(uint16), 1, fin) != 1 ||
630 +                        fread((char *)(vw+1), sizeof(uint16), 1, fin2) != 1 ||
631 +                        fread((char *)(vw+2), sizeof(uint16), 1, fin3) != 1)
632 +                        return(-1);
633 +        }
634 +        if (swapbytes)
635 +                swap16(vw, 3);
636 +        setcolor(col, (vw[rord[RED]]+.5)/65536.,
637 +                        (vw[rord[GRN]]+.5)/65536., (vw[rord[BLU]]+.5)/65536.);
638 +        return(0);
639 + }
640 +
641 +
642   getbascii(col)          /* get an ascii brightness value from fin */
643   COLOR  col;
644   {
# Line 605 | Line 703 | COLOR  col;
703   }
704  
705  
706 + getbword(col)           /* get a 16-bit brightness value from fin */
707 + COLOR  col;
708 + {
709 +        uint16  vw;
710 +        double  d;
711 +
712 +        if (fread((char *)&vw, sizeof(uint16), 1, fin) != 1)
713 +                return(-1);
714 +        if (swapbytes)
715 +                swap16(&vw, 1);
716 +        d = (vw+.5)/65536.;
717 +        setcolor(col, d, d, d);
718 +        return(0);
719 + }
720 +
721 +
722   putcascii(col)                  /* put an ascii color to stdout */
723   COLOR  col;
724   {
# Line 660 | Line 774 | COLOR  col;
774   putcbyte(col)                   /* put a byte color to stdout */
775   COLOR  col;
776   {
777 <        register int  i;
777 >        long  i;
778          BYTE  vb[3];
779  
780          i = colval(col,ord[0])*256.;
# Line 675 | Line 789 | COLOR  col;
789   }
790  
791  
792 + putcword(col)                   /* put a 16-bit color to stdout */
793 + COLOR  col;
794 + {
795 +        long  i;
796 +        uint16  vw[3];
797 +
798 +        i = colval(col,ord[0])*65536.;
799 +        vw[0] = min(i,65535);
800 +        i = colval(col,ord[1])*65536.;
801 +        vw[1] = min(i,65535);
802 +        i = colval(col,ord[2])*65536.;
803 +        vw[2] = min(i,65535);
804 +        if (swapbytes)
805 +                swap16(vw, 3);
806 +        fwrite((char *)vw, sizeof(uint16), 3, stdout);
807 +
808 +        return(ferror(stdout) ? -1 : 0);
809 + }
810 +
811 +
812   putbascii(col)                  /* put an ascii brightness to stdout */
813   COLOR  col;
814   {
815 <        fprintf(stdout, "%15.3e\n", bright(col));
815 >        fprintf(stdout, "%15.3e\n", (*mybright)(col));
816  
817          return(ferror(stdout) ? -1 : 0);
818   }
# Line 689 | Line 823 | COLOR  col;
823   {
824          float  vf;
825  
826 <        vf = bright(col);
826 >        vf = (*mybright)(col);
827          fwrite((char *)&vf, sizeof(float), 1, stdout);
828  
829          return(ferror(stdout) ? -1 : 0);
# Line 701 | Line 835 | COLOR  col;
835   {
836          double  vd;
837  
838 <        vd = bright(col);
838 >        vd = (*mybright)(col);
839          fwrite((char *)&vd, sizeof(double), 1, stdout);
840  
841          return(ferror(stdout) ? -1 : 0);
# Line 711 | Line 845 | COLOR  col;
845   putbint(col)                    /* put an int brightness to stdout */
846   COLOR  col;
847   {
848 <        fprintf(stdout, "%d\n", (int)(bright(col)*256.));
848 >        fprintf(stdout, "%d\n", (int)((*mybright)(col)*256.));
849  
850          return(ferror(stdout) ? -1 : 0);
851   }
# Line 723 | Line 857 | COLOR  col;
857          register int  i;
858          BYTE  vb;
859  
860 <        i = bright(col)*256.;
860 >        i = (*mybright)(col)*256.;
861          vb = min(i,255);
862          fwrite((char *)&vb, sizeof(BYTE), 1, stdout);
863  
# Line 731 | Line 865 | COLOR  col;
865   }
866  
867  
868 + putbword(col)                   /* put a 16-bit brightness to stdout */
869 + COLOR  col;
870 + {
871 +        long  i;
872 +        uint16  vw;
873 +
874 +        i = (*mybright)(col)*65536.;
875 +        vw = min(i,65535);
876 +        if (swapbytes)
877 +                swap16(&vw, 1);
878 +        fwrite((char *)&vw, sizeof(uint16), 1, stdout);
879 +
880 +        return(ferror(stdout) ? -1 : 0);
881 + }
882 +
883 +
884   putpascii(col)                  /* put an ascii primary to stdout */
885   COLOR  col;
886   {
# Line 776 | Line 926 | COLOR  col;
926   putpbyte(col)                   /* put a byte primary to stdout */
927   COLOR  col;
928   {
929 <        register int  i;
929 >        long  i;
930          BYTE  vb;
931  
932          i = colval(col,putprim)*256.;
# Line 787 | Line 937 | COLOR  col;
937   }
938  
939  
940 + putpword(col)                   /* put a 16-bit primary to stdout */
941 + COLOR  col;
942 + {
943 +        long  i;
944 +        uint16  vw;
945 +
946 +        i = colval(col,putprim)*65536.;
947 +        vw = min(i,65535);
948 +        if (swapbytes)
949 +                swap16(&vw, 1);
950 +        fwrite((char *)&vw, sizeof(uint16), 1, stdout);
951 +
952 +        return(ferror(stdout) ? -1 : 0);
953 + }
954 +
955 +
956   set_io()                        /* set put and get functions */
957   {
958          switch (format) {
# Line 800 | Line 966 | set_io()                       /* set put and get functions */
966                  } else {
967                          getval = getcascii;
968                          putval = putcascii;
969 +                        if (reverse && !interleave) {
970 +                                fprintf(stderr,
971 +                                "%s: ASCII input files must be interleaved\n",
972 +                                                progname);
973 +                                quit(1);
974 +                        }
975                  }
976                  return;
977          case 'f':                                       /* binary float */
# Line 812 | Line 984 | set_io()                       /* set put and get functions */
984                  } else {
985                          getval = getcfloat;
986                          putval = putcfloat;
987 +                        if (reverse && !interleave) {
988 +                                if (fin2 == NULL)
989 +                                        goto namerr;
990 +                                if (fseek(fin2,
991 +                                (long)sizeof(float)*picres.xr*picres.yr, 1))
992 +                                        goto seekerr;
993 +                                if (fseek(fin3,
994 +                                (long)sizeof(float)*2*picres.xr*picres.yr, 1))
995 +                                        goto seekerr;
996 +                        }
997                  }
998                  return;
999          case 'd':                                       /* binary double */
# Line 824 | Line 1006 | set_io()                       /* set put and get functions */
1006                  } else {
1007                          getval = getcdouble;
1008                          putval = putcdouble;
1009 +                        if (reverse && !interleave) {
1010 +                                if (fin2 == NULL)
1011 +                                        goto namerr;
1012 +                                if (fseek(fin2,
1013 +                                (long)sizeof(double)*picres.xr*picres.yr, 1))
1014 +                                        goto seekerr;
1015 +                                if (fseek(fin3,
1016 +                                (long)sizeof(double)*2*picres.xr*picres.yr, 1))
1017 +                                        goto seekerr;
1018 +                        }
1019                  }
1020                  return;
1021          case 'i':                                       /* integer */
# Line 836 | Line 1028 | set_io()                       /* set put and get functions */
1028                  } else {
1029                          getval = getcint;
1030                          putval = putcint;
1031 +                        if (reverse && !interleave) {
1032 +                                fprintf(stderr,
1033 +                                "%s: integer input files must be interleaved\n",
1034 +                                                progname);
1035 +                                quit(1);
1036 +                        }
1037                  }
1038                  return;
1039          case 'b':                                       /* byte */
# Line 848 | Line 1046 | set_io()                       /* set put and get functions */
1046                  } else {
1047                          getval = getcbyte;
1048                          putval = putcbyte;
1049 +                        if (reverse && !interleave) {
1050 +                                if (fin2 == NULL)
1051 +                                        goto namerr;
1052 +                                if (fseek(fin2,
1053 +                                (long)sizeof(BYTE)*picres.xr*picres.yr, 1))
1054 +                                        goto seekerr;
1055 +                                if (fseek(fin3,
1056 +                                (long)sizeof(BYTE)*2*picres.xr*picres.yr, 1))
1057 +                                        goto seekerr;
1058 +                        }
1059                  }
1060                  return;
1061 +        case 'w':                                       /* 16-bit */
1062 +                if (putprim == BRIGHT) {
1063 +                        getval = getbword;
1064 +                        putval = putbword;
1065 +                } else if (putprim != ALL) {
1066 +                        getval = getbword;
1067 +                        putval = putpword;
1068 +                } else {
1069 +                        getval = getcword;
1070 +                        putval = putcword;
1071 +                        if (reverse && !interleave) {
1072 +                                if (fin2 == NULL)
1073 +                                        goto namerr;
1074 +                                if (fseek(fin2,
1075 +                                (long)sizeof(uint16)*picres.xr*picres.yr, 1))
1076 +                                        goto seekerr;
1077 +                                if (fseek(fin3,
1078 +                                (long)sizeof(uint16)*2*picres.xr*picres.yr, 1))
1079 +                                        goto seekerr;
1080 +                        }
1081 +                }
1082 +                return;
1083          }
1084 + badopt:
1085 +        fprintf(stderr, "%s: botched file type\n", progname);
1086 +        quit(1);
1087 + namerr:
1088 +        fprintf(stderr, "%s: non-interleaved file(s) must be named\n",
1089 +                        progname);
1090 +        quit(1);
1091 + seekerr:
1092 +        fprintf(stderr, "%s: cannot seek on interleaved input file\n",
1093 +                        progname);
1094 +        quit(1);
1095   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines