From: Niels K. B. J. <nk...@us...> - 2006-03-22 05:26:44
|
Update of /cvsroot/ufraw/ufraw In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5892 Modified Files: dcraw.c Log Message: DCRaw modified 8.08 (1.318). Index: dcraw.c =================================================================== RCS file: /cvsroot/ufraw/ufraw/dcraw.c,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** dcraw.c 21 Mar 2006 05:21:01 -0000 1.63 --- dcraw.c 22 Mar 2006 05:26:42 -0000 1.64 *************** *** 269,278 **** } - double CLASS getrat() - { - double num = get4(); - return num / get4(); - } - float CLASS int_to_float (int i) { --- 269,272 ---- *************** *** 282,285 **** --- 276,300 ---- } + double CLASS getreal (int type) + { + double num; + switch (type) { + case 3: return (unsigned short) get2(); + case 4: return (unsigned int) get4(); + case 5: num = (unsigned int) get4(); + return num / (unsigned int) get4(); + case 8: return (signed short) get2(); + case 9: return (signed int) get4(); + case 10: num = (signed int) get4(); + return num / (signed int) get4(); + case 11: return int_to_float (get4()); + case 12: + fprintf (stderr, "%s: TIFF doubles not supported!\n", ifname); + longjmp (failure, 4); + default: return fgetc(ifp); + } + } + #define getrat() getreal(10) + void CLASS read_shorts (ushort *pixel, int count) { *************** *** 3941,3949 **** case 50716: /* BlackLevelDeltaV */ for (dblack=i=0; i < (int) len; i++) ! dblack += getrat(); black += dblack/len + 0.5; break; case 50717: /* WhiteLevel */ ! maximum = get2(); break; case 50718: /* DefaultScale */ --- 3956,3964 ---- case 50716: /* BlackLevelDeltaV */ for (dblack=i=0; i < (int) len; i++) ! dblack += getreal(type); black += dblack/len + 0.5; break; case 50717: /* WhiteLevel */ ! maximum = getint(type); break; case 50718: /* DefaultScale */ *************** *** 3968,3972 **** break; case 50728: /* AsShotNeutral */ ! FORCC asn[c] = type == 3 ? get2() : getrat(); break; case 50729: /* AsShotWhiteXY */ --- 3983,3987 ---- break; case 50728: /* AsShotNeutral */ ! FORCC asn[c] = getreal(type); break; case 50729: /* AsShotWhiteXY */ *************** *** 3984,3991 **** break; case 50829: /* ActiveArea */ ! top_margin = get4(); ! left_margin = get4(); ! height = get4() - top_margin; ! width = get4() - left_margin; break; case 64772: /* Kodak P-series */ --- 3999,4006 ---- break; case 50829: /* ActiveArea */ ! top_margin = getint(type); ! left_margin = getint(type); ! height = getint(type) - top_margin; ! width = getint(type) - left_margin; break; case 64772: /* Kodak P-series */ *************** *** 6176,6180 **** { fprintf (stderr, ! "\nRaw Photo Decoder \"dcraw\" v8.07" "\nby Dave Coffin, dcoffin a cybercom o net" "\n\nUsage: %s [options] file1 file2 ...\n" --- 6191,6195 ---- { fprintf (stderr, ! "\nRaw Photo Decoder \"dcraw\" v8.08" "\nby Dave Coffin, dcoffin a cybercom o net" "\n\nUsage: %s [options] file1 file2 ...\n" |