diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index 8ebc073d1..bae38b193 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -10,6 +10,7 @@ /*RT*/#define LOCALTIME /*RT*/#define DJGPP +#include "opthelper.h" /* dcraw.c -- Dave Coffin's raw photo decoder Copyright 1997-2016 by Dave Coffin, dcoffin a cybercom o net @@ -551,13 +552,13 @@ int CLASS canon_s2is() return 0; } -unsigned CLASS getbithuff_t::operator() (int nbits, ushort *huff) +inline unsigned CLASS getbithuff_t::operator() (int nbits, ushort *huff) { /*RT static unsigned bitbuf=0; */ /*RT static int vbits=0, reset=0; */ unsigned c; - if (nbits > 25) return 0; + if (UNLIKELY(nbits > 25)) return 0; if (nbits < 0) return bitbuf = vbits = reset = 0; if (nbits == 0 || vbits < 0) return 0; @@ -828,7 +829,7 @@ int CLASS ljpeg_start (struct jhead *jh, int info_only) 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); + jh->row = (ushort *) calloc (2 * jh->wide*jh->clrs, 4); merror (jh->row, "ljpeg_start()"); return zero_after_ff = 1; } @@ -840,7 +841,7 @@ void CLASS ljpeg_end (struct jhead *jh) free (jh->row); } -int CLASS ljpeg_diff (ushort *huff) +inline int CLASS ljpeg_diff (ushort *huff) { int len, diff; @@ -867,7 +868,7 @@ ushort * CLASS ljpeg_row (int jrow, struct jhead *jh) } getbits(-1); } - FORC3 row[c] = jh->row + jh->wide*jh->clrs*((jrow+c) & 1); + FORC3 row[c] = (jh->row + ((jrow & 1) + 1) * (jh->wide*jh->clrs*((jrow+c) & 1))); for (col=0; col < jh->wide; col++) FORC(jh->clrs) { diff = ljpeg_diff (jh->huff[c]); @@ -875,8 +876,7 @@ ushort * CLASS ljpeg_row (int jrow, struct jhead *jh) pred = spred; else if (col) pred = row[0][-jh->clrs]; else pred = (jh->vpred[c] += diff) - diff; - if (jrow && col) switch (jh->psv) { - case 1: break; + if (jh->psv != 1 && jrow && col) switch (jh->psv) { case 2: pred = row[1][0]; break; case 3: pred = row[1][-jh->clrs]; break; case 4: pred = pred + row[1][0] - row[1][-jh->clrs]; break; @@ -885,7 +885,7 @@ ushort * CLASS ljpeg_row (int jrow, struct jhead *jh) case 7: pred = (pred + row[1][0]) >> 1; break; default: pred = 0; } - if ((**row = pred + diff) >> jh->bits) derror(); + if (UNLIKELY((**row = pred + diff) >> jh->bits)) derror(); if (c <= jh->sraw) spred = **row; row[0]++; row[1]++; } @@ -894,22 +894,39 @@ ushort * CLASS ljpeg_row (int jrow, struct jhead *jh) void CLASS lossless_jpeg_load_raw() { - int jwide, jrow, jcol, val, jidx, i, j, row=0, col=0; struct jhead jh; - ushort *rp; if (!ljpeg_start (&jh, 0)) return; - jwide = jh.wide * jh.clrs; + int jwide = jh.wide * jh.clrs; + ushort *rp[2]; + rp[0] = ljpeg_row (0, &jh); + + for (int jrow=0; jrow < jh.high; jrow++) { +#ifdef _OPENMP +#pragma omp parallel sections +#endif +{ +#ifdef _OPENMP + #pragma omp section +#endif + { + if(jrow < jh.high - 1) + rp[(jrow + 1)&1] = ljpeg_row (jrow + 1, &jh); + } +#ifdef _OPENMP + #pragma omp section +#endif + { + int row=0, col=0; - for (jrow=0; jrow < jh.high; jrow++) { - rp = ljpeg_row (jrow, &jh); if (load_flags & 1) row = jrow & 1 ? height-1-jrow/2 : jrow/2; - for (jcol=0; jcol < jwide; jcol++) { - val = curve[*rp++]; + for (int jcol=0; jcol < jwide; jcol++) { + int val = curve[*rp[jrow&1]++]; if (cr2_slice[0]) { - jidx = jrow*jwide + jcol; - i = jidx / (cr2_slice[1]*raw_height); + int jidx = jrow*jwide + jcol; + int i = jidx / (cr2_slice[1]*raw_height); + int j; if ((j = i >= cr2_slice[0])) i = cr2_slice[0]; jidx -= i * (cr2_slice[1]*raw_height); @@ -922,6 +939,8 @@ void CLASS lossless_jpeg_load_raw() if (++col >= raw_width) col = (row++,0); } + } +} } ljpeg_end (&jh); } @@ -9297,13 +9316,15 @@ konica_400z: width -= 6; } else if (!strcmp(make,"Sony") && raw_width == 7392) { width -= 30; - } else if (!strcmp(make,"Sony") && raw_width == 8000) { - width -= 32; - if (!strncmp(model,"DSC",3)) { - tiff_bps = 14; - load_raw = &CLASS unpacked_load_raw; - black = 512; - } +// this was introduced with update to dcraw 9.27 +// but led to broken decode for compressed files from Sony DSC-RX1RM2 +// } else if (!strcmp(make,"Sony") && raw_width == 8000) { +// width -= 32; +// if (!strncmp(model,"DSC",3)) { +// tiff_bps = 14; +// load_raw = &CLASS unpacked_load_raw; +// black = 512; +// } } else if (!strcmp(model,"DSLR-A100")) { if (width == 3880) { height--; diff --git a/rtengine/dcraw.patch b/rtengine/dcraw.patch index 2b4ee4102..baa0af282 100644 --- a/rtengine/dcraw.patch +++ b/rtengine/dcraw.patch @@ -1,6 +1,6 @@ ---- dcraw.c 2016-05-29 22:32:01.173135400 +0200 -+++ dcraw.cc 2016-05-29 21:57:44.144527700 +0200 -@@ -1,3 +1,15 @@ +--- dcraw.c 2016-06-24 11:50:34 +0000 ++++ dcraw.cc 2016-06-24 12:40:36 +0000 +@@ -1,3 +1,16 @@ +/*RT*/#include +/*RT*/#include +/*RT*/#undef MAX @@ -13,10 +13,11 @@ +/*RT*/#define LOCALTIME +/*RT*/#define DJGPP + ++#include "opthelper.h" /* dcraw.c -- Dave Coffin's raw photo decoder Copyright 1997-2016 by Dave Coffin, dcoffin a cybercom o net -@@ -29,17 +41,17 @@ +@@ -29,17 +42,17 @@ #define _GNU_SOURCE #endif #define _USE_MATH_DEFINES @@ -44,7 +45,7 @@ #include #if defined(DJGPP) || defined(__MINGW32__) -@@ -54,7 +66,6 @@ +@@ -54,7 +67,6 @@ #ifdef WIN32 #include #include @@ -52,7 +53,7 @@ #define snprintf _snprintf #define strcasecmp stricmp #define strncasecmp strnicmp -@@ -89,89 +100,38 @@ +@@ -89,89 +101,38 @@ #define _(String) (String) #endif @@ -157,7 +158,7 @@ #define SWAP(a,b) { a=a+b; b=a-b; a=a-b; } /* -@@ -247,6 +207,7 @@ +@@ -247,6 +208,7 @@ if (filters == 1) return filter[(row+top_margin)&15][(col+left_margin)&15]; if (filters == 9) return xtrans[(row+6) % 6][(col+6) % 6]; @@ -165,7 +166,7 @@ return FC(row,col); } -@@ -289,6 +250,7 @@ +@@ -289,6 +251,7 @@ fprintf (stderr,_("Corrupt data near 0x%llx\n"), (INT64) ftello(ifp)); } data_error++; @@ -173,7 +174,7 @@ } ushort CLASS sget2 (uchar *s) -@@ -362,7 +324,7 @@ +@@ -362,7 +325,7 @@ { if (fread (pixel, 2, count, ifp) < count) derror(); if ((order == 0x4949) == (ntohs(0x1234) == 0x1234)) @@ -182,12 +183,12 @@ } void CLASS cubic_spline (const int *x_, const int *y_, const int len) -@@ -589,10 +551,10 @@ +@@ -589,13 +552,13 @@ return 0; } -unsigned CLASS getbithuff (int nbits, ushort *huff) -+unsigned CLASS getbithuff_t::operator() (int nbits, ushort *huff) ++inline unsigned CLASS getbithuff_t::operator() (int nbits, ushort *huff) { - static unsigned bitbuf=0; - static int vbits=0, reset=0; @@ -195,8 +196,12 @@ +/*RT static int vbits=0, reset=0; */ unsigned c; - if (nbits > 25) return 0; -@@ -805,9 +767,13 @@ +- if (nbits > 25) return 0; ++ if (UNLIKELY(nbits > 25)) return 0; + if (nbits < 0) + return bitbuf = vbits = reset = 0; + if (nbits == 0 || vbits < 0) return 0; +@@ -805,9 +768,13 @@ FORC(2) free (huff[c]); } @@ -212,7 +217,7 @@ }; int CLASS ljpeg_start (struct jhead *jh, int info_only) -@@ -828,9 +794,9 @@ +@@ -828,9 +795,9 @@ switch (tag) { case 0xffc3: jh->sraw = ((data[7] >> 4) * (data[7] & 15) - 1) & 3; @@ -224,7 +229,111 @@ jh->bits = data[0]; jh->high = data[1] << 8 | data[2]; jh->wide = data[3] << 8 | data[4]; -@@ -1124,8 +1090,7 @@ +@@ -862,7 +829,7 @@ + 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); ++ jh->row = (ushort *) calloc (2 * jh->wide*jh->clrs, 4); + merror (jh->row, "ljpeg_start()"); + return zero_after_ff = 1; + } +@@ -874,7 +841,7 @@ + free (jh->row); + } + +-int CLASS ljpeg_diff (ushort *huff) ++inline int CLASS ljpeg_diff (ushort *huff) + { + int len, diff; + +@@ -901,7 +868,7 @@ + } + getbits(-1); + } +- FORC3 row[c] = jh->row + jh->wide*jh->clrs*((jrow+c) & 1); ++ FORC3 row[c] = (jh->row + ((jrow & 1) + 1) * (jh->wide*jh->clrs*((jrow+c) & 1))); + for (col=0; col < jh->wide; col++) + FORC(jh->clrs) { + diff = ljpeg_diff (jh->huff[c]); +@@ -909,8 +876,7 @@ + pred = spred; + else if (col) pred = row[0][-jh->clrs]; + else pred = (jh->vpred[c] += diff) - diff; +- if (jrow && col) switch (jh->psv) { +- case 1: break; ++ if (jh->psv != 1 && jrow && col) switch (jh->psv) { + case 2: pred = row[1][0]; break; + case 3: pred = row[1][-jh->clrs]; break; + case 4: pred = pred + row[1][0] - row[1][-jh->clrs]; break; +@@ -919,7 +885,7 @@ + case 7: pred = (pred + row[1][0]) >> 1; break; + default: pred = 0; + } +- if ((**row = pred + diff) >> jh->bits) derror(); ++ if (UNLIKELY((**row = pred + diff) >> jh->bits)) derror(); + if (c <= jh->sraw) spred = **row; + row[0]++; row[1]++; + } +@@ -928,22 +894,39 @@ + + void CLASS lossless_jpeg_load_raw() + { +- int jwide, jrow, jcol, val, jidx, i, j, row=0, col=0; + struct jhead jh; +- ushort *rp; + + if (!ljpeg_start (&jh, 0)) return; +- jwide = jh.wide * jh.clrs; ++ int jwide = jh.wide * jh.clrs; ++ ushort *rp[2]; ++ rp[0] = ljpeg_row (0, &jh); ++ ++ for (int jrow=0; jrow < jh.high; jrow++) { ++#ifdef _OPENMP ++#pragma omp parallel sections ++#endif ++{ ++#ifdef _OPENMP ++ #pragma omp section ++#endif ++ { ++ if(jrow < jh.high - 1) ++ rp[(jrow + 1)&1] = ljpeg_row (jrow + 1, &jh); ++ } ++#ifdef _OPENMP ++ #pragma omp section ++#endif ++ { ++ int row=0, col=0; + +- for (jrow=0; jrow < jh.high; jrow++) { +- rp = ljpeg_row (jrow, &jh); + if (load_flags & 1) + row = jrow & 1 ? height-1-jrow/2 : jrow/2; +- for (jcol=0; jcol < jwide; jcol++) { +- val = curve[*rp++]; ++ for (int jcol=0; jcol < jwide; jcol++) { ++ int val = curve[*rp[jrow&1]++]; + if (cr2_slice[0]) { +- jidx = jrow*jwide + jcol; +- i = jidx / (cr2_slice[1]*raw_height); ++ int jidx = jrow*jwide + jcol; ++ int i = jidx / (cr2_slice[1]*raw_height); ++ int j; + if ((j = i >= cr2_slice[0])) + i = cr2_slice[0]; + jidx -= i * (cr2_slice[1]*raw_height); +@@ -956,6 +939,8 @@ + if (++col >= raw_width) + col = (row++,0); + } ++ } ++} + } + ljpeg_end (&jh); + } +@@ -1124,8 +1109,7 @@ if (++col >= tile_width || col >= raw_width) row += 1 + (col = 0); } @@ -234,7 +343,7 @@ fseek (ifp, save+4, SEEK_SET); if ((tcol += tile_width) >= raw_width) trow += tile_length + (tcol = 0); -@@ -1332,14 +1297,14 @@ +@@ -1332,14 +1316,14 @@ int i, nz; char tail[424]; @@ -251,7 +360,7 @@ void CLASS ppm_thumb() { -@@ -1701,10 +1666,10 @@ +@@ -1701,10 +1685,10 @@ } } @@ -265,7 +374,7 @@ unsigned c; if (nbits == -1) -@@ -1779,6 +1744,338 @@ +@@ -1779,6 +1763,338 @@ maximum = 0xfffc - ph1.black; } @@ -604,7 +713,7 @@ void CLASS hasselblad_load_raw() { struct jhead jh; -@@ -2002,10 +2299,10 @@ +@@ -2002,10 +2318,10 @@ maximum = curve[0x3ff]; } @@ -618,7 +727,7 @@ int byte; if (!nbits) return vbits=0; -@@ -2188,7 +2485,7 @@ +@@ -2188,7 +2504,7 @@ void CLASS kodak_radc_load_raw() { @@ -627,7 +736,7 @@ 1,1, 2,3, 3,4, 4,2, 5,7, 6,5, 7,6, 7,8, 1,0, 2,1, 3,3, 4,4, 5,2, 6,7, 7,6, 8,5, 8,8, 2,1, 2,3, 3,0, 3,2, 3,4, 4,6, 5,5, 6,7, 6,8, -@@ -2294,11 +2591,11 @@ +@@ -2294,11 +2610,11 @@ METHODDEF(boolean) fill_input_buffer (j_decompress_ptr cinfo) { @@ -641,7 +750,7 @@ cinfo->src->next_input_byte = jpeg_buffer; cinfo->src->bytes_in_buffer = nbytes; return TRUE; -@@ -2648,10 +2945,9 @@ +@@ -2648,10 +2964,9 @@ maximum = (1 << (thumb_misc & 31)) - 1; } @@ -654,7 +763,7 @@ if (start) { for (p=0; p < 4; p++) pad[p] = key = key * 48828125 + 1; -@@ -2736,11 +3032,13 @@ +@@ -2736,11 +3051,13 @@ bit += 7; } for (i=0; i < 16; i++, col+=2) @@ -669,7 +778,7 @@ } void CLASS samsung_load_raw() -@@ -3038,7 +3336,7 @@ +@@ -3038,7 +3355,7 @@ void CLASS foveon_decoder (unsigned size, unsigned code) { @@ -678,7 +787,7 @@ struct decode *cur; int i, len; -@@ -3135,7 +3433,7 @@ +@@ -3135,7 +3452,7 @@ pred[c] += diff[dindex->leaf]; if (pred[c] >> 16 && ~pred[c] >> 16) derror(); } @@ -687,7 +796,7 @@ } } } -@@ -3746,6 +4044,8 @@ +@@ -3746,6 +4063,8 @@ if (load_raw == &CLASS phase_one_load_raw || load_raw == &CLASS phase_one_load_raw_c) phase_one_correct(); @@ -696,7 +805,7 @@ if (fuji_width) { for (row=0; row < raw_height-top_margin*2; row++) { for (col=0; col < fuji_width << !fuji_layout; col++) { -@@ -3761,10 +4061,13 @@ +@@ -3761,10 +4080,13 @@ } } } else { @@ -712,7 +821,7 @@ if (mask[0][3] > 0) goto mask_set; if (load_raw == &CLASS canon_load_raw || load_raw == &CLASS lossless_jpeg_load_raw) { -@@ -4366,239 +4669,8 @@ +@@ -4366,239 +4688,8 @@ } } @@ -904,11 +1013,11 @@ - int dir[5] = { 1, width, -1, -width, 1 }; - int row, col, diff[2], guess[2], c, d, i; - ushort (*pix)[4]; -+/* RT: delete interpolation functions */ - +- - border_interpolate(3); - if (verbose) fprintf (stderr,_("PPG interpolation...\n")); -- ++/* RT: delete interpolation functions */ + -/* Fill in the green layer with gradients and pattern recognition: */ - for (row=3; row < height-3; row++) - for (col=3+(FC(row,3) & 1), c=FC(row,col); col < width-3; col+=2) { @@ -953,7 +1062,7 @@ void CLASS cielab (ushort rgb[3], short lab[3]) { -@@ -4864,112 +4936,7 @@ +@@ -4864,112 +4955,7 @@ } #undef fcol @@ -979,10 +1088,10 @@ - rgb = (ushort(*)[TS][TS][3]) buffer; - lab = (short (*)[TS][TS][3])(buffer + 12*TS*TS); - homo = (char (*)[TS][TS]) (buffer + 24*TS*TS); - +- - for (top=2; top < height-5; top += TS-6) - for (left=2; left < width-5; left += TS-6) { -- + -/* Interpolate green horizontally and vertically: */ - for (row=top; row < top+TS && row < height-2; row++) { - col = left + (FC(row,left) & 1); @@ -1066,7 +1175,7 @@ #undef TS void CLASS median_filter() -@@ -5139,7 +5106,7 @@ +@@ -5139,7 +5125,7 @@ } } @@ -1075,7 +1184,7 @@ void CLASS parse_makernote (int base, int uptag) { -@@ -5244,6 +5211,11 @@ +@@ -5244,6 +5230,11 @@ tag |= uptag << 16; if (tag == 2 && strstr(make,"NIKON") && !iso_speed) iso_speed = (get2(),get2()); @@ -1087,7 +1196,7 @@ if (tag == 4 && len > 26 && len < 35) { if ((i=(get4(),get2())) != 0x7fff && !iso_speed) iso_speed = 50 * pow (2, i/32.0 - 4); -@@ -5296,12 +5268,16 @@ +@@ -5296,12 +5287,16 @@ cam_mul[2] = get4() << 2; } } @@ -1105,7 +1214,7 @@ if (tag == 0x1d) while ((c = fgetc(ifp)) && c != EOF) serial = serial*10 + (isdigit(c) ? c - '0' : c % 10); -@@ -5491,14 +5467,14 @@ +@@ -5491,14 +5486,14 @@ while (entries--) { tiff_get (base, &tag, &type, &len, &save); switch (tag) { @@ -1123,7 +1232,7 @@ shutter = pow (2, expo); break; case 37378: aperture = pow (2, getreal(type)/2); break; case 37386: focal_len = getreal(type); break; -@@ -5667,28 +5643,33 @@ +@@ -5667,28 +5662,33 @@ } } @@ -1163,7 +1272,7 @@ entries = get2(); if (entries > 512) return 1; while (entries--) { -@@ -5758,7 +5739,8 @@ +@@ -5758,7 +5758,8 @@ fgets (make, 64, ifp); break; case 272: /* Model */ @@ -1173,7 +1282,7 @@ break; case 280: /* Panasonic RW2 offset */ if (type != 4) break; -@@ -5818,6 +5800,9 @@ +@@ -5818,6 +5819,9 @@ case 315: /* Artist */ fread (artist, 64, 1, ifp); break; @@ -1183,7 +1292,7 @@ case 322: /* TileWidth */ tiff_ifd[ifd].tile_width = getint(type); break; -@@ -5833,6 +5818,9 @@ +@@ -5833,6 +5837,9 @@ is_raw = 5; } break; @@ -1193,7 +1302,7 @@ case 330: /* SubIFDs */ if (!strcmp(model,"DSLR-A100") && tiff_ifd[ifd].width == 3872) { load_raw = &CLASS sony_arw_load_raw; -@@ -5846,6 +5834,9 @@ +@@ -5846,6 +5853,9 @@ fseek (ifp, i+4, SEEK_SET); } break; @@ -1203,7 +1312,7 @@ case 400: strcpy (make, "Sarnoff"); maximum = 0xfff; -@@ -6063,12 +6054,21 @@ +@@ -6063,12 +6073,21 @@ case 61450: cblack[4] = cblack[5] = MIN(sqrt(len),64); case 50714: /* BlackLevel */ @@ -1231,7 +1340,7 @@ case 50715: /* BlackLevelDeltaH */ case 50716: /* BlackLevelDeltaV */ for (num=i=0; i < (len & 0xffff); i++) -@@ -6085,13 +6085,13 @@ +@@ -6085,13 +6104,13 @@ case 50721: /* ColorMatrix1 */ case 50722: /* ColorMatrix2 */ FORCC for (j=0; j < 3; j++) @@ -1247,7 +1356,7 @@ break; case 50727: /* AnalogBalance */ FORCC ab[c] = getreal(type); -@@ -6114,6 +6114,11 @@ +@@ -6114,6 +6133,11 @@ case 50752: read_shorts (cr2_slice, 3); break; @@ -1259,7 +1368,7 @@ case 50829: /* ActiveArea */ top_margin = getint(type); left_margin = getint(type); -@@ -6146,21 +6151,27 @@ +@@ -6146,21 +6170,27 @@ fread (buf, sony_length, 1, ifp); sony_decrypt (buf, sony_length/4, 1, sony_key); sfp = ifp; @@ -1295,7 +1404,7 @@ cam_xyz_coeff (cmatrix, cam_xyz); } if (asn[0]) { -@@ -6168,13 +6179,14 @@ +@@ -6168,13 +6198,14 @@ FORCC cam_mul[c] = 1 / asn[c]; } if (!use_cm) @@ -1311,7 +1420,7 @@ fseek (ifp, base, SEEK_SET); order = get2(); -@@ -6206,6 +6218,7 @@ +@@ -6206,6 +6237,7 @@ shutter = tiff_ifd[i].shutter; tiff_ifd[i].shutter = shutter; } @@ -1319,7 +1428,7 @@ for (i=0; i < tiff_nifds; i++) { if (max_samp < tiff_ifd[i].samples) max_samp = tiff_ifd[i].samples; -@@ -6266,7 +6279,12 @@ +@@ -6266,7 +6298,12 @@ case 8: load_raw = &CLASS eight_bit_load_raw; break; case 12: if (tiff_ifd[raw].phint == 2) load_flags = 6; @@ -1333,7 +1442,7 @@ case 14: load_flags = 0; case 16: load_raw = &CLASS unpacked_load_raw; if (!strncmp(make,"OLYMPUS",7) && -@@ -6305,6 +6323,7 @@ +@@ -6305,6 +6342,7 @@ case 32803: load_raw = &CLASS kodak_65000_load_raw; } case 32867: case 34892: break; @@ -1341,7 +1450,7 @@ default: is_raw = 0; } if (!dng_version) -@@ -6390,7 +6409,7 @@ +@@ -6390,7 +6428,7 @@ { const char *file, *ext; char *jname, *jfile, *jext; @@ -1350,7 +1459,7 @@ ext = strrchr (ifname, '.'); file = strrchr (ifname, '/'); -@@ -6412,13 +6431,14 @@ +@@ -6412,13 +6450,14 @@ } else while (isdigit(*--jext)) { if (*jext != '9') { @@ -1367,7 +1476,7 @@ if (verbose) fprintf (stderr,_("Reading metadata from %s ...\n"), jname); parse_tiff (12); -@@ -6693,6 +6713,7 @@ +@@ -6693,6 +6732,7 @@ load_raw = ph1.format < 3 ? &CLASS phase_one_load_raw : &CLASS phase_one_load_raw_c; maximum = 0xffff; @@ -1375,7 +1484,7 @@ strcpy (make, "Phase One"); if (model[0]) return; switch (raw_height) { -@@ -6761,7 +6782,11 @@ +@@ -6761,7 +6801,11 @@ order = get2(); hlen = get4(); if (get4() == 0x48454150) /* "HEAP" */ @@ -1387,7 +1496,7 @@ if (parse_tiff (save+6)) apply_tiff(); fseek (ifp, save+len, SEEK_SET); } -@@ -7033,7 +7058,8 @@ +@@ -7033,7 +7077,8 @@ { static const struct { const char *prefix; @@ -1397,7 +1506,7 @@ } table[] = { { "AgfaPhoto DC-833m", 0, 0, /* DJC */ { 11438,-3762,-1115,-2409,9914,2497,-1227,2295,5300 } }, -@@ -7977,12 +8003,12 @@ +@@ -7977,12 +8022,12 @@ { 6596,-2079,-562,-4782,13016,1933,-970,1581,5181 } }, { "Sony DSC-RX100", 0, 0, { 8651,-2754,-1057,-3464,12207,1373,-568,1398,4434 } }, @@ -1412,7 +1521,7 @@ { "Sony DSLR-A100", 0, 0xfeb, { 9437,-2811,-774,-8405,16215,2290,-710,596,7181 } }, { "Sony DSLR-A290", 0, 0, -@@ -8088,6 +8114,33 @@ +@@ -8088,6 +8133,33 @@ } break; } @@ -1446,7 +1555,7 @@ } void CLASS simple_coeff (int index) -@@ -8410,7 +8463,7 @@ +@@ -8410,7 +8482,7 @@ tiff_flip = flip = filters = UINT_MAX; /* unknown */ raw_height = raw_width = fuji_width = fuji_layout = cr2_slice[0] = 0; maximum = height = width = top_margin = left_margin = 0; @@ -1455,7 +1564,7 @@ iso_speed = shutter = aperture = focal_len = unique_id = 0; tiff_nifds = 0; memset (tiff_ifd, 0, sizeof tiff_ifd); -@@ -8442,13 +8495,20 @@ +@@ -8442,13 +8514,20 @@ fread (head, 1, 32, ifp); fseek (ifp, 0, SEEK_END); flen = fsize = ftell(ifp); @@ -1478,7 +1587,7 @@ parse_ciff (hlen, flen-hlen, 0); load_raw = &CLASS canon_load_raw; } else if (parse_tiff(0)) apply_tiff(); -@@ -8494,6 +8554,7 @@ +@@ -8494,6 +8573,7 @@ fseek (ifp, 100+28*(shot_select > 0), SEEK_SET); parse_tiff (data_offset = get4()); parse_tiff (thumb_offset+12); @@ -1486,7 +1595,7 @@ apply_tiff(); } else if (!memcmp (head,"RIFF",4)) { fseek (ifp, 0, SEEK_SET); -@@ -8607,9 +8668,10 @@ +@@ -8607,9 +8687,10 @@ if (make[0] == 0) parse_smal (0, flen); if (make[0] == 0) { parse_jpeg(0); @@ -1500,7 +1609,7 @@ strcpy (make, "OmniVision"); data_offset = ftell(ifp) + 0x8000-32; width = raw_width; -@@ -8618,6 +8680,7 @@ +@@ -8618,6 +8699,7 @@ filters = 0x16161616; } else is_raw = 0; } @@ -1508,7 +1617,7 @@ for (i=0; i < sizeof corp / sizeof *corp; i++) if (strcasestr (make, corp[i])) /* Simplify company names */ -@@ -8649,7 +8712,7 @@ +@@ -8649,7 +8731,7 @@ if (height == 3136 && width == 4864) /* Pentax K20D and Samsung GX20 */ { height = 3124; width = 4688; filters = 0x16161616; } if (width == 4352 && (!strcmp(model,"K-r") || !strcmp(model,"K-x"))) @@ -1517,7 +1626,7 @@ if (width >= 4960 && !strncmp(model,"K-5",3)) { left_margin = 10; width = 4950; filters = 0x16161616; } if (width == 4736 && !strcmp(model,"K-7")) -@@ -8669,6 +8732,7 @@ +@@ -8669,6 +8751,7 @@ case 0: case 1: load_raw = &CLASS packed_dng_load_raw; break; case 7: load_raw = &CLASS lossless_dng_load_raw; break; @@ -1525,7 +1634,7 @@ case 34892: load_raw = &CLASS lossy_dng_load_raw; break; default: load_raw = 0; } -@@ -8725,6 +8789,7 @@ +@@ -8725,6 +8808,7 @@ if (height > width) pixel_aspect = 2; filters = 0; simple_coeff(0); @@ -1533,7 +1642,7 @@ } else if (!strcmp(make,"Canon") && tiff_bps == 15) { switch (width) { case 3344: width -= 66; -@@ -9034,24 +9099,53 @@ +@@ -9034,24 +9118,53 @@ if (load_raw == &CLASS lossless_jpeg_load_raw) load_raw = &CLASS hasselblad_load_raw; if (raw_width == 7262) { @@ -1592,7 +1701,7 @@ } else if (raw_width == 4090) { strcpy (model, "V96C"); height -= (top_margin = 6); -@@ -9109,6 +9203,7 @@ +@@ -9109,6 +9222,7 @@ filters = 0x16161616; } } else if (!strcmp(make,"Leica") || !strcmp(make,"Panasonic")) { @@ -1600,7 +1709,7 @@ if ((flen - data_offset) / (raw_width*8/7) == raw_height) load_raw = &CLASS panasonic_load_raw; if (!load_raw) { -@@ -9126,6 +9221,7 @@ +@@ -9126,6 +9240,7 @@ } filters = 0x01010101 * (uchar) "\x94\x61\x49\x16" [((filters-1) ^ (left_margin & 1) ^ (top_margin << 1)) & 3]; @@ -1608,7 +1717,30 @@ } else if (!strcmp(model,"C770UZ")) { height = 1718; width = 2304; -@@ -9357,6 +9453,18 @@ +@@ -9201,13 +9316,15 @@ + width -= 6; + } else if (!strcmp(make,"Sony") && raw_width == 7392) { + width -= 30; +- } else if (!strcmp(make,"Sony") && raw_width == 8000) { +- width -= 32; +- if (!strncmp(model,"DSC",3)) { +- tiff_bps = 14; +- load_raw = &CLASS unpacked_load_raw; +- black = 512; +- } ++// this was introduced with update to dcraw 9.27 ++// but led to broken decode for compressed files from Sony DSC-RX1RM2 ++// } else if (!strcmp(make,"Sony") && raw_width == 8000) { ++// width -= 32; ++// if (!strncmp(model,"DSC",3)) { ++// tiff_bps = 14; ++// load_raw = &CLASS unpacked_load_raw; ++// black = 512; ++// } + } else if (!strcmp(model,"DSLR-A100")) { + if (width == 3880) { + height--; +@@ -9357,6 +9474,18 @@ memcpy (rgb_cam, cmatrix, sizeof cmatrix); raw_color = 0; } @@ -1627,7 +1759,7 @@ if (raw_color) adobe_coeff (make, model); if (load_raw == &CLASS kodak_radc_load_raw) if (raw_color) adobe_coeff ("Apple","Quicktake"); -@@ -9371,9 +9479,9 @@ +@@ -9371,9 +9500,9 @@ if (raw_width < width ) raw_width = width; } if (!tiff_bps) tiff_bps = 12; @@ -1639,7 +1771,7 @@ is_raw = 0; #ifdef NO_JASPER if (load_raw == &CLASS redcine_load_raw) { -@@ -9452,199 +9560,250 @@ +@@ -9452,199 +9581,250 @@ } #endif @@ -2073,7 +2205,7 @@ struct tiff_tag { ushort tag, type; int count; -@@ -9667,594 +9826,11 @@ +@@ -9667,594 +9847,11 @@ char desc[512], make[64], model[64], soft[32], date[20], artist[64]; }; diff --git a/rtengine/ffmanager.cc b/rtengine/ffmanager.cc index 783c18bf7..c5461f3e9 100644 --- a/rtengine/ffmanager.cc +++ b/rtengine/ffmanager.cc @@ -18,12 +18,17 @@ */ #include "ffmanager.h" #include "../rtgui/options.h" -#include #include "rawimage.h" -#include -#include #include "imagedata.h" +#define PIX_SORT(a,b) { if ((a)>(b)) {temp=(a);(a)=(b);(b)=temp;} } +#define med5(a0,a1,a2,a3,a4,median) { \ +p[0]=a0; p[1]=a1; p[2]=a2; p[3]=a3; p[4]=a4; \ +PIX_SORT(p[0],p[1]) ; PIX_SORT(p[3],p[4]) ; PIX_SORT(p[0],p[3]) ; \ +PIX_SORT(p[1],p[4]) ; PIX_SORT(p[1],p[2]) ; PIX_SORT(p[2],p[3]) ; \ +PIX_SORT(p[1],p[2]) ; median=p[2] ;} + + namespace rtengine { @@ -200,8 +205,37 @@ void ffInfo::updateRawImage() ri->compress_image(); } } -} + if(ri) { + // apply median to avoid this step being executed each time a flat field gets applied + int H = ri->get_height(); + int W = ri->get_width(); + float *cfatmp = (float (*)) malloc (H * W * sizeof * cfatmp); + +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) +#endif + + for (int i = 0; i < H; i++) { + int p[5], temp; + int iprev = i < 2 ? i + 2 : i - 2; + int inext = i > H - 3 ? i - 2 : i + 2; + + for (int j = 0; j < W; j++) { + int jprev = j < 2 ? j + 2 : j - 2; + int jnext = j > W - 3 ? j - 2 : j + 2; + + med5(ri->data[iprev][j], ri->data[i][jprev], ri->data[i][j], + ri->data[i][jnext], ri->data[inext][j], cfatmp[i * W + j]); + } + } + + memcpy(ri->data[0], cfatmp, W * H * sizeof(float)); + + free (cfatmp); + + } +} // ************************* class FFManager ********************************* @@ -210,6 +244,7 @@ void FFManager::init( Glib::ustring pathname ) std::vector names; auto dir = Gio::File::create_for_path (pathname); + if (!dir || !dir->query_exists()) { return; } @@ -287,6 +322,7 @@ ffInfo* FFManager::addFileInfo (const Glib::ustring& filename, bool pool) Glib::ustring ext; auto lastdot = info->get_name ().find_last_of ('.'); + if (lastdot != Glib::ustring::npos) { ext = info->get_name ().substr (lastdot + 1); } diff --git a/rtengine/image16.cc b/rtengine/image16.cc index 8ba88bd4c..937e2d19d 100644 --- a/rtengine/image16.cc +++ b/rtengine/image16.cc @@ -19,10 +19,32 @@ #include "image16.h" #include "imagefloat.h" #include "image8.h" -#include #include #include "rtengine.h" +namespace +{ + +void getScanline8 (const uint16_t *red, const uint16_t *green, const uint16_t *blue, int width, unsigned char* buffer) +{ + for (int i = 0, ix = 0; i < width; i++) { + buffer[ix++] = red[i] >> 8; + buffer[ix++] = green[i] >> 8; + buffer[ix++] = blue[i] >> 8; + } +} + +void getScanline16 (const uint16_t *red, const uint16_t *green, const uint16_t *blue, int width, unsigned short* buffer) +{ + for (int i = 0, ix = 0; i < width; i++) { + buffer[ix++] = red[i]; + buffer[ix++] = green[i]; + buffer[ix++] = blue[i]; + } +} + +} + using namespace rtengine; Image16::Image16 () @@ -41,27 +63,14 @@ Image16::~Image16 () void Image16::getScanline (int row, unsigned char* buffer, int bps) { - if (data == NULL) { + if (data == nullptr) { return; } if (bps == 16) { - int ix = 0; - unsigned short* sbuffer = (unsigned short*) buffer; - - for (int i = 0; i < width; i++) { - sbuffer[ix++] = r(row, i); - sbuffer[ix++] = g(row, i); - sbuffer[ix++] = b(row, i); - } + getScanline16 (r(row), g(row), b(row), width, (unsigned short*)buffer); } else if (bps == 8) { - int ix = 0; - - for (int i = 0; i < width; i++) { - buffer[ix++] = r(row, i) >> 8; - buffer[ix++] = g(row, i) >> 8; - buffer[ix++] = b(row, i) >> 8; - } + getScanline8 (r(row), g(row), b(row), width, buffer); } } @@ -72,42 +81,42 @@ void Image16::getScanline (int row, unsigned char* buffer, int bps) void Image16::setScanline (int row, unsigned char* buffer, int bps, float *minValue, float *maxValue) { - if (data == NULL) { + if (data == nullptr) { return; } - // For optimization purpose, we're assuming that this class never have to provide min/max bound + // For optimization purpose, we're assuming that this class never has to provide min/max bounds assert(!minValue); switch (sampleFormat) { - case (IIOSF_UNSIGNED_CHAR): { - int ix = 0; + case (IIOSF_UNSIGNED_CHAR): { + int ix = 0; - for (int i = 0; i < width; i++) { - r(row, i) = (unsigned short)(buffer[ix++]) << 8; - g(row, i) = (unsigned short)(buffer[ix++]) << 8; - b(row, i) = (unsigned short)(buffer[ix++]) << 8; + for (int i = 0; i < width; i++) { + r(row, i) = (unsigned short)(buffer[ix++]) << 8; + g(row, i) = (unsigned short)(buffer[ix++]) << 8; + b(row, i) = (unsigned short)(buffer[ix++]) << 8; + } + + break; } - break; - } + case (IIOSF_UNSIGNED_SHORT): { + unsigned short* sbuffer = (unsigned short*) buffer; + int ix = 0; - case (IIOSF_UNSIGNED_SHORT): { - unsigned short* sbuffer = (unsigned short*) buffer; - int ix = 0; + for (int i = 0; i < width; i++) { + r(row, i) = sbuffer[ix++]; + g(row, i) = sbuffer[ix++]; + b(row, i) = sbuffer[ix++]; + } - for (int i = 0; i < width; i++) { - r(row, i) = sbuffer[ix++]; - g(row, i) = sbuffer[ix++]; - b(row, i) = sbuffer[ix++]; + break; } - break; - } - - default: - // Other type are ignored, but could be implemented if necessary - break; + default: + // Other types are ignored, but could be implemented if necessary + break; } /* diff --git a/rtengine/imageio.cc b/rtengine/imageio.cc index 4fa5a5a93..3ad8faee0 100644 --- a/rtengine/imageio.cc +++ b/rtengine/imageio.cc @@ -61,6 +61,7 @@ FILE* g_fopen_withBinaryAndLock(const Glib::ustring& fname) std::unique_ptr wfname (reinterpret_cast(g_utf8_to_utf16 (fname.c_str (), -1, NULL, NULL, NULL)), g_free); HANDLE hFile = CreateFileW ( wfname.get (), GENERIC_READ | GENERIC_WRITE, 0 /* no sharing allowed */, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + if (hFile != INVALID_HANDLE_VALUE) { f = _fdopen (_open_osfhandle ((intptr_t)hFile, 0), "wb"); } @@ -1227,9 +1228,11 @@ int ImageIO::saveTIFF (Glib::ustring fname, int bps, bool uncompressed) // buffer for the exif and iptc int bufferSize = 165535; //TODO: Is it really 165535... or 65535 ? - if(profileData) + + if(profileData) { bufferSize += profileLength; - + } + unsigned char* buffer = new unsigned char[bufferSize]; unsigned char* iptcdata = NULL; unsigned int iptclen = 0; diff --git a/rtengine/imagesource.h b/rtengine/imagesource.h index f252dc1bb..305c67da5 100644 --- a/rtengine/imagesource.h +++ b/rtengine/imagesource.h @@ -67,7 +67,7 @@ public: virtual ~ImageSource () {} virtual int load (const Glib::ustring &fname, bool batch = false) = 0; - virtual void preprocess (const RAWParams &raw, const LensProfParams &lensProf, const CoarseTransformParams& coarse) {}; + virtual void preprocess (const RAWParams &raw, const LensProfParams &lensProf, const CoarseTransformParams& coarse, bool prepareDenoise = true) {}; virtual void demosaic (const RAWParams &raw) {}; virtual void retinex (ColorManagementParams cmp, RetinexParams deh, ToneCurveParams Tc, LUTf & cdcurve, LUTf & mapcurve, const RetinextransmissionCurve & dehatransmissionCurve, const RetinexgaintransmissionCurve & dehagaintransmissionCurve, multi_array2D &conversionBuffer, bool dehacontlutili, bool mapcontlutili, bool useHsl, float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax, LUTu &histLRETI) {}; virtual void retinexPrepareCurves (RetinexParams retinexParams, LUTf &cdcurve, LUTf &mapcurve, RetinextransmissionCurve &retinextransmissionCurve, RetinexgaintransmissionCurve &retinexgaintransmissionCurve, bool &retinexcontlutili, bool &mapcontlutili, bool &useHsl, LUTu & lhist16RETI, LUTu & histLRETI) {}; diff --git a/rtengine/myfile.h b/rtengine/myfile.h index 9e9039a7a..771dd7b84 100644 --- a/rtengine/myfile.h +++ b/rtengine/myfile.h @@ -79,7 +79,7 @@ inline void fseek (IMFILE* f, int p, int how) inline int fgetc (IMFILE* f) { - if (f->pos < f->size) { + if (LIKELY(f->pos < f->size)) { if (f->plistener && ++f->progress_current >= f->progress_next) { imfile_update_progress(f); } diff --git a/rtengine/rawimage.h b/rtengine/rawimage.h index de2baed32..5b425f7df 100644 --- a/rtengine/rawimage.h +++ b/rtengine/rawimage.h @@ -44,7 +44,7 @@ public: PixelsMap(int width, int height ) : h(height) { - w = (width + base_t_size - 1) / base_t_size; + w = (width / (base_t_size * 8)) + 1; pm = new base_t [h * w ]; memset(pm, 0, h * w * base_t_size ); } diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 218ba9fe2..56ef57a07 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -49,32 +49,32 @@ namespace void rotateLine (const float* const line, rtengine::PlanarPtr &channel, const int tran, const int i, const int w, const int h) { switch(tran & TR_ROT) { - case TR_R180: - for (int j = 0; j < w; j++) { - channel(h - 1 - i, w - 1 - j) = line[j]; - } + case TR_R180: + for (int j = 0; j < w; j++) { + channel(h - 1 - i, w - 1 - j) = line[j]; + } - break; + break; - case TR_R90: - for (int j = 0; j < w; j++) { - channel(j, h - 1 - i) = line[j]; - } + case TR_R90: + for (int j = 0; j < w; j++) { + channel(j, h - 1 - i) = line[j]; + } - break; + break; - case TR_R270: - for (int j = 0; j < w; j++) { - channel(w - 1 - j, i) = line[j]; - } + case TR_R270: + for (int j = 0; j < w; j++) { + channel(w - 1 - j, i) = line[j]; + } - break; + break; - case TR_NONE: - default: - for (int j = 0; j < w; j++) { - channel(i, j) = line[j]; - } + case TR_NONE: + default: + for (int j = 0; j < w; j++) { + channel(i, j) = line[j]; + } } } @@ -96,60 +96,60 @@ void transLineFuji (const float* const red, const float* const green, const floa int end = min(h + fw - i, w - fw + i); switch(tran & TR_ROT) { - case TR_R180: - for (int j = start; j < end; j++) { - int y = i + j - fw; - int x = fw - i + j; + case TR_R180: + for (int j = start; j < end; j++) { + int y = i + j - fw; + int x = fw - i + j; - if (x >= 0 && y < image->height && y >= 0 && x < image->width) { - image->r(image->height - 1 - y, image->width - 1 - x) = red[j]; - image->g(image->height - 1 - y, image->width - 1 - x) = green[j]; - image->b(image->height - 1 - y, image->width - 1 - x) = blue[j]; + if (x >= 0 && y < image->height && y >= 0 && x < image->width) { + image->r(image->height - 1 - y, image->width - 1 - x) = red[j]; + image->g(image->height - 1 - y, image->width - 1 - x) = green[j]; + image->b(image->height - 1 - y, image->width - 1 - x) = blue[j]; + } } - } - break; + break; - case TR_R270: - for (int j = start; j < end; j++) { - int y = i + j - fw; - int x = fw - i + j; + case TR_R270: + for (int j = start; j < end; j++) { + int y = i + j - fw; + int x = fw - i + j; - if (x >= 0 && x < image->height && y >= 0 && y < image->width) { - image->r(image->height - 1 - x, y) = red[j]; - image->g(image->height - 1 - x, y) = green[j]; - image->b(image->height - 1 - x, y) = blue[j]; + if (x >= 0 && x < image->height && y >= 0 && y < image->width) { + image->r(image->height - 1 - x, y) = red[j]; + image->g(image->height - 1 - x, y) = green[j]; + image->b(image->height - 1 - x, y) = blue[j]; + } } - } - break; + break; - case TR_R90: - for (int j = start; j < end; j++) { - int y = i + j - fw; - int x = fw - i + j; + case TR_R90: + for (int j = start; j < end; j++) { + int y = i + j - fw; + int x = fw - i + j; - if (x >= 0 && y < image->width && y >= 0 && x < image->height) { - image->r(x, image->width - 1 - y) = red[j]; - image->g(x, image->width - 1 - y) = green[j]; - image->b(x, image->width - 1 - y) = blue[j]; + if (x >= 0 && y < image->width && y >= 0 && x < image->height) { + image->r(x, image->width - 1 - y) = red[j]; + image->g(x, image->width - 1 - y) = green[j]; + image->b(x, image->width - 1 - y) = blue[j]; + } } - } - break; + break; - case TR_NONE: - default: - for (int j = start; j < end; j++) { - int y = i + j - fw; - int x = fw - i + j; + case TR_NONE: + default: + for (int j = start; j < end; j++) { + int y = i + j - fw; + int x = fw - i + j; - if (x >= 0 && y < image->height && y >= 0 && x < image->width) { - image->r(y, x) = red[j]; - image->g(y, x) = green[j]; - image->b(y, x) = blue[j]; + if (x >= 0 && y < image->height && y >= 0 && x < image->width) { + image->r(y, x) = red[j]; + image->g(y, x) = green[j]; + image->b(y, x) = blue[j]; + } } - } } } @@ -161,250 +161,250 @@ void transLineD1x (const float* const red, const float* const green, const float // We do that in combination with coarse rotation switch(tran & TR_ROT) { - case TR_R180: // rotate 180 degree - for (int j = 0; j < imwidth; j++) { - image->r(2 * (imheight - 1 - i), imwidth - 1 - j) = red[j]; - image->g(2 * (imheight - 1 - i), imwidth - 1 - j) = green[j]; - image->b(2 * (imheight - 1 - i), imwidth - 1 - j) = blue[j]; - } - - if (i == 0) { + case TR_R180: // rotate 180 degree for (int j = 0; j < imwidth; j++) { - image->r(2 * imheight - 1, imwidth - 1 - j) = red[j]; - image->g(2 * imheight - 1, imwidth - 1 - j) = green[j]; - image->b(2 * imheight - 1, imwidth - 1 - j) = blue[j]; - } - } - - if (i == 1 || i == 2) { // linear interpolation - int row = 2 * imheight - 1 - 2 * i; - - for (int j = 0; j < imwidth; j++) { - int col = imwidth - 1 - j; - image->r(row, col) = (red[j] + image->r(row + 1, col)) / 2; - image->g(row, col) = (green[j] + image->g(row + 1, col)) / 2; - image->b(row, col) = (blue[j] + image->b(row + 1, col)) / 2; + image->r(2 * (imheight - 1 - i), imwidth - 1 - j) = red[j]; + image->g(2 * (imheight - 1 - i), imwidth - 1 - j) = green[j]; + image->b(2 * (imheight - 1 - i), imwidth - 1 - j) = blue[j]; } - if(i == 2 && oddHeight) { - int row = 2 * imheight; + if (i == 0) { + for (int j = 0; j < imwidth; j++) { + image->r(2 * imheight - 1, imwidth - 1 - j) = red[j]; + image->g(2 * imheight - 1, imwidth - 1 - j) = green[j]; + image->b(2 * imheight - 1, imwidth - 1 - j) = blue[j]; + } + } + + if (i == 1 || i == 2) { // linear interpolation + int row = 2 * imheight - 1 - 2 * i; for (int j = 0; j < imwidth; j++) { int col = imwidth - 1 - j; - image->r(row, col) = (red[j] + image->r(row - 2, col)) / 2; - image->g(row, col) = (green[j] + image->g(row - 2, col)) / 2; - image->b(row, col) = (blue[j] + image->b(row - 2, col)) / 2; - } - } - } else if (i == imheight - 1 || i == imheight - 2) { - int row = 2 * imheight - 1 - 2 * i; - - for (int j = 0; j < imwidth; j++) { - int col = imwidth - 1 - j; - image->r(row, col) = (red[j] + image->r(row + 1, col)) / 2; - image->g(row, col) = (green[j] + image->g(row + 1, col)) / 2; - image->b(row, col) = (blue[j] + image->b(row + 1, col)) / 2; - } - - row = 2 * imheight - 1 - 2 * i + 2; - - for (int j = 0; j < imwidth; j++) { - int col = imwidth - 1 - j; - image->r(row, col) = (red[j] + image->r(row + 1, col)) / 2; - image->g(row, col) = (green[j] + image->g(row + 1, col)) / 2; - image->b(row, col) = (blue[j] + image->b(row + 1, col)) / 2; - } - } else if (i > 2 && i < imheight - 1) { // vertical bicubic interpolation - int row = 2 * imheight - 1 - 2 * i + 2; - - for (int j = 0; j < imwidth; j++) { - int col = imwidth - 1 - j; - image->r(row, col) = MAX(0.f, -0.0625f * (red[j] + image->r(row + 3, col)) + 0.5625f * (image->r(row - 1, col) + image->r(row + 1, col))); - image->g(row, col) = MAX(0.f, -0.0625f * (green[j] + image->g(row + 3, col)) + 0.5625f * (image->g(row - 1, col) + image->g(row + 1, col))); - image->b(row, col) = MAX(0.f, -0.0625f * (blue[j] + image->b(row + 3, col)) + 0.5625f * (image->b(row - 1, col) + image->b(row + 1, col))); - - if(clip) { - image->r(row, col) = MIN(image->r(row, col), rtengine::MAXVALF); - image->g(row, col) = MIN(image->g(row, col), rtengine::MAXVALF); - image->b(row, col) = MIN(image->b(row, col), rtengine::MAXVALF); - } - } - } - - break; - - case TR_R90: // rotate right - if( i == 0) { - for (int j = 0; j < imwidth; j++) { - image->r(j, 2 * imheight - 1) = red[j]; - image->g(j, 2 * imheight - 1) = green[j]; - image->b(j, 2 * imheight - 1) = blue[j]; - } - } - - for (int j = 0; j < imwidth; j++) { - image->r(j, 2 * (imheight - 1 - i)) = red[j]; - image->g(j, 2 * (imheight - 1 - i)) = green[j]; - image->b(j, 2 * (imheight - 1 - i)) = blue[j]; - } - - if (i == 1 || i == 2) { // linear interpolation - int col = 2 * imheight - 1 - 2 * i; - - for (int j = 0; j < imwidth; j++) { - image->r(j, col) = (red[j] + image->r(j, col + 1)) / 2; - image->g(j, col) = (green[j] + image->g(j, col + 1)) / 2; - image->b(j, col) = (blue[j] + image->b(j, col + 1)) / 2; - - if(oddHeight && i == 2) { - image->r(j, 2 * imheight) = (red[j] + image->r(j, 2 * imheight - 2)) / 2; - image->g(j, 2 * imheight) = (green[j] + image->g(j, 2 * imheight - 2)) / 2; - image->b(j, 2 * imheight) = (blue[j] + image->b(j, 2 * imheight - 2)) / 2; - } - } - } else if (i == imheight - 1) { - int col = 2 * imheight - 1 - 2 * i; - - for (int j = 0; j < imwidth; j++) { - image->r(j, col) = (red[j] + image->r(j, col + 1)) / 2; - image->g(j, col) = (green[j] + image->g(j, col + 1)) / 2; - image->b(j, col) = (blue[j] + image->b(j, col + 1)) / 2; - } - - col = 2 * imheight - 1 - 2 * i + 2; - - for (int j = 0; j < imwidth; j++) { - image->r(j, col) = (red[j] + image->r(j, col + 1)) / 2; - image->g(j, col) = (green[j] + image->g(j, col + 1)) / 2; - image->b(j, col) = (blue[j] + image->b(j, col + 1)) / 2; - } - } else if (i > 2 && i < imheight - 1) { // vertical bicubic interpolation - int col = 2 * imheight - 1 - 2 * i + 2; - - for (int j = 0; j < imwidth; j++) { - image->r(j, col) = MAX(0.f, -0.0625f * (red[j] + image->r(j, col + 3)) + 0.5625f * (image->r(j, col - 1) + image->r(j, col + 1))); - image->g(j, col) = MAX(0.f, -0.0625f * (green[j] + image->g(j, col + 3)) + 0.5625f * (image->g(j, col - 1) + image->g(j, col + 1))); - image->b(j, col) = MAX(0.f, -0.0625f * (blue[j] + image->b(j, col + 3)) + 0.5625f * (image->b(j, col - 1) + image->b(j, col + 1))); - - if(clip) { - image->r(j, col) = MIN(image->r(j, col), rtengine::MAXVALF); - image->g(j, col) = MIN(image->g(j, col), rtengine::MAXVALF); - image->b(j, col) = MIN(image->b(j, col), rtengine::MAXVALF); - } - } - } - - break; - - case TR_R270: // rotate left - if (i == 0) { - for (int j = imwidth - 1, row = 0; j >= 0; j--, row++) { - image->r(row, 2 * i) = red[j]; - image->g(row, 2 * i) = green[j]; - image->b(row, 2 * i) = blue[j]; - } - } else if (i == 1 || i == 2) { // linear interpolation - for (int j = imwidth - 1, row = 0; j >= 0; j--, row++) { - image->r(row, 2 * i) = red[j]; - image->g(row, 2 * i) = green[j]; - image->b(row, 2 * i) = blue[j]; - image->r(row, 2 * i - 1) = (red[j] + image->r(row, 2 * i - 2)) * 0.5f; - image->g(row, 2 * i - 1) = (green[j] + image->g(row, 2 * i - 2)) * 0.5f; - image->b(row, 2 * i - 1) = (blue[j] + image->b(row, 2 * i - 2)) * 0.5f; - } - } else if (i > 0 && i < imheight) { // vertical bicubic interpolation - for (int j = imwidth - 1, row = 0; j >= 0; j--, row++) { - image->r(row, 2 * i - 3) = MAX(0.f, -0.0625f * (red[j] + image->r(row, 2 * i - 6)) + 0.5625f * (image->r(row, 2 * i - 2) + image->r(row, 2 * i - 4))); - image->g(row, 2 * i - 3) = MAX(0.f, -0.0625f * (green[j] + image->g(row, 2 * i - 6)) + 0.5625f * (image->g(row, 2 * i - 2) + image->g(row, 2 * i - 4))); - image->b(row, 2 * i - 3) = MAX(0.f, -0.0625f * (blue[j] + image->b(row, 2 * i - 6)) + 0.5625f * (image->b(row, 2 * i - 2) + image->b(row, 2 * i - 4))); - - if(clip) { - image->r(row, 2 * i - 3) = MIN(image->r(row, 2 * i - 3), rtengine::MAXVALF); - image->g(row, 2 * i - 3) = MIN(image->g(row, 2 * i - 3), rtengine::MAXVALF); - image->b(row, 2 * i - 3) = MIN(image->b(row, 2 * i - 3), rtengine::MAXVALF); + image->r(row, col) = (red[j] + image->r(row + 1, col)) / 2; + image->g(row, col) = (green[j] + image->g(row + 1, col)) / 2; + image->b(row, col) = (blue[j] + image->b(row + 1, col)) / 2; } - image->r(row, 2 * i) = red[j]; - image->g(row, 2 * i) = green[j]; - image->b(row, 2 * i) = blue[j]; - } - } + if(i == 2 && oddHeight) { + int row = 2 * imheight; - if (i == imheight - 1) { - for (int j = imwidth - 1, row = 0; j >= 0; j--, row++) { - image->r(row, 2 * i - 1) = MAX(0.f, -0.0625f * (red[j] + image->r(row, 2 * i - 4)) + 0.5625f * (image->r(row, 2 * i) + image->r(row, 2 * i - 2))); - image->g(row, 2 * i - 1) = MAX(0.f, -0.0625f * (green[j] + image->g(row, 2 * i - 4)) + 0.5625f * (image->g(row, 2 * i) + image->g(row, 2 * i - 2))); - image->b(row, 2 * i - 1) = MAX(0.f, -0.0625f * (blue[j] + image->b(row, 2 * i - 4)) + 0.5625f * (image->b(row, 2 * i) + image->b(row, 2 * i - 2))); + for (int j = 0; j < imwidth; j++) { + int col = imwidth - 1 - j; + image->r(row, col) = (red[j] + image->r(row - 2, col)) / 2; + image->g(row, col) = (green[j] + image->g(row - 2, col)) / 2; + image->b(row, col) = (blue[j] + image->b(row - 2, col)) / 2; + } + } + } else if (i == imheight - 1 || i == imheight - 2) { + int row = 2 * imheight - 1 - 2 * i; - if(clip) { - image->r(j, 2 * i - 1) = MIN(image->r(j, 2 * i - 1), rtengine::MAXVALF); - image->g(j, 2 * i - 1) = MIN(image->g(j, 2 * i - 1), rtengine::MAXVALF); - image->b(j, 2 * i - 1) = MIN(image->b(j, 2 * i - 1), rtengine::MAXVALF); + for (int j = 0; j < imwidth; j++) { + int col = imwidth - 1 - j; + image->r(row, col) = (red[j] + image->r(row + 1, col)) / 2; + image->g(row, col) = (green[j] + image->g(row + 1, col)) / 2; + image->b(row, col) = (blue[j] + image->b(row + 1, col)) / 2; } - image->r(row, 2 * i + 1) = (red[j] + image->r(row, 2 * i - 1)) / 2; - image->g(row, 2 * i + 1) = (green[j] + image->g(row, 2 * i - 1)) / 2; - image->b(row, 2 * i + 1) = (blue[j] + image->b(row, 2 * i - 1)) / 2; + row = 2 * imheight - 1 - 2 * i + 2; - if (oddHeight) { - image->r(row, 2 * i + 2) = (red[j] + image->r(row, 2 * i - 2)) / 2; - image->g(row, 2 * i + 2) = (green[j] + image->g(row, 2 * i - 2)) / 2; - image->b(row, 2 * i + 2) = (blue[j] + image->b(row, 2 * i - 2)) / 2; + for (int j = 0; j < imwidth; j++) { + int col = imwidth - 1 - j; + image->r(row, col) = (red[j] + image->r(row + 1, col)) / 2; + image->g(row, col) = (green[j] + image->g(row + 1, col)) / 2; + image->b(row, col) = (blue[j] + image->b(row + 1, col)) / 2; + } + } else if (i > 2 && i < imheight - 1) { // vertical bicubic interpolation + int row = 2 * imheight - 1 - 2 * i + 2; + + for (int j = 0; j < imwidth; j++) { + int col = imwidth - 1 - j; + image->r(row, col) = MAX(0.f, -0.0625f * (red[j] + image->r(row + 3, col)) + 0.5625f * (image->r(row - 1, col) + image->r(row + 1, col))); + image->g(row, col) = MAX(0.f, -0.0625f * (green[j] + image->g(row + 3, col)) + 0.5625f * (image->g(row - 1, col) + image->g(row + 1, col))); + image->b(row, col) = MAX(0.f, -0.0625f * (blue[j] + image->b(row + 3, col)) + 0.5625f * (image->b(row - 1, col) + image->b(row + 1, col))); + + if(clip) { + image->r(row, col) = MIN(image->r(row, col), rtengine::MAXVALF); + image->g(row, col) = MIN(image->g(row, col), rtengine::MAXVALF); + image->b(row, col) = MIN(image->b(row, col), rtengine::MAXVALF); + } } } - } - break; + break; - case TR_NONE: // no coarse rotation - default: - rotateLine (red, image->r, tran, 2 * i, imwidth, imheight); - rotateLine (green, image->g, tran, 2 * i, imwidth, imheight); - rotateLine (blue, image->b, tran, 2 * i, imwidth, imheight); + case TR_R90: // rotate right + if( i == 0) { + for (int j = 0; j < imwidth; j++) { + image->r(j, 2 * imheight - 1) = red[j]; + image->g(j, 2 * imheight - 1) = green[j]; + image->b(j, 2 * imheight - 1) = blue[j]; + } + } - if (i == 1 || i == 2) { // linear interpolation for (int j = 0; j < imwidth; j++) { - image->r(2 * i - 1, j) = (red[j] + image->r(2 * i - 2, j)) / 2; - image->g(2 * i - 1, j) = (green[j] + image->g(2 * i - 2, j)) / 2; - image->b(2 * i - 1, j) = (blue[j] + image->b(2 * i - 2, j)) / 2; + image->r(j, 2 * (imheight - 1 - i)) = red[j]; + image->g(j, 2 * (imheight - 1 - i)) = green[j]; + image->b(j, 2 * (imheight - 1 - i)) = blue[j]; } - } else if (i > 2 && i < imheight) { // vertical bicubic interpolation - for (int j = 0; j < imwidth; j++) { - image->r(2 * i - 3, j) = MAX(0.f, -0.0625f * (red[j] + image->r(2 * i - 6, j)) + 0.5625f * (image->r(2 * i - 2, j) + image->r(2 * i - 4, j))); - image->g(2 * i - 3, j) = MAX(0.f, -0.0625f * (green[j] + image->g(2 * i - 6, j)) + 0.5625f * (image->g(2 * i - 2, j) + image->g(2 * i - 4, j))); - image->b(2 * i - 3, j) = MAX(0.f, -0.0625f * (blue[j] + image->b(2 * i - 6, j)) + 0.5625f * (image->b(2 * i - 2, j) + image->b(2 * i - 4, j))); - if(clip) { - image->r(2 * i - 3, j) = MIN(image->r(2 * i - 3, j), rtengine::MAXVALF); - image->g(2 * i - 3, j) = MIN(image->g(2 * i - 3, j), rtengine::MAXVALF); - image->b(2 * i - 3, j) = MIN(image->b(2 * i - 3, j), rtengine::MAXVALF); + if (i == 1 || i == 2) { // linear interpolation + int col = 2 * imheight - 1 - 2 * i; + + for (int j = 0; j < imwidth; j++) { + image->r(j, col) = (red[j] + image->r(j, col + 1)) / 2; + image->g(j, col) = (green[j] + image->g(j, col + 1)) / 2; + image->b(j, col) = (blue[j] + image->b(j, col + 1)) / 2; + + if(oddHeight && i == 2) { + image->r(j, 2 * imheight) = (red[j] + image->r(j, 2 * imheight - 2)) / 2; + image->g(j, 2 * imheight) = (green[j] + image->g(j, 2 * imheight - 2)) / 2; + image->b(j, 2 * imheight) = (blue[j] + image->b(j, 2 * imheight - 2)) / 2; + } } - } - } + } else if (i == imheight - 1) { + int col = 2 * imheight - 1 - 2 * i; - if (i == imheight - 1) { - for (int j = 0; j < imwidth; j++) { - image->r(2 * i - 1, j) = MAX(0.f, -0.0625f * (red[j] + image->r(2 * i - 4, j)) + 0.5625f * (image->r(2 * i, j) + image->r(2 * i - 2, j))); - image->g(2 * i - 1, j) = MAX(0.f, -0.0625f * (green[j] + image->g(2 * i - 4, j)) + 0.5625f * (image->g(2 * i, j) + image->g(2 * i - 2, j))); - image->b(2 * i - 1, j) = MAX(0.f, -0.0625f * (blue[j] + image->b(2 * i - 4, j)) + 0.5625f * (image->b(2 * i, j) + image->b(2 * i - 2, j))); - - if(clip) { - image->r(2 * i - 1, j) = MIN(image->r(2 * i - 1, j), rtengine::MAXVALF); - image->g(2 * i - 1, j) = MIN(image->g(2 * i - 1, j), rtengine::MAXVALF); - image->b(2 * i - 1, j) = MIN(image->b(2 * i - 1, j), rtengine::MAXVALF); + for (int j = 0; j < imwidth; j++) { + image->r(j, col) = (red[j] + image->r(j, col + 1)) / 2; + image->g(j, col) = (green[j] + image->g(j, col + 1)) / 2; + image->b(j, col) = (blue[j] + image->b(j, col + 1)) / 2; } - image->r(2 * i + 1, j) = (red[j] + image->r(2 * i - 1, j)) / 2; - image->g(2 * i + 1, j) = (green[j] + image->g(2 * i - 1, j)) / 2; - image->b(2 * i + 1, j) = (blue[j] + image->b(2 * i - 1, j)) / 2; + col = 2 * imheight - 1 - 2 * i + 2; - if (oddHeight) { - image->r(2 * i + 2, j) = (red[j] + image->r(2 * i - 2, j)) / 2; - image->g(2 * i + 2, j) = (green[j] + image->g(2 * i - 2, j)) / 2; - image->b(2 * i + 2, j) = (blue[j] + image->b(2 * i - 2, j)) / 2; + for (int j = 0; j < imwidth; j++) { + image->r(j, col) = (red[j] + image->r(j, col + 1)) / 2; + image->g(j, col) = (green[j] + image->g(j, col + 1)) / 2; + image->b(j, col) = (blue[j] + image->b(j, col + 1)) / 2; + } + } else if (i > 2 && i < imheight - 1) { // vertical bicubic interpolation + int col = 2 * imheight - 1 - 2 * i + 2; + + for (int j = 0; j < imwidth; j++) { + image->r(j, col) = MAX(0.f, -0.0625f * (red[j] + image->r(j, col + 3)) + 0.5625f * (image->r(j, col - 1) + image->r(j, col + 1))); + image->g(j, col) = MAX(0.f, -0.0625f * (green[j] + image->g(j, col + 3)) + 0.5625f * (image->g(j, col - 1) + image->g(j, col + 1))); + image->b(j, col) = MAX(0.f, -0.0625f * (blue[j] + image->b(j, col + 3)) + 0.5625f * (image->b(j, col - 1) + image->b(j, col + 1))); + + if(clip) { + image->r(j, col) = MIN(image->r(j, col), rtengine::MAXVALF); + image->g(j, col) = MIN(image->g(j, col), rtengine::MAXVALF); + image->b(j, col) = MIN(image->b(j, col), rtengine::MAXVALF); + } + } + } + + break; + + case TR_R270: // rotate left + if (i == 0) { + for (int j = imwidth - 1, row = 0; j >= 0; j--, row++) { + image->r(row, 2 * i) = red[j]; + image->g(row, 2 * i) = green[j]; + image->b(row, 2 * i) = blue[j]; + } + } else if (i == 1 || i == 2) { // linear interpolation + for (int j = imwidth - 1, row = 0; j >= 0; j--, row++) { + image->r(row, 2 * i) = red[j]; + image->g(row, 2 * i) = green[j]; + image->b(row, 2 * i) = blue[j]; + image->r(row, 2 * i - 1) = (red[j] + image->r(row, 2 * i - 2)) * 0.5f; + image->g(row, 2 * i - 1) = (green[j] + image->g(row, 2 * i - 2)) * 0.5f; + image->b(row, 2 * i - 1) = (blue[j] + image->b(row, 2 * i - 2)) * 0.5f; + } + } else if (i > 0 && i < imheight) { // vertical bicubic interpolation + for (int j = imwidth - 1, row = 0; j >= 0; j--, row++) { + image->r(row, 2 * i - 3) = MAX(0.f, -0.0625f * (red[j] + image->r(row, 2 * i - 6)) + 0.5625f * (image->r(row, 2 * i - 2) + image->r(row, 2 * i - 4))); + image->g(row, 2 * i - 3) = MAX(0.f, -0.0625f * (green[j] + image->g(row, 2 * i - 6)) + 0.5625f * (image->g(row, 2 * i - 2) + image->g(row, 2 * i - 4))); + image->b(row, 2 * i - 3) = MAX(0.f, -0.0625f * (blue[j] + image->b(row, 2 * i - 6)) + 0.5625f * (image->b(row, 2 * i - 2) + image->b(row, 2 * i - 4))); + + if(clip) { + image->r(row, 2 * i - 3) = MIN(image->r(row, 2 * i - 3), rtengine::MAXVALF); + image->g(row, 2 * i - 3) = MIN(image->g(row, 2 * i - 3), rtengine::MAXVALF); + image->b(row, 2 * i - 3) = MIN(image->b(row, 2 * i - 3), rtengine::MAXVALF); + } + + image->r(row, 2 * i) = red[j]; + image->g(row, 2 * i) = green[j]; + image->b(row, 2 * i) = blue[j]; + } + } + + if (i == imheight - 1) { + for (int j = imwidth - 1, row = 0; j >= 0; j--, row++) { + image->r(row, 2 * i - 1) = MAX(0.f, -0.0625f * (red[j] + image->r(row, 2 * i - 4)) + 0.5625f * (image->r(row, 2 * i) + image->r(row, 2 * i - 2))); + image->g(row, 2 * i - 1) = MAX(0.f, -0.0625f * (green[j] + image->g(row, 2 * i - 4)) + 0.5625f * (image->g(row, 2 * i) + image->g(row, 2 * i - 2))); + image->b(row, 2 * i - 1) = MAX(0.f, -0.0625f * (blue[j] + image->b(row, 2 * i - 4)) + 0.5625f * (image->b(row, 2 * i) + image->b(row, 2 * i - 2))); + + if(clip) { + image->r(j, 2 * i - 1) = MIN(image->r(j, 2 * i - 1), rtengine::MAXVALF); + image->g(j, 2 * i - 1) = MIN(image->g(j, 2 * i - 1), rtengine::MAXVALF); + image->b(j, 2 * i - 1) = MIN(image->b(j, 2 * i - 1), rtengine::MAXVALF); + } + + image->r(row, 2 * i + 1) = (red[j] + image->r(row, 2 * i - 1)) / 2; + image->g(row, 2 * i + 1) = (green[j] + image->g(row, 2 * i - 1)) / 2; + image->b(row, 2 * i + 1) = (blue[j] + image->b(row, 2 * i - 1)) / 2; + + if (oddHeight) { + image->r(row, 2 * i + 2) = (red[j] + image->r(row, 2 * i - 2)) / 2; + image->g(row, 2 * i + 2) = (green[j] + image->g(row, 2 * i - 2)) / 2; + image->b(row, 2 * i + 2) = (blue[j] + image->b(row, 2 * i - 2)) / 2; + } + } + } + + break; + + case TR_NONE: // no coarse rotation + default: + rotateLine (red, image->r, tran, 2 * i, imwidth, imheight); + rotateLine (green, image->g, tran, 2 * i, imwidth, imheight); + rotateLine (blue, image->b, tran, 2 * i, imwidth, imheight); + + if (i == 1 || i == 2) { // linear interpolation + for (int j = 0; j < imwidth; j++) { + image->r(2 * i - 1, j) = (red[j] + image->r(2 * i - 2, j)) / 2; + image->g(2 * i - 1, j) = (green[j] + image->g(2 * i - 2, j)) / 2; + image->b(2 * i - 1, j) = (blue[j] + image->b(2 * i - 2, j)) / 2; + } + } else if (i > 2 && i < imheight) { // vertical bicubic interpolation + for (int j = 0; j < imwidth; j++) { + image->r(2 * i - 3, j) = MAX(0.f, -0.0625f * (red[j] + image->r(2 * i - 6, j)) + 0.5625f * (image->r(2 * i - 2, j) + image->r(2 * i - 4, j))); + image->g(2 * i - 3, j) = MAX(0.f, -0.0625f * (green[j] + image->g(2 * i - 6, j)) + 0.5625f * (image->g(2 * i - 2, j) + image->g(2 * i - 4, j))); + image->b(2 * i - 3, j) = MAX(0.f, -0.0625f * (blue[j] + image->b(2 * i - 6, j)) + 0.5625f * (image->b(2 * i - 2, j) + image->b(2 * i - 4, j))); + + if(clip) { + image->r(2 * i - 3, j) = MIN(image->r(2 * i - 3, j), rtengine::MAXVALF); + image->g(2 * i - 3, j) = MIN(image->g(2 * i - 3, j), rtengine::MAXVALF); + image->b(2 * i - 3, j) = MIN(image->b(2 * i - 3, j), rtengine::MAXVALF); + } + } + } + + if (i == imheight - 1) { + for (int j = 0; j < imwidth; j++) { + image->r(2 * i - 1, j) = MAX(0.f, -0.0625f * (red[j] + image->r(2 * i - 4, j)) + 0.5625f * (image->r(2 * i, j) + image->r(2 * i - 2, j))); + image->g(2 * i - 1, j) = MAX(0.f, -0.0625f * (green[j] + image->g(2 * i - 4, j)) + 0.5625f * (image->g(2 * i, j) + image->g(2 * i - 2, j))); + image->b(2 * i - 1, j) = MAX(0.f, -0.0625f * (blue[j] + image->b(2 * i - 4, j)) + 0.5625f * (image->b(2 * i, j) + image->b(2 * i - 2, j))); + + if(clip) { + image->r(2 * i - 1, j) = MIN(image->r(2 * i - 1, j), rtengine::MAXVALF); + image->g(2 * i - 1, j) = MIN(image->g(2 * i - 1, j), rtengine::MAXVALF); + image->b(2 * i - 1, j) = MIN(image->b(2 * i - 1, j), rtengine::MAXVALF); + } + + image->r(2 * i + 1, j) = (red[j] + image->r(2 * i - 1, j)) / 2; + image->g(2 * i + 1, j) = (green[j] + image->g(2 * i - 1, j)) / 2; + image->b(2 * i + 1, j) = (blue[j] + image->b(2 * i - 1, j)) / 2; + + if (oddHeight) { + image->r(2 * i + 2, j) = (red[j] + image->r(2 * i - 2, j)) / 2; + image->g(2 * i + 2, j) = (green[j] + image->g(2 * i - 2, j)) / 2; + image->b(2 * i + 2, j) = (blue[j] + image->b(2 * i - 2, j)) / 2; + } } } - } } } @@ -714,7 +714,7 @@ void RawImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* ima rm /= area; gm /= area; bm /= area; - + bool doHr = (hrp.hrenabled && hrp.method != "Color"); #ifdef _OPENMP #pragma omp parallel if(!d1x) // omp disabled for D1x to avoid race conditions (see Issue 1088 http://code.google.com/p/rawtherapee/issues/detail?id=1088) { @@ -801,8 +801,8 @@ void RawImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* ima } //process all highlight recovery other than "Color" - if (hrp.hrenabled && hrp.method != "Color") { - hlRecovery (hrp.method, line_red, line_grn, line_blue, i, sx1, imwidth, skip, raw, hlmax); + if (doHr) { + hlRecovery (hrp.method, line_red, line_grn, line_blue, imwidth, hlmax); } if(d1x) { @@ -879,12 +879,12 @@ void RawImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* ima // Colour correction (only when running on full resolution) if(pp.skip == 1) { switch(ri->getSensorType()) { - case ST_BAYER: - processFalseColorCorrection (image, raw.bayersensor.ccSteps); - break; + case ST_BAYER: + processFalseColorCorrection (image, raw.bayersensor.ccSteps); + break; - case ST_FUJI_XTRANS: - processFalseColorCorrection (image, raw.xtranssensor.ccSteps); + case ST_FUJI_XTRANS: + processFalseColorCorrection (image, raw.xtranssensor.ccSteps); } } } @@ -1662,8 +1662,9 @@ int RawImageSource::load (const Glib::ustring &fname, bool batch) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &lensProf, const CoarseTransformParams& coarse) +void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &lensProf, const CoarseTransformParams& coarse, bool prepareDenoise) { +// BENCHFUN MyTime t1, t2; t1.set(); @@ -1682,18 +1683,20 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le printf( "Subtracting Darkframe:%s\n", rid->get_filename().c_str()); } - PixelsMap bitmapBads(W, H); + PixelsMap *bitmapBads = nullptr; + int totBP = 0; // Hold count of bad pixels to correct if(ri->zeroIsBad()) { // mark all pixels with value zero as bad, has to be called before FF and DF. dcraw sets this flag only for some cameras (mainly Panasonic and Leica) + bitmapBads = new PixelsMap(W, H); #ifdef _OPENMP - #pragma omp parallel for reduction(+:totBP) + #pragma omp parallel for reduction(+:totBP) schedule(dynamic,16) #endif for(int i = 0; i < H; i++) for(int j = 0; j < W; j++) { if(ri->data[i][j] == 0.f) { - bitmapBads.set(j, i); + bitmapBads->set(j, i); totBP++; } } @@ -1704,7 +1707,6 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le } //FLATFIELD start - Glib::ustring newFF = raw.ff_file; RawImage *rif = NULL; if (!raw.ff_AutoSelect) { @@ -1730,7 +1732,11 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le std::vector *bp = dfm.getBadPixels( ri->get_maker(), ri->get_model(), idata->getSerialNumber() ); if( bp ) { - totBP += bitmapBads.set( *bp ); + if(!bitmapBads) { + bitmapBads = new PixelsMap(W, H); + } + + totBP += bitmapBads->set( *bp ); if( settings->verbose ) { std::cout << "Correcting " << bp->size() << " pixels from .badpixels" << std::endl; @@ -1747,7 +1753,11 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le } if(bp) { - totBP += bitmapBads.set( *bp ); + if(!bitmapBads) { + bitmapBads = new PixelsMap(W, H); + } + + totBP += bitmapBads->set( *bp ); if( settings->verbose && !bp->empty()) { std::cout << "Correcting " << bp->size() << " hotpixels from darkframe" << std::endl; @@ -1786,7 +1796,11 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le plistener->setProgress (0.0); } - int nFound = findHotDeadPixels( bitmapBads, raw.hotdeadpix_thresh, raw.hotPixelFilter, raw.deadPixelFilter ); + if(!bitmapBads) { + bitmapBads = new PixelsMap(W, H); + } + + int nFound = findHotDeadPixels( *bitmapBads, raw.hotdeadpix_thresh, raw.hotPixelFilter, raw.deadPixelFilter ); totBP += nFound; if( settings->verbose && nFound > 0) { @@ -1844,11 +1858,11 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le if( totBP ) if ( ri->getSensorType() == ST_BAYER ) { - interpolateBadPixelsBayer( bitmapBads ); + interpolateBadPixelsBayer( *bitmapBads ); } else if ( ri->getSensorType() == ST_FUJI_XTRANS ) { - interpolateBadPixelsXtrans( bitmapBads ); + interpolateBadPixelsXtrans( *bitmapBads ); } else { - interpolateBadPixelsNColours( bitmapBads, ri->get_colors() ); + interpolateBadPixelsNColours( *bitmapBads, ri->get_colors() ); } if ( ri->getSensorType() == ST_BAYER && raw.bayersensor.linenoise > 0 ) { @@ -1873,7 +1887,7 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le processRawWhitepoint(raw.expos, raw.preser); } - if(dirpyrdenoiseExpComp == INFINITY) { + if(prepareDenoise && dirpyrdenoiseExpComp == INFINITY) { LUTu aehist; int aehistcompr; double clip = 0; @@ -1888,6 +1902,10 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le printf("Preprocessing: %d usec\n", t2.etime(t1)); } + if(bitmapBads) { + delete bitmapBads; + } + return; } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -2673,8 +2691,8 @@ void RawImageSource::HLRecovery_Global(ToneCurveParams hrp) void RawImageSource::processFlatField(const RAWParams &raw, RawImage *riFlatFile, unsigned short black[4]) { - float (*cfablur); - cfablur = (float (*)) calloc (H * W, sizeof * cfablur); +// BENCHFUN + float *cfablur = (float (*)) malloc (H * W * sizeof * cfablur); int BS = raw.ff_BlurRadius; BS += BS & 1; @@ -2683,9 +2701,8 @@ void RawImageSource::processFlatField(const RAWParams &raw, RawImage *riFlatFile cfaboxblur(riFlatFile, cfablur, 2 * BS, 0); } else if (raw.ff_BlurType == RAWParams::ff_BlurTypestring[RAWParams::h_ff]) { cfaboxblur(riFlatFile, cfablur, 0, 2 * BS); - } else if (raw.ff_BlurType == RAWParams::ff_BlurTypestring[RAWParams::vh_ff]) + } else if (raw.ff_BlurType == RAWParams::ff_BlurTypestring[RAWParams::vh_ff]) { //slightly more complicated blur if trying to correct both vertical and horizontal anomalies - { cfaboxblur(riFlatFile, cfablur, BS, BS); //first do area blur to correct vignette } else { //(raw.ff_BlurType == RAWParams::ff_BlurTypestring[RAWParams::area_ff]) cfaboxblur(riFlatFile, cfablur, BS, BS); @@ -2694,7 +2711,7 @@ void RawImageSource::processFlatField(const RAWParams &raw, RawImage *riFlatFile if(ri->getSensorType() == ST_BAYER) { float refcolor[2][2]; - //find center ave values by channel + //find centre average values by channel for (int m = 0; m < 2; m++) for (int n = 0; n < 2; n++) { int row = 2 * (H >> 2) + m; @@ -2763,27 +2780,47 @@ void RawImageSource::processFlatField(const RAWParams &raw, RawImage *riFlatFile } - for (int m = 0; m < 2; m++) - for (int n = 0; n < 2; n++) { -#ifdef _OPENMP - #pragma omp parallel + unsigned int c[2][2] = {{FC(0, 0), FC(0, 1)}, {FC(1, 0), FC(1, 1)}}; + unsigned int c4[2][2]; + c4[0][0] = ( c[0][0] == 1) ? 3 : c[0][0]; + c4[0][1] = ( c[0][1] == 1) ? 3 : c[0][1]; + c4[1][0] = c[1][0]; + c4[1][1] = c[1][1]; + +#ifdef __SSE2__ + vfloat refcolorv[2] = {_mm_set_ps(refcolor[0][1], refcolor[0][0], refcolor[0][1], refcolor[0][0]), + _mm_set_ps(refcolor[1][1], refcolor[1][0], refcolor[1][1], refcolor[1][0]) + }; + vfloat blackv[2] = {_mm_set_ps(black[c4[0][1]], black[c4[0][0]], black[c4[0][1]], black[c4[0][0]]), + _mm_set_ps(black[c4[1][1]], black[c4[1][0]], black[c4[1][1]], black[c4[1][0]]) + }; + + vfloat epsv = F2V(1e-5f); #endif - { - int c = FC(m, n); - int c4 = ( c == 1 && !(m & 1) ) ? 3 : c; #ifdef _OPENMP - #pragma omp for + #pragma omp parallel for schedule(dynamic,16) #endif - for (int row = 0; row < H - m; row += 2) - { - for (int col = 0; col < W - n; col += 2) { - float vignettecorr = ( refcolor[m][n] / max(1e-5f, cfablur[(row + m) * W + col + n] - black[c4]) ); - rawData[row + m][col + n] = (rawData[row + m][col + n] - black[c4]) * vignettecorr + black[c4]; - } - } - } + for (int row = 0; row < H; row ++) { + int col = 0; +#ifdef __SSE2__ + vfloat rowBlackv = blackv[row & 1]; + vfloat rowRefcolorv = refcolorv[row & 1]; + + for (; col < W - 3; col += 4) { + vfloat vignettecorrv = rowRefcolorv / vmaxf(epsv, LVFU(cfablur[(row) * W + col]) - rowBlackv); + vfloat valv = LVFU(rawData[row][col]); + valv -= rowBlackv; + STVFU(rawData[row][col], valv * vignettecorrv + rowBlackv); } + +#endif + + for (; col < W; col ++) { + float vignettecorr = refcolor[row & 1][col & 1] / max(1e-5f, cfablur[(row) * W + col] - black[c4[row & 1][col & 1]]); + rawData[row][col] = (rawData[row][col] - black[c4[row & 1][col & 1]]) * vignettecorr + black[c4[row & 1][col & 1]]; + } + } } else if(ri->getSensorType() == ST_FUJI_XTRANS) { float refcolor[3] = {0.f}; int cCount[3] = {0}; @@ -2866,32 +2903,52 @@ void RawImageSource::processFlatField(const RAWParams &raw, RawImage *riFlatFile } if (raw.ff_BlurType == RAWParams::ff_BlurTypestring[RAWParams::vh_ff]) { - float (*cfablur1); - cfablur1 = (float (*)) calloc (H * W, sizeof * cfablur1); - float (*cfablur2); - cfablur2 = (float (*)) calloc (H * W, sizeof * cfablur2); + float *cfablur1 = (float (*)) malloc (H * W * sizeof * cfablur1); + float *cfablur2 = (float (*)) malloc (H * W * sizeof * cfablur2); //slightly more complicated blur if trying to correct both vertical and horizontal anomalies cfaboxblur(riFlatFile, cfablur1, 0, 2 * BS); //now do horizontal blur cfaboxblur(riFlatFile, cfablur2, 2 * BS, 0); //now do vertical blur if(ri->getSensorType() == ST_BAYER) { - for (int m = 0; m < 2; m++) - for (int n = 0; n < 2; n++) { + unsigned int c[2][2] = {{FC(0, 0), FC(0, 1)}, {FC(1, 0), FC(1, 1)}}; + unsigned int c4[2][2]; + c4[0][0] = ( c[0][0] == 1) ? 3 : c[0][0]; + c4[0][1] = ( c[0][1] == 1) ? 3 : c[0][1]; + c4[1][0] = c[1][0]; + c4[1][1] = c[1][1]; + +#ifdef __SSE2__ + vfloat blackv[2] = {_mm_set_ps(black[c4[0][1]], black[c4[0][0]], black[c4[0][1]], black[c4[0][0]]), + _mm_set_ps(black[c4[1][1]], black[c4[1][0]], black[c4[1][1]], black[c4[1][0]]) + }; + + vfloat epsv = F2V(1e-5f); +#endif #ifdef _OPENMP - #pragma omp parallel for + #pragma omp parallel for schedule(dynamic,16) #endif - for (int row = 0; row < H - m; row += 2) { - int c = FC(row, 0); - int c4 = ( c == 1 && !(row & 1) ) ? 3 : c; + for (int row = 0; row < H; row ++) { + int col = 0; +#ifdef __SSE2__ + vfloat rowBlackv = blackv[row & 1]; - for (int col = 0; col < W - n; col += 2) { - float hlinecorr = (max(1e-5f, cfablur[(row + m) * W + col + n] - black[c4]) / max(1e-5f, cfablur1[(row + m) * W + col + n] - black[c4]) ); - float vlinecorr = (max(1e-5f, cfablur[(row + m) * W + col + n] - black[c4]) / max(1e-5f, cfablur2[(row + m) * W + col + n] - black[c4]) ); - rawData[row + m][col + n] = ((rawData[row + m][col + n] - black[c4]) * hlinecorr * vlinecorr + black[c4]); - } - } + for (; col < W - 3; col += 4) { + vfloat linecorrv = SQRV(vmaxf(epsv, LVFU(cfablur[row * W + col]) - rowBlackv)) / + (vmaxf(epsv, LVFU(cfablur1[row * W + col]) - rowBlackv) * vmaxf(epsv, LVFU(cfablur2[row * W + col]) - rowBlackv)); + vfloat valv = LVFU(rawData[row][col]); + valv -= rowBlackv; + STVFU(rawData[row][col], valv * linecorrv + rowBlackv); } + +#endif + + for (; col < W; col ++) { + float linecorr = SQR(max(1e-5f, cfablur[row * W + col] - black[c4[row & 1][col & 1]])) / + (max(1e-5f, cfablur1[row * W + col] - black[c4[row & 1][col & 1]]) * max(1e-5f, cfablur2[row * W + col] - black[c4[row & 1][col & 1]])) ; + rawData[row][col] = (rawData[row][col] - black[c4[row & 1][col & 1]]) * linecorr + black[c4[row & 1][col & 1]]; + } + } } else if(ri->getSensorType() == ST_FUJI_XTRANS) { #ifdef _OPENMP #pragma omp parallel for @@ -2938,13 +2995,17 @@ void RawImageSource::copyOriginalPixels(const RAWParams &raw, RawImage *src, Raw for (int col = 0; col < W; col++) { int c = FC(row, col); int c4 = ( c == 1 && !(row & 1) ) ? 3 : c; - rawData[row][col] = max(src->data[row][col] + black[c4] - riDark->data[row][col], 0.0f); + rawData[row][col] = max(src->data[row][col] + black[c4] - riDark->data[row][col], 0.0f); } } } else { +#ifdef _OPENMP + #pragma omp parallel for +#endif + for (int row = 0; row < H; row++) { for (int col = 0; col < W; col++) { - rawData[row][col] = src->data[row][col]; + rawData[row][col] = src->data[row][col]; } } } @@ -3001,238 +3062,248 @@ void RawImageSource::copyOriginalPixels(const RAWParams &raw, RawImage *src, Raw } } -SSEFUNCTION void RawImageSource::cfaboxblur(RawImage *riFlatFile, float* cfablur, const int boxH, const int boxW ) +SSEFUNCTION void RawImageSource::cfaboxblur(RawImage *riFlatFile, float* cfablur, const int boxH, const int boxW) { - float (*cfatmp); - cfatmp = (float (*)) calloc (H * W, sizeof * cfatmp); -// const float hotdeadthresh = 0.5; + if(boxW == 0 && boxH == 0) { // nothing to blur + memcpy(cfablur, riFlatFile->data[0], W * H * sizeof(float)); + return; + } + + float *tmpBuffer = nullptr; + float *cfatmp = nullptr; + float *srcVertical = nullptr; + + + if(boxH > 0 && boxW > 0) { + // we need a temporary buffer if we have to blur both directions + tmpBuffer = (float (*)) calloc (H * W, sizeof * tmpBuffer); + } + + if(boxH == 0) { + // if boxH == 0 we can skip the vertical blur and process the horizontal blur from riFlatFile to cfablur without using a temporary buffer + cfatmp = cfablur; + } else { + cfatmp = tmpBuffer; + } + + if(boxW == 0) { + // if boxW == 0 we can skip the horizontal blur and process the vertical blur from riFlatFile to cfablur without using a temporary buffer + srcVertical = riFlatFile->data[0]; + } else { + srcVertical = cfatmp; + } #ifdef _OPENMP #pragma omp parallel #endif { + + if(boxW > 0) { + //box blur cfa image; box size = BS + //horizontal blur #ifdef _OPENMP - #pragma omp for + #pragma omp for #endif - for (int i = 0; i < H; i++) { - int iprev, inext, jprev, jnext; - int p[5], temp, median; + for (int row = 0; row < H; row++) { + int len = boxW / 2 + 1; + cfatmp[row * W + 0] = riFlatFile->data[row][0] / len; + cfatmp[row * W + 1] = riFlatFile->data[row][1] / len; - if (i < 2) { - iprev = i + 2; - } else { - iprev = i - 2; - } - - if (i > H - 3) { - inext = i - 2; - } else { - inext = i + 2; - } - - for (int j = 0; j < W; j++) { - if (j < 2) { - jprev = j + 2; - } else { - jprev = j - 2; + for (int j = 2; j <= boxW; j += 2) { + cfatmp[row * W + 0] += riFlatFile->data[row][j] / len; + cfatmp[row * W + 1] += riFlatFile->data[row][j + 1] / len; } - if (j > W - 3) { - jnext = j - 2; - } else { - jnext = j + 2; + for (int col = 2; col <= boxW; col += 2) { + cfatmp[row * W + col] = (cfatmp[row * W + col - 2] * len + riFlatFile->data[row][boxW + col]) / (len + 1); + cfatmp[row * W + col + 1] = (cfatmp[row * W + col - 1] * len + riFlatFile->data[row][boxW + col + 1]) / (len + 1); + len ++; } - //med3x3(riFlatFile->data[iprev][jprev], riFlatFile->data[iprev][j], riFlatFile->data[iprev][jnext], - // riFlatFile->data[i][jprev], riFlatFile->data[i][j], riFlatFile->data[i][jnext], - // riFlatFile->data[inext][jprev], riFlatFile->data[inext][j], riFlatFile->data[inext][jnext], cfatmp[i*W+j]); - med5(riFlatFile->data[iprev][j], riFlatFile->data[i][jprev], riFlatFile->data[i][j], - riFlatFile->data[i][jnext], riFlatFile->data[inext][j], median); - -// if (riFlatFile->data[i][j]>hotdeadthresh*median || median>hotdeadthresh*riFlatFile->data[i][j]) { - if (((int)riFlatFile->data[i][j] << 1) > median || (median << 1) > riFlatFile->data[i][j]) { - cfatmp[i * W + j] = median; - } else { - cfatmp[i * W + j] = riFlatFile->data[i][j]; + for (int col = boxW + 2; col < W - boxW; col++) { + cfatmp[row * W + col] = cfatmp[row * W + col - 2] + (riFlatFile->data[row][boxW + col] - cfatmp[row * W + col - boxW - 2]) / len; } + for (int col = W - boxW; col < W; col += 2) { + cfatmp[row * W + col] = (cfatmp[row * W + col - 2] * len - cfatmp[row * W + col - boxW - 2]) / (len - 1); + + if (col + 1 < W) { + cfatmp[row * W + col + 1] = (cfatmp[row * W + col - 1] * len - cfatmp[row * W + col - boxW - 1]) / (len - 1); + } + + len --; + } } } - //box blur cfa image; box size = BS - //horizontal blur -#ifdef _OPENMP - #pragma omp for -#endif - - for (int row = 0; row < H; row++) { - int len = boxW / 2 + 1; - cfatmp[row * W + 0] = cfatmp[row * W + 0] / len; - cfatmp[row * W + 1] = cfatmp[row * W + 1] / len; - - for (int j = 2; j <= boxW; j += 2) { - cfatmp[row * W + 0] += cfatmp[row * W + j] / len; - cfatmp[row * W + 1] += cfatmp[row * W + j + 1] / len; - } - - for (int col = 2; col <= boxW; col += 2) { - cfatmp[row * W + col] = (cfatmp[row * W + col - 2] * len + cfatmp[row * W + boxW + col]) / (len + 1); - cfatmp[row * W + col + 1] = (cfatmp[row * W + col - 1] * len + cfatmp[row * W + boxW + col + 1]) / (len + 1); - len ++; - } - - for (int col = boxW + 2; col < W - boxW; col++) { - cfatmp[row * W + col] = cfatmp[row * W + col - 2] + (cfatmp[row * W + boxW + col] - cfatmp[row * W + col - boxW - 2]) / len; - } - - for (int col = W - boxW; col < W; col += 2) { - cfatmp[row * W + col] = (cfatmp[row * W + col - 2] * len - cfatmp[row * W + col - boxW - 2]) / (len - 1); - - if (col + 1 < W) { - cfatmp[row * W + col + 1] = (cfatmp[row * W + col - 1] * len - cfatmp[row * W + col - boxW - 1]) / (len - 1); - } - - len --; - } - } - - //vertical blur + if(boxH > 0) { + //vertical blur #ifdef __SSE2__ - vfloat leninitv = F2V(boxH / 2 + 1); - vfloat onev = F2V( 1.0f ); - vfloat temp1v, temp2v, lenv, lenp1v, lenm1v; - int row; + vfloat leninitv = F2V(boxH / 2 + 1); + vfloat onev = F2V( 1.0f ); + vfloat temp1v, temp2v, temp3v, temp4v, lenv, lenp1v, lenm1v; + int row; #ifdef _OPENMP - #pragma omp for + #pragma omp for nowait #endif - for (int col = 0; col < W - 3; col += 4) { - lenv = leninitv; - temp1v = LVFU(cfatmp[0 * W + col]) / lenv; - temp2v = LVFU(cfatmp[1 * W + col]) / lenv; + for (int col = 0; col < W - 7; col += 8) { + lenv = leninitv; + temp1v = LVFU(srcVertical[0 * W + col]) / lenv; + temp2v = LVFU(srcVertical[1 * W + col]) / lenv; + temp3v = LVFU(srcVertical[0 * W + col + 4]) / lenv; + temp4v = LVFU(srcVertical[1 * W + col + 4]) / lenv; - for (int i = 2; i < boxH + 2; i += 2) { - temp1v += LVFU(cfatmp[i * W + col]) / lenv; - temp2v += LVFU(cfatmp[(i + 1) * W + col]) / lenv; - } - - STVFU(cfablur[0 * W + col], temp1v); - STVFU(cfablur[1 * W + col], temp2v); - - for (row = 2; row < boxH + 2; row += 2) { - lenp1v = lenv + onev; - temp1v = (temp1v * lenv + LVFU(cfatmp[(row + boxH) * W + col])) / lenp1v; - temp2v = (temp2v * lenv + LVFU(cfatmp[(row + boxH + 1) * W + col])) / lenp1v; - STVFU(cfablur[row * W + col], temp1v); - STVFU(cfablur[(row + 1)*W + col], temp2v); - lenv = lenp1v; - } - - for (; row < H - boxH - 1; row += 2) { - temp1v = temp1v + (LVFU(cfatmp[(row + boxH) * W + col]) - LVFU(cfatmp[(row - boxH - 2) * W + col])) / lenv; - temp2v = temp2v + (LVFU(cfatmp[(row + 1 + boxH) * W + col]) - LVFU(cfatmp[(row + 1 - boxH - 2) * W + col])) / lenv; - STVFU(cfablur[row * W + col], temp1v); - STVFU(cfablur[(row + 1)*W + col], temp2v); - } - - for(; row < H - boxH; row++) { - temp1v = temp1v + (LVFU(cfatmp[(row + boxH) * W + col]) - LVFU(cfatmp[(row - boxH - 2) * W + col])) / lenv; - STVFU(cfablur[row * W + col], temp1v); - vfloat swapv = temp1v; - temp1v = temp2v; - temp2v = swapv; - - } - - for (; row < H - 1; row += 2) { - lenm1v = lenv - onev; - temp1v = (temp1v * lenv - LVFU(cfatmp[(row - boxH - 2) * W + col])) / lenm1v; - temp2v = (temp2v * lenv - LVFU(cfatmp[(row - boxH - 1) * W + col])) / lenm1v; - STVFU(cfablur[row * W + col], temp1v); - STVFU(cfablur[(row + 1)*W + col], temp2v); - lenv = lenm1v; - } - - for(; row < H; row++) { - lenm1v = lenv - onev; - temp1v = (temp1v * lenv - LVFU(cfatmp[(row - boxH - 2) * W + col])) / lenm1v; - STVFU(cfablur[(row)*W + col], temp1v); - } - - } - - for (int col = W - (W % 4); col < W; col++) { - int len = boxH / 2 + 1; - cfablur[0 * W + col] = cfatmp[0 * W + col] / len; - cfablur[1 * W + col] = cfatmp[1 * W + col] / len; - - for (int i = 2; i < boxH + 2; i += 2) { - cfablur[0 * W + col] += cfatmp[i * W + col] / len; - cfablur[1 * W + col] += cfatmp[(i + 1) * W + col] / len; - } - - for (int row = 2; row < boxH + 2; row += 2) { - cfablur[row * W + col] = (cfablur[(row - 2) * W + col] * len + cfatmp[(row + boxH) * W + col]) / (len + 1); - cfablur[(row + 1)*W + col] = (cfablur[(row - 1) * W + col] * len + cfatmp[(row + boxH + 1) * W + col]) / (len + 1); - len ++; - } - - for (int row = boxH + 2; row < H - boxH; row++) { - cfablur[row * W + col] = cfablur[(row - 2) * W + col] + (cfatmp[(row + boxH) * W + col] - cfatmp[(row - boxH - 2) * W + col]) / len; - } - - for (int row = H - boxH; row < H; row += 2) { - cfablur[row * W + col] = (cfablur[(row - 2) * W + col] * len - cfatmp[(row - boxH - 2) * W + col]) / (len - 1); - - if (row + 1 < H) { - cfablur[(row + 1)*W + col] = (cfablur[(row - 1) * W + col] * len - cfatmp[(row - boxH - 1) * W + col]) / (len - 1); + for (int i = 2; i < boxH + 2; i += 2) { + temp1v += LVFU(srcVertical[i * W + col]) / lenv; + temp2v += LVFU(srcVertical[(i + 1) * W + col]) / lenv; + temp3v += LVFU(srcVertical[i * W + col + 4]) / lenv; + temp4v += LVFU(srcVertical[(i + 1) * W + col + 4]) / lenv; + } + + STVFU(cfablur[0 * W + col], temp1v); + STVFU(cfablur[1 * W + col], temp2v); + STVFU(cfablur[0 * W + col + 4], temp3v); + STVFU(cfablur[1 * W + col + 4], temp4v); + + for (row = 2; row < boxH + 2; row += 2) { + lenp1v = lenv + onev; + temp1v = (temp1v * lenv + LVFU(srcVertical[(row + boxH) * W + col])) / lenp1v; + temp2v = (temp2v * lenv + LVFU(srcVertical[(row + boxH + 1) * W + col])) / lenp1v; + temp3v = (temp3v * lenv + LVFU(srcVertical[(row + boxH) * W + col + 4])) / lenp1v; + temp4v = (temp4v * lenv + LVFU(srcVertical[(row + boxH + 1) * W + col + 4])) / lenp1v; + STVFU(cfablur[row * W + col], temp1v); + STVFU(cfablur[(row + 1)*W + col], temp2v); + STVFU(cfablur[row * W + col + 4], temp3v); + STVFU(cfablur[(row + 1)*W + col + 4], temp4v); + lenv = lenp1v; + } + + for (; row < H - boxH - 1; row += 2) { + temp1v = temp1v + (LVFU(srcVertical[(row + boxH) * W + col]) - LVFU(srcVertical[(row - boxH - 2) * W + col])) / lenv; + temp2v = temp2v + (LVFU(srcVertical[(row + 1 + boxH) * W + col]) - LVFU(srcVertical[(row + 1 - boxH - 2) * W + col])) / lenv; + temp3v = temp3v + (LVFU(srcVertical[(row + boxH) * W + col + 4]) - LVFU(srcVertical[(row - boxH - 2) * W + col + 4])) / lenv; + temp4v = temp4v + (LVFU(srcVertical[(row + 1 + boxH) * W + col + 4]) - LVFU(srcVertical[(row + 1 - boxH - 2) * W + col + 4])) / lenv; + STVFU(cfablur[row * W + col], temp1v); + STVFU(cfablur[(row + 1)*W + col], temp2v); + STVFU(cfablur[row * W + col + 4], temp3v); + STVFU(cfablur[(row + 1)*W + col + 4], temp4v); + } + + for(; row < H - boxH; row++) { + temp1v = temp1v + (LVFU(srcVertical[(row + boxH) * W + col]) - LVFU(srcVertical[(row - boxH - 2) * W + col])) / lenv; + temp3v = temp3v + (LVFU(srcVertical[(row + boxH) * W + col + 4]) - LVFU(srcVertical[(row - boxH - 2) * W + col + 4])) / lenv; + STVFU(cfablur[row * W + col], temp1v); + STVFU(cfablur[row * W + col + 4], temp3v); + vfloat swapv = temp1v; + temp1v = temp2v; + temp2v = swapv; + swapv = temp3v; + temp3v = temp4v; + temp4v = swapv; + } + + for (; row < H - 1; row += 2) { + lenm1v = lenv - onev; + temp1v = (temp1v * lenv - LVFU(srcVertical[(row - boxH - 2) * W + col])) / lenm1v; + temp2v = (temp2v * lenv - LVFU(srcVertical[(row - boxH - 1) * W + col])) / lenm1v; + temp3v = (temp3v * lenv - LVFU(srcVertical[(row - boxH - 2) * W + col + 4])) / lenm1v; + temp4v = (temp4v * lenv - LVFU(srcVertical[(row - boxH - 1) * W + col + 4])) / lenm1v; + STVFU(cfablur[row * W + col], temp1v); + STVFU(cfablur[(row + 1)*W + col], temp2v); + STVFU(cfablur[row * W + col + 4], temp3v); + STVFU(cfablur[(row + 1)*W + col + 4], temp4v); + lenv = lenm1v; + } + + for(; row < H; row++) { + lenm1v = lenv - onev; + temp1v = (temp1v * lenv - LVFU(srcVertical[(row - boxH - 2) * W + col])) / lenm1v; + temp3v = (temp3v * lenv - LVFU(srcVertical[(row - boxH - 2) * W + col + 4])) / lenm1v; + STVFU(cfablur[(row)*W + col], temp1v); + STVFU(cfablur[(row)*W + col + 4], temp3v); } - len --; } - } + + #pragma omp single + + for (int col = W - (W % 8); col < W; col++) { + int len = boxH / 2 + 1; + cfablur[0 * W + col] = srcVertical[0 * W + col] / len; + cfablur[1 * W + col] = srcVertical[1 * W + col] / len; + + for (int i = 2; i < boxH + 2; i += 2) { + cfablur[0 * W + col] += srcVertical[i * W + col] / len; + cfablur[1 * W + col] += srcVertical[(i + 1) * W + col] / len; + } + + for (int row = 2; row < boxH + 2; row += 2) { + cfablur[row * W + col] = (cfablur[(row - 2) * W + col] * len + srcVertical[(row + boxH) * W + col]) / (len + 1); + cfablur[(row + 1)*W + col] = (cfablur[(row - 1) * W + col] * len + srcVertical[(row + boxH + 1) * W + col]) / (len + 1); + len ++; + } + + for (int row = boxH + 2; row < H - boxH; row++) { + cfablur[row * W + col] = cfablur[(row - 2) * W + col] + (srcVertical[(row + boxH) * W + col] - srcVertical[(row - boxH - 2) * W + col]) / len; + } + + for (int row = H - boxH; row < H; row += 2) { + cfablur[row * W + col] = (cfablur[(row - 2) * W + col] * len - srcVertical[(row - boxH - 2) * W + col]) / (len - 1); + + if (row + 1 < H) { + cfablur[(row + 1)*W + col] = (cfablur[(row - 1) * W + col] * len - srcVertical[(row - boxH - 1) * W + col]) / (len - 1); + } + + len --; + } + } #else #ifdef _OPENMP - #pragma omp for + #pragma omp for #endif - for (int col = 0; col < W; col++) { - int len = boxH / 2 + 1; - cfablur[0 * W + col] = cfatmp[0 * W + col] / len; - cfablur[1 * W + col] = cfatmp[1 * W + col] / len; + for (int col = 0; col < W; col++) { + int len = boxH / 2 + 1; + cfablur[0 * W + col] = srcVertical[0 * W + col] / len; + cfablur[1 * W + col] = srcVertical[1 * W + col] / len; - for (int i = 2; i < boxH + 2; i += 2) { - cfablur[0 * W + col] += cfatmp[i * W + col] / len; - cfablur[1 * W + col] += cfatmp[(i + 1) * W + col] / len; - } - - for (int row = 2; row < boxH + 2; row += 2) { - cfablur[row * W + col] = (cfablur[(row - 2) * W + col] * len + cfatmp[(row + boxH) * W + col]) / (len + 1); - cfablur[(row + 1)*W + col] = (cfablur[(row - 1) * W + col] * len + cfatmp[(row + boxH + 1) * W + col]) / (len + 1); - len ++; - } - - for (int row = boxH + 2; row < H - boxH; row++) { - cfablur[row * W + col] = cfablur[(row - 2) * W + col] + (cfatmp[(row + boxH) * W + col] - cfatmp[(row - boxH - 2) * W + col]) / len; - } - - for (int row = H - boxH; row < H; row += 2) { - cfablur[row * W + col] = (cfablur[(row - 2) * W + col] * len - cfatmp[(row - boxH - 2) * W + col]) / (len - 1); - - if (row + 1 < H) { - cfablur[(row + 1)*W + col] = (cfablur[(row - 1) * W + col] * len - cfatmp[(row - boxH - 1) * W + col]) / (len - 1); + for (int i = 2; i < boxH + 2; i += 2) { + cfablur[0 * W + col] += srcVertical[i * W + col] / len; + cfablur[1 * W + col] += srcVertical[(i + 1) * W + col] / len; } - len --; + for (int row = 2; row < boxH + 2; row += 2) { + cfablur[row * W + col] = (cfablur[(row - 2) * W + col] * len + srcVertical[(row + boxH) * W + col]) / (len + 1); + cfablur[(row + 1)*W + col] = (cfablur[(row - 1) * W + col] * len + srcVertical[(row + boxH + 1) * W + col]) / (len + 1); + len ++; + } + + for (int row = boxH + 2; row < H - boxH; row++) { + cfablur[row * W + col] = cfablur[(row - 2) * W + col] + (srcVertical[(row + boxH) * W + col] - srcVertical[(row - boxH - 2) * W + col]) / len; + } + + for (int row = H - boxH; row < H; row += 2) { + cfablur[row * W + col] = (cfablur[(row - 2) * W + col] * len - srcVertical[(row - boxH - 2) * W + col]) / (len - 1); + + if (row + 1 < H) { + cfablur[(row + 1)*W + col] = (cfablur[(row - 1) * W + col] * len - srcVertical[(row - boxH - 1) * W + col]) / (len - 1); + } + + len --; + } } - } #endif + } + } + + if(tmpBuffer) { + free (tmpBuffer); } - free (cfatmp); } @@ -3733,10 +3804,11 @@ void RawImageSource::colorSpaceConversion_ (Imagefloat* im, ColorManagementParam pre_mul[2] }; const DCPProfile::Matrix cam_matrix = {{ - {camMatrix[0][0], camMatrix[0][1], camMatrix[0][2]}, - {camMatrix[1][0], camMatrix[1][1], camMatrix[1][2]}, - {camMatrix[2][0], camMatrix[2][1], camMatrix[2][2]} - }}; + {camMatrix[0][0], camMatrix[0][1], camMatrix[0][2]}, + {camMatrix[1][0], camMatrix[1][1], camMatrix[1][2]}, + {camMatrix[2][0], camMatrix[2][1], camMatrix[2][2]} + } + }; dcpProf->apply(im, cmp.dcpIlluminant, cmp.working, wb, pre_mul_row, cam_matrix, cmp.applyHueSatMap); return; } @@ -3844,32 +3916,32 @@ void RawImageSource::colorSpaceConversion_ (Imagefloat* im, ColorManagementParam lcmsMutex->lock (); switch (camera_icc_type) { - case CAMERA_ICC_TYPE_PHASE_ONE: - case CAMERA_ICC_TYPE_LEAF: { - // These profiles have a RGB to Lab cLUT, gives gamma 1.8 output, and expects a "film-like" curve on input - transform_via_pcs_lab = true; - separate_pcs_lab_highlights = true; - // We transform to Lab because we can and that we avoid getting an unnecessary unmatched gamma conversion which we would need to revert. - hTransform = cmsCreateTransform (in, TYPE_RGB_FLT, NULL, TYPE_Lab_FLT, INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_NOOPTIMIZE | cmsFLAGS_NOCACHE ); + case CAMERA_ICC_TYPE_PHASE_ONE: + case CAMERA_ICC_TYPE_LEAF: { + // These profiles have a RGB to Lab cLUT, gives gamma 1.8 output, and expects a "film-like" curve on input + transform_via_pcs_lab = true; + separate_pcs_lab_highlights = true; + // We transform to Lab because we can and that we avoid getting an unnecessary unmatched gamma conversion which we would need to revert. + hTransform = cmsCreateTransform (in, TYPE_RGB_FLT, NULL, TYPE_Lab_FLT, INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_NOOPTIMIZE | cmsFLAGS_NOCACHE ); - for (int i = 0; i < 3; i++) { - for (int j = 0; j < 3; j++) { - leaf_prophoto_mat[i][j] = 0; + for (int i = 0; i < 3; i++) { + for (int j = 0; j < 3; j++) { + leaf_prophoto_mat[i][j] = 0; - for (int k = 0; k < 3; k++) { - leaf_prophoto_mat[i][j] += prophoto_xyz[i][k] * camMatrix[k][j]; + for (int k = 0; k < 3; k++) { + leaf_prophoto_mat[i][j] += prophoto_xyz[i][k] * camMatrix[k][j]; + } } } + + break; } - break; - } - - case CAMERA_ICC_TYPE_NIKON: - case CAMERA_ICC_TYPE_GENERIC: - default: - hTransform = cmsCreateTransform (in, TYPE_RGB_FLT, prophoto, TYPE_RGB_FLT, INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_NOOPTIMIZE | cmsFLAGS_NOCACHE ); // NOCACHE is important for thread safety - break; + case CAMERA_ICC_TYPE_NIKON: + case CAMERA_ICC_TYPE_GENERIC: + default: + hTransform = cmsCreateTransform (in, TYPE_RGB_FLT, prophoto, TYPE_RGB_FLT, INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_NOOPTIMIZE | cmsFLAGS_NOCACHE ); // NOCACHE is important for thread safety + break; } lcmsMutex->unlock (); @@ -3927,45 +3999,45 @@ void RawImageSource::colorSpaceConversion_ (Imagefloat* im, ColorManagementParam } switch (camera_icc_type) { - case CAMERA_ICC_TYPE_PHASE_ONE: - // Here we apply a curve similar to Capture One's "Film Standard" + gamma, the reason is that the LUTs embedded in the - // ICCs are designed to work on such input, and if you provide it with a different curve you don't get as good result. - // We will revert this curve after we've made the color transform. However when we revert the curve, we'll notice that - // highlight rendering suffers due to that the LUT transform don't expand well, therefore we do a less compressed - // conversion too and mix them, this gives us the highest quality and most flexible result. - hl_buffer.data[3 * w + 0] = pow_F(r, 1.0 / 1.8); - hl_buffer.data[3 * w + 1] = pow_F(g, 1.0 / 1.8); - hl_buffer.data[3 * w + 2] = pow_F(b, 1.0 / 1.8); - r = phaseOneIccCurveInv->getVal(r); - g = phaseOneIccCurveInv->getVal(g); - b = phaseOneIccCurveInv->getVal(b); - break; + case CAMERA_ICC_TYPE_PHASE_ONE: + // Here we apply a curve similar to Capture One's "Film Standard" + gamma, the reason is that the LUTs embedded in the + // ICCs are designed to work on such input, and if you provide it with a different curve you don't get as good result. + // We will revert this curve after we've made the color transform. However when we revert the curve, we'll notice that + // highlight rendering suffers due to that the LUT transform don't expand well, therefore we do a less compressed + // conversion too and mix them, this gives us the highest quality and most flexible result. + hl_buffer.data[3 * w + 0] = pow_F(r, 1.0 / 1.8); + hl_buffer.data[3 * w + 1] = pow_F(g, 1.0 / 1.8); + hl_buffer.data[3 * w + 2] = pow_F(b, 1.0 / 1.8); + r = phaseOneIccCurveInv->getVal(r); + g = phaseOneIccCurveInv->getVal(g); + b = phaseOneIccCurveInv->getVal(b); + break; - case CAMERA_ICC_TYPE_LEAF: { - // Leaf profiles expect that the camera native RGB has been converted to Prophoto RGB - float newr = leaf_prophoto_mat[0][0] * r + leaf_prophoto_mat[0][1] * g + leaf_prophoto_mat[0][2] * b; - float newg = leaf_prophoto_mat[1][0] * r + leaf_prophoto_mat[1][1] * g + leaf_prophoto_mat[1][2] * b; - float newb = leaf_prophoto_mat[2][0] * r + leaf_prophoto_mat[2][1] * g + leaf_prophoto_mat[2][2] * b; - hl_buffer.data[3 * w + 0] = pow_F(newr, 1.0 / 1.8); - hl_buffer.data[3 * w + 1] = pow_F(newg, 1.0 / 1.8); - hl_buffer.data[3 * w + 2] = pow_F(newb, 1.0 / 1.8); - r = phaseOneIccCurveInv->getVal(newr); - g = phaseOneIccCurveInv->getVal(newg); - b = phaseOneIccCurveInv->getVal(newb); - break; - } + case CAMERA_ICC_TYPE_LEAF: { + // Leaf profiles expect that the camera native RGB has been converted to Prophoto RGB + float newr = leaf_prophoto_mat[0][0] * r + leaf_prophoto_mat[0][1] * g + leaf_prophoto_mat[0][2] * b; + float newg = leaf_prophoto_mat[1][0] * r + leaf_prophoto_mat[1][1] * g + leaf_prophoto_mat[1][2] * b; + float newb = leaf_prophoto_mat[2][0] * r + leaf_prophoto_mat[2][1] * g + leaf_prophoto_mat[2][2] * b; + hl_buffer.data[3 * w + 0] = pow_F(newr, 1.0 / 1.8); + hl_buffer.data[3 * w + 1] = pow_F(newg, 1.0 / 1.8); + hl_buffer.data[3 * w + 2] = pow_F(newb, 1.0 / 1.8); + r = phaseOneIccCurveInv->getVal(newr); + g = phaseOneIccCurveInv->getVal(newg); + b = phaseOneIccCurveInv->getVal(newb); + break; + } - case CAMERA_ICC_TYPE_NIKON: - // gamma 0.5 - r = sqrtf(r); - g = sqrtf(g); - b = sqrtf(b); - break; + case CAMERA_ICC_TYPE_NIKON: + // gamma 0.5 + r = sqrtf(r); + g = sqrtf(g); + b = sqrtf(b); + break; - case CAMERA_ICC_TYPE_GENERIC: - default: - // do nothing - break; + case CAMERA_ICC_TYPE_GENERIC: + default: + // do nothing + break; } *(p++) = r; @@ -4008,37 +4080,37 @@ void RawImageSource::colorSpaceConversion_ (Imagefloat* im, ColorManagementParam // restore pre-processing and/or add post-processing for the various ICC types switch (camera_icc_type) { - default: - break; + default: + break; - case CAMERA_ICC_TYPE_PHASE_ONE: - case CAMERA_ICC_TYPE_LEAF: { - // note the 1/1.8 gamma, it's the gamma that the profile has applied, which we must revert before we can revert the curve - r = phaseOneIccCurve->getVal(pow_F(r, 1.0 / 1.8)); - g = phaseOneIccCurve->getVal(pow_F(g, 1.0 / 1.8)); - b = phaseOneIccCurve->getVal(pow_F(b, 1.0 / 1.8)); - const float mix = 0.25; // may seem a low number, but remember this is linear space, mixing starts 2 stops from clipping - const float maxc = max(r, g, b); + case CAMERA_ICC_TYPE_PHASE_ONE: + case CAMERA_ICC_TYPE_LEAF: { + // note the 1/1.8 gamma, it's the gamma that the profile has applied, which we must revert before we can revert the curve + r = phaseOneIccCurve->getVal(pow_F(r, 1.0 / 1.8)); + g = phaseOneIccCurve->getVal(pow_F(g, 1.0 / 1.8)); + b = phaseOneIccCurve->getVal(pow_F(b, 1.0 / 1.8)); + const float mix = 0.25; // may seem a low number, but remember this is linear space, mixing starts 2 stops from clipping + const float maxc = max(r, g, b); - if (maxc > mix) { - float fac = (maxc - mix) / (1.0 - mix); - fac = sqrtf(sqrtf(fac)); // gamma 0.25 to mix in highlight render relatively quick - r = (1.0 - fac) * r + fac * hr; - g = (1.0 - fac) * g + fac * hg; - b = (1.0 - fac) * b + fac * hb; + if (maxc > mix) { + float fac = (maxc - mix) / (1.0 - mix); + fac = sqrtf(sqrtf(fac)); // gamma 0.25 to mix in highlight render relatively quick + r = (1.0 - fac) * r + fac * hr; + g = (1.0 - fac) * g + fac * hg; + b = (1.0 - fac) * b + fac * hb; + } + + break; } - break; - } - - case CAMERA_ICC_TYPE_NIKON: { - const float lineFac = -0.4; - const float lineSum = 1.35; - r *= r * lineFac + lineSum; - g *= g * lineFac + lineSum; - b *= b * lineFac + lineSum; - break; - } + case CAMERA_ICC_TYPE_NIKON: { + const float lineFac = -0.4; + const float lineSum = 1.35; + r *= r * lineFac + lineSum; + g *= g * lineFac + lineSum; + b *= b * lineFac + lineSum; + break; + } } // restore highlight scaling if any @@ -4352,7 +4424,7 @@ void RawImageSource::HLRecovery_CIELab (float* rin, float* gin, float* bin, floa //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -void RawImageSource::hlRecovery (std::string method, float* red, float* green, float* blue, int i, int sx1, int width, int skip, const RAWParams &raw, float* hlmax ) +void RawImageSource::hlRecovery (std::string method, float* red, float* green, float* blue, int width, float* hlmax ) { if (method == "Luminance") { @@ -4372,12 +4444,12 @@ void RawImageSource::hlRecovery (std::string method, float* red, float* green, f void RawImageSource::getAutoExpHistogram (LUTu & histogram, int& histcompr) { - BENCHFUN +// BENCHFUN histcompr = 3; histogram(65536 >> histcompr); histogram.clear(); - const float refwb[3] = {static_cast(refwb_red), static_cast(refwb_green), static_cast(refwb_blue)}; + const float refwb[3] = {static_cast(refwb_red / (1 << histcompr)), static_cast(refwb_green / (1 << histcompr)), static_cast(refwb_blue / (1 << histcompr))}; #ifdef _OPENMP #pragma omp parallel @@ -4386,7 +4458,7 @@ void RawImageSource::getAutoExpHistogram (LUTu & histogram, int& histcompr) LUTu tmphistogram(histogram.getSize()); tmphistogram.clear(); #ifdef _OPENMP - #pragma omp for nowait + #pragma omp for schedule(dynamic,16) nowait #endif for (int i = border; i < H - border; i++) { @@ -4394,22 +4466,50 @@ void RawImageSource::getAutoExpHistogram (LUTu & histogram, int& histcompr) getRowStartEnd (i, start, end); if (ri->getSensorType() == ST_BAYER) { - for (int j = start; j < end; j++) { - tmphistogram[(int)(refwb[ri->FC(i, j)] * rawData[i][j]) >> histcompr] += 4; + // precalculate factors to avoid expensive per pixel calculations + float refwb0 = refwb[ri->FC(i, start)]; + float refwb1 = refwb[ri->FC(i, start + 1)]; + int j; + + for (j = start; j < end - 1; j += 2) { + tmphistogram[(int)(refwb0 * rawData[i][j])] += 4; + tmphistogram[(int)(refwb1 * rawData[i][j + 1])] += 4; + } + + if(j < end) { + tmphistogram[(int)(refwb0 * rawData[i][j])] += 4; } } else if (ri->getSensorType() == ST_FUJI_XTRANS) { - for (int j = start; j < end; j++) { - tmphistogram[(int)(refwb[ri->XTRANSFC(i, j)] * rawData[i][j]) >> histcompr] += 4; + // precalculate factors to avoid expensive per pixel calculations + float refwb0 = refwb[ri->XTRANSFC(i, start)]; + float refwb1 = refwb[ri->XTRANSFC(i, start + 1)]; + float refwb2 = refwb[ri->XTRANSFC(i, start + 2)]; + float refwb3 = refwb[ri->XTRANSFC(i, start + 3)]; + float refwb4 = refwb[ri->XTRANSFC(i, start + 4)]; + float refwb5 = refwb[ri->XTRANSFC(i, start + 5)]; + int j; + + for (j = start; j < end - 5; j += 6) { + tmphistogram[(int)(refwb0 * rawData[i][j])] += 4; + tmphistogram[(int)(refwb1 * rawData[i][j + 1])] += 4; + tmphistogram[(int)(refwb2 * rawData[i][j + 2])] += 4; + tmphistogram[(int)(refwb3 * rawData[i][j + 3])] += 4; + tmphistogram[(int)(refwb4 * rawData[i][j + 4])] += 4; + tmphistogram[(int)(refwb5 * rawData[i][j + 5])] += 4; + } + + for (; j < end; j++) { + tmphistogram[(int)(refwb[ri->XTRANSFC(i, j)] * rawData[i][j])] += 4; } } else if (ri->get_colors() == 1) { for (int j = start; j < end; j++) { - tmphistogram[(int)(refwb_red * rawData[i][j]) >> histcompr]++; + tmphistogram[(int)(refwb_red * rawData[i][j])]++; } } else { for (int j = start; j < end; j++) { - tmphistogram[CLIP((int)(refwb_red * rawData[i][3 * j + 0])) >> histcompr]++; - tmphistogram[CLIP((int)(refwb_green * rawData[i][3 * j + 1])) >> histcompr] += 2; - tmphistogram[CLIP((int)(refwb_blue * rawData[i][3 * j + 2])) >> histcompr]++; + tmphistogram[CLIP((int)(refwb_red * rawData[i][3 * j + 0]))]++; + tmphistogram[CLIP((int)(refwb_green * rawData[i][3 * j + 1]))] += 2; + tmphistogram[CLIP((int)(refwb_blue * rawData[i][3 * j + 2]))]++; } } } @@ -4426,7 +4526,7 @@ void RawImageSource::getAutoExpHistogram (LUTu & histogram, int& histcompr) // Histogram MUST be 256 in size; gamma is applied, blackpoint and gain also void RawImageSource::getRAWHistogram (LUTu & histRedRaw, LUTu & histGreenRaw, LUTu & histBlueRaw) { - BENCHFUN +// BENCHFUN histRedRaw.clear(); histGreenRaw.clear(); histBlueRaw.clear(); @@ -4457,7 +4557,7 @@ void RawImageSource::getRAWHistogram (LUTu & histRedRaw, LUTu & histGreenRaw, LU #ifdef _OPENMP int numThreads; - // reduce the number of threads under certain conditions to avoid overhaed of too many critical regions + // reduce the number of threads under certain conditions to avoid overhead of too many critical regions numThreads = sqrt((((H - 2 * border) * (W - 2 * border)) / 262144.f)); numThreads = std::min(std::max(numThreads, 1), omp_get_max_threads()); @@ -4590,7 +4690,7 @@ void RawImageSource::getRowStartEnd (int x, int &start, int &end) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% void RawImageSource::getAutoWBMultipliers (double &rm, double &gm, double &bm) { - BENCHFUN +// BENCHFUN constexpr double clipHigh = 64000.0; if (ri->get_colors() == 1) { diff --git a/rtengine/rawimagesource.h b/rtengine/rawimagesource.h index 2af26c702..e682f0e79 100644 --- a/rtengine/rawimagesource.h +++ b/rtengine/rawimagesource.h @@ -97,7 +97,7 @@ protected: void hphd_horizontal (float** hpmap, int row_from, int row_to); void hphd_green (float** hpmap); void processFalseColorCorrectionThread (Imagefloat* im, array2D &rbconv_Y, array2D &rbconv_I, array2D &rbconv_Q, array2D &rbout_I, array2D &rbout_Q, const int row_from, const int row_to); - void hlRecovery (std::string method, float* red, float* green, float* blue, int i, int sx1, int width, int skip, const RAWParams &raw, float* hlmax); + void hlRecovery (std::string method, float* red, float* green, float* blue, int width, float* hlmax); void transformRect (PreviewProps pp, int tran, int &sx1, int &sy1, int &width, int &height, int &fw); void transformPosition (int x, int y, int tran, int& tx, int& ty); @@ -116,7 +116,7 @@ public: ~RawImageSource (); int load (const Glib::ustring &fname, bool batch = false); - void preprocess (const RAWParams &raw, const LensProfParams &lensProf, const CoarseTransformParams& coarse); + void preprocess (const RAWParams &raw, const LensProfParams &lensProf, const CoarseTransformParams& coarse, bool prepareDenoise = true); void demosaic (const RAWParams &raw); void retinex (ColorManagementParams cmp, RetinexParams deh, ToneCurveParams Tc, LUTf & cdcurve, LUTf & mapcurve, const RetinextransmissionCurve & dehatransmissionCurve, const RetinexgaintransmissionCurve & dehagaintransmissionCurve, multi_array2D &conversionBuffer, bool dehacontlutili, bool mapcontlutili, bool useHsl, float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax, LUTu &histLRETI); void retinexPrepareCurves (RetinexParams retinexParams, LUTf &cdcurve, LUTf &mapcurve, RetinextransmissionCurve &retinextransmissionCurve, RetinexgaintransmissionCurve &retinexgaintransmissionCurve, bool &retinexcontlutili, bool &mapcontlutili, bool &useHsl, LUTu & lhist16RETI, LUTu & histLRETI); @@ -134,7 +134,7 @@ public: void processFlatField(const RAWParams &raw, RawImage *riFlatFile, unsigned short black[4]); void copyOriginalPixels(const RAWParams &raw, RawImage *ri, RawImage *riDark, RawImage *riFlatFile ); - void cfaboxblur (RawImage *riFlatFile, float* cfablur, int boxH, int boxW ); + void cfaboxblur (RawImage *riFlatFile, float* cfablur, int boxH, int boxW); void scaleColors (int winx, int winy, int winw, int winh, const RAWParams &raw); // raw for cblack void getImage (const ColorTemp &ctemp, int tran, Imagefloat* image, const PreviewProps &pp, const ToneCurveParams &hrp, const ColorManagementParams &cmp, const RAWParams &raw); diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index c11ac6452..25bf45742 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -102,7 +102,7 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p ImProcFunctions ipf (¶ms, true); PreviewProps pp (0, 0, fw, fh, 1); - imgsrc->preprocess( params.raw, params.lensProf, params.coarse); + imgsrc->preprocess( params.raw, params.lensProf, params.coarse, params.dirpyrDenoise.enabled); if (params.toneCurve.autoexp) {// this enabled HLRecovery LUTu histRedRaw(256), histGreenRaw(256), histBlueRaw(256); @@ -823,11 +823,13 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p cl2Toningcurve (65536, 0); CurveFactory::curveToning(params.colorToning.cl2curve, cl2Toningcurve, 1); } + LabImage* labView = new LabImage (fw, fh); if(params.blackwhite.enabled) { CurveFactory::curveBW (params.blackwhite.beforeCurve, params.blackwhite.afterCurve, hist16, dummy, customToneCurvebw1, customToneCurvebw2, 1); } + double rrm, ggm, bbm; float autor, autog, autob; float satLimit = float(params.colorToning.satProtectionThreshold) / 100.f * 0.7f + 0.3f; @@ -910,8 +912,7 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p #endif for (int i = 0; i < fh; i++) - for (int j = 0; j < fw; j++) - { + for (int j = 0; j < fw; j++) { hist16thr[(int)((labView->L[i][j]))]++; } diff --git a/rtexif/canonattribs.cc b/rtexif/canonattribs.cc index 981798732..a4f4ab8b8 100644 --- a/rtexif/canonattribs.cc +++ b/rtexif/canonattribs.cc @@ -149,6 +149,9 @@ public: choices[3] = "Continuous, Speed Priority"; choices[4] = "Continuous, Low"; choices[5] = "Continuous, High"; + choices[6] = "Silent Single"; + choices[9] = "Single, Silent"; + choices[10] = "Continuous, Silent"; } }; CAContinuousDriveInterpreter caContinuousDriveInterpreter; @@ -161,11 +164,13 @@ public: choices[0] = "One-shot AF"; choices[1] = "AI Servo AF"; choices[2] = "AI Focus AF"; - choices[3] = "Manual Focus"; + choices[3] = "Manual Focus (3)"; choices[4] = "Single"; choices[5] = "Continuous"; - choices[6] = "Manual Focus"; + choices[6] = "Manual Focus (6)"; choices[16] = "Pan Focus"; + choices[256] = "AF + MF"; + choices[512] = "Movie Snap Focus"; } }; CAFocusModeInterpreter caFocusModeInterpreter; @@ -182,7 +187,8 @@ public: choices[5] = "TIF+JPEG"; choices[6] = "CR2"; choices[7] = "CR2+JPEG"; - choices[9] = "Video"; + choices[9] = "MOV"; + choices[10] = "MP4"; } }; CARecordModeInterpreter caRecordModeInterpreter; @@ -201,6 +207,9 @@ public: choices[8] = "Postcard"; choices[9] = "Widescreen"; choices[10] = "Medium Widescreen"; + choices[14] = "Small 1"; + choices[15] = "Small 2"; + choices[16] = "Small 3"; choices[128] = "640x480 Movie"; choices[129] = "Medium Movie"; choices[130] = "Small Movie"; @@ -215,17 +224,17 @@ class CAEasyModeInterpreter : public ChoiceInterpreter public: CAEasyModeInterpreter () { - choices[0] = "Full auto "; - choices[1] = "Manual "; - choices[2] = "Landscape "; - choices[3] = "Fast shutter "; - choices[4] = "Slow shutter "; - choices[5] = "Night "; - choices[6] = "Gray Scale "; - choices[7] = "Sepia "; - choices[8] = "Portrait "; - choices[9] = "Sports "; - choices[10] = "Macro "; + choices[0] = "Full auto"; + choices[1] = "Manual"; + choices[2] = "Landscape"; + choices[3] = "Fast shutter"; + choices[4] = "Slow shutter"; + choices[5] = "Night"; + choices[6] = "Gray Scale"; + choices[7] = "Sepia"; + choices[8] = "Portrait"; + choices[9] = "Sports"; + choices[10] = "Macro"; choices[11] = "Black & White"; choices[12] = "Pan focus"; choices[13] = "Vivid"; @@ -243,17 +252,49 @@ public: choices[25] = "Night Snapshot"; choices[26] = "Digital Macro"; choices[27] = "My Colors"; - choices[28] = "Still Image"; + choices[28] = "Movie Snap"; + choices[29] = "Super Macro 2"; choices[30] = "Color Accent"; choices[31] = "Color Swap"; choices[32] = "Aquarium"; choices[33] = "ISO 3200"; + choices[34] = "ISO 6400"; + choices[35] = "Creative Light Effect"; + choices[36] = "Easy"; + choices[37] = "Quick Shot"; choices[38] = "Creative Auto"; + choices[39] = "Zoom Blur"; + choices[40] = "Low Light"; + choices[41] = "Nostalgic"; choices[42] = "Super Vivid"; - choices[43] = "Poster"; - choices[47] = "Fisheye"; - choices[48] = "Miniature"; + choices[43] = "Poster Effect"; + choices[44] = "Face Self-timer"; + choices[45] = "Smile"; + choices[46] = "Wink Self-timer"; + choices[47] = "Fisheye Effect"; + choices[48] = "Miniature Effect"; + choices[49] = "High-speed Burst"; + choices[50] = "Best Image Selection"; + choices[51] = "High Dynamic Range"; + choices[52] = "Handheld Night Scene"; + choices[53] = "Movie Digest"; + choices[54] = "Live View Control"; + choices[55] = "Discreet"; + choices[56] = "Blur Reduction"; + choices[57] = "Monochrome"; + choices[58] = "Toy Camera Effect"; + choices[59] = "Scene Intelligent Auto"; + choices[60] = "High-speed Burst HQ"; + choices[61] = "Smooth Skin"; + choices[62] = "Soft Focus"; + choices[257] = "Spotlight"; + choices[258] = "Night 2"; + choices[259] = "Night+"; + choices[260] = "Super Night"; choices[261] = "Sunset"; + choices[263] = "Night Scene"; + choices[264] = "Surface"; + choices[265] = "Low Light 2"; } }; CAEasyModeInterpreter caEasyModeInterpreter; @@ -281,7 +322,7 @@ public: choices[2] = "Average"; choices[3] = "Evaluative"; choices[4] = "Partial"; - choices[5] = "Center-weighted averaging"; + choices[5] = "Center-weighted average"; } }; CAMeteringModeInterpreter caMeteringModeInterpreter; @@ -422,9 +463,14 @@ public: { choices[0] = "Off"; choices[1] = "On"; - choices[2] = "On, Shot Only"; - choices[3] = "On, Panning"; - choices[4] = "On, Video"; + choices[2] = "Shoot Only"; + choices[3] = "Panning"; + choices[4] = "Dynamic"; + choices[256] = "Off (2)"; + choices[257] = "On (2)"; + choices[258] = "Shoot Only (2)"; + choices[259] = "Panning (2)"; + choices[260] = "Dynamic (2)"; } }; CAStabilizationInterpreter caStabilizationInterpreter; @@ -593,6 +639,8 @@ public: choices.insert(p_t(44, "Canon EF 90-300mm f/4.5-5.6")); choices.insert(p_t(45, "Canon EF-S 18-55mm f/3.5-5.6 [II]")); choices.insert(p_t(46, "Canon EF 28-90mm f/4-5.6")); + choices.insert(p_t(47, "Zeiss Milvus 35mm f/2 or 50mm f/2")); + choices.insert(p_t(47, "Zeiss Milvus 50mm f/2 Makro")); choices.insert(p_t(48, "Canon EF-S 18-55mm f/3.5-5.6 IS")); choices.insert(p_t(49, "Canon EF-S 55-250mm f/4-5.6 IS")); choices.insert(p_t(50, "Canon EF-S 18-200mm f/3.5-5.6 IS")); @@ -626,9 +674,9 @@ public: choices.insert(p_t(137, "Sigma 18-250mm f/3.5-6.3 DC OS HSM")); choices.insert(p_t(137, "Sigma 24-70mm f/2.8 IF EX DG HSM")); choices.insert(p_t(137, "Sigma 18-125mm f/3.8-5.6 DC OS HSM")); - choices.insert(p_t(137, "Sigma 17-70mm f/2.8-4 DC Macro OS HSM")); + choices.insert(p_t(137, "Sigma 17-70mm f/2.8-4 DC Macro OS HSM | C")); choices.insert(p_t(137, "Sigma 17-50mm f/2.8 OS HSM")); - choices.insert(p_t(137, "Sigma 18-200mm f/3.5-6.3 II DC OS HSM")); + choices.insert(p_t(137, "Sigma 18-200mm f/3.5-6.3 DC OS HSM [II]")); choices.insert(p_t(137, "Tamron AF 18-270mm f/3.5-6.3 Di II VC PZD")); choices.insert(p_t(137, "Sigma 8-16mm f/4.5-5.6 DC HSM")); choices.insert(p_t(137, "Tamron SP 17-50mm f/2.8 XR Di II VC")); @@ -642,7 +690,8 @@ public: choices.insert(p_t(140, "Canon EF 500mm f/4.5L")); choices.insert(p_t(141, "Canon EF 500mm f/4.5L")); choices.insert(p_t(142, "Canon EF 300mm f/2.8L IS")); - choices.insert(p_t(143, "Canon EF 500mm f/4L IS")); + choices.insert(p_t(143, "Canon EF 500mm f/4L IS or Sigma Lens")); + choices.insert(p_t(143, "Sigma 17-70mm f/2.8-4 DC Macro OS HSM")); choices.insert(p_t(144, "Canon EF 35-135mm f/4-5.6 USM")); choices.insert(p_t(145, "Canon EF 100-300mm f/4.5-5.6 USM")); choices.insert(p_t(146, "Canon EF 70-210mm f/3.5-4.5 USM")); @@ -665,15 +714,18 @@ public: choices.insert(p_t(153, "Tamron AF 28-300mm f/3.5-6.3 XR LD Aspherical [IF] Macro")); choices.insert(p_t(153, "Tamron AF 18-200mm f/3.5-6.3 XR Di II LD Aspherical [IF] Macro Model A14")); choices.insert(p_t(153, "Tamron 18-250mm f/3.5-6.3 Di II LD Aspherical [IF] Macro")); - choices.insert(p_t(154, "Canon EF 20mm f/2.8 USM")); + choices.insert(p_t(154, "Canon EF 20mm f/2.8 USM or Zeiss Lens")); + choices.insert(p_t(154, "Zeiss Milvus 21mm f/2.8")); choices.insert(p_t(155, "Canon EF 85mm f/1.8 USM")); choices.insert(p_t(156, "Canon EF 28-105mm f/3.5-4.5 USM or Tamron Lens")); choices.insert(p_t(156, "Tamron SP 70-300mm f/4.0-5.6 Di VC USD")); + choices.insert(p_t(156, "Tamron SP AF 28-105mm f/2.8 LD Aspherical IF")); choices.insert(p_t(160, "Canon EF 20-35mm f/3.5-4.5 USM or Tamron or Tokina Lens")); choices.insert(p_t(160, "Tamron AF 19-35mm f/3.5-4.5")); choices.insert(p_t(160, "Tokina AT-X 124 AF Pro DX 12-24mm f/4")); choices.insert(p_t(160, "Tokina AT-X 107 AF DX 10-17mm f/3.5-4.5 Fisheye")); choices.insert(p_t(160, "Tokina AT-X 116 AF Pro DX 11-16mm f/2.8")); + choices.insert(p_t(160, "Tokina AT-X 11-20 F2.8 PRO DX Aspherical 11-20mm f/2.8")); choices.insert(p_t(161, "Canon EF 28-70mm f/2.8L or Sigma or Tamron Lens")); choices.insert(p_t(161, "Sigma 24-70mm f/2.8 EX")); choices.insert(p_t(161, "Sigma 28-70mm f/2.8 EX")); @@ -688,7 +740,8 @@ public: choices.insert(p_t(165, "Canon EF 70-200mm f/2.8 L")); choices.insert(p_t(166, "Canon EF 70-200mm f/2.8 L + 1.4x")); choices.insert(p_t(167, "Canon EF 70-200mm f/2.8 L + 2x")); - choices.insert(p_t(168, "Canon EF 28mm f/1.8 USM")); + choices.insert(p_t(168, "Canon EF 28mm f/1.8 USM or Sigma Lens")); + choices.insert(p_t(168, "Sigma 50-100mm f/1.8 DC HSM | A")); choices.insert(p_t(169, "Canon EF 17-35mm f/2.8L or Sigma Lens")); choices.insert(p_t(169, "Sigma 18-200mm f/3.5-6.3 DC OS")); choices.insert(p_t(169, "Sigma 15-30mm f/3.5-4.5 EX DG Aspherical")); @@ -704,25 +757,32 @@ public: choices.insert(p_t(173, "Canon EF 180mm Macro f/3.5L or Sigma Lens")); choices.insert(p_t(173, "Sigma 180mm EX HSM Macro f/3.5")); choices.insert(p_t(173, "Sigma APO Macro 150mm f/2.8 EX DG HSM")); - choices.insert(p_t(174, "Canon EF 135mm f/2L or Sigma Lens")); + choices.insert(p_t(174, "Canon EF 135mm f/2L or Other Lens")); choices.insert(p_t(174, "Sigma 70-200mm f/2.8 EX DG APO OS HSM")); choices.insert(p_t(174, "Sigma 50-500mm f/4.5-6.3 APO DG OS HSM")); choices.insert(p_t(174, "Sigma 150-500mm f/5-6.3 APO DG OS HSM")); + choices.insert(p_t(174, "Zeiss Milvus 100mm f/2 Makro")); choices.insert(p_t(175, "Canon EF 400mm f/2.8L")); choices.insert(p_t(176, "Canon EF 24-85mm f/3.5-4.5 USM")); choices.insert(p_t(177, "Canon EF 300mm f/4L IS")); choices.insert(p_t(178, "Canon EF 28-135mm f/3.5-5.6 IS")); choices.insert(p_t(179, "Canon EF 24mm f/1.4L")); - choices.insert(p_t(180, "Canon EF 35mm f/1.4L or Sigma Lens")); + choices.insert(p_t(180, "Canon EF 35mm f/1.4L or Other Lens")); choices.insert(p_t(180, "Sigma 50mm f/1.4 DG HSM | A")); choices.insert(p_t(180, "Sigma 24mm f/1.4 DG HSM | A")); - choices.insert(p_t(181, "Canon EF 100-400mm f/4.5-5.6L IS + 1.4x")); - choices.insert(p_t(182, "Canon EF 100-400mm f/4.5-5.6L IS + 2x")); + choices.insert(p_t(180, "Zeiss Milvus 50mm f/1.4")); + choices.insert(p_t(180, "Zeiss Milvus 85mm f/1.4")); + choices.insert(p_t(180, "Zeiss Otus 28mm f/1.4 ZE")); + choices.insert(p_t(181, "Canon EF 100-400mm f/4.5-5.6L IS + 1.4x or Sigma Lens")); + choices.insert(p_t(181, "Sigma 150-600mm f/5-6.3 DG OS HSM | S + 1.4x")); + choices.insert(p_t(182, "Canon EF 100-400mm f/4.5-5.6L IS + 2x or Sigma Lens")); + choices.insert(p_t(182, "Sigma 150-600mm f/5-6.3 DG OS HSM | S + 2x")); choices.insert(p_t(183, "Canon EF 100-400mm f/4.5-5.6L IS or Sigma Lens")); choices.insert(p_t(183, "Sigma 150mm f/2.8 EX DG OS HSM APO Macro")); choices.insert(p_t(183, "Sigma 105mm f/2.8 EX DG OS HSM Macro")); choices.insert(p_t(183, "Sigma 180mm f/2.8 EX DG OS HSM APO Macro")); choices.insert(p_t(183, "Sigma 150-600mm f/5-6.3 DG OS HSM | C")); + choices.insert(p_t(183, "Sigma 150-600mm f/5-6.3 DG OS HSM | S")); choices.insert(p_t(184, "Canon EF 400mm f/2.8L + 2x")); choices.insert(p_t(185, "Canon EF 600mm f/4L IS")); choices.insert(p_t(186, "Canon EF 70-200mm f/4L")); @@ -751,6 +811,8 @@ public: choices.insert(p_t(213, "Canon EF 90-300mm f/4.5-5.6 USM or Tamron Lens")); choices.insert(p_t(213, "Tamron SP 150-600mm f/5-6.3 Di VC USD")); choices.insert(p_t(213, "Tamron 16-300mm f/3.5-6.3 Di II VC PZD Macro")); + choices.insert(p_t(213, "Tamron SP 35mm f/1.8 Di VC USD")); + choices.insert(p_t(213, "Tamron SP 45mm f/1.8 Di VC USD")); choices.insert(p_t(214, "Canon EF-S 18-55mm f/3.5-5.6 USM")); choices.insert(p_t(215, "Canon EF 55-200mm f/4.5-5.6 II USM")); choices.insert(p_t(217, "Tamron AF 18-270mm f/3.5-6.3 Di II VC PZD")); @@ -765,7 +827,7 @@ public: choices.insert(p_t(232, "Canon EF 70-300mm f/4.5-5.6 DO IS USM")); choices.insert(p_t(233, "Canon EF 28-300mm f/3.5-5.6L IS")); choices.insert(p_t(234, "Canon EF-S 17-85mm f/4-5.6 IS USM or Tokina Lens")); - choices.insert(p_t(234, "Tokina AT-X 12-28mm f/4 PRO DX")); + choices.insert(p_t(234, "Tokina AT-X 12-28 PRO DX 12-28mm f/4")); choices.insert(p_t(235, "Canon EF-S 10-22mm f/3.5-4.5 USM")); choices.insert(p_t(236, "Canon EF-S 60mm f/2.8 Macro USM")); choices.insert(p_t(237, "Canon EF 24-105mm f/4L IS")); @@ -779,9 +841,11 @@ public: choices.insert(p_t(245, "Canon EF 70-200mm f/4L IS + 2.8x")); choices.insert(p_t(246, "Canon EF 16-35mm f/2.8L II")); choices.insert(p_t(247, "Canon EF 14mm f/2.8L II USM")); - choices.insert(p_t(248, "Canon EF 200mm f/2L IS")); + choices.insert(p_t(248, "Canon EF 200mm f/2L IS or Sigma Lens")); + choices.insert(p_t(248, "Sigma 24-35mm f/2 DG HSM | A")); choices.insert(p_t(249, "Canon EF 800mm f/5.6L IS")); - choices.insert(p_t(250, "Canon EF 24 f/1.4L II")); + choices.insert(p_t(250, "Canon EF 24mm f/1.4L II or Sigma Lens")); + choices.insert(p_t(250, "Sigma 20mm f/1.4 DG HSM | A")); choices.insert(p_t(251, "Canon EF 70-200mm f/2.8L IS II USM")); choices.insert(p_t(252, "Canon EF 70-200mm f/2.8L IS II USM + 1.4x")); choices.insert(p_t(253, "Canon EF 70-200mm f/2.8L IS II USM + 2x")); @@ -807,6 +871,8 @@ public: choices.insert(p_t(507, "Canon EF 16-35mm f/4L IS USM")); choices.insert(p_t(508, "Canon EF 11-24mm f/4L USM")); choices.insert(p_t(747, "Canon EF 100-400mm f/4.5-5.6L IS II USM")); + choices.insert(p_t(748, "Canon EF 100-400mm f/4.5-5.6L IS II USM + 1.4x")); + choices.insert(p_t(750, "Canon EF 35mm f/1.4L II USM")); choices.insert(p_t(4142, "Canon EF-S 18-135mm f/3.5-5.6 IS STM")); choices.insert(p_t(4143, "Canon EF-M 18-55mm f/3.5-5.6 IS STM or Tamron Lens")); choices.insert(p_t(4143, "Tamron 18-200mm f/3.5-6.3 Di III VC")); @@ -818,8 +884,12 @@ public: choices.insert(p_t(4149, "Canon EF-M 55-200mm f/4.5-6.3 IS STM")); choices.insert(p_t(4150, "Canon EF-S 10-18mm f/4.5-5.6 IS STM")); choices.insert(p_t(4152, "Canon EF 24-105mm f/3.5-5.6 IS STM")); + choices.insert(p_t(4153, "Canon EF-M 15-45mm f/3.5-6.3 IS STM")); choices.insert(p_t(4154, "Canon EF-S 24mm f/2.8 STM")); + choices.insert(p_t(4155, "Canon EF-M 28mm f/3.5 Macro IS STM ")); choices.insert(p_t(4156, "Canon EF 50mm f/1.8 STM")); + choices.insert(p_t(36912, "Canon EF-S 18-135mm f/3.5-5.6 IS USM")); + choices.insert(p_t(65535, "n/a")); } virtual std::string toString (Tag* t) @@ -962,7 +1032,7 @@ class CAFocalTypeInterpreter : public ChoiceInterpreter public: CAFocalTypeInterpreter() { - choices[0] = "undef"; + choices[0] = "Fixed"; choices[1] = "Fixed"; choices[2] = "Zoom"; } @@ -1095,6 +1165,11 @@ public: choices[15] = "Custom 1"; choices[16] = "Custom 2"; choices[17] = "Underwater"; + choices[18] = "Custom 3"; + choices[19] = "Custom 4"; + choices[20] = "PC Set4"; + choices[21] = "PC Set5"; + choices[23] = "Auto (ambience priority)"; } }; CAWhiteBalanceInterpreter caWhiteBalanceInterpreter; @@ -1112,15 +1187,17 @@ public: choices[0x21] = "User Def. 1"; choices[0x22] = "User Def. 2"; choices[0x23] = "User Def. 3"; - choices[0x41] = "External 1"; - choices[0x42] = "External 2"; - choices[0x43] = "External 3"; + choices[0x41] = "PC 1"; + choices[0x42] = "PC 2"; + choices[0x43] = "PC 3"; choices[0x81] = "Standard"; choices[0x82] = "Portrait"; choices[0x83] = "Landscape"; choices[0x84] = "Neutral"; choices[0x85] = "Faithful"; choices[0x86] = "Monochrome"; + choices[0x87] = "Auto"; + choices[0x88] = "Fine Detail"; } }; CAPictureStyleInterpreter caPictureStyleInterpreter; @@ -1274,6 +1351,8 @@ public: choices[3] = "Fine"; choices[4] = "RAW"; choices[5] = "Superfine"; + choices[130] = "Normal Movie"; + choices[131] = "Movie (2)"; } }; CARAWJpegQualityInterpreter caRAWJpegQualityInterpreter; @@ -1291,6 +1370,15 @@ public: choices[7] = "Medium 3"; choices[8] = "Postcard"; choices[9] = "Widescreen"; + choices[10] = "Medium Widescreen"; + choices[14] = "Small 1"; + choices[15] = "Small 2"; + choices[16] = "Small 3"; + choices[128] = "640x480 Movie"; + choices[129] = "Medium Movie"; + choices[130] = "Small Movie"; + choices[137] = "1280x720 Movie"; + choices[142] = "1920x1080 Movie"; } }; CAJpegSizeInterpreter caJpegSizeInterpreter; @@ -1301,8 +1389,8 @@ public: CAWBBracketModeInterpreter() { choices[0] = "Off"; - choices[1] = "Shift AB"; - choices[2] = "shift GM"; + choices[1] = "On (shift AB)"; + choices[2] = "On (shift GM)"; } }; CAWBBracketModeInterpreter caWBBracketModeInterpreter; @@ -1398,10 +1486,10 @@ public: choices[0x1570000] = "PowerShot A510"; choices[0x1590000] = "PowerShot SD20 / Digital IXUS i5 / IXY Digital L2"; choices[0x1640000] = "PowerShot S2 IS"; - choices[0x1650000] = "PowerShot SD430 / IXUS Wireless / IXY Wireless"; + choices[0x1650000] = "PowerShot SD430 / Digital IXUS Wireless / IXY Digital Wireless"; choices[0x1660000] = "PowerShot SD500 / Digital IXUS 700 / IXY Digital 600"; choices[0x1668000] = "EOS D60"; - choices[0x1700000] = "PowerShot SD30 / Digital IXUS i zoom / IXY Digital L3"; + choices[0x1700000] = "PowerShot SD30 / Digital IXUS i Zoom / IXY Digital L3"; choices[0x1740000] = "PowerShot A430"; choices[0x1750000] = "PowerShot A410"; choices[0x1760000] = "PowerShot S80"; @@ -1474,7 +1562,7 @@ public: choices[0x2770000] = "PowerShot SD940 IS / Digital IXUS 120 IS / IXY Digital 220 IS"; choices[0x2800000] = "PowerShot A495"; choices[0x2810000] = "PowerShot A490"; - choices[0x2820000] = "PowerShot A3100 IS"; + choices[0x2820000] = "PowerShot A3100 IS / A3150 IS"; choices[0x2830000] = "PowerShot A3000 IS"; choices[0x2840000] = "PowerShot SD1400 IS / IXUS 130 / IXY 400F"; choices[0x2850000] = "PowerShot SD1300 IS / IXUS 105 / IXY 200F"; @@ -1486,36 +1574,125 @@ public: choices[0x2930000] = "PowerShot SX30 IS"; choices[0x2940000] = "PowerShot SX130 IS"; choices[0x2950000] = "PowerShot S95"; + choices[0x2980000] = "PowerShot A3300 IS"; + choices[0x2990000] = "PowerShot A3200 IS"; + choices[0x3000000] = "PowerShot ELPH 500 HS / IXUS 310 HS / IXY 31S"; choices[0x3010000] = "PowerShot Pro90 IS"; - choices[0x3340000] = "PowerShot SX50 HS"; - choices[0x3360000] = "PowerShot S110"; + choices[0x3010001] = "PowerShot A800"; + choices[0x3020000] = "PowerShot ELPH 100 HS / IXUS 115 HS / IXY 210F"; + choices[0x3030000] = "PowerShot SX230 HS"; + choices[0x3040000] = "PowerShot ELPH 300 HS / IXUS 220 HS / IXY 410F"; + choices[0x3050000] = "PowerShot A2200"; + choices[0x3060000] = "PowerShot A1200"; + choices[0x3070000] = "PowerShot SX220 HS"; + choices[0x3080000] = "PowerShot G1 X"; + choices[0x3090000] = "PowerShot SX150 IS"; + choices[0x3100000] = "PowerShot ELPH 510 HS / IXUS 1100 HS / IXY 51S"; + choices[0x3110000] = "PowerShot S100 (new)"; + choices[0x3120000] = "PowerShot ELPH 310 HS / IXUS 230 HS / IXY 600F"; + choices[0x3130000] = "PowerShot SX40 HS"; + choices[0x3140000] = "IXY 32S"; + choices[0x3160000] = "PowerShot A1300"; + choices[0x3170000] = "PowerShot A810"; + choices[0x3180000] = "PowerShot ELPH 320 HS / IXUS 240 HS / IXY 420F"; + choices[0x3190000] = "PowerShot ELPH 110 HS / IXUS 125 HS / IXY 220F"; + choices[0x3200000] = "PowerShot D20"; + choices[0x3210000] = "PowerShot A4000 IS"; + choices[0x3220000] = "PowerShot SX260 HS"; + choices[0x3230000] = "PowerShot SX240 HS"; + choices[0x3240000] = "PowerShot ELPH 530 HS / IXUS 510 HS / IXY 1"; + choices[0x3250000] = "PowerShot ELPH 520 HS / IXUS 500 HS / IXY 3"; + choices[0x3260000] = "PowerShot A3400 IS"; + choices[0x3270000] = "PowerShot A2400 IS"; + choices[0x3280000] = "PowerShot A2300"; + choices[0x3330000] = "PowerShot G15"; + choices[0x3340000] = "PowerShot SX50"; + choices[0x3350000] = "PowerShot SX160 IS"; + choices[0x3360000] = "PowerShot S110 (new)"; + choices[0x3370000] = "PowerShot SX500 IS"; + choices[0x3380000] = "PowerShot N"; + choices[0x3390000] = "IXUS 245 HS / IXY 430F"; + choices[0x3400000] = "PowerShot SX280 HS"; + choices[0x3410000] = "PowerShot SX270 HS"; + choices[0x3420000] = "PowerShot A3500 IS"; + choices[0x3430000] = "PowerShot A2600"; + choices[0x3450000] = "PowerShot A1400"; + choices[0x3460000] = "PowerShot ELPH 130 IS / IXUS 140 / IXY 110F"; + choices[0x3470000] = "PowerShot ELPH 115/120 IS / IXUS 132/135 / IXY 90F/100F"; + choices[0x3490000] = "PowerShot ELPH 330 HS / IXUS 255 HS / IXY 610F"; + choices[0x3510000] = "PowerShot A2500"; choices[0x3540000] = "PowerShot G16"; choices[0x3550000] = "PowerShot S120"; + choices[0x3560000] = "PowerShot SX170 IS"; + choices[0x3580000] = "PowerShot SX510 HS"; + choices[0x3590000] = "PowerShot S200 (new)"; + choices[0x3600000] = "IXY 620F"; + choices[0x3610000] = "PowerShot N100"; + choices[0x3640000] = "PowerShot G1 X Mark II"; + choices[0x3650000] = "PowerShot D30"; + choices[0x3660000] = "PowerShot SX700 HS"; + choices[0x3670000] = "PowerShot SX600 HS"; + choices[0x3680000] = "PowerShot ELPH 140 IS / IXUS 150 / IXY 130"; + choices[0x3690000] = "PowerShot ELPH 135 / IXUS 145 / IXY 120"; + choices[0x3700000] = "PowerShot ELPH 340 HS / IXUS 265 HS / IXY 630"; + choices[0x3710000] = "PowerShot ELPH 150 IS / IXUS 155 / IXY 140"; + choices[0x3740000] = "EOS M3"; + choices[0x3750000] = "PowerShot SX60 HS"; + choices[0x3760000] = "PowerShot SX520 HS"; + choices[0x3770000] = "PowerShot SX400 IS"; + choices[0x3780000] = "PowerShot G7 X"; + choices[0x3790000] = "PowerShot N2"; + choices[0x3800000] = "PowerShot SX530 HS"; + choices[0x3820000] = "PowerShot SX710 HS"; + choices[0x3830000] = "PowerShot SX610 HS"; + choices[0x3840000] = "EOS M10"; + choices[0x3850000] = "PowerShot G3 X"; + choices[0x3860000] = "PowerShot ELPH 165 HS / IXUS 165 / IXY 160"; + choices[0x3870000] = "PowerShot ELPH 160 / IXUS 160"; + choices[0x3880000] = "PowerShot ELPH 350 HS / IXUS 275 HS / IXY 640"; + choices[0x3890000] = "PowerShot ELPH 170 IS / IXUS 170"; + choices[0x3910000] = "PowerShot SX410 IS"; + choices[0x3930000] = "PowerShot G9 X"; + choices[0x3950000] = "PowerShot G5 X"; + choices[0x3970000] = "PowerShot G7 X Mark II"; + choices[0x3990000] = "PowerShot ELPH 360 HS / IXUS 285 HS / IXY 650"; + choices[0x4010000] = "PowerShot SX540 HS"; + choices[0x4020000] = "PowerShot SX420 IS"; + choices[0x4030000] = "PowerShot ELPH 190 IS / IXUS 180 / IXY 190"; choices[0x4040000] = "PowerShot G1"; + choices[0x4040001] = "IXY 180"; + choices[0x4050000] = "PowerShot SX720 HS"; choices[0x6040000] = "PowerShot S100 / Digital IXUS / IXY Digital"; - choices[0x4007d673] = "DC19 / DC21 / DC22"; + choices[0x4007d673] = "DC19/DC21/DC22"; choices[0x4007d674] = "XH A1"; choices[0x4007d675] = "HV10"; - choices[0x4007d676] = "MD130 / MD140 / MD150 / MD160"; - choices[0x4007d777] = "iVIS DC50"; - choices[0x4007d778] = "iVIS HV20"; + choices[0x4007d676] = "MD130/MD140/MD150/MD160/ZR850"; + choices[0x4007d777] = "DC50"; + choices[0x4007d778] = "HV20"; choices[0x4007d779] = "DC211"; choices[0x4007d77a] = "HG10"; - choices[0x4007d77b] = "iVIS HR10"; + choices[0x4007d77b] = "HR10"; + choices[0x4007d77d] = "MD255/ZR950"; + choices[0x4007d81c] = "HF11"; choices[0x4007d878] = "HV30"; - choices[0x4007d87e] = "DC301 / DC310 / DC311 / DC320 / DC330"; + choices[0x4007d87c] = "XH A1S"; + choices[0x4007d87e] = "DC301/DC310/DC311/DC320/DC330"; choices[0x4007d87f] = "FS100"; - choices[0x4007d880] = "iVIS HF10"; - choices[0x4007d882] = "HG20 / HG21 / VIXIA HG21"; - choices[0x4007d925] = "LEGRIA HF21"; - choices[0x4007d978] = "LEGRIA HV40"; - choices[0x4007d987] = "DC410 / DC420"; - choices[0x4007d988] = "LEGRIA FS19 / FS20 / FS21 / FS22 / FS200"; - choices[0x4007d989] = "LEGRIA HF20 / HF200"; - choices[0x4007d98a] = "VIXIA HF S10 / S100"; - choices[0x4007da8e] = "LEGRIA HF R16 / R17 / R106"; - choices[0x4007da90] = "LEGRIA HF S21 / VIXIA HF S200"; - choices[0x4007da92] = "LEGRIA FS36 / FS305 / FS306 / FS307"; + choices[0x4007d880] = "HF10"; + choices[0x4007d882] = "HG20/HG21"; + choices[0x4007d925] = "HF21"; + choices[0x4007d926] = "HF S11"; + choices[0x4007d978] = "HV40"; + choices[0x4007d987] = "DC410/DC411/DC420"; + choices[0x4007d988] = "FS19/FS20/FS21/FS22/FS200"; + choices[0x4007d989] = "HF20/HF200"; + choices[0x4007d98a] = "HF S10/S100"; + choices[0x4007da8e] = "HF R10/R16/R17/R18/R100/R106"; + choices[0x4007da8f] = "HF M30/M31/M36/M300/M306"; + choices[0x4007da90] = "HF S20/S21/S200"; + choices[0x4007da92] = "FS31/FS36/FS37/FS300/FS305/FS306/FS307"; + choices[0x4007dda9] = "HF G25"; + choices[0x4007dfb4] = "XC10"; choices[0x80000001] = "EOS-1D"; choices[0x80000167] = "EOS-1DS"; choices[0x80000168] = "EOS 10D"; @@ -1530,19 +1707,44 @@ public: choices[0x80000213] = "EOS 5D"; choices[0x80000215] = "EOS-1Ds Mark III"; choices[0x80000218] = "EOS 5D Mark II"; + choices[0x80000219] = "WFT-E1"; choices[0x80000232] = "EOS-1D Mark II N"; choices[0x80000234] = "EOS 30D"; choices[0x80000236] = "EOS Digital Rebel XTi / 400D / Kiss Digital X"; + choices[0x80000241] = "WFT-E2"; + choices[0x80000246] = "WFT-E3"; choices[0x80000250] = "EOS 7D"; choices[0x80000252] = "EOS Rebel T1i / 500D / Kiss X3"; choices[0x80000254] = "EOS Rebel XS / 1000D / Kiss F"; choices[0x80000261] = "EOS 50D"; + choices[0x80000269] = "EOS-1D X"; choices[0x80000270] = "EOS Rebel T2i / 550D / Kiss X4"; + choices[0x80000271] = "WFT-E4"; + choices[0x80000273] = "WFT-E5"; choices[0x80000281] = "EOS-1D Mark IV"; choices[0x80000285] = "EOS 5D Mark III"; - choices[0x80000286] = "EOS 600D"; + choices[0x80000286] = "EOS Rebel T3i / 600D / Kiss X5"; choices[0x80000287] = "EOS 60D"; + choices[0x80000288] = "EOS Rebel T3 / 1100D / Kiss X50"; + choices[0x80000289] = "EOS 7D Mark II"; + choices[0x80000297] = "WFT-E2 II"; + choices[0x80000298] = "WFT-E4 II"; + choices[0x80000301] = "EOS Rebel T4i / 650D / Kiss X6i"; + choices[0x80000302] = "EOS 6D"; + choices[0x80000324] = "EOS-1D C"; choices[0x80000325] = "EOS 70D"; + choices[0x80000326] = "EOS Rebel T5i / 700D / Kiss X7i"; + choices[0x80000327] = "EOS Rebel T5 / 1200D / Kiss X70"; + choices[0x80000328] = "EOS-1D X MARK II"; + choices[0x80000331] = "EOS M"; + choices[0x80000346] = "EOS Rebel SL1 / 100D / Kiss X7"; + choices[0x80000347] = "EOS Rebel T6s / 760D / 8000D"; + choices[0x80000350] = "EOS 80D"; + choices[0x80000355] = "EOS M2"; + choices[0x80000382] = "EOS 5DS"; + choices[0x80000393] = "EOS Rebel T6i / 750D / Kiss X8i"; + choices[0x80000401] = "EOS 5DS R"; + choices[0x80000404] = "EOS Rebel T6 / 1300D / Kiss X80"; } }; CAModelIDInterpreter caModelIDInterpreter; @@ -1570,6 +1772,7 @@ public: choices[1] = "1:1"; choices[2] = "4:3"; choices[7] = "16:9"; + choices[8] = "4:5"; } }; diff --git a/rtexif/fujiattribs.cc b/rtexif/fujiattribs.cc index 456559175..311e47ad6 100644 --- a/rtexif/fujiattribs.cc +++ b/rtexif/fujiattribs.cc @@ -68,6 +68,7 @@ public: choices[0x304] = "Living Room Warm White Fluorescent"; choices[0x400] = "Incandescent"; choices[0x500] = "Flash"; + choices[0x600] = "Underwater"; choices[0xf00] = "Custom"; choices[0xf01] = "Custom2"; choices[0xf02] = "Custom3"; @@ -89,6 +90,11 @@ public: choices[0x180] = "Medium Low"; choices[0x200] = "Low"; choices[0x300] = "None (B&W)"; + choices[0x301] = "B&W Red Filter"; + choices[0x302] = "B&W Yellow Filter"; + choices[0x303] = "B&W Green Filter"; + choices[0x310] = "B&W Sepia"; + choices[0x400] = "Low 2"; choices[0x8000] = "Film Simulation"; } }; @@ -126,8 +132,9 @@ class FANoiseReductionInterpreter : public ChoiceInterpreter public: FANoiseReductionInterpreter () { - choices[0x40] = "Low"; - choices[0x80] = "Normal"; + choices[0x40] = "Low"; + choices[0x80] = "Normal"; + choices[0x100] = "n/a"; } }; FANoiseReductionInterpreter faNoiseReductionInterpreter; @@ -135,6 +142,7 @@ FANoiseReductionInterpreter faNoiseReductionInterpreter; class FAFlashInterpreter : public ChoiceInterpreter { public: + // FujiFlashMode FAFlashInterpreter () { choices[0] = "Auto"; @@ -185,14 +193,17 @@ class FAFilmModeInterpreter : public ChoiceInterpreter public: FAFilmModeInterpreter () { - choices[0] = "F0/Standard"; - choices[0x100] = "F1/Studio Portrait"; - choices[0x110] = "F1a/Studio Portrait Enhanced Saturation"; - choices[0x120] = "F1b/Studio Portrait Smooth Skin Tone"; - choices[0x130] = "F1c/Studio Portrait Increased Sharpness "; - choices[0x200] = "F2/Fujichrome"; - choices[0x300] = "F3/Studio Portrait Ex"; - choices[0x400] = "F4/Velvia"; + choices[0x0] = "F0/Standard (Provia)"; + choices[0x100] = "F1/Studio Portrait"; + choices[0x110] = "F1a/Studio Portrait Enhanced Saturation"; + choices[0x120] = "F1b/Studio Portrait Smooth Skin Tone (Astia)"; + choices[0x130] = "F1c/Studio Portrait Increased Sharpness"; + choices[0x200] = "F2/Fujichrome (Velvia)"; + choices[0x300] = "F3/Studio Portrait Ex"; + choices[0x400] = "F4/Velvia"; + choices[0x500] = "Pro Neg. Std"; + choices[0x501] = "Pro Neg. Hi"; + choices[0x600] = "Classic Chrome"; } }; FAFilmModeInterpreter faFilmModeInterpreter; @@ -200,10 +211,11 @@ FAFilmModeInterpreter faFilmModeInterpreter; class FADRSettingInterpreter : public ChoiceInterpreter { public: + // DynamicRangeSetting FADRSettingInterpreter () { - choices[0] = "Auto (100-400%)"; - choices[0x1] = "RAW"; + choices[0x0] = "Auto (100-400%)"; + choices[0x1] = "Manual"; choices[0x100] = "Standard (100%)"; choices[0x200] = "Wide1 (230%)"; choices[0x201] = "Wide2 (400%)"; @@ -217,25 +229,35 @@ class FAPictureModeInterpreter : public ChoiceInterpreter public: FAPictureModeInterpreter () { - choices[0] = "Auto"; - choices[1] = "Portrait"; - choices[2] = "Landscape"; - choices[3] = "Macro"; - choices[4] = "Sports"; - choices[5] = "Night Scene"; - choices[6] = "Program AE"; - choices[7] = "Natural Light"; - choices[8] = "Anti-blur"; - choices[9] = "Beach & Snow"; - choices[10] = "Sunset"; - choices[11] = "Museum"; - choices[12] = "Party"; - choices[13] = "Flower"; - choices[14] = "Text"; - choices[15] = "Natural Light & Flash"; - choices[16] = "Beach"; - choices[17] = "Fireworks"; - choices[18] = "Underwater"; + choices[0x0] = "Auto"; + choices[0x1] = "Portrait"; + choices[0x2] = "Landscape"; + choices[0x3] = "Macro"; + choices[0x4] = "Sports"; + choices[0x5] = "Night Scene"; + choices[0x6] = "Program AE"; + choices[0x7] = "Natural Light"; + choices[0x8] = "Anti-blur"; + choices[0x9] = "Beach & Snow"; + choices[0xa] = "Sunset"; + choices[0xb] = "Museum"; + choices[0xc] = "Party"; + choices[0xd] = "Flower"; + choices[0xe] = "Text"; + choices[0xf] = "Natural Light & Flash"; + choices[0x10] = "Beach"; + choices[0x11] = "Snow"; + choices[0x12] = "Fireworks"; + choices[0x13] = "Underwater"; + choices[0x14] = "Portrait with Skin Correction"; + choices[0x16] = "Panorama"; + choices[0x17] = "Night (tripod)"; + choices[0x18] = "Pro Low-light"; + choices[0x19] = "Pro Focus"; + choices[0x1a] = "Portrait 2"; + choices[0x1b] = "Dog Face Detection"; + choices[0x1c] = "Cat Face Detection"; + choices[0x40] = "Advanced Filter"; choices[0x100] = "Aperture-priority AE"; choices[0x200] = "Shutter speed priority AE"; choices[0x300] = "Manual"; diff --git a/rtexif/nikonattribs.cc b/rtexif/nikonattribs.cc index facb13a36..38f4ce1f0 100644 --- a/rtexif/nikonattribs.cc +++ b/rtexif/nikonattribs.cc @@ -161,11 +161,12 @@ class NAFlashModeInterpreter : public ChoiceInterpreter public: NAFlashModeInterpreter () { - choices[0] = "Did Not Fire"; - choices[1] = "Fired, Manual"; - choices[7] = "Fired, External"; - choices[8] = "Fired, Commander Mode"; - choices[9] = "Fired, TTL Mode"; + choices[0x0] = "Did Not Fire"; + choices[0x1] = "Fired, Manual"; + choices[0x3] = "Not Ready"; + choices[0x7] = "Fired, External"; + choices[0x8] = "Fired, Commander Mode"; + choices[0x9] = "Fired, TTL Mode"; } }; NAFlashModeInterpreter naFlashModeInterpreter; @@ -173,13 +174,16 @@ NAFlashModeInterpreter naFlashModeInterpreter; class NAHiISONRInterpreter : public ChoiceInterpreter { public: + // HighISONoiseReduction NAHiISONRInterpreter () { - choices[0] = "Off"; - choices[1] = "Minimal"; - choices[2] = "Low"; - choices[4] = "Normal"; - choices[6] = "High"; + choices[0x0] = "Off"; + choices[0x1] = "Minimal"; + choices[0x2] = "Low"; + choices[0x3] = "Medium Low"; + choices[0x4] = "Normal"; + choices[0x5] = "Medium High"; + choices[0x6] = "High"; } }; NAHiISONRInterpreter naHiISONRInterpreter; @@ -209,25 +213,27 @@ class NAAFInfoInterpreter : public Interpreter std::map amchoices; std::map afpchoices; public: + // AFAreaMode NAAFInfoInterpreter () { - amchoices[0] = "Single Area"; - amchoices[1] = "Dynamic Area"; - amchoices[2] = "Dynamic Area, Closest Subject"; - amchoices[3] = "Group Dynamic"; - amchoices[4] = "Single Area (wide)"; - amchoices[5] = "Dynamic Area (wide)"; - afpchoices[0] = "Center"; - afpchoices[1] = "Top"; - afpchoices[2] = "Bottom"; - afpchoices[3] = "Left"; - afpchoices[4] = "Right"; - afpchoices[5] = "Upper-left"; - afpchoices[6] = "Upper-right"; - afpchoices[7] = "Lower-left"; - afpchoices[8] = "Lower-right"; - afpchoices[9] = "Far Left"; - afpchoices[10] = "Far Right"; + amchoices[0x0] = "Single Area"; + amchoices[0x1] = "Dynamic Area"; + amchoices[0x2] = "Dynamic Area (closest subject)"; + amchoices[0x3] = "Group Dynamic"; + amchoices[0x4] = "Single Area (wide)"; + amchoices[0x5] = "Dynamic Area (wide)"; + // AFPoint + afpchoices[0x0] = "Center"; + afpchoices[0x1] = "Top"; + afpchoices[0x2] = "Bottom"; + afpchoices[0x3] = "Mid-left"; + afpchoices[0x4] = "Mid-right"; + afpchoices[0x5] = "Upper-left"; + afpchoices[0x6] = "Upper-right"; + afpchoices[0x7] = "Lower-left"; + afpchoices[0x8] = "Lower-right"; + afpchoices[0x9] = "Far Left"; + afpchoices[0xa] = "Far Right"; } virtual std::string toString (Tag* t) { @@ -329,6 +335,8 @@ public: lenses["00 00 48 48 53 53 00 01"] = "Loreo 40mm f/11-22 3D Lens in a Cap 9005"; lenses["00 36 1C 2D 34 3C 00 06"] = "Tamron SP AF 11-18mm f/4.5-5.6 Di II LD Aspherical (IF) (A13)"; lenses["00 3C 1F 37 30 30 00 06"] = "Tokina AT-X 124 AF PRO DX (AF 12-24mm f/4)"; + lenses["00 3C 2B 44 30 30 00 06"] = "Tokina AT-X 17-35 f/4 PRO FX (AF 17-35mm f/4)"; + lenses["00 3C 5C 80 30 30 00 0E"] = "Tokina AT-X 70-200 f/4 FX VCM-S (AF 70-200mm f/4)"; lenses["00 3E 80 A0 38 3F 00 02"] = "Tamron SP AF 200-500mm f/5-6.3 Di LD (IF) (A08)"; lenses["00 3F 2D 80 2B 40 00 06"] = "Tamron AF 18-200mm f/3.5-6.3 XR Di II LD Aspherical (IF) (A14)"; lenses["00 3F 2D 80 2C 40 00 06"] = "Tamron AF 18-200mm f/3.5-6.3 XR Di II LD Aspherical (IF) Macro (A14)"; @@ -354,10 +362,13 @@ public: lenses["00 48 29 3C 24 24 00 06"] = "Tokina AT-X 16-28 AF PRO FX (AF 16-28mm f/2.8)"; lenses["00 48 29 50 24 24 00 06"] = "Tokina AT-X 165 PRO DX (AF 16-50mm f/2.8)"; lenses["00 48 32 32 24 24 00 00"] = "Carl Zeiss Distagon T* 2.8/21 ZF.2"; + lenses["00 48 37 5C 24 24 00 06"] = "Tokina AT-X 24-70 f/2.8 PRO FX (AF 24-70mm f/2.8)"; + lenses["00 48 3C 3C 24 24 00 00"] = "Voigtlander Color Skopar 28mm f/2.8 SL II"; lenses["00 48 3C 60 24 24 00 02"] = "Tokina AT-X 280 AF PRO (AF 28-80mm f/2.8)"; lenses["00 48 3C 6A 24 24 00 02"] = "Tamron SP AF 28-105mm f/2.8 LD Aspherical IF (176D)"; lenses["00 48 50 50 18 18 00 00"] = "Nikkor H 50mm f/2"; lenses["00 48 50 72 24 24 00 06"] = "Tokina AT-X 535 PRO DX (AF 50-135mm f/2.8)"; + lenses["00 48 5C 80 30 30 00 0E"] = "Tokina AT-X 70-200 f/4 FX VCM-S (AF 70-200mm f/4)"; lenses["00 48 5C 8E 30 3C 00 06"] = "Tamron AF 70-300mm f/4-5.6 Di LD Macro 1:2 (A17NII)"; lenses["00 48 68 68 24 24 00 00"] = "Series E 100mm f/2.8"; lenses["00 48 80 80 30 30 00 00"] = "Nikkor 200mm f/4 AiS"; @@ -367,7 +378,7 @@ public: lenses["00 53 2B 50 24 24 00 06"] = "Tamron SP AF 17-50mm f/2.8 XR Di II LD Aspherical (IF) (A16)"; lenses["00 54 2B 50 24 24 00 06"] = "Tamron SP AF 17-50mm f/2.8 XR Di II LD Aspherical (IF) (A16NII)"; lenses["00 54 3C 3C 18 18 00 00"] = "Carl Zeiss Distagon T* 2/28 ZF.2"; - lenses["00 54 44 44 0C 0C 00 00"] = "Nikkor 35mm f/1.4 AiS"; + lenses["00 54 44 44 0C 0C 00 00"] = "Carl Zeiss Distagon T* 1.4/35 ZF.2"; lenses["00 54 44 44 18 18 00 00"] = "Carl Zeiss Distagon T* 2/35 ZF.2"; lenses["00 54 48 48 18 18 00 00"] = "Voigtlander Ultron 40mm f/2 SLII Aspherical"; lenses["00 54 50 50 0C 0C 00 00"] = "Carl Zeiss Planar T* 1.4/50 ZF.2"; @@ -378,11 +389,13 @@ public: lenses["00 54 62 62 0C 0C 00 00"] = "Carl Zeiss Planar T* 1.4/85 ZF.2"; lenses["00 54 68 68 18 18 00 00"] = "Carl Zeiss Makro-Planar T* 2/100 ZF.2"; lenses["00 54 68 68 24 24 00 02"] = "Tokina AT-X M100 AF PRO D (AF 100mm f/2.8 Macro)"; + lenses["00 54 72 72 18 18 00 00"] = "Carl Zeiss Apo Sonnar T* 2/135 ZF.2"; lenses["00 54 8E 8E 24 24 00 02"] = "Tokina AT-X 300 AF PRO (AF 300mm f/2.8)"; lenses["00 57 50 50 14 14 00 00"] = "Nikkor 50mm f/1.8 AI"; lenses["00 58 64 64 20 20 00 00"] = "Soligor C/D Macro MC 90mm f/2.5"; lenses["01 00 00 00 00 00 02 00"] = "TC-16A"; lenses["01 00 00 00 00 00 08 00"] = "TC-16A"; + lenses["01 54 62 62 0C 0C 00 00"] = "Zeiss Otus 1.4/85"; lenses["01 58 50 50 14 14 02 00"] = "AF Nikkor 50mm f/1.8"; lenses["01 58 50 50 14 14 05 00"] = "AF Nikkor 50mm f/1.8"; lenses["02 2F 98 98 3D 3D 02 00"] = "Sigma APO 400mm f/5.6"; @@ -611,12 +624,17 @@ public: lenses["4E 48 72 72 18 18 51 02"] = "AF DC-Nikkor 135mm f/2D"; lenses["4F 40 37 5C 2C 3C 53 06"] = "IX-Nikkor 24-70mm f/3.5-5.6"; lenses["50 48 56 7C 30 3C 54 06"] = "IX-Nikkor 60-180mm f/4-5.6"; + lenses["52 54 44 44 18 18 00 00"] = "Zeiss Milvus 35mm f/2"; lenses["53 48 60 80 24 24 57 02"] = "AF Zoom-Nikkor 80-200mm f/2.8D ED"; lenses["53 48 60 80 24 24 60 02"] = "AF Zoom-Nikkor 80-200mm f/2.8D ED"; + lenses["53 54 50 50 0C 0C 00 00"] = "Zeiss Milvus 50mm f/1.4"; lenses["54 44 5C 7C 34 3C 58 02"] = "AF Zoom-Micro Nikkor 70-180mm f/4.5-5.6D ED"; lenses["54 44 5C 7C 34 3C 61 02"] = "AF Zoom-Micro Nikkor 70-180mm f/4.5-5.6D ED"; + lenses["54 54 50 50 18 18 00 00"] = "Zeiss Milvus 50mm f/2 Macro"; + lenses["55 54 62 62 0C 0C 00 00"] = "Zeiss Milvus 85mm f/1.4"; lenses["56 3C 5C 8E 30 3C 1C 02"] = "Sigma 70-300mm f/4-5.6 APO Macro Super II"; lenses["56 48 5C 8E 30 3C 5A 02"] = "AF Zoom-Nikkor 70-300mm f/4-5.6D ED"; + lenses["56 54 68 68 18 18 00 00"] = "Zeiss Milvus 100mm f/2 Macro"; lenses["59 48 98 98 24 24 5D 02"] = "AF-S Nikkor 400mm f/2.8D IF-ED"; lenses["59 48 98 98 24 24 E1 02"] = "AF-S Nikkor 400mm f/2.8D IF-ED + TC-17E"; lenses["59 48 98 98 24 24 F1 02"] = "AF-S Nikkor 400mm f/2.8D IF-ED + TC-14E"; @@ -664,6 +682,7 @@ public: lenses["7A 47 2B 5C 24 34 4B 06"] = "Sigma 17-70mm f/2.8-4.5 DC Macro Asp. IF HSM"; lenses["7A 47 50 76 24 24 4B 06"] = "Sigma 50-150mm f/2.8 EX APO DC HSM"; lenses["7A 48 1C 29 24 24 7E 06"] = "Tokina AT-X 116 PRO DX II (AF 11-16mm f/2.8)"; + lenses["7A 48 1C 30 24 24 7E 06"] = "Tokina AT-X 11-20 f/2.8 PRO DX (AF 11-20mm f/2.8)"; lenses["7A 48 2B 5C 24 34 4B 06"] = "Sigma 17-70mm f/2.8-4.5 DC Macro Asp. IF HSM"; lenses["7A 48 2D 50 24 24 4B 06"] = "Sigma 18-50mm f/2.8 EX DC Macro"; lenses["7A 48 5C 80 24 24 4B 06"] = "Sigma 70-200mm f/2.8 EX APO DG Macro HSM II"; @@ -676,6 +695,7 @@ public: lenses["80 48 1A 1A 24 24 85 06"] = "AF DX Fisheye-Nikkor 10.5mm f/2.8G ED"; lenses["81 34 76 A6 38 40 4B 0E"] = "Sigma 150-600mm f/5-6.3 DG OS HSM | S"; lenses["81 54 80 80 18 18 86 0E"] = "AF-S VR Nikkor 200mm f/2G IF-ED"; + lenses["82 34 76 A6 38 40 4B 0E"] = "Sigma 150-600mm f/5-6.3 DG OS HSM | C"; lenses["82 48 8E 8E 24 24 87 0E"] = "AF-S VR Nikkor 300mm f/2.8G IF-ED"; lenses["83 00 B0 B0 5A 5A 88 04"] = "FSA-L2, EDG 65, 800mm f/13 G"; lenses["88 54 50 50 0C 0C 4B 06"] = "Sigma 50mm f/1.4 DG HSM | A"; @@ -687,7 +707,7 @@ public: lenses["8B 4C 2D 44 14 14 4B 06"] = "Sigma 18-35mm f/1.8 DC HSM"; lenses["8C 40 2D 53 2C 3C 8E 06"] = "AF-S DX Zoom-Nikkor 18-55mm f/3.5-5.6G ED"; lenses["8D 44 5C 8E 34 3C 8F 0E"] = "AF-S VR Zoom-Nikkor 70-300mm f/4.5-5.6G IF-ED"; - lenses["8E 3C 2B 5C 24 30 4B 0E"] = "Sigma 17-70mm f/2.8-4 DC Macro OS HSM Contemporary"; + lenses["8E 3C 2B 5C 24 30 4B 0E"] = "Sigma 17-70mm f/2.8-4 DC Macro OS HSM | C"; lenses["8F 40 2D 72 2C 3C 91 06"] = "AF-S DX Zoom-Nikkor 18-135mm f/3.5-5.6G IF-ED"; lenses["8F 48 2B 50 24 24 4B 0E"] = "Sigma 17-50mm f/2.8 EX DC OS HSM"; lenses["90 3B 53 80 30 3C 92 0E"] = "AF-S DX VR Zoom-Nikkor 55-200mm f/4-5.6G IF-ED"; @@ -726,7 +746,7 @@ public: lenses["A1 40 18 37 2C 34 A3 06"] = "AF-S DX Nikkor 10-24mm f/3.5-4.5G ED"; lenses["A1 41 19 31 2C 2C 4B 06"] = "Sigma 10-20mm f/3.5 EX DC HSM"; lenses["A1 54 55 55 0C 0C BC 06"] = "AF-S Nikkor 58mm f/1.4G"; - lenses["A2 40 2D 53 2C 3C BD 0E"] = "AF-S DX VR Nikkor 18-55mm f/3.5-5.6G II"; + lenses["A2 40 2D 53 2C 3C BD 0E"] = "AF-S DX Nikkor 18-55mm f/3.5-5.6G VR II"; lenses["A2 48 5C 80 24 24 A4 0E"] = "AF-S Nikkor 70-200mm f/2.8G ED VR II"; lenses["A3 3C 29 44 30 30 A5 0E"] = "AF-S Nikkor 16-35mm f/4G ED VR"; lenses["A3 3C 5C 8E 30 3C 4B 0E"] = "Sigma 70-300mm f/4-5.6 DG OS"; @@ -735,9 +755,10 @@ public: lenses["A4 54 37 37 0C 0C A6 06"] = "AF-S Nikkor 24mm f/1.4G ED"; lenses["A5 40 2D 88 2C 40 4B 0E"] = "Sigma 18-250mm f/3.5-6.3 DC OS HSM"; lenses["A5 40 3C 8E 2C 3C A7 0E"] = "AF-S Nikkor 28-300mm f/3.5-5.6G ED VR"; - lenses["A5 4C 44 44 14 14 C0 06"] = "AF-S Nikkor 35mm f/1.8G"; + lenses["A5 4C 44 44 14 14 C0 06"] = "AF-S Nikkor 35mm f/1.8G ED"; lenses["A6 48 37 5C 24 24 4B 06"] = "Sigma 24-70mm f/2.8 IF EX DG HSM"; lenses["A6 48 8E 8E 24 24 A8 0E"] = "AF-S VR Nikkor 300mm f/2.8G IF-ED II"; + lenses["A6 48 98 98 24 24 C1 0E"] = "AF-S Nikkor 400mm f/2.8E FL ED VR"; lenses["A7 3C 53 80 30 3C C2 0E"] = "AF-S DX Nikkor 55-200mm f/4-5.6G ED VR II"; lenses["A7 49 80 A0 24 24 4B 06"] = "Sigma APO 200-500mm f/2.8 EX DG"; lenses["A7 4B 62 62 2C 2C A9 0E"] = "AF-S DX Micro Nikkor 85mm f/3.5G ED VR"; @@ -748,9 +769,16 @@ public: lenses["A9 54 80 80 18 18 AB 0E"] = "AF-S Nikkor 200mm f/2G ED VR II"; lenses["AA 3C 37 6E 30 30 AC 0E"] = "AF-S Nikkor 24-120mm f/4G ED VR"; lenses["AA 48 37 5C 24 24 C5 4E"] = "AF-S Nikkor 24-70mm f/2.8E ED VR"; + lenses["AB 3C A0 A0 30 30 C6 4E"] = "AF-S Nikkor 500mm f/4E FL ED VR"; lenses["AC 38 53 8E 34 3C AE 0E"] = "AF-S DX VR Nikkor 55-300mm f/4.5-5.6G ED"; + lenses["AC 3C A6 A6 30 30 C7 4E"] = "AF-S Nikkor 600mm f/4E FL ED VR"; lenses["AD 3C 2D 8E 2C 3C AF 0E"] = "AF-S DX Nikkor 18-300mm f/3.5-5.6G ED VR"; + lenses["AD 48 28 60 24 30 C8 0E"] = "AF-S DX Nikkor 16-80mm f/2.8-4E ED VR"; + lenses["AD 48 28 60 24 30 C8 4E"] = "AF-S DX Nikkor 16-80mm f/2.8-4E ED VR"; + lenses["AE 3C 80 A0 3C 3C C9 0E"] = "AF-S Nikkor 200-500mm f/5.6E ED VR"; + lenses["AE 3C 80 A0 3C 3C C9 4E"] = "AF-S Nikkor 200-500mm f/5.6E ED VR"; lenses["AE 54 62 62 0C 0C B0 06"] = "AF-S Nikkor 85mm f/1.4G"; + lenses["AF 4C 37 37 14 14 CC 06"] = "AF-S Nikkor 24mm f/1.8G ED"; lenses["AF 54 44 44 0C 0C B1 06"] = "AF-S Nikkor 35mm f/1.4G"; lenses["B0 4C 50 50 14 14 B2 06"] = "AF-S Nikkor 50mm f/1.8G"; lenses["B1 48 48 48 24 24 B3 06"] = "AF-S DX Micro Nikkor 40mm f/2.8G"; @@ -758,9 +786,11 @@ public: lenses["B3 4C 62 62 14 14 B5 06"] = "AF-S Nikkor 85mm f/1.8G"; lenses["B4 40 37 62 2C 34 B6 0E"] = "AF-S VR Zoom-Nikkor 24-85mm f/3.5-4.5G IF-ED"; lenses["B5 4C 3C 3C 14 14 B7 06"] = "AF-S Nikkor 28mm f/1.8G"; + lenses["B6 3C B0 B0 3C 3C B8 0E"] = "AF-S VR Nikkor 800mm f/5.6E FL ED"; lenses["B6 48 37 56 24 24 1C 02"] = "Sigma 24-60mm f/2.8 EX DG"; lenses["B7 44 60 98 34 3C B9 0E"] = "AF-S Nikkor 80-400mm f/4.5-5.6G ED VR"; lenses["B8 40 2D 44 2C 34 BA 06"] = "AF-S Nikkor 18-35mm f/3.5-4.5G ED"; + lenses["CC 4C 50 68 14 14 4B 06"] = "Sigma 50-100mm f/1.8 DC HSM | A"; lenses["CD 3D 2D 70 2E 3C 4B 0E"] = "Sigma 18-125mm f/3.8-5.6 DC OS HSM"; lenses["CE 34 76 A0 38 40 4B 0E"] = "Sigma 150-500mm f/5-6.3 DG OS APO HSM"; lenses["CF 38 6E 98 34 3C 4B 0E"] = "Sigma APO 120-400mm f/4.5-5.6 DG OS HSM"; @@ -771,6 +801,7 @@ public: lenses["E3 54 50 50 24 24 35 02"] = "Sigma Macro 50mm f/2.8 EX DG"; lenses["E5 54 6A 6A 24 24 35 02"] = "Sigma Macro 105mm f/2.8 EX DG"; lenses["E6 41 3C 8E 2C 40 1C 02"] = "Sigma 28-300mm f/3.5-6.3 DG Macro"; + lenses["E8 4C 44 44 14 14 DF 0E"] = "Tamron SP 35mm f/1.8 VC"; lenses["E9 48 27 3E 24 24 DF 0E"] = "Tamron SP 15-30mm f/2.8 Di VC USD (A012)"; lenses["E9 54 37 5C 24 24 1C 02"] = "Sigma 24-70mm f/2.8 EX DG Macro"; lenses["EA 40 29 8E 2C 40 DF 0E"] = "Tamron AF 16-300mm f/3.5-6.3 Di II VC PZD (B016)"; diff --git a/rtexif/olympusattribs.cc b/rtexif/olympusattribs.cc index 8ec17b90a..35e390b88 100644 --- a/rtexif/olympusattribs.cc +++ b/rtexif/olympusattribs.cc @@ -120,6 +120,7 @@ public: lenses["00 23 00"] = "Olympus Zuiko Digital ED 14-42mm f/3.5-5.6"; lenses["00 23 10"] = "Olympus M.Zuiko Digital ED 7-14mm f/2.8 Pro"; lenses["00 24 00"] = "Olympus Zuiko Digital ED 40-150mm f/4.0-5.6"; + lenses["00 24 10"] = "Olympus M.Zuiko Digital ED 300mm f/4.0 IS Pro"; lenses["00 25 10"] = "Olympus M.Zuiko Digital ED 8mm f/1.8 Fisheye Pro"; lenses["00 30 00"] = "Olympus Zuiko Digital ED 50-200mm f/2.8-3.5 SWD"; lenses["00 31 00"] = "Olympus Zuiko Digital ED 12-60mm f/2.8-4.0 SWD"; @@ -138,6 +139,7 @@ public: lenses["01 05 00"] = "Sigma 30mm f/1.4 EX DC HSM"; lenses["01 05 10"] = "Sigma 60mm f/2.8 DN | A"; lenses["01 06 00"] = "Sigma APO 50-500mm f/4.0-6.3 EX DG HSM"; + lenses["01 06 10"] = "Sigma 30mm f/1.4 DC DN | C"; lenses["01 07 00"] = "Sigma Macro 105mm f/2.8 EX DG"; lenses["01 08 00"] = "Sigma APO Macro 150mm f/2.8 EX DG HSM"; lenses["01 09 00"] = "Sigma 18-50mm f/2.8 EX DC Macro"; @@ -176,8 +178,12 @@ public: lenses["02 20 10"] = "Lumix G Vario 12-32mm f/3.5-5.6 Asph. Mega OIS"; lenses["02 21 10"] = "Leica DG Nocticron 42.5mm f/1.2 Asph. Power OIS"; lenses["02 22 10"] = "Leica DG Summilux 15mm f/1.7 Asph."; + lenses["02 23 10"] = "Lumix G Vario 35-100mm f/4.0-5.6 Asph. Mega OIS"; lenses["02 24 10"] = "Lumix G Macro 30mm f/2.8 Asph. Mega OIS"; lenses["02 25 10"] = "Lumix G 42.5mm f/1.7 Asph. Power OIS"; + lenses["02 26 10"] = "Lumix G 25mm f/1.7 Asph."; + lenses["02 27 10"] = "Leica DG Vario-Elmar 100-400mm f/4.0-6.3 Asph. Power OIS"; + lenses["02 28 10"] = "Lumix G Vario 12-60mm f/3.5-5.6 Asph. Power OIS"; lenses["03 01 00"] = "Leica D Vario Elmarit 14-50mm f/2.8-3.5 Asph."; lenses["03 02 00"] = "Leica D Summilux 25mm f/1.4 Asph."; lenses["05 01 10"] = "Tamron 14-150mm f/3.5-5.8 Di III"; @@ -263,22 +269,28 @@ public: OLWhitebalance2Interpreter () { choices[0] = "Auto"; + choices[1] = "Auto (Keep Warm Color Off)"; choices[16] = "7500K (Fine Weather with Shade)"; choices[17] = "6000K (Cloudy)"; choices[18] = "5300K (Fine Weather)"; choices[20] = "3000K (Tungsten light)"; choices[21] = "3600K (Tungsten light-like)"; + choices[22] = "Auto Setup"; + choices[23] = "5500K (Flash)"; choices[33] = "6600K (Daylight fluorescent)"; choices[34] = "4500K (Neutral white fluorescent)"; choices[35] = "4000K (Cool white fluorescent)"; + choices[36] = "White Fluorescent"; choices[48] = "3600K (Tungsten light-like)"; - choices[256] = "Custom WB 1"; - choices[257] = "Custom WB 2"; - choices[258] = "Custom WB 3"; - choices[259] = "Custom WB 4"; - choices[512] = "Custom WB 5400K"; - choices[513] = "Custom WB 2900K"; - choices[514] = "Custom WB 8000K"; + choices[67] = "Underwater"; + choices[256] = "One Touch WB 1"; + choices[257] = "One Touch WB 2"; + choices[258] = "One Touch WB 3"; + choices[259] = "One Touch WB 4"; + choices[512] = "Custom WB 1"; + choices[513] = "Custom WB 2"; + choices[514] = "Custom WB 3"; + choices[515] = "Custom WB 4"; } }; OLWhitebalance2Interpreter olWhitebalance2Interpreter; @@ -304,6 +316,7 @@ public: choices[18] = "Indoor"; choices[19] = "Fireworks"; choices[20] = "Sunset"; + choices[21] = "Beauty Skin"; choices[22] = "Macro"; choices[23] = "Super Macro"; choices[24] = "Food"; @@ -333,6 +346,17 @@ public: choices[48] = "Nature Macro"; choices[49] = "Underwater Snapshot"; choices[50] = "Shooting Guide"; + choices[54] = "Face Portrait"; + choices[57] = "Bulb"; + choices[59] = "Smile Shot"; + choices[60] = "Quick Shutter"; + choices[63] = "Slow Shutter"; + choices[64] = "Bird Watching"; + choices[65] = "Multiple Exposure"; + choices[66] = "e-Portrait"; + choices[67] = "Soft Background Shot"; + choices[142] = "Hand-held Starlight"; + choices[154] = "HDR"; } }; OLSceneModeInterpreter olSceneModeInterpreter; @@ -376,6 +400,7 @@ public: choices[2] = "HQ"; choices[3] = "SHQ"; choices[4] = "RAW"; + choices[5] = "SQ (5)"; } }; OLImageQuality2Interpreter olImageQuality2Interpreter; @@ -383,6 +408,7 @@ OLImageQuality2Interpreter olImageQuality2Interpreter; class OLDevEngineInterpreter : public ChoiceInterpreter { public: + // RawDevEngine OLDevEngineInterpreter () { choices[0] = "High Speed"; @@ -402,6 +428,14 @@ public: choices[2] = "Natural"; choices[3] = "Muted"; choices[4] = "Portrait"; + choices[5] = "i-Enhance"; + choices[7] = "Color Creator"; + choices[9] = "Color Profile 1"; + choices[10] = "Color Profile 2"; + choices[11] = "Color Profile 3"; + choices[12] = "Monochrome Profile 1"; + choices[13] = "Monochrome Profile 2"; + choices[14] = "Monochrome Profile 3"; choices[256] = "Monotone"; choices[512] = "Sepia"; } @@ -474,7 +508,8 @@ public: int a = t->toInt (); str << "Noise Reduction = " << ((a & 1) ? "On" : "Off") << std::endl; str << "Noise Filter = " << ((a & 2) ? "On" : "Off") << std::endl; - str << "Noise Filter (ISO Boost) = " << ((a & 4) ? "On" : "Off"); + str << "Noise Filter (ISO Boost) = " << ((a & 4) ? "On" : "Off") << std::endl; + str << "Auto = " << ((a & 8) ? "On" : "Off"); return str.str(); } }; @@ -485,14 +520,16 @@ class OLFlashModelInterpreter : public ChoiceInterpreter public: OLFlashModelInterpreter () { - choices[0] = "None"; - choices[1] = "FL-20"; - choices[2] = "FL-50"; - choices[3] = "RF-11"; - choices[4] = "TF-22"; - choices[5] = "FL-36"; - choices[6] = "FL-50R"; - choices[7] = "FL-36R"; + choices[0] = "None"; + choices[1] = "FL-20"; + choices[2] = "FL-50"; + choices[3] = "RF-11"; + choices[4] = "TF-22"; + choices[5] = "FL-36"; + choices[6] = "FL-50R"; + choices[7] = "FL-36R"; + choices[9] = "FL-14"; + choices[11] = "FL-600R"; } }; OLFlashModelInterpreter olFlashModelInterpreter; diff --git a/rtexif/pentaxattribs.cc b/rtexif/pentaxattribs.cc index 8f183cd09..91a508244 100644 --- a/rtexif/pentaxattribs.cc +++ b/rtexif/pentaxattribs.cc @@ -36,12 +36,14 @@ class PAQualityInterpreter : public ChoiceInterpreter public: PAQualityInterpreter () { - choices[0] = "Good"; - choices[1] = "Better"; - choices[2] = "Best"; - choices[3] = "TIFF"; - choices[4] = "RAW"; - choices[5] = "Premium"; + choices[0] = "Good"; + choices[1] = "Better"; + choices[2] = "Best"; + choices[3] = "TIFF"; + choices[4] = "RAW"; + choices[5] = "Premium"; + choices[7] = "RAW (pixel shift enabled)"; + choices[65535] = "n/a"; } }; PAQualityInterpreter paQualityInterpreter; @@ -79,6 +81,7 @@ PAShakeReductionInterpreter paShakeReductionInterpreter; class PAShakeReduction2Interpreter : public ChoiceInterpreter { public: + // ShakeReduction PAShakeReduction2Interpreter () { choices[ 0] = "Off"; @@ -144,7 +147,15 @@ public: choices[59] = "Report"; choices[60] = "Kids"; choices[61] = "Blur Reduction"; + choices[63] = "Panorama 2"; choices[65] = "Half-length Portrait"; + choices[66] = "Portrait 2"; + choices[74] = "Digital Microscope"; + choices[75] = "Blue Sky"; + choices[80] = "Miniature"; + choices[81] = "HDR"; + choices[83] = "Fisheye"; + choices[85] = "Digital Filter 4"; choices[221] = "P"; choices[255] = "PICT"; } @@ -156,14 +167,14 @@ class PASceneModeInterpreter : public ChoiceInterpreter public: PASceneModeInterpreter () { - choices[ 0] = "Off"; - choices[ 1] = "HDR"; - choices[ 4] = "Auto PICT"; - choices[ 5] = "Portrait"; - choices[ 6] = "Landscape"; - choices[ 7] = "Macro"; - choices[ 8] = "Sport"; - choices[ 9] = "Night Scene Portrait"; + choices[0] = "Off"; + choices[1] = "HDR"; + choices[4] = "Auto PICT"; + choices[5] = "Portrait"; + choices[6] = "Landscape"; + choices[7] = "Macro"; + choices[8] = "Sport"; + choices[9] = "Night Scene Portrait"; choices[10] = "No Flash"; choices[11] = "Night Scene"; choices[12] = "Surf & Snow"; @@ -188,25 +199,25 @@ class PAAEProgramModeInterpreter : public ChoiceInterpreter public: PAAEProgramModeInterpreter () { - choices[ 0] = "M, P or TAv"; - choices[ 1] = "Av, B or X"; - choices[ 2] = "Tv"; - choices[ 3] = "Sv or Green Mode"; - choices[ 8] = "Hi-speed Program"; - choices[ 11] = "Hi-speed Program (P-Shift)"; - choices[ 16] = "DOF Program"; - choices[ 19] = "DOF Program (P-Shift)"; - choices[ 24] = "MTF Program"; - choices[ 27] = "MTF Program (P-Shift)"; - choices[ 35] = "Standard"; - choices[ 43] = "Portrait"; - choices[ 51] = "Landscape"; - choices[ 59] = "Macro"; - choices[ 67] = "Sport"; - choices[ 75] = "Night Scene Portrait"; - choices[ 83] = "No Flash"; - choices[ 91] = "Night Scene"; - choices[ 99] = "Surf & Snow"; + choices[0] = "M, P or TAv"; + choices[1] = "Av, B or X"; + choices[2] = "Tv"; + choices[3] = "Sv or Green Mode"; + choices[8] = "Hi-speed Program"; + choices[11] = "Hi-speed Program (P-Shift)"; + choices[16] = "DOF Program"; + choices[19] = "DOF Program (P-Shift)"; + choices[24] = "MTF Program"; + choices[27] = "MTF Program (P-Shift)"; + choices[35] = "Standard"; + choices[43] = "Portrait"; + choices[51] = "Landscape"; + choices[59] = "Macro"; + choices[67] = "Sport"; + choices[75] = "Night Scene Portrait"; + choices[83] = "No Flash"; + choices[91] = "Night Scene"; + choices[99] = "Surf & Snow"; choices[104] = "Night Snap"; choices[107] = "Text"; choices[115] = "Sunset"; @@ -227,20 +238,21 @@ class PAFlashModeInterpreter : public ChoiceInterpreter public: PAFlashModeInterpreter () { - choices[0x0] = "Auto, Did not fire"; - choices[0x1] = "Off"; - choices[0x2] = "On, Did not fire"; - choices[0x3] = "Auto, Did not fire, Red-eye reduction"; - choices[0x100] = "Auto, Fired"; - choices[0x102] = "On"; - choices[0x103] = "Auto, Fired, Red-eye reduction"; - choices[0x104] = "On, Red-eye reduction"; - choices[0x105] = "On, Wireless (Master)"; - choices[0x106] = "On, Wireless (Control)"; - choices[0x108] = "On, Soft"; - choices[0x109] = "On, Slow-sync"; - choices[0x10a] = "On, Slow-sync, Red-eye reduction"; - choices[0x10b] = "On, Trailing-curtain Sync"; + choices[0] = "Auto, Did not fire"; + choices[1] = "Off, Did not fire"; + choices[2] = "On, Did not fire"; + choices[3] = "Auto, Did not fire, Red-eye reduction"; + choices[5] = "On, Did not fire, Wireless (Master)"; + choices[256] = "Auto, Fired"; + choices[258] = "On, Fired"; + choices[259] = "Auto, Fired, Red-eye reduction"; + choices[260] = "On, Red-eye reduction"; + choices[261] = "On, Wireless (Master)"; + choices[262] = "On, Wireless (Control)"; + choices[264] = "On, Soft"; + choices[265] = "On, Slow-sync"; + choices[266] = "On, Slow-sync, Red-eye reduction"; + choices[267] = "On, Trailing-curtain Sync"; } }; PAFlashModeInterpreter paFlashModeInterpreter; @@ -256,9 +268,15 @@ public: choices[3] = "Manual"; choices[4] = "Super Macro"; choices[5] = "Pan Focus"; - choices[16] = "AF-S"; - choices[17] = "AF-C"; - choices[18] = "AF-A"; + choices[16] = "AF-S (Focus-priority)"; + choices[17] = "AF-C (Focus-priority)"; + choices[18] = "AF-A (Focus-priority)"; + choices[32] = "Contrast-detect (Focus-priority)"; + choices[33] = "Tracking Contrast-detect (Focus-priority)"; + choices[272] = "AF-S (Release-priority)"; + choices[273] = "AF-C (Release-priority)"; + choices[274] = "AF-A (Release-priority)"; + choices[288] = "Contrast-detect (Release-priority)"; } }; PAFocusModeInterpreter paFocusModeInterpreter; @@ -266,8 +284,10 @@ PAFocusModeInterpreter paFocusModeInterpreter; class PAAFPointInterpreter : public ChoiceInterpreter { public: + // AFPointSelected PAAFPointInterpreter () { + choices[0] = "None"; choices[1] = "Upper-left"; choices[2] = "Top"; choices[3] = "Upper-right"; @@ -279,7 +299,8 @@ public: choices[9] = "Lower-left"; choices[10] = "Bottom"; choices[11] = "Lower-right"; - choices[65532] = "Face Recognition AF"; + choices[65531] = "AF Select"; + choices[65532] = "Face Detect AF"; choices[65533] = "Automatic Tracking AF"; choices[65534] = "Fixed Center"; choices[65535] = "Auto"; @@ -290,19 +311,20 @@ PAAFPointInterpreter paAFPointInterpreter; class PAAFFocusInterpreter : public ChoiceInterpreter { public: + // AFPointsInFocus PAAFFocusInterpreter () { - choices[0x0] = "Fixed Center or Multiple"; - choices[0x1] = "Top-left"; - choices[0x2] = "Top-center"; - choices[0x3] = "Top-right"; - choices[0x4] = "Left"; - choices[0x5] = "Center"; - choices[0x6] = "Right"; - choices[0x7] = "Bottom-left"; - choices[0x8] = "Bottom-center"; - choices[0x9] = "Bottom-right"; - choices[0xffff] = "None"; + choices[0] = "Fixed Center or Multiple"; + choices[1] = "Top-left"; + choices[2] = "Top-center"; + choices[3] = "Top-right"; + choices[4] = "Left"; + choices[5] = "Center"; + choices[6] = "Right"; + choices[7] = "Bottom-left"; + choices[8] = "Bottom-center"; + choices[9] = "Bottom-right"; + choices[65535] = "None"; } }; PAAFFocusInterpreter paAFFocusInterpreter; @@ -343,15 +365,15 @@ public: choices[31] = "32000"; choices[32] = "40000"; choices[33] = "51200"; - + choices[34] = "64000"; + choices[35] = "80000"; + choices[36] = "102400"; + choices[37] = "128000"; + choices[38] = "160000"; + choices[39] = "204800"; choices[50] = "50"; choices[100] = "100"; choices[200] = "200"; - /*choices[400] = "400"; - choices[800] = "800"; - choices[1600] = "1600"; - choices[3200] = "3200"; Moved to tail for sorting reasons */ - choices[258] = "50"; choices[259] = "70"; choices[260] = "100"; @@ -373,14 +395,10 @@ public: choices[276] = "25600"; choices[277] = "36000"; choices[278] = "51200"; - choices[400] = "400"; choices[800] = "800"; choices[1600] = "1600"; choices[3200] = "3200"; - - //choices[65534] = "Auto"; ?? - //choices[65535] = "Auto"; ?? } }; PAISOInterpreter paISOInterpreter; @@ -437,7 +455,7 @@ public: choices[15] = "Color Temperature Enhancement"; choices[17] = "Kelvin"; choices[65534] = "Unknown"; - choices[65535] = "User Selected"; + choices[65535] = "User-Selected"; } }; PAWhiteBalanceInterpreter paWhiteBalanceInterpreter; @@ -451,11 +469,11 @@ public: choices[2] = "Auto (Shade)"; choices[3] = "Auto (Flash)"; choices[4] = "Auto (Tungsten)"; - choices[6] = "Auto (DaylightFluorescent)"; - choices[7] = "Auto (DaywhiteFluorescent)"; - choices[8] = "Auto (WhiteFluorescent)"; + choices[6] = "Auto (Daylight Fluorescent)"; + choices[7] = "Auto (Day White Fluorescent)"; + choices[8] = "Auto (White Fluorescent)"; choices[10] = "Auto (Cloudy)"; - choices[65534] = "Preset (Fireworks?)"; + choices[65534] = "Unknown"; choices[65535] = "User-Selected"; } }; @@ -466,13 +484,16 @@ class PASaturationInterpreter : public ChoiceInterpreter public: PASaturationInterpreter () { - choices[0] = "Low"; - choices[1] = "Normal"; - choices[2] = "High"; - choices[3] = "Med Low"; - choices[4] = "Med High"; - choices[5] = "Very Low"; - choices[6] = "Very High"; + choices[0] = "-2 (low)"; + choices[1] = "0 (normal)"; + choices[2] = "+2 (high)"; + choices[3] = "-1 (med low)"; + choices[4] = "+1 (med high)"; + choices[5] = "-3 (very low)"; + choices[6] = "+3 (very high)"; + choices[7] = "-4 (minimum)"; + choices[8] = "+4 (maximum)"; + choices[65535] = "None"; } }; PASaturationInterpreter paSaturationInterpreter; @@ -482,13 +503,16 @@ class PAContrastInterpreter : public ChoiceInterpreter public: PAContrastInterpreter () { - choices[0] = "Low"; - choices[1] = "Normal"; - choices[2] = "High"; - choices[3] = "Med Low"; - choices[4] = "Med High"; - choices[5] = "Very Low"; - choices[6] = "Very High"; + choices[0] = "-2 (low)"; + choices[1] = "0 (normal)"; + choices[2] = "+2 (high)"; + choices[3] = "-1 (med low)"; + choices[4] = "+1 (med high)"; + choices[5] = "-3 (very low)"; + choices[6] = "+3 (very high)"; + choices[7] = "-4 (minimum)"; + choices[8] = "+4 (maximum)"; + choices[65535] = "n/a"; } }; PAContrastInterpreter paContrastInterpreter; @@ -498,13 +522,15 @@ class PASharpnessInterpreter : public ChoiceInterpreter public: PASharpnessInterpreter () { - choices[0] = "Soft"; - choices[1] = "Normal"; - choices[2] = "Hard"; - choices[3] = "Med Soft"; - choices[4] = "Med Hard"; - choices[5] = "Very Soft"; - choices[6] = "Very Hard"; + choices[0] = "-2 (soft)"; + choices[1] = "0 (normal)"; + choices[2] = "+2 (hard)"; + choices[3] = "-1 (med soft)"; + choices[4] = "+1 (med hard)"; + choices[5] = "-3 (very soft)"; + choices[6] = "+3 (very hard)"; + choices[7] = "-4 (minimum)"; + choices[8] = "+4 (maximum)"; } }; PASharpnessInterpreter paSharpnessInterpreter; @@ -514,51 +540,67 @@ class PAPictureModeInterpreter2: public ChoiceInterpreter public: PAPictureModeInterpreter2() { - choices[ 0] = "Program"; - choices[ 1] = "Hi-speed Program"; - choices[ 2] = "DOF Program"; - choices[ 3] = "MTF Program"; - choices[ 4] = "Standard"; - choices[ 5] = "Portrait"; - choices[ 6] = "Landscape"; - choices[ 7] = "Macro"; - choices[ 8] = "Sport "; - choices[ 9] = "Night Scene Portrait "; - choices[10] = "No Flash"; - choices[11] = "Night Scene"; - choices[12] = "Surf & Snow"; - choices[13] = "Text"; - choices[14] = "Sunset"; - choices[15] = "Kids"; - choices[16] = "Pet"; - choices[17] = "Candlelight"; - choices[18] = "Museum"; - choices[19] = "Food "; - choices[20] = "Stage Lighting"; - choices[21] = "Night Snap"; - choices[256 + 4] = "Auto PICT"; - choices[256 + 5] = "Auto PICT (Portrait)"; - choices[256 + 6] = "Auto PICT (Landscape)"; - choices[256 + 7] = "Auto PICT (Macro)"; - choices[256 + 8] = "Auto PICT (Sport)"; - choices[256 + 8] = "Auto PICT (Sport)"; - choices[512 + 0] = "Program (HyP)"; - choices[512 + 1] = "Hi-speed Program (HyP)"; - choices[512 + 2] = "DOF Program (HyP)"; - choices[512 + 3] = "MTF Program (HyP)"; - choices[3 * 256] = "Green Mode"; - choices[4 * 256] = "Shutter Speed Priority"; - choices[5 * 256] = "Aperture Priority"; - choices[6 * 256] = "Program Tv Shift"; - choices[7 * 256] = "Program Av Shift"; - choices[8 * 256] = "Manual"; - choices[9 * 256] = "Bulb"; - choices[10 * 256] = "Aperture Priority, Off-Auto-Aperture"; - choices[11 * 256] = "Manual, Off-Auto-Aperture"; - choices[12 * 256] = "Bulb, Off-Auto-Aperture"; - choices[13 * 256] = "Shutter & Aperture Priority AE"; - choices[15 * 256] = "Sensitivity Priority AE"; - choices[16 * 256] = "Flash X-Sync Speed AE"; + choices[256 * 0 + 0] = "Program"; + choices[256 * 0 + 1] = "Hi-speed Program"; + choices[256 * 0 + 2] = "DOF Program"; + choices[256 * 0 + 3] = "MTF Program"; + choices[256 * 0 + 4] = "Standard"; + choices[256 * 0 + 5] = "Portrait"; + choices[256 * 0 + 6] = "Landscape"; + choices[256 * 0 + 7] = "Macro"; + choices[256 * 0 + 8] = "Sport"; + choices[256 * 0 + 9] = "Night Scene Portrait"; + choices[256 * 0 + 10] = "No Flash"; + choices[256 * 0 + 11] = "Night Scene"; + choices[256 * 0 + 12] = "Surf & Snow"; + choices[256 * 0 + 13] = "Text"; + choices[256 * 0 + 14] = "Sunset"; + choices[256 * 0 + 15] = "Kids"; + choices[256 * 0 + 16] = "Pet"; + choices[256 * 0 + 17] = "Candlelight"; + choices[256 * 0 + 18] = "Museum"; + choices[256 * 0 + 19] = "Food"; + choices[256 * 0 + 20] = "Stage Lighting"; + choices[256 * 0 + 21] = "Night Snap"; + choices[256 * 0 + 23] = "Blue Sky"; + choices[256 * 0 + 24] = "Sunset"; + choices[256 * 0 + 26] = "Night Scene HDR"; + choices[256 * 0 + 27] = "HDR"; + choices[256 * 0 + 28] = "Quick Macro"; + choices[256 * 0 + 29] = "Forest"; + choices[256 * 0 + 30] = "Backlight Silhouette"; + choices[256 * 1 + 4] = "Auto PICT (Standard)"; + choices[256 * 1 + 5] = "Auto PICT (Portrait)"; + choices[256 * 1 + 6] = "Auto PICT (Landscape)"; + choices[256 * 1 + 7] = "Auto PICT (Macro)"; + choices[256 * 1 + 8] = "Auto PICT (Sport)"; + choices[256 * 2 + 0] = "Program (HyP)"; + choices[256 * 2 + 1] = "Hi-speed Program (HyP)"; + choices[256 * 2 + 2] = "DOF Program (HyP)"; + choices[256 * 2 + 3] = "MTF Program (HyP)"; + choices[256 * 2 + 22] = "Shallow DOF (HyP)"; + choices[256 * 3 + 0] = "Green Mode"; + choices[256 * 4 + 0] = "Shutter Speed Priority"; + choices[256 * 5 + 0] = "Aperture Priority"; + choices[256 * 6 + 0] = "Program Tv Shift"; + choices[256 * 7 + 0] = "Program Av Shift"; + choices[256 * 8 + 0] = "Manual"; + choices[256 * 9 + 0] = "Bulb"; + choices[256 * 10 + 0] = "Aperture Priority, Off-Auto-Aperture"; + choices[256 * 11 + 0] = "Manual, Off-Auto-Aperture"; + choices[256 * 12 + 0] = "Bulb, Off-Auto-Aperture"; + choices[256 * 13 + 0] = "Shutter & Aperture Priority AE"; + choices[256 * 15 + 0] = "Sensitivity Priority AE"; + choices[256 * 16 + 0] = "Flash X-Sync Speed AE"; + choices[256 * 18 + 0] = "Auto Program (Normal)"; + choices[256 * 18 + 1] = "Auto Program (Hi-speed)"; + choices[256 * 18 + 2] = "Auto Program (DOF)"; + choices[256 * 18 + 3] = "Auto Program (MTF)"; + choices[256 * 18 + 22] = "Auto Program (Shallow DOF)"; + choices[256 * 20 + 22] = "Blur Control"; + choices[256 * 254 + 0] = "Video"; + choices[256 * 255 + 0] = "Video (Auto Aperture)"; + choices[256 * 255 + 4] = "Video (4)"; } virtual std::string toString (Tag* t) { @@ -701,6 +743,7 @@ public: choices.insert(p_t(256 * 3 + 44, "Sigma 12-24mm f/4.5-5.6 EX DG")); choices.insert(p_t(256 * 3 + 44, "Sigma 17-70mm f/2.8-4.5 DC Macro")); choices.insert(p_t(256 * 3 + 44, "Sigma 18-50mm f/3.5-5.6 DC")); + choices.insert(p_t(256 * 3 + 44, "Sigma 17-35mm f/2.8-4 EX DG")); choices.insert(p_t(256 * 3 + 44, "Tamron 35-90mm f/4 AF")); choices.insert(p_t(256 * 3 + 46, "Sigma or Samsung Lens (3 46)")); choices.insert(p_t(256 * 3 + 46, "Sigma APO 70-200mm f/2.8 EX")); @@ -873,11 +916,16 @@ public: choices.insert(p_t(256 * 8 + 27, "Sigma 18-200mm f/3.5-6.3 II DC HSM")); choices.insert(p_t(256 * 8 + 28, "Sigma 18-250mm f/3.5-6.3 DC Macro HSM")); choices.insert(p_t(256 * 8 + 29, "Sigma 35mm f/1.4 DG HSM")); - choices.insert(p_t(256 * 8 + 30, "Sigma 17-70mm f/2.8-4 DC Macro HSM Contemporary")); + choices.insert(p_t(256 * 8 + 30, "Sigma 17-70mm f/2.8-4 DC Macro HSM | C")); choices.insert(p_t(256 * 8 + 31, "Sigma 18-35mm f/1.8 DC HSM")); choices.insert(p_t(256 * 8 + 32, "Sigma 30mm f/1.4 DC HSM | A")); + choices.insert(p_t(256 * 8 + 34, "Sigma 18-300mm f/3.5-6.3 DC Macro HSM")); choices.insert(p_t(256 * 8 + 59, "HD PENTAX-D FA 150-450mm f/4.5-5.6 ED DC AW")); choices.insert(p_t(256 * 8 + 60, "HD PENTAX-D FA* 70-200mm f/2.8 ED DC AW")); + choices.insert(p_t(256 * 8 + 61, "HD PENTAX-D FA 28-105mm f/3.5-5.6 ED DC WR")); + choices.insert(p_t(256 * 8 + 62, "HD PENTAX-D FA 24-70mm f/2.8 ED SDM WR")); + choices.insert(p_t(256 * 8 + 63, "HD PENTAX-D FA 15-30mm f/2.8 ED SDM WR")); + choices.insert(p_t(256 * 8 + 197, "HD PENTAX-DA 55-300mm f/4.5-6.3 ED PLM WR RE")); choices.insert(p_t(256 * 8 + 198, "smc PENTAX-DA L 18-50mm f/4-5.6 DC WR RE")); choices.insert(p_t(256 * 8 + 199, "HD PENTAX-DA 18-50mm f/4-5.6 DC WR RE")); choices.insert(p_t(256 * 8 + 200, "HD PENTAX-DA 16-85mm f/3.5-5.6 ED DC WR")); @@ -915,6 +963,7 @@ public: choices.insert(p_t(256 * 11 + 14, "smc PENTAX-FA 645 55-110mm f/5.6")); choices.insert(p_t(256 * 11 + 16, "smc PENTAX-FA 645 33-55mm f/4.5 AL")); choices.insert(p_t(256 * 11 + 17, "smc PENTAX-FA 645 150-300mm f/5.6 ED [IF]")); + choices.insert(p_t(256 * 11 + 21, "HD PENTAX-D FA 645 35mm f/3.5 AL [IF]")); choices.insert(p_t(256 * 13 + 18, "smc PENTAX-D FA 645 55mm f/2.8 AL [IF] SDM AW")); choices.insert(p_t(256 * 13 + 19, "smc PENTAX-D FA 645 25mm f/4 AL [IF] SDM AW")); choices.insert(p_t(256 * 13 + 20, "HD PENTAX-D FA 645 90mm f/2.8 ED AW SR")); @@ -1018,12 +1067,15 @@ PASRResultInterpreter paSRResultInterpreter; class PAHighISONoiseInterpreter: public ChoiceInterpreter { public: + // HighISONoiseReduction PAHighISONoiseInterpreter() { choices[0] = "Off"; choices[1] = "Weakest"; choices[2] = "Weak"; choices[3] = "Strong"; + choices[4] = "Medium"; + choices[255] = "Auto"; } }; PAHighISONoiseInterpreter paHighISONoiseInterpreter; @@ -1171,9 +1223,9 @@ public: choices1[1] = "Auto-align On"; choices2[0] = "n/a"; - choices2[1] = "1 EV"; - choices2[2] = "2 EV"; - choices2[4] = "3 EV"; + choices2[4] = "1 EV"; + choices2[8] = "2 EV"; + choices2[12] = "3 EV"; } virtual std::string toString (Tag* t) { @@ -1529,11 +1581,13 @@ class PAFlashStatusInterpreter: public ChoiceInterpreter public: PAFlashStatusInterpreter() { - choices[0x0] = "Off"; - choices[0x2] = "External, Did not fire"; - choices[0x6] = "External, Fired"; - choices[0x9] = "Internal, Did not fire"; - choices[0xd] = "Internal, Fired"; + choices[0] = "Off"; + choices[1] = "Off (1)"; + choices[2] = "External, Did not fire"; + choices[6] = "External, Fired"; + choices[8] = "Internal, Did not fire (0x08)"; + choices[9] = "Internal, Did not fire"; + choices[13] = "Internal, Fired"; } }; PAFlashStatusInterpreter paFlashStatusInterpreter; @@ -1543,26 +1597,27 @@ class PAInternalFlashModeInterpreter: public ChoiceInterpreter public: PAInternalFlashModeInterpreter() { - choices[0x0] = "n/a - Off-Auto-Aperture"; - choices[0x86] = "On, Wireless (Control)"; - choices[0x95] = "On, Wireless (Master)"; - choices[0xc0] = "On"; - choices[0xc1] = "On, Red-eye reduction"; - choices[0xc2] = "On, Auto"; - choices[0xc3] = "On, Auto, Red-eye reduction"; - choices[0xc8] = "On, Slow-sync"; - choices[0xc9] = "On, Slow-sync, Red-eye reduction"; - choices[0xca] = "On, Trailing-curtain Sync"; - choices[0xf0] = "Off, Normal"; - choices[0xf1] = "Off, Red-eye reduction"; - choices[0xf2] = "Off, Auto"; - choices[0xf3] = "Off, Auto, Red-eye reduction"; - choices[0xf4] = "Off, (Unknown 0xf4)"; - choices[0xf5] = "Off, Wireless (Master)"; - choices[0xf6] = "Off, Wireless (Control)"; - choices[0xf8] = "Off, Slow-sync"; - choices[0xf9] = "Off, Slow-sync, Red-eye reduction"; - choices[0xfa] = "Off, Trailing-curtain Sync"; + choices[0] = "n/a - Off-Auto-Aperture"; + choices[134] = "Fired, Wireless (Control)"; + choices[149] = "Fired, Wireless (Master)"; + choices[192] = "Fired"; + choices[193] = "Fired, Red-eye reduction"; + choices[194] = "Fired, Auto"; + choices[195] = "Fired, Auto, Red-eye reduction"; + choices[198] = "Fired, Wireless (Control), Fired normally not as control"; + choices[200] = "Fired, Slow-sync"; + choices[201] = "Fired, Slow-sync, Red-eye reduction"; + choices[202] = "Fired, Trailing-curtain Sync"; + choices[240] = "Did not fire, Normal"; + choices[241] = "Did not fire, Red-eye reduction"; + choices[242] = "Did not fire, Auto"; + choices[243] = "Did not fire, Auto, Red-eye reduction"; + choices[244] = "Did not fire, (Unknown 0xf4)"; + choices[245] = "Did not fire, Wireless (Master)"; + choices[246] = "Did not fire, Wireless (Control)"; + choices[248] = "Did not fire, Slow-sync"; + choices[249] = "Did not fire, Slow-sync, Red-eye reduction"; + choices[250] = "Did not fire, Trailing-curtain Sync"; } }; PAInternalFlashModeInterpreter paInternalFlashModeInterpreter; @@ -1572,16 +1627,17 @@ class PAExternalFlashModeInterpreter: public ChoiceInterpreter public: PAExternalFlashModeInterpreter() { - choices[0x0 ] = "n/a - Off-Auto-Aperture"; - choices[0x3f] = "Off"; - choices[0x40] = "On, Auto"; - choices[0xbf] = "On, Flash Problem"; - choices[0xc0] = "On, Manual"; - choices[0xc4] = "On, P-TTL Auto"; - choices[0xc5] = "On, Contrast-control Sync"; - choices[0xc6] = "On, High-speed Sync"; - choices[0xcc] = "On, Wireless"; - choices[0xcd] = "On, Wireless, High-speed Sync"; + choices[0] = "n/a - Off-Auto-Aperture"; + choices[63] = "Off"; + choices[64] = "On, Auto"; + choices[191] = "On, Flash Problem"; + choices[192] = "On, Manual"; + choices[196] = "On, P-TTL Auto"; + choices[197] = "On, Contrast-control Sync"; + choices[198] = "On, High-speed Sync"; + choices[204] = "On, Wireless"; + choices[205] = "On, Wireless, High-speed Sync"; + choices[240] = "Not Connected"; } }; PAExternalFlashModeInterpreter paExternalFlashModeInterpreter; @@ -1599,9 +1655,9 @@ public: choices[171] = "-1.5"; choices[172] = "-1.0"; choices[175] = "-0.5"; - choices[176] = "0"; - choices[179] = "+0.5"; - choices[180] = "+1.0"; + choices[176] = "0.0"; + choices[179] = "0.5"; + choices[180] = "1.0"; } }; PAExternalFlashExposureCompInterpreter paExternalFlashExposureCompInterpreter; @@ -1694,15 +1750,15 @@ class PAFlashOptionInterpreter: public ChoiceInterpreter public: PAFlashOptionInterpreter() { - choices[0x0] = "Normal"; - choices[0x1] = "Red-eye reduction"; - choices[0x2] = "Auto"; - choices[0x3] = "Auto, Red-eye reduction"; - choices[0x5] = "Wireless (Master)"; - choices[0x6] = "Wireless (Control)"; - choices[0x8] = "Slow-sync"; - choices[0x9] = "Slow-sync, Red-eye reduction"; - choices[0xa] = "Trailing-curtain Sync"; + choices[0] = "Normal"; + choices[1] = "Red-eye reduction"; + choices[2] = "Auto"; + choices[3] = "Auto, Red-eye reduction"; + choices[5] = "Wireless (Master)"; + choices[6] = "Wireless (Control)"; + choices[8] = "Slow-sync"; + choices[9] = "Slow-sync, Red-eye reduction"; + choices[10] = "Trailing-curtain Sync"; } virtual std::string toString (Tag* t) { @@ -1884,6 +1940,8 @@ public: return "Single-frame"; } else if( c & 0x01) { return "Continuous"; + } else if( c & 0x02) { + return "Continuous (Lo)"; } else if( c & 0x04) { return "Self-timer (12 s)"; } else if( c & 0x08) { diff --git a/rtexif/sonyminoltaattribs.cc b/rtexif/sonyminoltaattribs.cc index ea8fc0b49..a0d280df1 100644 --- a/rtexif/sonyminoltaattribs.cc +++ b/rtexif/sonyminoltaattribs.cc @@ -314,6 +314,7 @@ public: choices[0x50] = "Flash"; choices[0x60] = "Fluorescent"; choices[0x70] = "Custom"; + choices[0x80] = "Underwater"; } }; SAWhiteBalanceInterpreter saWhiteBalanceInterpreter; @@ -383,23 +384,31 @@ class SASceneModeInterpreter : public ChoiceInterpreter public: SASceneModeInterpreter () { - choices[0] = "Normal (P,A,S or M)"; + choices[0] = "Standard"; choices[1] = "Portrait"; choices[2] = "Text"; choices[3] = "Night Scene"; choices[4] = "Sunset"; choices[5] = "Sports"; choices[6] = "Landscape"; + choices[7] = "Night Portrait"; choices[8] = "Macro"; choices[9] = "Super Macro"; choices[16] = "Auto"; - choices[17] = "Night Portrait"; + choices[17] = "Night View/Portrait"; choices[18] = "Sweep Panorama"; choices[19] = "Handheld Night Shot"; choices[20] = "Anti Motion Blur"; - choices[21] = "Cont.Priority AE"; + choices[21] = "Cont. Priority AE"; choices[22] = "Auto+"; choices[23] = "3D Sweep Panorama"; + choices[24] = "Superior Auto"; + choices[25] = "High Sensitivity"; + choices[26] = "Fireworks"; + choices[27] = "Food"; + choices[28] = "Pet"; + choices[33] = "HDR"; + choices[65535] = "n/a"; } }; SASceneModeInterpreter saSceneModeInterpreter; @@ -449,14 +458,14 @@ public: choices[2] = "Portrait"; choices[3] = "Landscape"; choices[4] = "Sunset"; - choices[5] = "Night Scene"; + choices[5] = "Night View/Portrait"; choices[6] = "B&W"; choices[7] = "Adobe RGB"; choices[12] = "Neutral"; choices[13] = "Clear"; choices[14] = "Deep"; choices[15] = "Light"; - choices[16] = "Autumn"; + choices[16] = "Autumn Leaves"; choices[17] = "Sepia"; choices[100] = "Neutral"; choices[101] = "Clear"; @@ -473,18 +482,19 @@ class SAExposureModeInterpreter : public ChoiceInterpreter public: SAExposureModeInterpreter () { - choices[0] = "Auto"; + choices[0] = "Program AE"; choices[1] = "Portrait"; choices[2] = "Beach"; + choices[3] = "Sports"; choices[4] = "Snow"; choices[5] = "Landscape"; - choices[6] = "Program"; - choices[7] = "Aperture Priority"; - choices[8] = "Shutter Priority"; - choices[9] = "Night Scene"; + choices[6] = "Auto"; + choices[7] = "Aperture-priority AE"; + choices[8] = "Shutter speed priority AE"; + choices[9] = "Night Scene / Twilight"; choices[10] = "Hi-Speed Shutter"; choices[11] = "Twilight Portrait"; - choices[12] = "Soft Snap"; + choices[12] = "Soft Snap/Portrait"; choices[13] = "Fireworks"; choices[14] = "Smile Shutter"; choices[15] = "Manual"; @@ -492,13 +502,17 @@ public: choices[19] = "Macro"; choices[20] = "Advanced Sports Shooting"; choices[29] = "Underwater"; - choices[33] = "Gourmet"; - choices[34] = "Panorama"; - choices[35] = "Handheld Twilight"; + choices[33] = "Food"; + choices[34] = "Sweep Panorama"; + choices[35] = "Handheld Night Shot"; choices[36] = "Anti Motion Blur"; choices[37] = "Pet"; choices[38] = "Backlight Correction HDR"; + choices[39] = "Superior Auto"; choices[40] = "Background Defocus"; + choices[41] = "Soft Skin"; + choices[42] = "3D Image"; + choices[65535] = "n/a"; } }; SAExposureModeInterpreter saExposureModeInterpreter; @@ -611,7 +625,7 @@ public: choices.insert(p_t(55, "Sony DT 18-55mm f/3.5-5.6 SAM (SAL1855) or SAM II")); choices.insert(p_t(55, "Sony DT 18-55mm f/3.5-5.6 SAM II (SAL18552)")); choices.insert(p_t(56, "Sony DT 55-200mm f/4-5.6 SAM (SAL55200-2)")); - choices.insert(p_t(57, "Sony DT 50mm f/1.8 SAM (SAL50F18) or Tamron Lens")); + choices.insert(p_t(57, "Sony DT 50mm f/1.8 SAM (SAL50F18) or Tamron Lens or Commlite CM-EF-NEX adapter")); choices.insert(p_t(57, "Tamron SP AF 60mm f/2 Di II LD [IF] Macro 1:1")); choices.insert(p_t(57, "Tamron 18-270mm f/3.5-6.3 Di II PZD")); choices.insert(p_t(58, "Sony DT 30mm f/2.8 Macro SAM (SAL30M28)")); @@ -648,6 +662,7 @@ public: choices.insert(p_t(128, "Tamron AF 28-105mm f/4-5.6 [IF]")); choices.insert(p_t(128, "Sigma 35mm f/1.4 DG HSM")); choices.insert(p_t(128, "Sigma 18-35mm f/1.8 DC HSM")); + choices.insert(p_t(128, "Sigma 50-500mm f/4.5-6.3 APO DG OS HSM")); choices.insert(p_t(129, "Tamron Lens (129)")); choices.insert(p_t(129, "Tamron 200-400mm f/5.6 LD")); choices.insert(p_t(129, "Tamron 70-300mm f/4-5.6 LD")); @@ -675,6 +690,7 @@ public: choices.insert(p_t(255, "Tamron SP AF 70-200mm f/2.8 Di LD IF Macro")); choices.insert(p_t(255, "Tamron SP AF 28-75mm f/2.8 XR Di LD Aspherical IF")); choices.insert(p_t(255, "Tamron AF 90-300mm f/4.5-5.6 Telemacro")); + choices.insert(p_t(1868, "Sigma MC-11 Adapter")); choices.insert(p_t(2550, "Minolta AF 50mm f/1.7")); choices.insert(p_t(2551, "Minolta AF 35-70mm f/4 or Other Lens")); choices.insert(p_t(2551, "Sigma UC AF 28-70mm f/3.5-4.5")); @@ -723,7 +739,7 @@ public: choices.insert(p_t(2563, "Sigma 400mm f/5.6 APO")); choices.insert(p_t(2564, "Minolta AF 50mm f/2.8 Macro or Sigma Lens")); choices.insert(p_t(2564, "Sigma 50mm f/2.8 EX Macro")); - choices.insert(p_t(2565, "Minolta AF 600mm f/4")); + choices.insert(p_t(2565, "Minolta AF 600mm f/4 APO")); choices.insert(p_t(2566, "Minolta AF 24mm f/2.8 or Sigma Lens")); choices.insert(p_t(2566, "Sigma 17-35mm f/2.8-4 EX Aspherical")); choices.insert(p_t(2572, "Minolta/Sony AF 500mm f/8 Reflex")); @@ -749,7 +765,7 @@ public: choices.insert(p_t(2590, "Minolta AF 600mm f/4 HS-APO G + Minolta AF 1.4x APO")); choices.insert(p_t(2591, "Minolta AF 35mm f/1.4")); choices.insert(p_t(2592, "Minolta AF 85mm f/1.4 G (D)")); - choices.insert(p_t(2593, "Minolta AF 200mm f/2.8 G APO")); + choices.insert(p_t(2593, "Minolta AF 200mm f/2.8 APO")); choices.insert(p_t(2594, "Minolta AF 3x-1x f/1.7-2.8 Macro")); choices.insert(p_t(2596, "Minolta AF 28mm f/2")); choices.insert(p_t(2597, "Minolta AF 35mm f/2 [New]")); @@ -771,7 +787,7 @@ public: choices.insert(p_t(2620, "Minolta AF 28-70mm f/2.8 G")); choices.insert(p_t(2621, "Minolta AF 100-300mm f/4.5-5.6 xi")); choices.insert(p_t(2624, "Minolta AF 35-80mm f/4-5.6 Power Zoom")); - choices.insert(p_t(2628, "Minolta AF 80-200mm f/2.8 G")); + choices.insert(p_t(2628, "Minolta AF 80-200mm f/2.8 HS-APO G")); choices.insert(p_t(2629, "Minolta AF 85mm f/1.4 New")); choices.insert(p_t(2631, "Minolta/Sony AF 100-300mm f/4.5-5.6 APO")); choices.insert(p_t(2632, "Minolta AF 24-50mm f/4 New")); @@ -795,7 +811,8 @@ public: choices.insert(p_t(4585, "Tamron SP AF 300mm f/2.8 LD IF")); choices.insert(p_t(4586, "Tamron SP AF 35-105mm f/2.8 LD Aspherical IF")); choices.insert(p_t(4587, "Tamron AF 70-210mm f/2.8 SP LD")); - choices.insert(p_t(6118, "Metabones Canon EF Adapter")); + choices.insert(p_t(4812, "Metabones Canon EF Speed Booster Ultra")); + choices.insert(p_t(6118, "Canon EF Adapter")); choices.insert(p_t(6553, "E-Mount, T-Mount, Other Lens or no lens")); choices.insert(p_t(6553, "Sony E 16mm f/2.8")); choices.insert(p_t(6553, "Sony E 18-55mm f/3.5-5.6 OSS")); @@ -824,14 +841,22 @@ public: choices.insert(p_t(6553, "Sony FE 24-240mm f/3.5-6.3 OSS")); choices.insert(p_t(6553, "Sony FE 28mm f/2")); choices.insert(p_t(6553, "Sony FE PZ 28-135mm f/4 G OSS")); + choices.insert(p_t(6553, "Sony FE 24-70mm f/2.8 GM")); + choices.insert(p_t(6553, "Sony FE 85mm f/1.4 GM")); + choices.insert(p_t(6553, "Sony FE 50mm f/1.8")); choices.insert(p_t(6553, "Sony FE 21mm f/2.8 (SEL28F20 + SEL075UWC)")); choices.insert(p_t(6553, "Sony FE 16mm f/3.5 Fisheye (SEL28F20 + SEL057FEC)")); + choices.insert(p_t(6553, "Sony FE 70-300mm f/4.5-5.6 G OSS")); + choices.insert(p_t(6553, "Sony FE 70-200mm f/2.8 GM OSS")); choices.insert(p_t(6553, "Sigma 19mm f/2.8 [EX] DN")); choices.insert(p_t(6553, "Sigma 30mm f/2.8 [EX] DN")); choices.insert(p_t(6553, "Sigma 60mm f/2.8 DN")); + choices.insert(p_t(6553, "Sigma 30mm f/1.4 DC DN | C")); choices.insert(p_t(6553, "Tamron 18-200mm f/3.5-6.3 Di III VC")); choices.insert(p_t(6553, "Zeiss Batis 25mm f/2")); choices.insert(p_t(6553, "Zeiss Batis 85mm f/1.8")); + choices.insert(p_t(6553, "Zeiss Batis 18mm f/2.8")); + choices.insert(p_t(6553, "Zeiss Loxia 21mm f/2.8")); choices.insert(p_t(6553, "Zeiss Loxia 35mm f/2")); choices.insert(p_t(6553, "Zeiss Loxia 50mm f/2")); choices.insert(p_t(6553, "Zeiss Touit 12mm f/2.8")); @@ -844,6 +869,7 @@ public: choices.insert(p_t(6553, "Pentacon Auto 135mm f/2.8")); choices.insert(p_t(6553, "Pentacon Auto 29mm f/2.8")); choices.insert(p_t(6553, "Helios 44-2 58mm f/2.0")); + choices.insert(p_t(18688, "Sigma MC-11 Adapter")); choices.insert(p_t(25501, "Minolta AF 50mm f/1.7")); choices.insert(p_t(25511, "Minolta AF 35-70mm f/4 or Other Lens")); choices.insert(p_t(25511, "Sigma UC AF 28-70mm f/3.5-4.5")); @@ -892,7 +918,7 @@ public: choices.insert(p_t(25631, "Sigma 400mm f/5.6 APO")); choices.insert(p_t(25641, "Minolta AF 50mm f/2.8 Macro or Sigma Lens")); choices.insert(p_t(25641, "Sigma 50mm f/2.8 EX Macro")); - choices.insert(p_t(25651, "Minolta AF 600mm f/4")); + choices.insert(p_t(25651, "Minolta AF 600mm f/4 APO")); choices.insert(p_t(25661, "Minolta AF 24mm f/2.8 or Sigma Lens")); choices.insert(p_t(25661, "Sigma 17-35mm f/2.8-4 EX Aspherical")); choices.insert(p_t(25721, "Minolta/Sony AF 500mm f/8 Reflex")); @@ -918,7 +944,7 @@ public: choices.insert(p_t(25901, "Minolta AF 600mm f/4 HS-APO G + Minolta AF 1.4x APO")); choices.insert(p_t(25911, "Minolta AF 35mm f/1.4")); choices.insert(p_t(25921, "Minolta AF 85mm f/1.4 G (D)")); - choices.insert(p_t(25931, "Minolta AF 200mm f/2.8 G APO")); + choices.insert(p_t(25931, "Minolta AF 200mm f/2.8 APO")); choices.insert(p_t(25941, "Minolta AF 3x-1x f/1.7-2.8 Macro")); choices.insert(p_t(25961, "Minolta AF 28mm f/2")); choices.insert(p_t(25971, "Minolta AF 35mm f/2 [New]")); @@ -940,7 +966,7 @@ public: choices.insert(p_t(26201, "Minolta AF 28-70mm f/2.8 G")); choices.insert(p_t(26211, "Minolta AF 100-300mm f/4.5-5.6 xi")); choices.insert(p_t(26241, "Minolta AF 35-80mm f/4-5.6 Power Zoom")); - choices.insert(p_t(26281, "Minolta AF 80-200mm f/2.8 G")); + choices.insert(p_t(26281, "Minolta AF 80-200mm f/2.8 HS-APO G")); choices.insert(p_t(26291, "Minolta AF 85mm f/1.4 New")); choices.insert(p_t(26311, "Minolta/Sony AF 100-300mm f/4.5-5.6 APO")); choices.insert(p_t(26321, "Minolta AF 24-50mm f/4 New")); @@ -964,7 +990,8 @@ public: choices.insert(p_t(45851, "Tamron SP AF 300mm f/2.8 LD IF")); choices.insert(p_t(45861, "Tamron SP AF 35-105mm f/2.8 LD Aspherical IF")); choices.insert(p_t(45871, "Tamron AF 70-210mm f/2.8 SP LD")); - choices.insert(p_t(61184, "Metabones Canon EF Adapter")); + choices.insert(p_t(48128, "Metabones Canon EF Speed Booster Ultra")); + choices.insert(p_t(61184, "Canon EF Adapter")); choices.insert(p_t(65535, "E-Mount, T-Mount, Other Lens or no lens")); choices.insert(p_t(65535, "Sony E 16mm f/2.8")); choices.insert(p_t(65535, "Sony E 18-55mm f/3.5-5.6 OSS")); @@ -993,14 +1020,22 @@ public: choices.insert(p_t(65535, "Sony FE 24-240mm f/3.5-6.3 OSS")); choices.insert(p_t(65535, "Sony FE 28mm f/2")); choices.insert(p_t(65535, "Sony FE PZ 28-135mm f/4 G OSS")); + choices.insert(p_t(65535, "Sony FE 24-70mm f/2.8 GM")); + choices.insert(p_t(65535, "Sony FE 85mm f/1.4 GM")); + choices.insert(p_t(65535, "Sony FE 50mm f/1.8")); choices.insert(p_t(65535, "Sony FE 21mm f/2.8 (SEL28F20 + SEL075UWC)")); choices.insert(p_t(65535, "Sony FE 16mm f/3.5 Fisheye (SEL28F20 + SEL057FEC)")); + choices.insert(p_t(65535, "Sony FE 70-300mm f/4.5-5.6 G OSS")); + choices.insert(p_t(65535, "Sony FE 70-200mm f/2.8 GM OSS")); choices.insert(p_t(65535, "Sigma 19mm f/2.8 [EX] DN")); choices.insert(p_t(65535, "Sigma 30mm f/2.8 [EX] DN")); choices.insert(p_t(65535, "Sigma 60mm f/2.8 DN")); + choices.insert(p_t(65535, "Sigma 30mm f/1.4 DC DN | C")); choices.insert(p_t(65535, "Tamron 18-200mm f/3.5-6.3 Di III VC")); choices.insert(p_t(65535, "Zeiss Batis 25mm f/2")); choices.insert(p_t(65535, "Zeiss Batis 85mm f/1.8")); + choices.insert(p_t(65535, "Zeiss Batis 18mm f/2.8")); + choices.insert(p_t(65535, "Zeiss Loxia 21mm f/2.8")); choices.insert(p_t(65535, "Zeiss Loxia 35mm f/2")); choices.insert(p_t(65535, "Zeiss Loxia 50mm f/2")); choices.insert(p_t(65535, "Zeiss Touit 12mm f/2.8")); @@ -1060,8 +1095,8 @@ public: choices.insert(p_t(3, "Sony LA-EA3 Adapter")); choices.insert(p_t(6, "Sony LA-EA4 Adapter")); choices.insert(p_t(44, "Metabones Canon EF Smart Adapter")); - choices.insert(p_t(78, "Metabones Canon EF Smart Adapter Mark III or IV")); - choices.insert(p_t(234, "Adapter only - no lens attached")); + choices.insert(p_t(78, "Metabones Canon EF Smart Adapter Mark III or Other Adapter")); + choices.insert(p_t(234, "Metabones Canon EF Smart Adapter Mark IV")); choices.insert(p_t(239, "Metabones Canon EF Speed Booster")); choices.insert(p_t(32784, "Sony E 16mm f/2.8")); choices.insert(p_t(32785, "Sony E 18-55mm f/3.5-5.6 OSS")); @@ -1090,10 +1125,35 @@ public: choices.insert(p_t(32815, "Sony FE 24-240mm f/3.5-6.3 OSS")); choices.insert(p_t(32816, "Sony FE 28mm f/2")); choices.insert(p_t(32817, "Sony FE PZ 28-135mm f/4 G OSS")); + choices.insert(p_t(32821, "Sony FE 24-70mm f/2.8 GM")); + choices.insert(p_t(32823, "Sony FE 85mm f/1.4 GM")); + choices.insert(p_t(32824, "Sony FE 50mm f/1.8")); choices.insert(p_t(32826, "Sony FE 21mm f/2.8 (SEL28F20 + SEL075UWC)")); choices.insert(p_t(32827, "Sony FE 16mm f/3.5 Fisheye (SEL28F20 + SEL057FEC)")); + choices.insert(p_t(32828, "Sony FE 70-300mm f/4.5-5.6 G OSS")); + choices.insert(p_t(32830, "Sony FE 70-200mm f/2.8 GM OSS")); + choices.insert(p_t(49201, "Zeiss Touit 12mm f/2.8")); + choices.insert(p_t(49202, "Zeiss Touit 32mm f/1.8")); + choices.insert(p_t(49203, "Zeiss Touit 50mm f/2.8 Macro")); choices.insert(p_t(49216, "Zeiss Batis 25mm f/2")); choices.insert(p_t(49217, "Zeiss Batis 85mm f/1.8")); + choices.insert(p_t(49218, "Zeiss Batis 18mm f/2.8")); + choices.insert(p_t(49232, "Zeiss Loxia 50mm f/2")); + choices.insert(p_t(49233, "Zeiss Loxia 35mm f/2")); + choices.insert(p_t(49234, "Zeiss Loxia 21mm f/2.8")); + choices.insert(p_t(50480, "Sigma 30mm f/1.4 DC DN | C 016")); + choices.insert(p_t(50481, "Sigma 50mm f/1.4 DG HSM | A 014 + MC-11")); + choices.insert(p_t(50482, "Sigma 18-300mm f/3.5-6.3 DC MACRO OS HSM | C 014 + MC-11")); + choices.insert(p_t(50483, "Sigma 18-35mm f/1.8 DC HSM | A 013 + MC-11")); + choices.insert(p_t(50484, "Sigma 24-35mm f/2 DG HSM | A 015 + MC-11")); + choices.insert(p_t(50486, "Sigma 150-600mm f/5-6.3 DG OS HSM | C 015 + MC-11")); + choices.insert(p_t(50487, "Sigma 20mm f/1.4 DG HSM | A 015 + MC-11")); + choices.insert(p_t(50488, "Sigma 35mm f/1.4 DG HSM | A 012 + MC-11")); + choices.insert(p_t(50489, "Sigma 150-600mm f/5-6.3 DG OS HSM | S 014 + MC-11")); + choices.insert(p_t(50490, "Sigma 120-300mm f/2.8 DG OS HSM | S 013 + MC-11")); + choices.insert(p_t(50492, "Sigma 24-105mm f/4 DG OS HSM | A 013 + MC-11")); + choices.insert(p_t(50493, "Sigma 17-70mm f/2.8-4 DC MACRO OS HSM | C 013 + MC-11")); + choices.insert(p_t(50495, "Sigma 50-100mm f/1.8 DC HSM | A 016 + MC-11")); } virtual std::string toString (Tag* t) @@ -1135,11 +1195,15 @@ class MATeleconverterInterpreter : public ChoiceInterpreter public: MATeleconverterInterpreter () { - choices[0] = "None "; - choices[0x48] = "Minolta AF 2x APO (D)"; - choices[0x50] = "Minolta AF 2x APO II"; - choices[0x88] = "Minolta AF 1.4x APO (D)"; - choices[0x90] = "Minolta AF 1.4x APO II"; + choices[0x0] = "None"; + choices[0x4] = "Minolta/Sony AF 1.4x APO (D) (0x04)"; + choices[0x5] = "Minolta/Sony AF 2x APO (D) (0x05)"; + choices[0x48] = "Minolta/Sony AF 2x APO (D)"; + choices[0x50] = "Minolta AF 2x APO II"; + choices[0x60] = "Minolta AF 2x APO"; + choices[0x88] = "Minolta/Sony AF 1.4x APO (D)"; + choices[0x90] = "Minolta AF 1.4x APO II"; + choices[0xa0] = "Minolta AF 1.4x APO"; } }; MATeleconverterInterpreter maTeleconverterInterpreter; @@ -1149,15 +1213,15 @@ class MAQualityInterpreter : public ChoiceInterpreter public: MAQualityInterpreter () { - choices[0] = "Raw"; - choices[1] = "Super Fine"; - choices[2] = "Fine"; - choices[3] = "Standard"; - choices[4] = "Economy"; - choices[5] = "Extra fine"; - choices[6] = "RAW + JPEG"; - choices[7] = "cRAW"; - choices[8] = "cRAW + JPEG"; + choices[0] = "RAW"; + choices[1] = "Super Fine"; + choices[2] = "Fine"; + choices[3] = "Standard"; + choices[4] = "Economy"; + choices[5] = "Extra Fine"; + choices[6] = "RAW + JPEG"; + choices[7] = "Compressed RAW"; + choices[8] = "Compressed RAW + JPEG"; } }; MAQualityInterpreter maQualityInterpreter; @@ -1211,14 +1275,19 @@ class SADriveMode : public ChoiceInterpreter public: SADriveMode () { - choices[0] = "Single Frame"; - choices[1] = "Continuous High"; + choices[1] = "Single Frame"; + choices[2] = "Continuous High"; choices[4] = "Self-timer 10 sec"; - choices[5] = "Self-timer 2 sec"; + choices[5] = "Self-timer 2 sec, Mirror Lock-up"; + choices[6] = "Single-frame Bracketing"; choices[7] = "Continuous Bracketing"; - choices[12] = "Continuous Low"; - choices[18] = "White Balance Bracketing Low"; - choices[19] = "D-Range Optimizer Bracketing Low"; + choices[10] = "Remote Commander"; + choices[11] = "Mirror Lock-up"; + choices[18] = "Continuous Low"; + choices[24] = "White Balance Bracketing Low"; + choices[25] = "D-Range Optimizer Bracketing Low"; + choices[40] = "White Balance Bracketing High"; + choices[41] = "D-Range Optimizer Bracketing High"; } }; SADriveMode saDriveMode; @@ -1228,7 +1297,7 @@ class SADriveMode2 : public ChoiceInterpreter public: SADriveMode2 () { - choices[0] = "Single Frame"; + choices[1] = "Single Frame"; choices[2] = "Continuous High"; choices[4] = "Self-timer 10 sec"; choices[5] = "Self-timer 2 sec, Mirror Lock-up"; @@ -1244,23 +1313,23 @@ class SADriveMode3 : public ChoiceInterpreter public: SADriveMode3 () { - choices[0x10] = "Single Frame"; - choices[0x21] = "Continuous High"; - choices[0x22] = "Continuous Low"; - choices[0x30] = "Speed Priority Continuous"; - choices[0x51] = "Self-timer 10 sec"; - choices[0x52] = "Self-timer 2 sec, Mirror Lock-up"; - choices[0x71] = "Continuous Bracketing 0.3 EV"; - choices[0x75] = "Continuous Bracketing 0.7 EV"; - choices[0x91] = "White Balance Bracketing Low"; - choices[0x92] = "White Balance Bracketing High"; - choices[0xC0] = "Remote Commander"; - choices[0xD1] = "Continuous - HDR"; - choices[0xD2] = "Continuous - Multi Frame NR"; - choices[0xD3] = "Continuous - Handheld Night Shot"; - choices[0xD4] = "Continuous - Anti Motion Blur"; - choices[0xD5] = "Continuous - Sweep Panorama"; - choices[0xD6] = "Continuous - 3D Sweep Panorama"; + choices[16] = "Single Frame"; + choices[33] = "Continuous High"; + choices[34] = "Continuous Low"; + choices[48] = "Speed Priority Continuous"; + choices[81] = "Self-timer 10 sec"; + choices[82] = "Self-timer 2 sec, Mirror Lock-up"; + choices[113] = "Continuous Bracketing 0.3 EV"; + choices[117] = "Continuous Bracketing 0.7 EV"; + choices[145] = "White Balance Bracketing Low"; + choices[146] = "White Balance Bracketing High"; + choices[192] = "Remote Commander"; + choices[209] = "Continuous - HDR"; + choices[210] = "Continuous - Multi Frame NR"; + choices[211] = "Continuous - Handheld Night Shot"; + choices[212] = "Continuous - Anti Motion Blur"; + choices[213] = "Continuous - Sweep Panorama"; + choices[214] = "Continuous - 3D Sweep Panorama"; } }; SADriveMode3 saDriveMode3; @@ -1320,8 +1389,8 @@ public: choices[3] = "Spot AF"; choices[4] = "Flexible Spot AF"; choices[6] = "Touch AF"; - choices[14] = "Manual Focus"; - choices[15] = "Face Detected"; + choices[14] = "Tracking"; + choices[15] = "Face Tracking"; choices[65535] = "n/a"; } }; @@ -1624,27 +1693,27 @@ class SAExposureProgram2: public ChoiceInterpreter public: SAExposureProgram2 () { - choices[1] = "Program AE"; - choices[2] = "Aperture-priority AE"; - choices[3] = "Shutter speed priority AE"; - choices[4] = "Manual"; - choices[5] = "Cont. Priority AE"; - choices[16] = "Auto"; - choices[17] = "Auto (no flash)"; - choices[18] = "Auto+"; - choices[49] = "Portrait"; - choices[50] = "Landscape"; - choices[51] = "Macro"; - choices[52] = "Sports"; - choices[53] = "Sunset"; - choices[54] = "Night view"; - choices[55] = "Night view/portrait"; - choices[56] = "Handheld Night Shot"; - choices[57] = "3D Sweep Panorama"; - choices[64] = "Auto 2"; - choices[65] = "Auto 2 (no flash)"; - choices[80] = "Sweep Panorama"; - choices[96] = "Anti Motion Blur"; + choices[1] = "Program AE"; + choices[2] = "Aperture-priority AE"; + choices[3] = "Shutter speed priority AE"; + choices[4] = "Manual"; + choices[5] = "Cont. Priority AE"; + choices[16] = "Auto"; + choices[17] = "Auto (no flash)"; + choices[18] = "Auto+"; + choices[49] = "Portrait"; + choices[50] = "Landscape"; + choices[51] = "Macro"; + choices[52] = "Sports"; + choices[53] = "Sunset"; + choices[54] = "Night view"; + choices[55] = "Night view/portrait"; + choices[56] = "Handheld Night Shot"; + choices[57] = "3D Sweep Panorama"; + choices[64] = "Auto 2"; + choices[65] = "Auto 2 (no flash)"; + choices[80] = "Sweep Panorama"; + choices[96] = "Anti Motion Blur"; choices[128] = "Toy Camera"; choices[129] = "Pop Color"; choices[130] = "Posterization"; @@ -1785,9 +1854,10 @@ public: SAReleaseModeInterpreter () { choices[0] = "Normal"; - choices[2] = "Burst"; + choices[2] = "Continuous"; choices[5] = "Exposure Bracketing"; choices[6] = "White Balance Bracketing"; + choices[8] = "DRO Bracketing"; choices[65535] = "n/a"; } }; @@ -1800,11 +1870,19 @@ public: { choices[1] = "Standard"; choices[2] = "Vivid"; + choices[3] = "Portrait"; + choices[4] = "Landscape"; + choices[5] = "Sunset"; + choices[7] = "Night View/Portrait"; + choices[8] = "B&W"; choices[9] = "Adobe RGB"; choices[11] = "Neutral"; choices[129] = "StyleBox1"; choices[130] = "StyleBox2"; choices[131] = "StyleBox3"; + choices[132] = "StyleBox4"; + choices[133] = "StyleBox5"; + choices[134] = "StyleBox6"; } }; SAImageStyleInterpreter saImageStyleInterpreter; @@ -1814,27 +1892,42 @@ class SAPictureEffectInterpreter: public ChoiceInterpreter public: SAPictureEffectInterpreter() { - choices[0] = "Off"; - choices[1] = "Toy Camera"; - choices[2] = "Pop Color"; - choices[3] = "Posterization"; - choices[4] = "Posterization B/W"; - choices[5] = "Retro Photo"; - choices[6] = "Soft High Key"; - choices[7] = "Partial Color Red"; - choices[8] = "Partial Color Green"; - choices[9] = "Partial Color Blue"; - choices[10] = "Partial Color Yellow"; + choices[0] = "Off"; + choices[1] = "Toy Camera"; + choices[2] = "Pop Color"; + choices[3] = "Posterization"; + choices[4] = "Posterization B/W"; + choices[5] = "Retro Photo"; + choices[6] = "Soft High Key"; + choices[7] = "Partial Color (red)"; + choices[8] = "Partial Color (green)"; + choices[9] = "Partial Color (blue)"; + choices[10] = "Partial Color (yellow)"; choices[13] = "High Contrast Monochrome"; - choices[16] = "Toy Camera 2"; + choices[16] = "Toy Camera (normal)"; + choices[17] = "Toy Camera (cool)"; + choices[18] = "Toy Camera (warm)"; + choices[19] = "Toy Camera (green)"; + choices[20] = "Toy Camera (magenta)"; + choices[32] = "Soft Focus (low)"; choices[33] = "Soft Focus"; - choices[48] = "Miniature"; - choices[50] = "Miniature 2"; - choices[51] = "Miniature 3"; + choices[34] = "Soft Focus (high)"; + choices[48] = "Miniature (auto)"; + choices[49] = "Miniature (top)"; + choices[50] = "Miniature (middle horizontal)"; + choices[51] = "Miniature (bottom)"; + choices[52] = "Miniature (left)"; + choices[53] = "Miniature (middle vertical)"; + choices[54] = "Miniature (right)"; + choices[64] = "HDR Painting (low)"; choices[65] = "HDR Painting"; + choices[66] = "HDR Painting (high)"; choices[80] = "Rich-tone Monochrome"; - choices[98] = "Water Color"; - choices[114] = "Illustration"; + choices[97] = "Water Color"; + choices[98] = "Water Color 2"; + choices[112] = "Illustration (low)"; + choices[113] = "Illustration"; + choices[114] = "Illustration (high)"; } }; SAPictureEffectInterpreter saPictureEffectInterpreter; diff --git a/rtgui/batchqueue.cc b/rtgui/batchqueue.cc index bd1f5e439..6f2ff8846 100644 --- a/rtgui/batchqueue.cc +++ b/rtgui/batchqueue.cc @@ -33,7 +33,7 @@ #include "batchqueuebuttonset.h" #include "guiutils.h" #include "rtimage.h" - +#include using namespace std; using namespace rtengine; @@ -363,6 +363,10 @@ bool BatchQueue::loadBatchQueue () Glib::ustring BatchQueue::getTempFilenameForParams( const Glib::ustring filename ) { + timeval tv; + gettimeofday(&tv, 0); + char mseconds[4]; + sprintf(mseconds, "%d", tv.tv_usec / 1000); time_t rawtime; struct tm *timeinfo; char stringTimestamp [80]; @@ -374,6 +378,7 @@ Glib::ustring BatchQueue::getTempFilenameForParams( const Glib::ustring filename g_mkdir_with_parents (savedParamPath.c_str (), 0755); savedParamPath += Glib::path_get_basename (filename); savedParamPath += stringTimestamp; + savedParamPath += mseconds; savedParamPath += paramFileExtension; return savedParamPath; }