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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines