--- ray/src/util/radcompare.c 2018/10/19 22:15:30 2.12 +++ ray/src/util/radcompare.c 2023/11/21 20:01:39 2.34 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: radcompare.c,v 2.12 2018/10/19 22:15:30 greg Exp $"; +static const char RCSid[] = "$Id: radcompare.c,v 2.34 2023/11/21 20:01:39 greg Exp $"; #endif /* * Compare Radiance files for significant differences @@ -8,12 +8,14 @@ static const char RCSid[] = "$Id: radcompare.c,v 2.12 */ #include -#include #include +#include "rtmath.h" #include "platform.h" #include "rtio.h" #include "resolu.h" #include "color.h" +#include "depthcodec.h" +#include "normcodec.h" #include "lookup.h" /* Reporting levels */ #define REP_QUIET 0 /* no reporting */ @@ -25,6 +27,8 @@ int report = REP_WARN; /* reporting level */ int ign_header = 0; /* ignore header differences? */ +int escape_newlines = 0; /* allow backslash to skip newlines */ + double rel_min = 1e-5; /* positive for relative comparisons */ double rms_lim = 0.01; /* RMS difference limit */ @@ -33,6 +37,8 @@ double max_lim = 0.25; /* difference limit if non-neg int lin1cnt=0, lin2cnt=0; /* file line position */ +int comment_c = '\0'; /* comment delimiter for text files */ + const char nsuffix[10][3] = { /* 1st, 2nd, 3rd, etc. */ "th","st","nd","rd","th","th","th","th","th","th" }; @@ -45,17 +51,25 @@ const char *file_type[] = { "ascii", COLRFMT, CIEFMT, + SPECFMT, + DEPTH16FMT, + NORMAL32FMT, "float", "double", "BSDF_RBFmesh", "Radiance_octree", "Radiance_tmesh", + "8-bit_indexed_name", + "16-bit_indexed_name", + "24-bit_indexed_name", "BINARY_unknown", NULL /* terminator */ }; /* keep consistent with above */ -enum {TYP_UNKNOWN, TYP_TEXT, TYP_ASCII, TYP_RGBE, TYP_XYZE, TYP_FLOAT, - TYP_DOUBLE, TYP_RBFMESH, TYP_OCTREE, TYP_TMESH, TYP_BINARY}; +enum {TYP_UNKNOWN, TYP_TEXT, TYP_ASCII, TYP_RGBE, TYP_XYZE, TYP_SPEC, + TYP_DEPTH, TYP_NORM, TYP_FLOAT, TYP_DOUBLE, + TYP_RBFMESH, TYP_OCTREE, TYP_TMESH, + TYP_ID8, TYP_ID16, TYP_ID24, TYP_BINARY}; #define has_header(t) (!( 1L<<(t) & (1L<ptr = NULL, (bp)->siz = 0) +#define init_line(bp) ((bp)->str = NULL, (bp)->siz = 0) /* 100 MByte limit on line buffer */ #define MAXBUF (100L<<20) @@ -89,6 +104,7 @@ char *progname = NULL; const char stdin_name[] = ""; const char *f1name=NULL, *f2name=NULL; FILE *f1in=NULL, *f2in=NULL; +int f1swap=0, f2swap=0; /* running real differences */ double diff2sum = 0; @@ -100,7 +116,7 @@ usage() { fputs("Usage: ", stderr); fputs(progname, stderr); - fputs(" [-h][-s|-w|-v][-rel min_test][-rms epsilon][-max epsilon] reference test\n", + fputs(" [-h][-c#][-s|-w|-v][-rel min_test][-rms epsilon][-max epsilon] reference test\n", stderr); exit(2); } @@ -109,26 +125,54 @@ usage() static int read_line(LINEBUF *bp, FILE *fp) { + static int doneWarn = 0; + bp->len = 0; - if (!bp->ptr) { - bp->ptr = (char *)malloc(bp->siz = 512); - if (!bp->ptr) + if (!bp->str) { + bp->str = (char *)malloc(bp->siz = 512); + if (!bp->str) goto memerr; } - while (fgets(bp->ptr + bp->len, bp->siz - bp->len, fp)) { - bp->len += strlen(bp->ptr + bp->len); - if (bp->ptr[bp->len-1] == '\n') + while (fgets(bp->str + bp->len, bp->siz - bp->len, fp)) { + bp->len += strlen(bp->str + bp->len); + if (bp->str[bp->len-1] == '\n') { + if (bp->len > 1 && bp->str[bp->len-2] == '\r') { + bp->str[--bp->len] = '\0'; + bp->str[bp->len-1] = '\n'; + } + if (escape_newlines && bp->len > 1 && + bp->str[bp->len-2] == '\\') { + bp->str[--bp->len] = '\0'; + bp->str[bp->len-1] = ' '; + continue; + } break; /* found EOL */ + } if (bp->len < bp->siz - 4) continue; /* at EOF? */ - if (bp->siz >= MAXBUF) - break; /* don't go to extremes */ + if (bp->siz >= MAXBUF) { + if ((report >= REP_WARN) & !doneWarn) { + fprintf(stderr, + "%s: warning - input line(s) past %ld MByte limit\n", + progname, MAXBUF>>20); + doneWarn++; + } + break; /* return MAXBUF partial line */ + } if ((bp->siz += bp->siz/2) > MAXBUF) bp->siz = MAXBUF; - bp->ptr = (char *)realloc(bp->ptr, bp->siz); - if (!bp->ptr) + bp->str = (char *)realloc(bp->str, bp->siz); + if (!bp->str) goto memerr; } + if (comment_c) { /* elide comment? */ + char *cp = sskip2(bp->str,0); + if (*cp == comment_c) { + *cp++ = '\n'; + *cp = '\0'; + bp->len = cp - bp->str; + } + } return(bp->len); memerr: fprintf(stderr, @@ -141,10 +185,8 @@ memerr: static void free_line(LINEBUF *bp) { - bp->len = 0; - if (!bp->ptr) return; - free(bp->ptr); - bp->ptr = NULL; + if (bp->str) free(bp->str); + init_line(bp); } /* Get type ID from name (or 0 if not found) */ @@ -169,8 +211,9 @@ real_check(double r1, double r2) if (rel_min > 0) { /* doing relative differences? */ double av2 = .25*(r1*r1 + 2.*fabs(r1*r2) + r2*r2); - if (av2 > rel_min*rel_min) - diff2 /= av2; + if (av2 < rel_min*rel_min) + av2 = rel_min*rel_min; + diff2 /= av2; } if (max_lim >= 0 && diff2 > max_lim*max_lim) { if (report != REP_QUIET) @@ -192,8 +235,8 @@ color_check(COLOR c1, COLOR c2) { int p; - if (!real_check(colval(c1,RED)+colval(c1,GRN)+colval(c1,BLU)*(1./3.), - colval(c2,RED)+colval(c2,GRN)+colval(c2,BLU))*(1./3.)) + if (!real_check((colval(c1,RED)+colval(c1,GRN)+colval(c1,BLU))*(1./3.), + (colval(c2,RED)+colval(c2,GRN)+colval(c2,BLU))*(1./3.))) return(0); p = (colval(c1,GRN) > colval(c1,RED)) ? GRN : RED; @@ -202,6 +245,69 @@ color_check(COLOR c1, COLOR c2) return(real_check(colval(c1,p), colval(c2,p))); } +#if 1 +/* Compare two color spectra for equivalence */ +static int +spec_check(COLORV *sc1, COLORV *sc2) +{ + int p, k; + + if (!real_check(scolor_mean(sc1), scolor_mean(sc2))) + return(0); + + p = 0; /* find max. component */ + for (k = NCSAMP; --k; ) + if (sc1[k] > sc1[p]) + p = k; + + return(real_check(sc1[p], sc2[p])); +} +#else +/* Compare two color spectra for equivalence */ +static int +spec_check(COLORV *sc1, COLORV *sc2) +{ + COLOR c1, c2; + int p; + + if (!real_check(scolor_mean(sc1), scolor_mean(sc2))) + return(0); + /* do comparisons in RGB space */ + scolor_rgb(c1, sc1); + scolor_rgb(c2, sc2); + + p = (colval(c1,GRN) > colval(c1,RED)) ? GRN : RED; + if (colval(c1,BLU) > colval(c1,p)) p = BLU; + + return(real_check(colval(c1,p), colval(c2,p))); +} +#endif + +/* Compare two normal directions for equivalence */ +static int +norm_check(FVECT nv1, FVECT nv2) +{ + double max2 = nv1[2]*nv2[2]; + int imax = 2; + int i = 2; + /* identify largest component */ + while (i--) { + double tm2 = nv1[i]*nv2[i]; + if (tm2 > max2) { + imax = i; + max2 = tm2; + } + } + i = 3; /* compare smaller components */ + while (i--) { + if (i == imax) + continue; + if (!real_check(nv1[i], nv2[i])) + return(0); + } + return(1); +} + /* Compare two strings for equivalence */ static int equiv_string(char *s1, char *s2) @@ -274,6 +380,7 @@ equiv_string(char *s1, char *s2) static int setheadvar(char *val, void *p) { + char newval[128]; LUTAB *htp = (LUTAB *)p; LUENT *tep; char *key; @@ -283,6 +390,14 @@ setheadvar(char *val, void *p) adv_linecnt(htp); /* side-effect is to count lines */ if (!isalpha(*val)) /* key must start line */ return(0); + /* check if we need to swap binary data */ + if ((n = isbigendian(val)) >= 0) { + if (nativebigendian() == n) + return(0); + f1swap += (htp == &hdr1); + f2swap += (htp == &hdr2); + return(0); + } key = val++; while (*val && !isspace(*val) & (*val != '=')) val++; @@ -308,8 +423,13 @@ setheadvar(char *val, void *p) return(-1); /* memory allocation error */ if (!tep->key) tep->key = strcpy(malloc(kln+1), key); - if (tep->data) + if (tep->data) { /* check for special cases */ + if (!strcmp(key, "EXPOSURE")) { + sprintf(newval, "%.6e", atof(tep->data)*atof(val)); + vln = strlen(val = newval); + } free(tep->data); + } tep->data = strcpy(malloc(vln+1), val); return(1); } @@ -418,7 +538,6 @@ identify_type(const char *name, FILE *fin, LUTAB *htp) } if (c) return(TYP_BINARY); - SET_FILE_TEXT(fin); /* originally set to binary */ return(TYP_TEXT); badeof: if (report != REP_QUIET) { @@ -501,20 +620,30 @@ compare_text() if (report >= REP_VERBOSE) { fputs(progname, stdout); - fputs(": comparing inputs as ASCII text\n", stdout); + fputs(": comparing inputs as ASCII text", stdout); + if (escape_newlines) + fputs(", allowing escaped newlines", stdout); + if (comment_c) { + fputs(", ignoring comments starting with '", stdout); + fputc(comment_c, stdout); + fputc('\'', stdout); + } + fputc('\n', stdout); } + SET_FILE_TEXT(f1in); /* originally set to binary */ + SET_FILE_TEXT(f2in); init_line(&l1buf); init_line(&l2buf); /* compare a line at a time */ while (read_line(&l1buf, f1in)) { lin1cnt++; - if (!*sskip2(l1buf.ptr,0)) + if (!*sskip2(l1buf.str,0)) continue; /* ignore empty lines */ while (read_line(&l2buf, f2in)) { lin2cnt++; - if (*sskip2(l2buf.ptr,0)) + if (*sskip2(l2buf.str,0)) break; /* found other non-empty line */ } - if (feof(f2in)) { + if (!l2buf.len) { /* input 2 EOF? */ if (report != REP_QUIET) { fputs(f2name, stdout); fputs(": unexpected end-of-file\n", stdout); @@ -523,40 +652,82 @@ compare_text() return(0); } /* compare non-empty lines */ - if (!equiv_string(l1buf.ptr, l2buf.ptr)) { + if (!equiv_string(l1buf.str, l2buf.str)) { if (report != REP_QUIET) { - printf("%s: inputs '%s' and '%s' differ at line %d|%d\n", - progname, f1name, f2name, - lin1cnt, lin2cnt); + printf("%s: inputs '%s' and '%s' differ at line %d", + progname, f1name, f2name, lin1cnt); + if (lin1cnt != lin2cnt) + printf("|%d\n", lin2cnt); + else + putchar('\n'); if ( report >= REP_VERBOSE && (l1buf.len < 256) & (l2buf.len < 256) ) { fputs("------------- Mismatch -------------\n", stdout); printf("%s@%d:\t%s", f1name, - lin1cnt, l1buf.ptr); + lin1cnt, l1buf.str); printf("%s@%d:\t%s", f2name, - lin2cnt, l2buf.ptr); + lin2cnt, l2buf.str); } } free_line(&l1buf); free_line(&l2buf); return(0); } } - /* check for EOF on input 2 */ + free_line(&l1buf); /* check for EOF on input 2 */ while (read_line(&l2buf, f2in)) { - if (!*sskip2(l2buf.ptr,0)) + if (!*sskip2(l2buf.str,0)) continue; if (report != REP_QUIET) { fputs(f1name, stdout); fputs(": unexpected end-of-file\n", stdout); } - free_line(&l1buf); free_line(&l2buf); + free_line(&l2buf); return(0); } - free_line(&l1buf); free_line(&l2buf); + free_line(&l2buf); return(good_RMS()); /* final check for reals */ } +/* Set resolution based on NROWS, NCOLS in header */ +static int +set_resolu(RESOLU *rs, LUTAB *htp) +{ + const char *val; + + rs->rt = PIXSTANDARD; + val = (const char *)lu_find(htp, "NROWS")->data; + if (!val) return(0); + rs->yr = atoi(val); + if (rs->yr <= 0) return(-1); + val = (const char *)lu_find(htp, "NCOLS")->data; + if (!val) return(0); + rs->xr = atoi(val); + if (rs->xr <= 0) return(-1); + return(1); +} + +/* Check image/map resolutions */ +static int +check_resolu(const char *class, RESOLU *r1p, RESOLU *r2p) +{ + if (r1p->rt != r2p->rt) { + if (report != REP_QUIET) + printf( + "%s: %ss '%s' and '%s' have different pixel ordering\n", + progname, class, f1name, f2name); + return(0); + } + if ((r1p->xr != r2p->xr) | (r1p->yr != r2p->yr)) { + if (report != REP_QUIET) + printf( + "%s: %ss '%s' and '%s' are different sizes\n", + progname, class, f1name, f2name); + return(0); + } + return(1); +} + /* Compare two inputs that are known to be RGBE or XYZE images */ static int compare_hdr() @@ -571,20 +742,8 @@ compare_hdr() } fgetsresolu(&rs1, f1in); fgetsresolu(&rs2, f2in); - if (rs1.rt != rs2.rt) { - if (report != REP_QUIET) - printf( - "%s: Images '%s' and '%s' have different pixel ordering\n", - progname, f1name, f2name); + if (!check_resolu("HDR image", &rs1, &rs2)) return(0); - } - if ((rs1.xr != rs2.xr) | (rs1.yr != rs2.yr)) { - if (report != REP_QUIET) - printf( - "%s: Images '%s' and '%s' are different sizes\n", - progname, f1name, f2name); - return(0); - } scan1 = (COLOR *)malloc(scanlen(&rs1)*sizeof(COLOR)); scan2 = (COLOR *)malloc(scanlen(&rs2)*sizeof(COLOR)); if (!scan1 | !scan2) { @@ -605,8 +764,7 @@ compare_hdr() if (color_check(scan1[x], scan2[x])) continue; if (report != REP_QUIET) { - printf( - "%s: pixels at scanline %d offset %d differ\n", + printf("%s: pixels at scanline %d offset %d differ\n", progname, y, x); if (report >= REP_VERBOSE) { printf("%s: (R,G,B)=(%g,%g,%g)\n", @@ -629,6 +787,209 @@ compare_hdr() return(good_RMS()); /* final check of RMS */ } +/* Compare two inputs that are known to be spectral images */ +static int +compare_spec() +{ + static char NCstr[] = NCOMPSTR; + RESOLU rs1, rs2; + COLORV *scan1, *scan2; + const char *val; + int x, y; + + if (report >= REP_VERBOSE) { + fputs(progname, stdout); + fputs(": comparing inputs as spectral images\n", stdout); + } + if (!(set_resolu(&rs1, &hdr1) || fgetsresolu(&rs1, f1in))) + return(0); + if (!(set_resolu(&rs2, &hdr2) || fgetsresolu(&rs2, f2in))) + return(0); + if (!check_resolu("Spectral image", &rs1, &rs2)) + return(0); + NCstr[LNCOMPSTR-1] = '\0'; + val = (const char *)lu_find(&hdr1, NCstr)->data; + if (!val || (NCSAMP = atoi(val)) < 3) { + if (report != REP_QUIET) { + if (val) + printf("%s: illegal # components (%d) for spectral image\n", + progname, NCSAMP); + else + printf("%s: missing %s in header for spectral image\n", + progname, NCstr); + } + return(0); + } + scan1 = (COLORV *)malloc(sizeof(COLORV)*NCSAMP*scanlen(&rs1)); + scan2 = (COLORV *)malloc(sizeof(COLORV)*NCSAMP*scanlen(&rs2)); + if (!scan1 | !scan2) { + fprintf(stderr, "%s: out of memory in compare_hdr()\n", progname); + exit(2); + } + for (y = 0; y < numscans(&rs1); y++) { + if ((freadsscan(scan1, NCSAMP, scanlen(&rs1), f1in) < 0) | + (freadsscan(scan2, NCSAMP, scanlen(&rs2), f2in) < 0)) { + if (report != REP_QUIET) + printf("%s: unexpected end-of-file\n", progname); + free(scan1); + free(scan2); + return(0); + } + for (x = 0; x < scanlen(&rs1); x++) { + if (spec_check(scan1+x*NCSAMP, scan2+x*NCSAMP)) + continue; + if (report != REP_QUIET) { + int k; + printf("%s: spectra at scanline %d offset %d differ\n", + progname, y, x); + if (report >= REP_VERBOSE) { + printf("%s: spectrum =", f1name); + for (k = 0; k < NCSAMP; k++) + printf(" %g", scan1[x*NCSAMP+k]); + fputc('\n', stdout); + printf("%s: spectrum =", f2name); + for (k = 0; k < NCSAMP; k++) + printf(" %g", scan2[x*NCSAMP+k]); + fputc('\n', stdout); + } + } + free(scan1); + free(scan2); + return(0); + } + } + free(scan1); + free(scan2); + return(good_RMS()); /* final check of RMS */ +} + +/* Set reference depth based on header variable */ +static int +set_refdepth(DEPTHCODEC *dcp, LUTAB *htp) +{ + static char depthvar[] = DEPTHSTR; + const char *drval; + + depthvar[LDEPTHSTR-1] = '\0'; + drval = (const char *)lu_find(htp, depthvar)->data; + if (!drval) + return(0); + dcp->refdepth = atof(drval); + if (dcp->refdepth <= 0) { + if (report != REP_QUIET) { + fputs(dcp->inpname, stderr); + fputs(": bad reference depth '", stderr); + fputs(drval, stderr); + fputs("'\n", stderr); + } + return(-1); + } + return(1); +} + +/* Compare two encoded depth maps */ +static int +compare_depth() +{ + long nread = 0; + DEPTHCODEC dc1, dc2; + + if (report >= REP_VERBOSE) { + fputs(progname, stdout); + fputs(": comparing inputs as depth maps\n", stdout); + } + set_dc_defaults(&dc1); + dc1.hdrflags = HF_RESIN; + dc1.finp = f1in; + dc1.inpname = f1name; + set_dc_defaults(&dc2); + dc2.hdrflags = HF_RESIN; + dc2.finp = f2in; + dc2.inpname = f2name; + if (report != REP_QUIET) { + dc1.hdrflags |= HF_STDERR; + dc2.hdrflags |= HF_STDERR; + } + if (!process_dc_header(&dc1, 0, NULL)) + return(0); + if (!process_dc_header(&dc2, 0, NULL)) + return(0); + if (!check_resolu("Depth map", &dc1.res, &dc2.res)) + return(0); + if (set_refdepth(&dc1, &hdr1) < 0) + return(0); + if (set_refdepth(&dc2, &hdr2) < 0) + return(0); + while (nread < dc1.res.xr*dc1.res.yr) { + double d1 = decode_depth_next(&dc1); + double d2 = decode_depth_next(&dc2); + if ((d1 < 0) | (d2 < 0)) { + if (report != REP_QUIET) + printf("%s: unexpected end-of-file\n", + progname); + return(0); + } + ++nread; + if (real_check(d1, d2)) + continue; + if (report != REP_QUIET) + printf("%s: %ld%s depth values differ\n", + progname, nread, num_sfx(nread)); + return(0); + } + return(good_RMS()); /* final check of RMS */ +} + +/* Compare two encoded normal maps */ +static int +compare_norm() +{ + long nread = 0; + NORMCODEC nc1, nc2; + + if (report >= REP_VERBOSE) { + fputs(progname, stdout); + fputs(": comparing inputs as normal maps\n", stdout); + } + set_nc_defaults(&nc1); + nc1.hdrflags = HF_RESIN; + nc1.finp = f1in; + nc1.inpname = f1name; + set_nc_defaults(&nc2); + nc2.hdrflags = HF_RESIN; + nc2.finp = f2in; + nc2.inpname = f2name; + if (report != REP_QUIET) { + nc1.hdrflags |= HF_STDERR; + nc2.hdrflags |= HF_STDERR; + } + if (!process_nc_header(&nc1, 0, NULL)) + return(0); + if (!process_nc_header(&nc2, 0, NULL)) + return(0); + if (!check_resolu("Normal map", &nc1.res, &nc2.res)) + return(0); + while (nread < nc1.res.xr*nc1.res.yr) { + FVECT nv1, nv2; + int rv1 = decode_normal_next(nv1, &nc1); + int rv2 = decode_normal_next(nv2, &nc2); + if ((rv1 < 0) | (rv2 < 0)) { + if (report != REP_QUIET) + printf("%s: unexpected end-of-file\n", + progname); + return(0); + } + ++nread; + if (rv1 == rv2 && (!rv1 || norm_check(nv1, nv2))) + continue; + if (report != REP_QUIET) + printf("%s: %ld%s normal vectors differ\n", + progname, nread, num_sfx(nread)); + return(0); + } + return(good_RMS()); /* final check of RMS */ +} + /* Compare two inputs that are known to be 32-bit floating-point data */ static int compare_float() @@ -644,6 +1005,8 @@ compare_float() if (!getbinary(&f2, sizeof(f2), 1, f2in)) goto badeof; ++nread; + if (f1swap) swap32((char *)&f1, 1); + if (f2swap) swap32((char *)&f2, 1); if (real_check(f1, f2)) continue; if (report != REP_QUIET) @@ -674,6 +1037,8 @@ compare_double() if (!getbinary(&f2, sizeof(f2), 1, f2in)) goto badeof; ++nread; + if (f1swap) swap64((char *)&f1, 1); + if (f2swap) swap64((char *)&f2, 1); if (real_check(f1, f2)) continue; if (report != REP_QUIET) @@ -702,6 +1067,12 @@ main(int argc, char *argv[]) case 'h': /* ignore header info. */ ign_header = !ign_header; continue; + case 'n': /* allow newline escapes */ + escape_newlines = !escape_newlines; + continue; + case 'c': /* ignore comments */ + comment_c = argv[a][2]; + continue; case 's': /* silent operation */ report = REP_QUIET; continue; @@ -762,7 +1133,7 @@ main(int argc, char *argv[]) return(2); if (typ1 != typ2) { if (report != REP_QUIET) - printf("%s: '%s' is %s and '%s' is %s\n", + printf("%s: '%s' format is %s and '%s' is %s\n", progname, f1name, file_type[typ1], f2name, file_type[typ2]); return(1); @@ -770,24 +1141,33 @@ main(int argc, char *argv[]) ign_header |= !has_header(typ1); /* check headers if indicated */ if (!ign_header && !headers_match()) return(1); - lu_done(&hdr1); lu_done(&hdr2); if (!ign_header & (report >= REP_WARN)) { - if (typ1 == TYP_UNKNOWN) - printf("%s: warning - unrecognized format, comparing as binary\n", - progname); if (lin1cnt != lin2cnt) printf("%s: warning - headers are different lengths\n", progname); + if (typ1 == TYP_UNKNOWN) + printf("%s: warning - unrecognized format\n", + progname); } - if (report >= REP_VERBOSE) - printf("%s: input file type is %s\n", - progname, file_type[typ1]); - + if (report >= REP_VERBOSE) { + printf("%s: data format is %s\n", progname, file_type[typ1]); + if ((typ1 == TYP_FLOAT) | (typ1 == TYP_DOUBLE)) { + if (f1swap) + printf("%s: input '%s' is byte-swapped\n", + progname, f1name); + if (f2swap) + printf("%s: input '%s' is byte-swapped\n", + progname, f2name); + } + } switch (typ1) { /* compare based on type */ case TYP_BINARY: case TYP_TMESH: case TYP_OCTREE: case TYP_RBFMESH: + case TYP_ID8: + case TYP_ID16: + case TYP_ID24: case TYP_UNKNOWN: return( !compare_binary() ); case TYP_TEXT: @@ -796,6 +1176,12 @@ main(int argc, char *argv[]) case TYP_RGBE: case TYP_XYZE: return( !compare_hdr() ); + case TYP_SPEC: + return( !compare_spec() ); + case TYP_DEPTH: + return( !compare_depth() ); + case TYP_NORM: + return( !compare_norm() ); case TYP_FLOAT: return( !compare_float() ); case TYP_DOUBLE: