Merge with d8cd8e8947eceaf648ef570ea0eaaa518d6b3da7

This commit is contained in:
michael
2012-07-06 16:20:49 -04:00
parent fc8dc512fc
commit 8de0ec439e
39 changed files with 205 additions and 137 deletions

View File

@@ -1,5 +1,5 @@
--- C:/GCC/RT/RTSrc/rtengine/dcraw.c Tue Jun 26 23:00:34 2012
+++ C:/GCC/RT/RTSrc/rtengine/dcraw.cc Fri Jun 29 23:09:38 2012
--- C:/GCC/RT/RTSrc/rtengine/dcraw.c Wed Jul 04 20:53:43 2012
+++ C:/GCC/RT/RTSrc/rtengine/dcraw.cc Wed Jul 04 21:00:00 2012
@@ -1,5 +1,17 @@
+/*RT*/#include <glib.h>
+/*RT*/#include <glib/gstdio.h>
@@ -18,7 +18,20 @@
Copyright 1997-2012 by Dave Coffin, dcoffin a cybercom o net
This is a command-line ANSI C program to convert raw photos from
@@ -27,21 +39,21 @@
@@ -17,31 +29,31 @@
since Revision 1.237. All other code remains free for all uses.
*If you have not modified dcraw.c in any way, a link to my
homepage qualifies as "full source code".
- $Revision: 1.450 $
- $Date: 2012/06/30 20:36:46 $
+ $Revision: 1.448 $
+ $Date: 2012/06/18 19:44:18 $
*/
-#define DCRAW_VERSION "9.16"
+#define DCRAW_VERSION "9.15"
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
@@ -798,30 +811,7 @@
{
static const uchar xlat[2][256] = {
{ 0xc1,0xbf,0x6d,0x0d,0x59,0xc5,0x13,0x9d,0x83,0x61,0x6b,0x4f,0xc7,0x7f,0x3d,0x3d,
@@ -4622,16 +4222,16 @@
fread (artist, 64, 1, ifp);
if (tag == 0xc && len == 4) {
cam_mul[0] = getreal(type);
cam_mul[2] = getreal(type);
}
- if (tag == 0xd && type == 7 && get2() == 0xaaaa) {
- fread (buf97, 1, sizeof buf97, ifp);
- i = (uchar *) memmem (buf97, sizeof buf97,"\xbb\xbb",2) - buf97 + 10;
- if (i < 70 && buf97[i] < 3)
- flip = "065"[buf97[i]]-'0';
- }
+// if (tag == 0xd && type == 7 && get2() == 0xaaaa) {
+// fread (buf97, 1, sizeof buf97, ifp);
+// i = (uchar *) memmem ((char*) buf97, sizeof buf97,"\xbb\xbb",2) - buf97 + 10;
+// if (i < 70 && buf97[i] < 3)
+// flip = "065"[buf97[i]]-'0';
+// }
if (tag == 0x10 && type == 4)
unique_id = get4();
if (tag == 0x11 && is_raw && !strncmp(make,"NIKON",5)) {
fseek (ifp, get4()+base, SEEK_SET);
parse_tiff_ifd (base);
@@ -5007,12 +4607,12 @@
@@ -5008,12 +4608,12 @@
if (tag == 64020) height = (getint(type)+1) & -2;
fseek (ifp, save, SEEK_SET);
}
@@ -836,7 +826,7 @@
{
unsigned entries, tag, type, len, plen=16, save;
int ifd, use_cm=0, cfa, i, j, c, ima_len=0;
@@ -5022,11 +4622,11 @@
@@ -5023,11 +4623,11 @@
double cc[4][4], cm[4][3], cam_xyz[4][3], num;
double ab[]={ 1,1,1,1 }, asn[] = { 0,0,0,0 }, xyz[] = { 1,1,1 };
unsigned sony_curve[] = { 0,0,0,0,0,4095 };
@@ -849,7 +839,7 @@
return 1;
ifd = tiff_nifds++;
for (j=0; j < 4; j++)
@@ -5454,16 +5054,17 @@
@@ -5455,16 +5055,17 @@
if (sony_length && (buf = (unsigned *) malloc(sony_length))) {
fseek (ifp, sony_offset, SEEK_SET);
fread (buf, sony_length, 1, ifp);
@@ -872,7 +862,7 @@
}
for (i=0; i < colors; i++)
FORCC cc[i][c] *= ab[i];
@@ -5484,10 +5085,12 @@
@@ -5485,10 +5086,12 @@
int CLASS parse_tiff (int base)
{
@@ -885,7 +875,7 @@
if (order != 0x4949 && order != 0x4d4d) return 0;
get2();
while ((doff = get4())) {
@@ -5557,11 +5160,11 @@
@@ -5558,11 +5161,11 @@
} slr:
switch (tiff_bps) {
case 8: load_raw = &CLASS eight_bit_load_raw; break;
@@ -898,7 +888,7 @@
}
break;
case 6: case 7: case 99:
@@ -5664,11 +5267,11 @@
@@ -5665,11 +5268,11 @@
*/
void CLASS parse_external_jpeg()
{
@@ -911,7 +901,7 @@
file = strrchr (ifname, '/');
if (!file) file = strrchr (ifname, '\\');
if (!file) file = ifname-1;
@@ -5686,17 +5289,18 @@
@@ -5687,17 +5290,18 @@
memcpy (jfile+4, file, 4);
}
} else
@@ -932,7 +922,7 @@
parse_tiff (12);
thumb_offset = 0;
is_raw = 1;
@@ -6030,11 +5634,15 @@
@@ -6031,11 +5635,15 @@
raw_width = get2();
}
order = get2();
@@ -949,7 +939,7 @@
}
return 1;
}
@@ -6282,11 +5890,12 @@
@@ -6283,11 +5891,12 @@
*/
void CLASS adobe_coeff (const char *make, const char *model)
{
@@ -963,7 +953,7 @@
{ 11438,-3762,-1115,-2409,9914,2497,-1227,2295,5300 } },
{ "Apple QuickTake", 0, 0, /* DJC */
{ 21392,-5653,-3353,2406,8010,-415,7166,1427,2078 } },
@@ -6296,44 +5905,44 @@
@@ -6297,44 +5906,44 @@
{ 20482,-7172,-3125,-1033,10410,-285,2542,226,3136 } },
{ "Canon EOS D30", 0, 0,
{ 9805,-2689,-1312,-5803,13064,3068,-2438,3075,8775 } },
@@ -1020,10 +1010,10 @@
+ { 6519,-772,-703,-4994,12737,2519,-1387,2492,6175 } },
{ "Canon EOS 600D", 0, 0x3510,
{ 6461,-907,-882,-4300,12184,2378,-819,1944,5931 } },
{ "Canon EOS 650D", 0, 0x354d,
{ 6602,-841,-939,-4472,12458,2247,-975,2039,6148 } },
{ "Canon EOS 1000D", 0, 0xe43,
{ 6771,-1139,-977,-7818,15123,2928,-1244,1437,7533 } },
{ "Canon EOS 1100D", 0, 0x3510,
@@ -6342,12 +5951,12 @@
@@ -6345,12 +5954,12 @@
{ 5859,-211,-930,-8255,16017,2353,-1732,1887,7448 } },
{ "Canon EOS-1Ds Mark II", 0, 0xe80,
{ 6517,-602,-867,-8180,15926,2378,-1618,1771,7633 } },
@@ -1038,7 +1028,7 @@
{ "Canon EOS-1D Mark II", 0, 0xe80,
{ 6264,-582,-724,-8312,15948,2504,-1744,1919,8664 } },
{ "Canon EOS-1DS", 0, 0xe20,
@@ -6362,16 +5971,16 @@
@@ -6365,16 +5974,16 @@
{ 0 } }, /* don't want the A5 matrix */
{ "Canon PowerShot A50", 0, 0,
{ -5300,9846,1776,3436,684,3939,-5540,9879,6200,-1404,11175,217 } },
@@ -1059,7 +1049,7 @@
{ "Canon PowerShot G1", 0, 0,
{ -4778,9467,2172,4743,-1141,4344,-5146,9908,6077,-1566,11051,557 } },
{ "Canon PowerShot G2", 0, 0,
@@ -6425,11 +6034,11 @@
@@ -6428,11 +6037,11 @@
{ "Canon PowerShot S3 IS", 0, 0, /* DJC */
{ 14062,-5199,-1446,-4712,12470,2243,-1286,2028,4836 } },
{ "Canon PowerShot SX1 IS", 0, 0,
@@ -1072,7 +1062,7 @@
{ "CASIO EX-S20", 0, 0, /* DJC */
{ 11634,-3924,-1128,-4968,12954,2015,-1588,2648,7206 } },
{ "CASIO EX-Z750", 0, 0, /* DJC */
@@ -6502,12 +6111,12 @@
@@ -6505,12 +6114,12 @@
{ 12440,-3954,-1183,-1123,9674,1708,-83,1614,4086 } },
{ "FUJIFILM HS20EXR", 0, 0,
{ 13690,-5358,-1474,-3369,11600,1998,-132,1554,4395 } },
@@ -1087,7 +1077,7 @@
{ "FUJIFILM X-Pro1", 0, 0,
{ 10413,-3996,-993,-3721,11640,2361,-733,1540,6011 } },
{ "FUJIFILM X-S1", 0, 0,
@@ -6608,28 +6217,26 @@
@@ -6611,28 +6220,26 @@
{ 7577,-2166,-926,-7454,15592,1934,-2377,2808,8606 } },
{ "NIKON D1X", 0, 0,
{ 7702,-2245,-975,-9114,17242,1875,-2679,3055,8521 } },
@@ -1124,7 +1114,7 @@
{ "NIKON D40X", 0, 0,
{ 8819,-2543,-911,-9025,16928,2151,-1329,1213,8449 } },
{ "NIKON D40", 0, 0,
@@ -6642,14 +6249,14 @@
@@ -6645,14 +6252,14 @@
{ 8198,-2239,-724,-4871,12389,2798,-1043,2050,7181 } },
{ "NIKON D50", 0, 0,
{ 7732,-2422,-789,-8238,15884,2498,-859,783,7330 } },
@@ -1143,7 +1133,7 @@
{ "NIKON D800", 0, 0,
{ 7866,-2108,-555,-4869,12483,2681,-1176,2069,7501 } },
{ "NIKON D80", 0, 0,
@@ -6708,12 +6315,12 @@
@@ -6711,12 +6318,12 @@
{ 13173,-4732,-1499,-5807,14036,1895,-2045,2452,7142 } },
{ "OLYMPUS E-300", 0, 0,
{ 7828,-1761,-348,-5788,14071,1830,-2853,4518,6557 } },
@@ -1158,7 +1148,7 @@
{ "OLYMPUS E-400", 0, 0,
{ 6169,-1483,-21,-7107,14761,2536,-2904,3580,8568 } },
{ "OLYMPUS E-410", 0, 0xf6a,
@@ -6726,34 +6333,32 @@
@@ -6729,30 +6336,30 @@
{ 8136,-1968,-299,-5481,13742,1871,-2556,4205,6630 } },
{ "OLYMPUS E-510", 0, 0xf6a,
{ 8785,-2529,-1033,-7639,15624,2112,-1783,2300,7817 } },
@@ -1202,14 +1192,10 @@
+ { 7041,-1794,-336,-3790,11192,2984,-1364,2625,6217 } },
{ "OLYMPUS E-PM1", 0, 0,
{ 7575,-2159,-571,-3722,11341,2725,-1434,2819,6271 } },
- { "OLYMPUS E-M5", 0, 0,
- { 8380,-2630,-639,-2887,10725,2496,-627,1427,5438 } },
{ "OLYMPUS E-M5", 0, 0,
{ 8380,-2630,-639,-2887,10725,2496,-627,1427,5438 } },
{ "OLYMPUS SP350", 0, 0,
{ 12078,-4836,-1069,-6671,14306,2578,-786,939,7418 } },
{ "OLYMPUS SP3", 0, 0,
{ 11766,-4445,-1067,-6901,14421,2707,-1029,1217,7572 } },
{ "OLYMPUS SP500UZ", 0, 0xfff,
@@ -6764,12 +6369,12 @@
@@ -6767,12 +6374,12 @@
{ 11597,-4006,-1049,-5432,12799,2957,-1029,1750,6516 } },
{ "OLYMPUS SP560UZ", 0, 0xff9,
{ 10915,-3677,-982,-5587,12986,2911,-1168,1968,6223 } },
@@ -1224,7 +1210,7 @@
{ "PENTAX *ist DL", 0, 0,
{ 10829,-2838,-1115,-8339,15817,2696,-837,680,11939 } },
{ "PENTAX *ist DS2", 0, 0,
@@ -6782,12 +6387,12 @@
@@ -6785,12 +6392,12 @@
{ 9566,-2863,-803,-7170,15172,2112,-818,803,9705 } },
{ "PENTAX K1", 0, 0,
{ 11095,-3157,-1324,-8377,15834,2720,-1108,947,11688 } },
@@ -1239,7 +1225,7 @@
{ "PENTAX K-m", 0, 0,
{ 11057,-3604,-1155,-5152,13046,2329,-282,375,8104 } },
{ "PENTAX K-x", 0, 0,
@@ -6840,40 +6445,42 @@
@@ -6843,40 +6450,42 @@
{ 8128,-2668,-655,-6134,13307,3161,-1782,2568,6083 } },
{ "Panasonic DMC-LX5", 143, 0,
{ 10909,-4295,-948,-1333,9306,2399,22,1738,4582 } },
@@ -1302,7 +1288,7 @@
{ "Phase One H 20", 0, 0, /* DJC */
{ 1313,1855,-109,-6715,15908,808,-327,1840,6020 } },
{ "Phase One H 25", 0, 0,
@@ -6930,26 +6537,24 @@
@@ -6933,26 +6542,24 @@
{ 4950,-580,-103,-5228,12542,3029,-709,1435,7371 } },
{ "SONY DSLR-A580", 128, 0xfeb,
{ 5932,-1492,-411,-4813,12285,2856,-741,1524,6739 } },
@@ -1341,7 +1327,7 @@
{ "SONY NEX", 128, 0, /* NEX-C3, NEX-F3 */
{ 5991,-1456,-455,-4764,12135,2980,-707,1425,6701 } },
{ "SONY SLT-A33", 128, 0,
@@ -6959,15 +6564,15 @@
@@ -6962,15 +6569,15 @@
{ "SONY SLT-A37", 128, 0,
{ 5991,-1456,-455,-4764,12135,2980,-707,1425,6701 } },
{ "SONY SLT-A55", 128, 0,
@@ -1360,7 +1346,7 @@
char name[130];
int i, j;
@@ -7211,17 +6816,26 @@
@@ -7214,17 +6821,26 @@
hlen = get4();
fseek (ifp, 0, SEEK_SET);
fread (head, 1, 32, ifp);
@@ -1389,7 +1375,7 @@
} else if (!memcmp (head,"\xff\xd8\xff\xe1",4) &&
!memcmp (head+6,"Exif",4)) {
fseek (ifp, 4, SEEK_SET);
@@ -7262,10 +6876,11 @@
@@ -7265,10 +6881,11 @@
}
load_raw = &CLASS unpacked_load_raw;
fseek (ifp, 100+28*(shot_select > 0), SEEK_SET);
@@ -1401,7 +1387,7 @@
fseek (ifp, 0, SEEK_SET);
parse_riff();
} else if (!memcmp (head,"\0\001\0\001\0@",6)) {
@@ -7359,11 +6974,11 @@
@@ -7362,11 +6979,11 @@
if (height == 2624 && width == 3936) /* Pentax K10D and Samsung GX10 */
{ height = 2616; width = 3896; }
if (height == 3136 && width == 4864) /* Pentax K20D and Samsung GX20 */
@@ -1414,7 +1400,7 @@
if (width == 4736 && !strcmp(model,"K-7"))
{ height = 3122; width = 4684; filters = 0x16161616; top_margin = 2; }
if (width == 7424 && !strcmp(model,"645D"))
@@ -7757,11 +7372,11 @@
@@ -7766,11 +7383,11 @@
height -= top_margin;
width -= left_margin;
} else if (is_canon && raw_width == 5920) {
@@ -1427,7 +1413,7 @@
cam_mul[0] *= 256/527.0;
cam_mul[2] *= 256/317.0;
} else if (!strcmp(model,"D1X")) {
@@ -7786,11 +7401,11 @@
@@ -7795,11 +7412,11 @@
width -= 42;
} else if (!strcmp(model,"D5100") ||
!strcmp(model,"D7000")) {
@@ -1440,7 +1426,7 @@
width -= 52;
left_margin = 2;
} else if (!strncmp(model,"D40",3) ||
@@ -8681,198 +8296,11 @@
@@ -8690,198 +8307,11 @@
quit:
cmsCloseProfile (hInProfile);
}
@@ -1640,7 +1626,7 @@
ushort tag, type;
int count;
union { char c[4]; short s[2]; int i; } val;
@@ -8892,572 +8320,13 @@
@@ -8901,572 +8331,13 @@
int rat[10];
unsigned gps[26];
char desc[512], make[64], model[64], soft[32], date[20], artist[64];
@@ -2141,7 +2127,7 @@
- colorcheck();
-#endif
- if (is_foveon) {
- if (document_mode || model[0] == 'D') {
- if (document_mode || load_raw == &CLASS foveon_dp_load_raw) {
- for (i=0; i < height*width*4; i++)
- if ((short) image[0][i] < 0) image[0][i] = 0;
- } else foveon_interpolate();