From 31a142008c45ee24132631fd4575c1b5c0ccf628 Mon Sep 17 00:00:00 2001 From: cgilles Date: Wed, 3 Dec 2008 20:09:16 +0000 Subject: [PATCH] libkdcraw from trunk : updated internal LibRaw to 0.6.2-beta1. Binary compatibility still respected. See LibRaw announce at this URL: http://www.libraw.org/blog/libraw-062-beta1.html CCMAIL: digikam-devel@kde.org CCMAIL: kde-imaging@kde.org git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/KDE/kdegraphics@892224 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- libs/libkdcraw/NEWS | 1 + libs/libkdcraw/libraw/internal/dcraw_common.cpp | 239 ++++++++++++++++-------- libs/libkdcraw/libraw/internal/defines.h | 4 +- libs/libkdcraw/libraw/internal/foveon.cpp | 14 +- libs/libkdcraw/libraw/libraw/libraw_internal.h | 4 +- libs/libkdcraw/libraw/src/libraw_cxx.cpp | 6 + 6 files changed, 175 insertions(+), 93 deletions(-) diff --git a/libs/libkdcraw/NEWS b/libs/libkdcraw/NEWS index af008e7b..3cc9ad79 100644 --- a/libs/libkdcraw/NEWS +++ b/libs/libkdcraw/NEWS @@ -1,4 +1,5 @@ 0.4.0 - Released with KDE 4.2.0 +Updated LibRaw to 0.6.2. Updated LibRaw to 0.6.1. Ported to LibRaw Api 0.6.0. Removed dcraw.c and DcrawBinary class. Use kDebug(51002) instead qDebug(). diff --git a/libs/libkdcraw/libraw/internal/dcraw_common.cpp b/libs/libkdcraw/libraw/internal/dcraw_common.cpp index 8e919c55..9bd8d119 100644 --- a/libs/libkdcraw/libraw/internal/dcraw_common.cpp +++ b/libs/libkdcraw/libraw/internal/dcraw_common.cpp @@ -1,6 +1,6 @@ /* GENERATED FILE, DO NOT EDIT - Generated from dcraw/dcraw.c at Thu Sep 25 11:44:51 2008 + Generated from dcraw/dcraw.c at Wed Dec 3 12:31:02 2008 Look into original file (probably http://cybercom.net/~dcoffin/dcraw/dcraw.c) for copyright information. */ @@ -372,7 +372,7 @@ void CLASS init_decoder() } /* - Construct a decode tree according the specification in *source. + Construct a decode tree according to the specification in *source. The first 16 bytes specify how many codes should be 1-bit, 2-bit 3-bit, etc. Bytes after that are the leaf values. @@ -594,13 +594,12 @@ void CLASS canon_compressed_load_raw() #line 881 "dcraw/dcraw.c" int CLASS ljpeg_start (struct jhead *jh, int info_only) { - int i, tag, len; + int c, tag, len; uchar data[0x10000], *dp; init_decoder(); memset (jh, 0, sizeof *jh); - for (i=0; i < 4; i++) - jh->huff[i] = free_decode; + FORC(6) jh->huff[c] = free_decode; jh->restart = INT_MAX; fread (data, 2, 1, ifp); if (data[1] != 0xd8) return 0; @@ -612,7 +611,7 @@ int CLASS ljpeg_start (struct jhead *jh, int info_only) fread (data, 1, len, ifp); switch (tag) { case 0xffc3: - jh->sraw = data[7] == 0x21; + jh->sraw = ((data[7] >> 4) * (data[7] & 15) - 1) & 3; case 0xffc0: jh->bits = data[0]; jh->high = data[1] << 8 | data[2]; @@ -629,6 +628,7 @@ int CLASS ljpeg_start (struct jhead *jh, int info_only) break; case 0xffda: jh->psv = data[1+data[0]*2]; + jh->bits -= data[3+data[0]*2] & 15; break; case 0xffdd: jh->restart = data[0] << 8 | data[1]; @@ -636,8 +636,8 @@ int CLASS ljpeg_start (struct jhead *jh, int info_only) } while (tag != 0xffda); if (info_only) return 1; if (jh->sraw) { - jh->huff[3] = jh->huff[2] = jh->huff[1]; - jh->huff[1] = jh->huff[0]; + FORC(4) jh->huff[2+c] = jh->huff[1]; + FORC(jh->sraw) jh->huff[1+c] = jh->huff[0]; } jh->row = (ushort *) calloc (jh->wide*jh->clrs, 4); merror (jh->row, "ljpeg_start()"); @@ -661,11 +661,11 @@ int CLASS ljpeg_diff (struct decode *dindex) ushort * CLASS ljpeg_row (int jrow, struct jhead *jh) { - int col, c, diff, pred; + int col, c, diff, pred, spred=0; ushort mark=0, *row[3]; if (jrow * jh->wide % jh->restart == 0) { - FORC4 jh->vpred[c] = 1 << (jh->bits-1); + FORC(6) jh->vpred[c] = 1 << (jh->bits-1); if (jrow) do mark = (mark << 8) + (c = fgetc(ifp)); while (c != EOF && mark >> 4 != 0xffd); @@ -675,8 +675,8 @@ ushort * CLASS ljpeg_row (int jrow, struct jhead *jh) for (col=0; col < jh->wide; col++) FORC(jh->clrs) { diff = ljpeg_diff (jh->huff[c]); - if (jh->sraw && c < 2 && (col | c)) - pred = row[0][(c << 1)-3]; + if (jh->sraw && c <= jh->sraw && (col | c)) + pred = spred; else if (col) pred = row[0][-jh->clrs]; else pred = (jh->vpred[c] += diff) - diff; if (jrow && col) switch (jh->psv) { @@ -690,6 +690,7 @@ ushort * CLASS ljpeg_row (int jrow, struct jhead *jh) default: pred = 0; } if ((**row = pred + diff) >> jh->bits) derror(); + if (c <= jh->sraw) spred = **row; row[0]++; row[1]++; } return row[2]; @@ -743,42 +744,57 @@ void CLASS lossless_jpeg_load_raw() void CLASS canon_sraw_load_raw() { struct jhead jh; - short *rp=0, *ip; + short *rp=0, (*ip)[4]; int jwide, slice, scol, ecol, row, col, jrow=0, jcol=0, pix[3], c; if (!ljpeg_start (&jh, 0)) return; - jwide = (jh.wide >>= 1) * 4; + jwide = (jh.wide >>= 1) * jh.clrs; for (ecol=slice=0; slice <= cr2_slice[0]; slice++) { scol = ecol; - ecol += cr2_slice[1] >> 1; - if (!cr2_slice[0] || ecol > width-1) ecol = width & -2; - for (row=0; row < height; row++) { - ip = (short *) image[row*width+scol]; - for (col=scol; col < ecol; col+=2, jcol+=4, ip+=8) { + ecol += cr2_slice[1] * 2 / jh.clrs; + if (!cr2_slice[0] || ecol > raw_width-1) ecol = raw_width & -2; + for (row=0; row < height; row += (jh.clrs >> 1) - 1) { + ip = (short (*)[4]) image + row*width; + for (col=scol; col < ecol; col+=2, jcol+=jh.clrs) { if ((jcol %= jwide) == 0) rp = (short *) ljpeg_row (jrow++, &jh); - ip[0] = rp[jcol]; - ip[4] = rp[jcol+1]; - ip[1] = (short) (rp[jcol+2] << 2) >> 2; - ip[2] = (short) (rp[jcol+3] << 2) >> 2; + if (col >= width) continue; + FORC (jh.clrs-2) + ip[col + (c >> 1)*width + (c & 1)][0] = rp[jcol+c]; + ip[col][1] = rp[jcol+jh.clrs-2] - 16384; + ip[col][2] = rp[jcol+jh.clrs-1] - 16384; } } } - for (row=0; row < height; row++) { - ip = (short *) image[row*width+1]; - for (col=1; col < width-1; col+=2, ip+=8) { - ip[1] = (ip[-3] + ip[5] + 1) >> 1; - ip[2] = (ip[-2] + ip[6] + 1) >> 1; - } - if (col < width) { ip[1] = ip[-3]; ip[2] = ip[-2]; } - ip = (short *) image[row*width]; - for (col=0; col < width; col++, ip+=4) { - pix[0] = ip[2] + ip[0]; - pix[2] = ip[1] + ip[0]; - pix[1] = ((ip[0] << 12) - ip[1]*778 - (ip[2] << 11)) >> 12; - FORC3 ip[c] = CLIP((pix[c] - 512) * sraw_mul[c] >> 10); + ip = (short (*)[4]) image; + rp = ip[0]; + for (row=0; row < height; row++, ip+=width) { + if (row & (jh.sraw >> 1)) + for (col=0; col < width; col+=2) + for (c=1; c < 3; c++) + if (row == height-1) + ip[col][c] = ip[col-width][c]; + else ip[col][c] = (ip[col-width][c] + ip[col+width][c] + 1) >> 1; + for (col=1; col < width; col+=2) + for (c=1; c < 3; c++) + if (col == width-1) + ip[col][c] = ip[col-1][c]; + else ip[col][c] = (ip[col-1][c] + ip[col+1][c] + 1) >> 1; + } + for ( ; rp < ip[0]; rp+=4) { + if (unique_id < 0x80000200) { + pix[0] = rp[0] + rp[2] - 512; + pix[2] = rp[0] + rp[1] - 512; + pix[1] = rp[0] + ((-778*rp[1] - (rp[2] << 11)) >> 12) - 512; + } else { + rp[1] += jh.sraw+1; + rp[2] += jh.sraw+1; + pix[0] = rp[0] + (( 200*rp[1] + 22929*rp[2]) >> 12); + pix[1] = rp[0] + ((-5640*rp[1] - 11751*rp[2]) >> 12); + pix[2] = rp[0] + ((29040*rp[1] - 101*rp[2]) >> 12); } + FORC3 rp[c] = CLIP(pix[c] * sraw_mul[c] >> 10); } free (jh.row); maximum = 0x3fff; @@ -1030,14 +1046,14 @@ void CLASS nikon_3700() */ int CLASS minolta_z2() { - int i; + int i, nz; char tail[424]; fseek (ifp, -sizeof tail, SEEK_END); fread (tail, 1, sizeof tail, ifp); - for (i=0; i < sizeof tail; i++) - if (tail[i]) return 1; - return 0; + for (nz=i=0; i < sizeof tail; i++) + if (tail[i]) nz++; + return nz > 20; } /* Here raw_width is in bytes, not pixels. */ @@ -1085,7 +1101,7 @@ void CLASS fuji_load_raw() } free (pixel); } -#line 1379 "dcraw/dcraw.c" +#line 1395 "dcraw/dcraw.c" void CLASS ppm_thumb (FILE *tfp) { char *thumb; @@ -1493,7 +1509,7 @@ void CLASS leaf_hdr_load_raw() } } -#line 1790 "dcraw/dcraw.c" +#line 1806 "dcraw/dcraw.c" void CLASS sinar_4shot_load_raw() { ushort *pixel; @@ -2040,7 +2056,7 @@ void CLASS kodak_jpeg_load_raw() #endif jpeg_destroy_decompress (&cinfo); throw LIBRAW_EXCEPTION_DECODE_JPEG; -#line 2339 "dcraw/dcraw.c" +#line 2355 "dcraw/dcraw.c" } buf = (*cinfo.mem->alloc_sarray) ((j_common_ptr) &cinfo, JPOOL_IMAGE, width*3, 1); @@ -2548,7 +2564,7 @@ void CLASS smal_v9_load_raw() smal_decode_segment (seg+i, holes); if (holes) fill_holes (holes); } -#line 3544 "dcraw/dcraw.c" +#line 3560 "dcraw/dcraw.c" /* Seach from the current directory up to the root looking for @@ -2564,7 +2580,7 @@ void CLASS bad_pixels (char *fname) RUN_CALLBACK(LIBRAW_PROGRESS_BAD_PIXELS,0,2); if (fname) fp = fopen (fname, "r"); -#line 3585 "dcraw/dcraw.c" +#line 3601 "dcraw/dcraw.c" if (!fp) { imgdata.process_warnings |= LIBRAW_WARN_NO_BADPIXELMAP; @@ -3855,7 +3871,7 @@ void CLASS parse_thumb_note (int base, unsigned toff, unsigned tlen) } } -#line 4879 "dcraw/dcraw.c" +#line 4895 "dcraw/dcraw.c" void CLASS parse_makernote (int base, int uptag) { static const uchar xlat[2][256] = { @@ -3951,10 +3967,11 @@ color_flags.cam_mul_state = LIBRAW_COLORSTATE_LOADED; if (tag == 2 && strstr(make,"NIKON")) iso_speed = (get2(),get2()); if (tag == 4 && len > 26 && len < 35) { - iso_speed = 50 * pow (2, (get4(),get2())/32.0 - 4); - if ((i=(get2(),get2())) != 0x7fff) + if ((i=(get4(),get2())) != 0x7fff && !iso_speed) + iso_speed = 50 * pow (2, i/32.0 - 4); + if ((i=(get2(),get2())) != 0x7fff && !aperture) aperture = pow (2, i/64.0); - if ((i=get2()) != 0xffff) + if ((i=get2()) != 0xffff && !shutter) shutter = pow (2, (short) i/-32.0); wbi = (get2(),get2()); shot_order = (get2(),get2()); @@ -4119,8 +4136,8 @@ color_flags.cam_mul_state = LIBRAW_COLORSTATE_LOADED; fseek (ifp, get4(), SEEK_SET); parse_thumb_note (base, 136, 137); } - if (tag == 0x4001 && type == 3) { - i = len == 582 ? 50 : len == 653 ? 68 : 126; + if (tag == 0x4001 && len > 500) { + i = len == 582 ? 50 : len == 653 ? 68 : len == 5120 ? 142 : 126; fseek (ifp, i, SEEK_CUR); get2_rggb: FORC4 cam_mul[c ^ (c >> 1)] = get2(); @@ -4234,7 +4251,7 @@ void CLASS parse_mos (int offset) static const char *mod[] = { "","DCB2","Volare","Cantare","CMost","Valeo 6","Valeo 11","Valeo 22", "Valeo 11p","Valeo 17","","Aptus 17","Aptus 22","Aptus 75","Aptus 65", - "Aptus 54S","Aptus 65S","Aptus 75S" }; + "Aptus 54S","Aptus 65S","Aptus 75S","AFi 5","AFi 6","AFi 7" }; float romm_cam[3][3]; fseek (ifp, offset, SEEK_SET); @@ -4338,7 +4355,7 @@ color_flags.cam_mul_state = LIBRAW_COLORSTATE_LOADED; } } } -#line 5365 "dcraw/dcraw.c" +#line 5382 "dcraw/dcraw.c" int CLASS parse_tiff_ifd (int base) { unsigned entries, tag, type, len, plen=16, save; @@ -4412,7 +4429,7 @@ color_flags.cam_mul_state = LIBRAW_COLORSTATE_LOADED; fgets (model, 64, ifp); break; case 280: /* Panasonic RW2 offset */ - if (~tiff_ifd[ifd].offset) break; + if (type != 4) break; load_raw = &CLASS panasonic_load_raw; load_flags = 0x2008; case 273: /* StripOffset */ @@ -4439,10 +4456,11 @@ color_flags.cam_mul_state = LIBRAW_COLORSTATE_LOADED; case 514: tiff_ifd[ifd].bytes = get4(); break; - case 305: /* Software */ + case 305: case 11: /* Software */ fgets (software, 64, ifp); if (!strncmp(software,"Adobe",5) || !strncmp(software,"dcraw",5) || + !strncmp(software,"UFRaw",5) || !strncmp(software,"Bibble",6) || !strncmp(software,"Nikon Scan",10) || !strcmp (software,"Digital Photo Professional")) @@ -4916,7 +4934,7 @@ color_flags.cam_mul_state = LIBRAW_COLORSTATE_LOADED; void CLASS parse_external_jpeg() { char *file, *ext, *jname, *jfile, *jext; -#line 5946 "dcraw/dcraw.c" +#line 5964 "dcraw/dcraw.c" ext = strrchr (ifname, '.'); file = strrchr (ifname, '/'); if (!file) file = strrchr (ifname, '\\'); @@ -4959,7 +4977,7 @@ void CLASS parse_external_jpeg() #endif } free (jname); -#line 5991 "dcraw/dcraw.c" +#line 6009 "dcraw/dcraw.c" } /* @@ -5303,11 +5321,19 @@ void CLASS parse_riff() order = 0x4949; fread (tag, 4, 1, ifp); size = get4(); + end = ftell(ifp) + size; if (!memcmp(tag,"RIFF",4) || !memcmp(tag,"LIST",4)) { - end = ftell(ifp) + size; get4(); while (ftell(ifp) < end) parse_riff(); + } else if (!memcmp(tag,"nctg",4)) { + while (ftell(ifp) < end) { + i = get2(); + size = get2(); + if ((i+1) >> 1 == 10 && size == 20) + get_timestamp(0); + else fseek (ifp, size, SEEK_CUR); + } } else if (!memcmp(tag,"IDIT",4) && size < 64) { fread (date, 64, 1, ifp); date[size] = 0; @@ -5392,7 +5418,7 @@ color_flags.cam_mul_state = LIBRAW_COLORSTATE_LOADED; data_offset = (INT64) get4() + 8; data_offset += (INT64) get4() << 32; } -#line 6528 "dcraw/dcraw.c" +#line 6554 "dcraw/dcraw.c" void CLASS adobe_coeff (const char *p_make, const char *p_model) { static const struct { @@ -5409,6 +5435,8 @@ void CLASS adobe_coeff (const char *p_make, const char *p_model) { 9805,-2689,-1312,-5803,13064,3068,-2438,3075,8775 } }, { "Canon EOS D60", 0, 0xfa0, { 6188,-1341,-890,-7168,14489,2937,-2640,3228,8483 } }, + { "Canon EOS 5D Mark II", 0, 0x3cf0, + { 4716,603,-830,-7798,15474,2480,-1496,1937,6651 } }, { "Canon EOS 5D", 0, 0xe6c, { 6347,-479,-972,-8297,15954,2480,-1968,2131,7649 } }, { "Canon EOS 10D", 0, 0xfa0, @@ -5421,6 +5449,8 @@ void CLASS adobe_coeff (const char *p_make, const char *p_model) { 6257,-303,-1000,-7880,15621,2396,-1714,1904,7046 } }, { "Canon EOS 40D", 0, 0x3f60, { 6071,-747,-856,-7653,15365,2441,-2025,2553,7315 } }, + { "Canon EOS 50D", 0, 0x3d93, + { 4920,616,-593,-6493,13964,2784,-1774,3178,7005 } }, { "Canon EOS 300D", 0, 0xfa0, { 8197,-2000,-1118,-6714,14335,2592,-2536,3178,8266 } }, { "Canon EOS 350D", 0, 0xfff, @@ -5430,7 +5460,7 @@ void CLASS adobe_coeff (const char *p_make, const char *p_model) { "Canon EOS 450D", 0, 0x390d, { 5784,-262,-821,-7539,15064,2672,-1982,2681,7427 } }, { "Canon EOS 1000D", 0, 0xe43, - { 7054,-1501,-990,-8156,15544,2812,-1278,1414,7796 } }, + { 6771,-1139,-977,-7818,15123,2928,-1244,1437,7533 } }, { "Canon EOS-1Ds Mark III", 0, 0x3bb0, { 5859,-211,-930,-8255,16017,2353,-1732,1887,7448 } }, { "Canon EOS-1Ds Mark II", 0, 0xe80, @@ -5451,6 +5481,8 @@ void CLASS adobe_coeff (const char *p_make, const char *p_model) { -5300,9846,1776,3436,684,3939,-5540,9879,6200,-1404,11175,217 } }, { "Canon PowerShot A5", 0, 0, { -4801,9475,1952,2926,1611,4094,-5259,10164,5947,-1554,10883,547 } }, + { "Canon PowerShot G10", 0, 0, + { 11093,-3906,-1028,-5047,12492,2879,-1003,1750,5561 } }, { "Canon PowerShot G1", 0, 0, { -4778,9467,2172,4743,-1141,4344,-5146,9908,6077,-1566,11051,557 } }, { "Canon PowerShot G2", 0, 0, @@ -5547,6 +5579,8 @@ void CLASS adobe_coeff (const char *p_make, const char *p_model) { 12343,-4515,-1285,-7165,14899,2435,-1895,2496,8800 } }, { "FUJIFILM IS-1", 0, 0, { 21461,-10807,-1441,-2332,10599,1999,289,875,7703 } }, + { "FUJIFILM IS Pro", 0, 0, + { 12300,-5110,-1304,-9117,17143,1998,-1947,2448,8100 } }, { "Imacon Ixpress", 0, 0, /* DJC */ { 7025,-1415,-704,-5188,13765,1424,-1248,2742,6038 } }, { "KODAK NC2000", 0, 0, @@ -5653,8 +5687,8 @@ void CLASS adobe_coeff (const char *p_make, const char *p_model) { 7732,-2422,-789,-8238,15884,2498,-859,783,7330 } }, { "NIKON D80", 0, 0, { 8629,-2410,-883,-9055,16940,2171,-1490,1363,8520 } }, - { "NIKON D90", 0, 0xf00, /* DJC */ - { 9692,-2519,-831,-5396,13053,2344,-1818,2682,7084 } }, + { "NIKON D90", 0, 0xf00, + { 7309,-1403,-519,-8474,16008,2622,-2434,2826,8064 } }, { "NIKON D200", 0, 0xfbc, { 8367,-2248,-763,-8758,16447,2422,-1527,1550,8053 } }, { "NIKON D300", 0, 0, @@ -5685,6 +5719,8 @@ void CLASS adobe_coeff (const char *p_make, const char *p_model) { 8489,-2583,-1036,-8051,15583,2643,-1307,1407,7354 } }, { "NIKON E8800", 0, 0, { 7971,-2314,-913,-8451,15762,2894,-1442,1520,7610 } }, + { "NIKON COOLPIX P6000", 0, 0, + { 9698,-3367,-914,-4706,12584,2368,-837,968,5801 } }, { "OLYMPUS C5050", 0, 0, { 10508,-3124,-1273,-6079,14294,1901,-1653,2306,6237 } }, { "OLYMPUS C5060", 0, 0, @@ -5751,10 +5787,14 @@ void CLASS adobe_coeff (const char *p_make, const char *p_model) { 9427,-2714,-868,-7493,16092,1373,-2199,3264,7180 } }, { "PENTAX K200D", 0, 0, { 9186,-2678,-907,-8693,16517,2260,-1129,1094,8524 } }, + { "PENTAX K2000", 0, 0, + { 11057,-3604,-1155,-5152,13046,2329,-282,375,8104 } }, { "Panasonic DMC-FZ8", 0, 0xf7f0, { 8986,-2755,-802,-6341,13575,3077,-1476,2144,6379 } }, { "Panasonic DMC-FZ18", 0, 0, { 9932,-3060,-935,-5809,13331,2753,-1267,2155,5575 } }, + { "Panasonic DMC-FZ28", 15, 0xfff, + { 10109,-3488,-993,-5412,12812,2916,-1305,2140,5543 } }, { "Panasonic DMC-FZ30", 0, 0xf94c, { 10976,-4029,-1141,-7918,15491,2600,-1670,2071,8246 } }, { "Panasonic DMC-FZ50", 0, 0xfff0, /* aka "LEICA V-LUX1" */ @@ -5769,6 +5809,12 @@ void CLASS adobe_coeff (const char *p_make, const char *p_model) { 10704,-4187,-1230,-8314,15952,2501,-920,945,8927 } }, { "Panasonic DMC-LX2", 0, 0, /* aka "LEICA D-LUX3" */ { 8048,-2810,-623,-6450,13519,3272,-1700,2146,7049 } }, + { "Panasonic DMC-LX3", 15, 0xfff, /* aka "LEICA D-LUX4" */ + { 8128,-2668,-655,-6134,13307,3161,-1782,2568,6083 } }, + { "Panasonic DMC-FX150", 15, 0xfff, + { 9082,-2907,-925,-6119,13377,3058,-1797,2641,5609 } }, + { "Panasonic DMC-G1", 15, 0xfff, + { 8199,-2065,-1056,-8124,16156,2033,-2458,3022,7220 } }, { "Phase One H 20", 0, 0, /* DJC */ { 1313,1855,-109,-6715,15908,808,-327,1840,6020 } }, { "Phase One P 2", 0, 0, @@ -5797,8 +5843,8 @@ void CLASS adobe_coeff (const char *p_make, const char *p_model) { 6038,-1484,-578,-9146,16746,2513,-875,746,7217 } }, { "SONY DSLR-A700", 254, 0x1ffe, { 5775,-805,-359,-8574,16295,2391,-1943,2341,7249 } }, - { "SONY DSLR-A900", 254, 0x1ffe, /* DJC */ - { 6971,-1730,-794,-5763,13529,2236,-1500,2251,6715 } } + { "SONY DSLR-A900", 254, 0x1ffe, + { 5209,-1072,-397,-8845,16120,2919,-1618,1803,8654 } } }; double cam_xyz[4][3]; char name[130]; @@ -6095,6 +6141,8 @@ color_flags.cam_mul_state = LIBRAW_COLORSTATE_LOADED; { height = 2616; width = 3896; } if (height == 3136 && width == 4864) /* Pentax K20D */ { height = 3124; width = 4688; } + if (height == 3014 && width == 4096) /* Ricoh GX200 */ + width = 4014; if (dng_version) { if (filters == UINT_MAX) filters = 0; if (filters) is_raw = tiff_samples; @@ -6128,6 +6176,10 @@ color_flags.cam_mul_state = LIBRAW_COLORSTATE_LOADED; load_raw = &CLASS foveon_load_raw; simple_coeff(0); } else if (is_canon && tiff_bps == 15) { + switch (width) { + case 3344: width -= 66; + case 3872: width -= 6; + } filters = 0; load_raw = &CLASS canon_sraw_load_raw; } else if (!strcmp(model,"PowerShot 600")) { @@ -6335,11 +6387,21 @@ color_flags.cam_mul_state = LIBRAW_COLORSTATE_LOADED; top_margin = 34; left_margin = 90; goto canon_cr2; + } else if (is_canon && raw_width == 4480) { + height = 3326; + width = 4432; + top_margin = 10; + left_margin = 12; + filters = 0x49494949; } else if (is_canon && raw_width == 1208) { top_margin = 51; left_margin = 62; raw_width = width *= 4; - maximum = 0x3d93; + goto canon_cr2; + } else if (is_canon && raw_width == 1448) { + top_margin = 51; + left_margin = 158; + raw_width = width *= 4; goto canon_cr2; } else if (is_canon && raw_width == 5108) { top_margin = 13; @@ -6709,6 +6771,9 @@ color_flags.pre_mul_state = LIBRAW_COLORSTATE_CONST; maximum = 0x3fff; } else if (!strcmp(make,"Leaf")) { maximum = 0x3fff; + fseek (ifp, data_offset, SEEK_SET); + if (ljpeg_start (&jh, 1) && jh.bits == 15) + maximum = 0x1fff; if (tiff_samples > 1) filters = 0; if (tiff_samples > 1 || tile_length < raw_height) load_raw = &CLASS leaf_hdr_load_raw; @@ -6772,22 +6837,21 @@ color_flags.pre_mul_state = LIBRAW_COLORSTATE_CONST; zero_is_bad = 1; adobe_coeff ("Panasonic","DMC-L1"); break; case 3304: - width -= 16; + width -= 17; zero_is_bad = 1; adobe_coeff ("Panasonic","DMC-FZ30"); break; case 3330: - width = 3291; - left_margin = 9; + width += 43; + left_margin = -6; maximum = 0xf7f0; - goto fz18; case 3370: - width = 3288; - left_margin = 15; -fz18: if (height > 2480) + width -= 82; + left_margin += 15; + if (height > 2480) height = 2480 - (top_margin = 10); filters = 0x49494949; zero_is_bad = 1; - break; + adobe_coeff ("Panasonic","DMC-FZ18"); break; case 3690: height += 36; left_margin = -14; @@ -6803,21 +6867,27 @@ fz18: if (height > 2480) case 3710: width = 3682; filters = 0x49494949; - break; + adobe_coeff ("Panasonic","DMC-L10"); break; case 3724: width -= 14; case 3836: - width += 36; - case 4060: - width -= 78; - filters = 0x16161616; - maximum = 0xfff; + width -= 42; +lx3: filters = 0x16161616; + if (make[0] != 'P') + adobe_coeff ("Panasonic","DMC-LX3"); break; case 3880: width -= 22; left_margin = 6; zero_is_bad = 1; adobe_coeff ("Panasonic","DMC-LX1"); break; + case 4060: + width = 3982; + if (height == 2250) goto lx3; + width = 4018; + filters = 0x49494949; + zero_is_bad = 1; + adobe_coeff ("Panasonic","DMC-G1"); break; case 4290: height += 38; left_margin = -14; @@ -6828,6 +6898,11 @@ fz18: if (height > 2480) top_margin = 15; left_margin += 17; adobe_coeff ("Panasonic","DMC-LX2"); break; + case 4508: + height -= 6; + width = 4429; + filters = 0x16161616; + adobe_coeff ("Panasonic","DMC-FX150"); break; } } else if (!strcmp(model,"C770UZ")) { height = 1718; @@ -7171,7 +7246,7 @@ void CLASS apply_profile (char *input, char *output) if (strcmp (input, "embed")) hInProfile = cmsOpenProfileFromFile (input, "r"); else if (profile_length) { -#line 8314 "dcraw/dcraw.c" +#line 8389 "dcraw/dcraw.c" hInProfile = cmsOpenProfileFromMem (imgdata.color.profile, profile_length); } else { @@ -7321,7 +7396,7 @@ RUN_CALLBACK(LIBRAW_PROGRESS_CONVERT_RGB,0,2); #endif memset(histogram,0,sizeof(int)*LIBRAW_HISTOGRAM_SIZE*4); -#line 8466 "dcraw/dcraw.c" +#line 8541 "dcraw/dcraw.c" for (img=image[0], row=0; row < height; row++) for (col=0; col < width; col++, img+=4) { if (!raw_color) { @@ -7462,7 +7537,7 @@ void CLASS gamma_lut (ushort lut[0x10000]) } -#line 8631 "dcraw/dcraw.c" +#line 8706 "dcraw/dcraw.c" void CLASS tiff_set (ushort *ntag, ushort tag, ushort type, int count, int val) { diff --git a/libs/libkdcraw/libraw/internal/defines.h b/libs/libkdcraw/libraw/internal/defines.h index 091c9a2e..58c999d9 100644 --- a/libs/libkdcraw/libraw/internal/defines.h +++ b/libs/libkdcraw/libraw/internal/defines.h @@ -1,6 +1,6 @@ /* GENERATED FILE, DO NOT EDIT - Generated from dcraw/dcraw.c at Thu Sep 25 11:44:51 2008 + Generated from dcraw/dcraw.c at Wed Dec 3 12:31:02 2008 Look into original file (probably http://cybercom.net/~dcoffin/dcraw/dcraw.c) for copyright information. */ @@ -8,7 +8,7 @@ #line 27 "dcraw/dcraw.c" #define NO_JPEG #line 32 "dcraw/dcraw.c" -#define VERSION "8.88" +#define VERSION "8.89" #define _GNU_SOURCE #define _USE_MATH_DEFINES diff --git a/libs/libkdcraw/libraw/internal/foveon.cpp b/libs/libkdcraw/libraw/internal/foveon.cpp index 3427f1a3..c18e8923 100644 --- a/libs/libkdcraw/libraw/internal/foveon.cpp +++ b/libs/libkdcraw/libraw/internal/foveon.cpp @@ -1,11 +1,11 @@ /* GENERATED FILE, DO NOT EDIT - Generated from dcraw/dcraw.c at Thu Sep 25 11:44:51 2008 + Generated from dcraw/dcraw.c at Wed Dec 3 12:31:02 2008 Look into original file (probably http://cybercom.net/~dcoffin/dcraw/dcraw.c) for copyright information. */ -#line 2848 "dcraw/dcraw.c" +#line 2864 "dcraw/dcraw.c" #define CLASS LibRaw:: #include "libraw/libraw_types.h" #define LIBRAW_LIBRARY_BUILD @@ -16,7 +16,7 @@ #define SRC_USES_CURVE #include "internal/var_defines.h" #define sget4(s) sget4((uchar *)s) -#line 2860 "dcraw/dcraw.c" +#line 2876 "dcraw/dcraw.c" /* RESTRICTED code starts here */ @@ -38,7 +38,7 @@ void CLASS foveon_decoder (unsigned size, unsigned code) cur = free_decode++; if (free_decode > first_decode+2048) { throw LIBRAW_EXCEPTION_DECODE_RAW; -#line 2885 "dcraw/dcraw.c" +#line 2901 "dcraw/dcraw.c" } if (code) for (i=0; i < size; i++) @@ -270,12 +270,12 @@ int CLASS foveon_apply_curve (short *curve, int i) return i < 0 ? -curve[1-i] : curve[1+i]; } -#line 3119 "dcraw/dcraw.c" +#line 3135 "dcraw/dcraw.c" #ifdef image #undef image #endif #define image ((short(*)[4]) imgdata.image) -#line 3126 "dcraw/dcraw.c" +#line 3142 "dcraw/dcraw.c" void CLASS foveon_interpolate() { @@ -692,7 +692,7 @@ RUN_CALLBACK(LIBRAW_PROGRESS_FOVEON_INTERPOLATE,8,9); #undef image /* RESTRICTED code ends here */ -#line 6426 "dcraw/dcraw.c" +#line 6452 "dcraw/dcraw.c" char * CLASS foveon_gets (int offset, char *str, int len) { int i; diff --git a/libs/libkdcraw/libraw/libraw/libraw_internal.h b/libs/libkdcraw/libraw/libraw/libraw_internal.h index 3e004a01..f2b7197e 100644 --- a/libs/libkdcraw/libraw/libraw/libraw_internal.h +++ b/libs/libkdcraw/libraw/libraw/libraw_internal.h @@ -174,8 +174,8 @@ struct tiff_ifd_t struct jhead { - int bits, high, wide, clrs, sraw, psv, restart, vpred[4]; - struct decode *huff[4]; + int bits, high, wide, clrs, sraw, psv, restart, vpred[6]; + struct decode *huff[6]; ushort *row; }; struct tiff_tag { diff --git a/libs/libkdcraw/libraw/src/libraw_cxx.cpp b/libs/libkdcraw/libraw/src/libraw_cxx.cpp index 068b12c6..534195c1 100644 --- a/libs/libkdcraw/libraw/src/libraw_cxx.cpp +++ b/libs/libkdcraw/libraw/src/libraw_cxx.cpp @@ -1031,6 +1031,7 @@ static const char *static_camera_list[] = "Canon PowerShot G6", "Canon PowerShot G7 (CHDK hack)", "Canon PowerShot G9", +"Canon PowerShot G10", "Canon PowerShot S2 IS (CHDK hack)", "Canon PowerShot S3 IS (CHDK hack)", "Canon PowerShot S5 IS (CHDK hack)", @@ -1045,6 +1046,7 @@ static const char *static_camera_list[] = "Canon EOS D30", "Canon EOS D60", "Canon EOS 5D", +"Canon EOS 5D Mark II", "Canon EOS 10D", "Canon EOS 20D", "Canon EOS 30D", @@ -1145,6 +1147,7 @@ static const char *static_camera_list[] = "Kodak KAI-0340", "Konica KD-400Z", "Konica KD-510Z", +"Leaf AFi 7", "Leaf Aptus 17", "Leaf Aptus 22", "Leaf Aptus 54S", @@ -1164,6 +1167,7 @@ static const char *static_camera_list[] = "Leica Digilux 3", "Leica D-LUX2", "Leica D-LUX3", +"Leica D-LUX4", "Leica V-LUX1", "Logitech Fotoman Pixtura", "Mamiya ZD", @@ -1257,6 +1261,8 @@ static const char *static_camera_list[] = "Panasonic DMC-FZ28", "Panasonic DMC-FZ30", "Panasonic DMC-FZ50", +"Panasonic DMC-FX150", +"Panasonic DMC-G1", "Panasonic DMC-L1", "Panasonic DMC-L10", "Panasonic DMC-LC1", -- 2.11.4.GIT