Applied patch from Phil for hardcoded language fixes

This commit is contained in:
Wyatt Olson
2010-05-01 13:32:21 -06:00
commit ff7c6a1531
569 changed files with 115870 additions and 0 deletions

13
rtexif/CMakeLists.txt Normal file
View File

@@ -0,0 +1,13 @@
include_directories (.)
add_library (rtexif rtexif.cc stdattribs.cc nikonattribs.cc canonattribs.cc
pentaxattribs.cc fujiattribs.cc sonyminoltaattribs.cc olympusattribs.cc)
IF (WIN32)
set_target_properties (rtexif PROPERTIES COMPILE_FLAGS "-O3 -ffast-math -fexpensive-optimizations")
ELSE (WIN32)
set_target_properties (rtexif PROPERTIES COMPILE_FLAGS "-O3 -ffast-math -fexpensive-optimizations -fPIC")
ENDIF (WIN32)
IF (BUILD_SHARED_LIBS)
INSTALL(TARGETS rtexif DESTINATION ${LIBDIR})
ENDIF (BUILD_SHARED_LIBS)

859
rtexif/canonattribs.cc Normal file
View File

@@ -0,0 +1,859 @@
/*
* This file is part of RawTherapee.
*
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
*
* RawTherapee is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* RawTherapee is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _CANONATTRIBS_
#define _CANONATTRIBS_
#include <rtexif.h>
#include <string>
#include <map>
#include <math.h>
#include <sstream>
#include <iomanip>
namespace rtexif {
class CAIntSerNumInterpreter : public Interpreter {
public:
CAIntSerNumInterpreter () {}
virtual std::string toString (Tag* t) { return ""; }
};
CAIntSerNumInterpreter caIntSerNumInterpreter;
class CAFocalLengthInterpreter : public Interpreter {
public:
CAFocalLengthInterpreter () {}
virtual std::string toString (Tag* t) {
std::ostringstream str;
str << "FocalType = " << t->toInt(0,SHORT) << std::endl;
str << "FocalLength = " << t->toInt(2,SHORT) << std::endl;
str << "FocalPlaneXSize = " << t->toInt(4,SHORT) << std::endl;
str << "FocalPlaneYSize = " << t->toInt(6,SHORT);
return str.str();
}
};
CAFocalLengthInterpreter caFocalLengthInterpreter;
class CACameraSettingsInterpreter : public Interpreter {
std::map<int,std::string> machoices;
std::map<int,std::string> qlchoices;
std::map<int,std::string> fmchoices;
std::map<int,std::string> cdchoices;
std::map<int,std::string> fochoices;
std::map<int,std::string> rmchoices;
std::map<int,std::string> ischoices;
std::map<int,std::string> mmchoices;
std::map<int,std::string> dzchoices;
std::map<int,std::string> emchoices;
std::map<int,std::string> frchoices;
std::map<int,std::string> afchoices;
std::map<int,std::string> exchoices;
std::map<int,std::string> fcchoices;
std::map<int,std::string> aechoices;
std::map<int,std::string> stchoices;
std::map<int,std::string> smchoices;
std::map<int,std::string> pechoices;
std::map<int,std::string> mfchoices;
std::map<int,std::string> choices;
public:
CACameraSettingsInterpreter () {
machoices[1] = "Macro";
machoices[2] = "Normal";
qlchoices[1] = "Economy";
qlchoices[2] = "Normal";
qlchoices[3] = "Fine";
qlchoices[4] = "RAW";
qlchoices[5] = "Superfine";
fmchoices[0] = "Off";
fmchoices[1] = "Auto";
fmchoices[2] = "On";
fmchoices[3] = "Red-eye reduction";
fmchoices[4] = "Slow-sync";
fmchoices[5] = "Red-eye reduction (Auto)";
fmchoices[6] = "Red-eye reduction (On)";
fmchoices[16] = "External flash";
cdchoices[0] = "Single";
cdchoices[1] = "Continuous";
cdchoices[2] = "Movie";
cdchoices[3] = "Continuous, Speed Priority";
cdchoices[4] = "Continuous, Low";
cdchoices[5] = "Continuous, High";
fochoices[0] = "One-shot AF";
fochoices[1] = "AI Servo AF";
fochoices[2] = "AI Focus AF";
fochoices[3] = "Manual Focus";
fochoices[4] = "Single";
fochoices[5] = "Continuous";
fochoices[6] = "Manual Focus";
fochoices[16] = "Pan Focus";
rmchoices[1] = "JPEG";
rmchoices[2] = "CRW+THM";
rmchoices[3] = "AVI+THM";
rmchoices[4] = "TIF";
rmchoices[5] = "TIF+JPEG";
rmchoices[6] = "CR2";
rmchoices[7] = "CR2+JPEG";
ischoices[0] = "Large";
ischoices[1] = "Medium";
ischoices[2] = "Small";
ischoices[5] = "Medium 1";
ischoices[6] = "Medium 2";
ischoices[7] = "Medium 3";
ischoices[8] = "Postcard";
ischoices[9] = "Widescreen";
emchoices[0] = "Full auto ";
emchoices[1] = "Manual ";
emchoices[2] = "Landscape ";
emchoices[3] = "Fast shutter ";
emchoices[4] = "Slow shutter ";
emchoices[5] = "Night ";
emchoices[6] = "Gray Scale ";
emchoices[7] = "Sepia ";
emchoices[8] = "Portrait ";
emchoices[9] = "Sports ";
emchoices[10] = "Macro ";
emchoices[11] = "Black & White";
emchoices[12] = "Pan focus";
emchoices[13] = "Vivid";
emchoices[14] = "Neutral";
emchoices[15] = "Flash Off";
emchoices[16] = "Long Shutter";
emchoices[17] = "Super Macro";
emchoices[18] = "Foliage";
emchoices[19] = "Indoor";
emchoices[20] = "Fireworks";
emchoices[21] = "Beach";
emchoices[22] = "Underwater";
emchoices[23] = "Snow";
emchoices[24] = "Kids & Pets";
emchoices[25] = "Night Snapshot";
emchoices[26] = "Digital Macro";
emchoices[27] = "My Colors";
emchoices[28] = "Still Image";
emchoices[30] = "Color Accent";
emchoices[31] = "Color Swap";
emchoices[32] = "Aquarium";
emchoices[33] = "ISO 3200";
dzchoices[0] = "None";
dzchoices[1] = "2x";
dzchoices[2] = "4x";
dzchoices[3] = "Other";
mmchoices[0] = "Default";
mmchoices[1] = "Spot";
mmchoices[2] = "Average";
mmchoices[3] = "Evaluative";
mmchoices[4] = "Partial";
mmchoices[5] = "Center-weighted averaging";
frchoices[0] = "Manual";
frchoices[1] = "Auto";
frchoices[2] = "Not Known";
frchoices[3] = "Macro";
frchoices[4] = "Very Close";
frchoices[5] = "Close";
frchoices[6] = "Middle Range";
frchoices[7] = "Far Range";
frchoices[8] = "Pan Focus";
frchoices[9] = "Super Macro";
frchoices[10] = "Infinity";
afchoices[0x2005] = "Manual AF point selection ";
afchoices[0x3000] = "None (MF)";
afchoices[0x3001] = "Auto AF point selection ";
afchoices[0x3002] = "Right ";
afchoices[0x3003] = "Center ";
afchoices[0x3004] = "Left ";
afchoices[0x4001] = "Auto AF point selection ";
afchoices[0x4006] = "Face Detect";
exchoices[0] = "Easy";
exchoices[1] = "Program AE";
exchoices[2] = "Shutter speed priority AE";
exchoices[3] = "Aperture-priority AE";
exchoices[4] = "Manual";
exchoices[5] = "Depth-of-field AE";
exchoices[6] = "M-Dep";
fcchoices[0] = "Single";
fcchoices[1] = "Continuous";
aechoices[0] = "Normal AE";
aechoices[1] = "Exposure Compensation";
aechoices[2] = "AE Lock";
aechoices[3] = "AE Lock + Exposure Comp.";
aechoices[4] = "No AE";
stchoices[0] = "Off";
stchoices[1] = "On";
stchoices[2] = "On, Shot Only";
stchoices[3] = "On, Panning";
smchoices[0] = "Center";
smchoices[1] = "AF Point";
pechoices[0] = "Off";
pechoices[1] = "Vivid";
pechoices[2] = "Neutral";
pechoices[3] = "Smooth";
pechoices[4] = "Sepia";
pechoices[5] = "B&W";
pechoices[6] = "Custom";
pechoices[100] = "My Color Data";
mfchoices[0] = "N/A";
mfchoices[0x500] = "Full";
mfchoices[0x502] = "Medium";
mfchoices[0x504] = "Low";
mfchoices[0x7fff] = "N/A";
choices[1] = "Canon EF 50mm f/1.8";
choices[2] = "Canon EF 28mm f/2.8";
choices[3] = "Canon EF 135mm f/2.8 Soft";
choices[4] = "Canon EF 35-105mm f/3.5-4.5 or Sigma Lens";
choices[5] = "Canon EF 35-70mm f/3.5-4.5";
choices[6] = "Canon EF 28-70mm f/3.5-4.5 or Sigma or Tokina Lens";
choices[7] = "Canon EF 100-300mm F5.6L";
choices[8] = "Canon EF 100-300mm f/5.6 or Sigma or Tokina Lens";
choices[9] = "Canon EF 70-210mm f/4 orSigma Lens";
choices[10] = "Canon EF 50mm f/2.5 Macro or Sigma Lens";
choices[11] = "Canon EF 35mm f/2";
choices[13] = "Canon EF 15mm f/2.8";
choices[14] = "Canon EF 50-200mm f/3.5-4.5L";
choices[15] = "Canon EF 50-200mm f/3.5-4.5";
choices[16] = "Canon EF 35-135mm f/3.5-4.5";
choices[17] = "Canon EF 35-70mm f/3.5-4.5A";
choices[18] = "Canon EF 28-70mm f/3.5-4.5";
choices[20] = "Canon EF 100-200mm f/4.5A";
choices[21] = "Canon EF 80-200mm f/2.8L";
choices[22] = "Canon EF 20-35mm f/2.8L or Tokina 28-80mm F2.8";
choices[23] = "Canon EF 35-105mm f/3.5-4.5";
choices[24] = "Canon EF 35-80mm f/4-5.6 Power Zoom";
choices[25] = "Canon EF 35-80mm f/4-5.6 Power Zoom";
choices[26] = "Canon EF 100mm f/2.8 Macro or Cosina 100mm f/3.5 Macro AF or Tamron";
choices[28] = "Tamron AF Aspherical 28-200mm f/3.8-5.6 or 28-75mm f/2.8 or 28-105mm f/2.8";
choices[27] = "Canon EF 35-80mm f/4-5.6";
choices[28] = "Canon EF 80-200mm f/4.5-5.6 or Tamron Lens";
choices[29] = "Canon EF 50mm f/1.8 MkII";
choices[30] = "Canon EF 35-105mm f/4.5-5.6";
choices[31] = "Tamron SP AF 300mm f/2.8 LD IF";
choices[32] = "Canon EF 24mm f/2.8 or Sigma 15mm f/2.8 EX Fisheye";
choices[33] = "Voigtlander Ultron 40mm f/2 SLII Aspherical";
choices[35] = "Canon EF 35-80mm f/4-5.6";
choices[36] = "Canon EF 38-76mm f/4.5-5.6";
choices[37] = "Canon EF 35-80mm f/4-5.6 or Tamron Lens";
choices[38] = "Canon EF 80-200mm f/4.5-5.6";
choices[39] = "Canon EF 75-300mm f/4-5.6";
choices[40] = "Canon EF 28-80mm f/3.5-5.6";
choices[41] = "Canon EF 28-90mm f/4-5.6";
choices[42] = "Canon EF 28-200mm f/3.5-5.6 or Tamron AF 28-300mm f/3.5-6.3";
choices[43] = "Canon EF 28-105mm f/4-5.6";
choices[44] = "Canon EF 90-300mm f/4.5-5.6";
choices[45] = "Canon EF-S 18-55mm f/3.5-5.6";
choices[46] = "Canon EF 28-90mm f/4-5.6";
choices[48] = "Canon EF-S 18-55mm f/3.5-5.6 IS";
choices[49] = "Canon EF-S 55-250mm f/4-5.6 IS";
choices[50] = "Canon EF-S 18-200mm f/3.5-5.6 IS";
choices[51] = "Canon EF-S 18-135mm f/3.5-5.6 IS";
choices[94] = "Canon TS-E 17mm f/4L";
choices[95] = "Canon TS-E 24.0mm f/3.5 L II";
choices[124] = "Canon MP-E 65mm f/2.8 1-5x Macro Photo";
choices[125] = "Canon TS-E 24mm f/3.5L";
choices[126] = "Canon TS-E 45mm f/2.8";
choices[127] = "Canon TS-E 90mm f/2.8";
choices[129] = "Canon EF 300mm f/2.8L";
choices[130] = "Canon EF 50mm f/1.0L";
choices[131] = "Canon EF 28-80mm f/2.8-4L or Sigma Lens";
choices[132] = "Canon EF 1200mm f/5.6L";
choices[134] = "Canon EF 600mm f/4L IS";
choices[135] = "Canon EF 200mm f/1.8L";
choices[136] = "Canon EF 300mm f/2.8L";
choices[137] = "Canon EF 85mm f/1.2L or Sigma Lens";
choices[138] = "Canon EF 28-80mm f/2.8-4L";
choices[139] = "Canon EF 400mm f/2.8L";
choices[140] = "Canon EF 500mm f/4.5L";
choices[141] = "Canon EF 500mm f/4.5L";
choices[142] = "Canon EF 300mm f/2.8L IS";
choices[143] = "Canon EF 500mm f/4L IS";
choices[144] = "Canon EF 35-135mm f/4-5.6 USM";
choices[145] = "Canon EF 100-300mm f/4.5-5.6 USM";
choices[146] = "Canon EF 70-210mm f/3.5-4.5 USM";
choices[147] = "Canon EF 35-135mm f/4-5.6 USM";
choices[148] = "Canon EF 28-80mm f/3.5-5.6 USM";
choices[149] = "Canon EF 100mm f/2";
choices[150] = "Canon EF 14mm f/2.8L or Sigma Lens";
choices[151] = "Canon EF 200mm f/2.8L";
choices[152] = "Canon EF 300mm f/4L IS or Sigma Lens";
choices[153] = "Canon EF 35-350mm f/3.5-5.6L or Tamron or Sigma Lens";
choices[154] = "Canon EF 20mm f/2.8 USM";
choices[155] = "Canon EF 85mm f/1.8 USM";
choices[156] = "Canon EF 28-105mm f/3.5-4.5 USM";
choices[160] = "Canon EF 20-35mm f/3.5-4.5 USM or Tamron AF 19-35mm f/3.5-4.5";
choices[161] = "Canon EF 28-70mm f/2.8L or Sigma or Tamron Lens";
choices[162] = "Canon EF 200mm f/2.8L";
choices[163] = "Canon EF 300mm f/4L";
choices[164] = "Canon EF 400mm f/5.6L";
choices[165] = "Canon EF 70-200mm f/2.8 L";
choices[166] = "Canon EF 70-200mm f/2.8 L + x1.4";
choices[167] = "Canon EF 70-200mm f/2.8 L + x2";
choices[168] = "Canon EF 28mm f/1.8 USM";
choices[169] = "Canon EF17-35mm f/2.8L or Sigma Lens";
choices[170] = "Canon EF 200mm f/2.8L II";
choices[171] = "Canon EF 300mm f/4L";
choices[172] = "Canon EF 400mm f/5.6L";
choices[173] = "Canon EF 180mm Macro f/3.5L or Sigma 180mm F3.5 or 150mm f/2.8 Macro";
choices[174] = "Canon EF 135mm f/2L";
choices[175] = "Canon EF 400mm f/2.8L";
choices[176] = "Canon EF 24-85mm f/3.5-4.5 USM";
choices[177] = "Canon EF 300mm f/4L IS";
choices[178] = "Canon EF 28-135mm f/3.5-5.6 IS";
choices[179] = "Canon EF 24mm f/1.4L USM";
choices[180] = "Canon EF 35mm f/1.4L";
choices[181] = "Canon EF 100-400mm f/4.5-5.6L IS + x1.4";
choices[182] = "Canon EF 100-400mm f/4.5-5.6L IS + x2";
choices[183] = "Canon EF 100-400mm f/4.5-5.6L IS";
choices[184] = "Canon EF 400mm f/2.8L + x2";
choices[185] = "Canon EF 600mm f/4L IS";
choices[186] = "Canon EF 70-200mm f/4L";
choices[187] = "Canon EF 70-200mm f/4L + 1.4x";
choices[188] = "Canon EF 70-200mm f/4L + 2x";
choices[189] = "Canon EF 70-200mm f/4L + 2.8x";
choices[190] = "Canon EF 100mm f/2.8 Macro";
choices[191] = "Canon EF 400mm f/4 DO IS";
choices[193] = "Canon EF 35-80mm f/4-5.6 USM";
choices[194] = "Canon EF 80-200mm f/4.5-5.6 USM";
choices[195] = "Canon EF 35-105mm f/4.5-5.6 USM";
choices[196] = "Canon EF 75-300mm f/4-5.6 USM";
choices[197] = "Canon EF 75-300mm f/4-5.6 IS";
choices[198] = "Canon EF 50mm f/1.4 USM";
choices[199] = "Canon EF 28-80mm f/3.5-5.6 USM";
choices[200] = "Canon EF 75-300mm f/4-5.6 USM";
choices[201] = "Canon EF 28-80mm f/3.5-5.6 USM";
choices[202] = "Canon EF 28-80 f/3.5-5.6 USM IV";
choices[208] = "Canon EF 22-55mm f/4-5.6 USM";
choices[209] = "Canon EF 55-200mm f/4.5-5.6";
choices[210] = "Canon EF 28-90mm f/4-5.6 USM";
choices[211] = "Canon EF 28-200mm f/3.5-5.6";
choices[212] = "Canon EF 28-105mm f/4-5.6 USM";
choices[213] = "Canon EF 90-300mm f/4.5-5.6";
choices[214] = "Canon EF-S 18-55mm f/3.5-4.5 USM";
choices[215] = "Canon EF 55-200mm f/4.5-5.6 II USM";
choices[224] = "Canon EF 70-200mm f/2.8L IS USM";
choices[225] = "Canon EF 70-200mm f/2.8L IS USM + x1.4";
choices[226] = "Canon EF 70-200mm f/2.8L IS USM + x2";
choices[227] = "Canon EF 70-200mm f/2.8L IS + 2.8x";
choices[228] = "Canon EF 28-105mm f/3.5-4.5 USM";
choices[229] = "Canon EF 16-35mm f/2.8L";
choices[230] = "Canon EF 24-70mm f/2.8L";
choices[231] = "Canon EF 17-40mm f/4L";
choices[232] = "Canon EF 70-300mm f/4.5-5.6 DO IS USM";
choices[233] = "Canon EF 28-300mm f/3.5-5.6L IS";
choices[234] = "Canon EF-S 17-85mm f4-5.6 IS USM";
choices[235] = "Canon EF-S10-22mm F3.5-4.5 USM";
choices[236] = "Canon EF-S60mm F2.8 Macro USM";
choices[237] = "Canon EF 24-105mm f/4L IS";
choices[238] = "Canon EF 70-300mm f/4-5.6 IS USM";
choices[239] = "Canon EF 85mm f/1.2L II USM";
choices[240] = "Canon EF-S 17-55mm f/2.8 IS USM";
choices[241] = "Canon EF 50mm f/1.2L USM";
choices[242] = "Canon EF 70-200mm f/4L IS USM";
choices[243] = "Canon EF 70-200mm f/4L IS + 1.4x";
choices[244] = "Canon EF 70-200mm f/4L IS + 2x";
choices[245] = "Canon EF 70-200mm f/4L IS + 2.8x";
choices[246] = "Canon EF 16-35mm f/2.8L II";
choices[247] = "Canon EF 14mm f/2.8L II USM";
choices[248] = "Canon EF 200mm f/2L IS";
choices[249] = "Canon EF 800mm f/5.6L IS";
choices[250] = "Canon EF 24 f/1.4L II";
choices[254] = "Canon EF 100mm f/2.8L Macro IS USM";
choices[488] = "Canon EF-S 15-85mm f/3.5-5.6 IS USM";
}
virtual std::string toString (Tag* t) {
std::ostringstream str;
str << "MacroMode = " << machoices[t->toInt(2,SHORT)] << std::endl;
str << "Self-timer = " << t->toInt(4,SHORT) << std::endl;
str << "Quality = " << qlchoices[t->toInt(6,SHORT)] << std::endl;
str << "CanonFlashMode = " << fmchoices[t->toInt(8,SHORT)] << std::endl;
str << "ContinuousDrive = " << cdchoices[t->toInt(10,SHORT)] << std::endl;
str << "FocusMode = " << fochoices[t->toInt(14,SHORT)] << std::endl;
str << "RecordMode = " << rmchoices[t->toInt(18,SHORT)] << std::endl;
str << "CanonImageSize = " << ischoices[t->toInt(20,SHORT)] << std::endl;
str << "EasyMode = " << emchoices[t->toInt(22,SHORT)] << std::endl;
str << "DigitalZoom = " << dzchoices[t->toInt(24,SHORT)] << std::endl;
str << "Contrast = " << t->toInt(26,SHORT) << std::endl;
str << "Saturation = " << t->toInt(28,SHORT) << std::endl;
str << "Sharpness = " << t->toInt(30,SHORT) << std::endl;
str << "CameraISO = " << t->toInt(32,SHORT) << std::endl;
str << "MeteringMode = " << mmchoices[t->toInt(34,SHORT)] << std::endl;
str << "FocusRange = " << frchoices[t->toInt(36,SHORT)] << std::endl;
str << "AFPoint = " << afchoices[t->toInt(38,SHORT)] << std::endl;
str << "CanonExposureMode = " << exchoices[t->toInt(40,SHORT)] << std::endl;
str << "LensType = " << choices[t->toInt(44,SHORT)] << " (" << t->toInt(44,SHORT) << ")" << std::endl;
str << "LongFocal = " << (double)t->toInt(46,SHORT)/t->toInt(50,SHORT) << " mm" << std::endl;
str << "ShortFocal = " << (double)t->toInt(48,SHORT)/t->toInt(50,SHORT) << " mm" << std::endl;
str << "FocalUnits = " << t->toInt(50,SHORT) << std::endl;
str << "MaxAperture = " << pow (2, t->toInt(52,SHORT)/64.0) << std::endl;
str << "MinAperture = " << pow (2, t->toInt(54,SHORT)/64.0) << std::endl;
str << "FlashActivity = " << t->toInt(56,SHORT) << std::endl;
str << "FlashBits = ";
int f = t->toInt(58,SHORT);
if (f&1)
str << "Manual ";
if (f&2)
str << "TTL ";
if (f&4)
str << "A-TTL ";
if (f&8)
str << "E-TTL ";
if (f&16)
str << "FP sync enabled ";
if (f&(1<<7))
str << "2nd-curtain sync used ";
if (f&(1<<11))
str << "FP sync used ";
if (f&(1<<13))
str << "Built-in ";
if (f&(1<<14))
str << "External ";
str << std::endl;
str << "FocusContinuous = " << fcchoices[t->toInt(64,SHORT)] << std::endl;
str << "AESetting = " << aechoices[t->toInt(66,SHORT)] << std::endl;
str << "ImageStabilization = " << stchoices[t->toInt(68,SHORT)] << " (" << t->toInt(68,SHORT) << ")" << std::endl;
str << "DisplayAperture = " << t->toInt(70,SHORT) << std::endl;
str << "ZoomSourceWidth = " << t->toInt(72,SHORT) << std::endl;
str << "ZoomTargetWidth = " << t->toInt(74,SHORT) << std::endl;
str << "SpotMeteringMode = " << smchoices[t->toInt(78,SHORT)] << std::endl;
str << "PhotoEffect = " << pechoices[t->toInt(80,SHORT)] << std::endl;
str << "ManualFlashOutput = " << mfchoices[t->toInt(82,SHORT)] << std::endl;
str << "ColorTone = " << t->toInt(84,SHORT);
return str.str();
}
};
CACameraSettingsInterpreter caCameraSettingsInterpreter;
class CAProcessingInfoInterpreter : public Interpreter {
std::map<int,std::string> tcchoices;
std::map<int,std::string> sfchoices;
std::map<int,std::string> wbchoices;
std::map<int,std::string> pschoices;
public:
CAProcessingInfoInterpreter () {
tcchoices[0] = "Standard";
tcchoices[1] = "Manual";
tcchoices[2] = "Custom";
sfchoices[0] = "N/A";
sfchoices[1] = "Lowest";
sfchoices[2] = "Low";
sfchoices[3] = "Standard";
sfchoices[4] = "High";
sfchoices[5] = "Highest";
wbchoices[0] = "Auto";
wbchoices[1] = "Daylight";
wbchoices[2] = "Cloudy";
wbchoices[3] = "Tungsten";
wbchoices[4] = "Fluorescent";
wbchoices[5] = "Flash";
wbchoices[6] = "Custom";
wbchoices[7] = "Black & White";
wbchoices[8] = "Shade";
wbchoices[9] = "Manual Temperature (Kelvin)";
wbchoices[10] = "PC Set1";
wbchoices[11] = "PC Set2";
wbchoices[12] = "PC Set3";
wbchoices[14] = "Daylight Fluorescent";
wbchoices[15] = "Custom 1";
wbchoices[16] = "Custom 2";
wbchoices[17] = "Underwater";
pschoices[0] = "None";
pschoices[1] = "Standard ";
pschoices[2] = "Set 1";
pschoices[3] = "Set 2";
pschoices[4] = "Set 3";
pschoices[0x21] = "User Def. 1";
pschoices[0x22] = "User Def. 2";
pschoices[0x23] = "User Def. 3";
pschoices[0x41] = "External 1";
pschoices[0x42] = "External 2";
pschoices[0x43] = "External 3";
pschoices[0x81] = "Standard";
pschoices[0x82] = "Portrait";
pschoices[0x83] = "Landscape";
pschoices[0x84] = "Neutral";
pschoices[0x85] = "Faithful";
pschoices[0x86] = "Monochrome";
}
virtual std::string toString (Tag* t) {
std::ostringstream str;
str << "ToneCurve = " << tcchoices[t->toInt(2,SHORT)] << std::endl;
str << "Sharpness = " << t->toInt(4,SHORT) << std::endl;
str << "SharpnessFrequency = " << sfchoices[t->toInt(6,SHORT)] << std::endl;
str << "SensorRedLevel = " << t->toInt(8,SHORT) << std::endl;
str << "SensorBlueLevel = " << t->toInt(10,SHORT) << std::endl;
str << "WhiteBalanceRed = " << t->toInt(12,SHORT) << std::endl;
str << "WhiteBalanceBlue = " << t->toInt(14,SHORT) << std::endl;
str << "WhiteBalance = " << wbchoices[t->toInt(16,SHORT)] << std::endl;
str << "ColorTemperature = " << t->toInt(18,SHORT) << std::endl;
str << "PictureStyle = " << pschoices[t->toInt(20,SHORT)] << std::endl;
str << "DigitalGain = " << t->toInt(22,SHORT) << std::endl;
str << "WBShiftAB = " << t->toInt(24,SHORT) << std::endl;
str << "WBShiftGM = " << t->toInt(26,SHORT);
return str.str();
}
};
CAProcessingInfoInterpreter caProcessingInfoInterpreter;
class CAShotInfoInterpreter : public Interpreter {
std::map<short,std::string> sschoices;
std::map<short,std::string> afchoices;
std::map<short,std::string> aechoices;
std::map<short,std::string> wbchoices;
std::map<short,std::string> ctchoices;
std::map<short,std::string> cmchoices;
std::map<short,std::string> archoices;
std::map<short,std::string> ndchoices;
public:
CAShotInfoInterpreter () {
sschoices[0] = "Off";
sschoices[1] = "Night Scene";
sschoices[2] = "On";
sschoices[3] = "None";
afchoices[0x3000] = "None (MF)";
afchoices[0x3001] = "Right";
afchoices[0x3002] = "Center";
afchoices[0x3003] = "Center+Right";
afchoices[0x3004] = "Left";
afchoices[0x3005] = "Left+Right";
afchoices[0x3006] = "Left+Center";
afchoices[0x3007] = "All";
wbchoices[0] = "Auto";
wbchoices[1] = "Daylight";
wbchoices[2] = "Cloudy";
wbchoices[3] = "Tungsten";
wbchoices[4] = "Fluorescent";
wbchoices[5] = "Flash";
wbchoices[6] = "Custom";
wbchoices[7] = "Black & White";
wbchoices[8] = "Shade";
wbchoices[9] = "Manual Temperature (Kelvin)";
wbchoices[10] = "PC Set1";
wbchoices[11] = "PC Set2";
wbchoices[12] = "PC Set3";
wbchoices[14] = "Daylight Fluorescent";
wbchoices[15] = "Custom 1";
wbchoices[16] = "Custom 2";
wbchoices[17] = "Underwater";
aechoices[-1] = "On ";
aechoices[0] = "Off ";
aechoices[1] = "On (shot 1)";
aechoices[2] = "On (shot 2)";
aechoices[3] = "On (shot 3)";
cmchoices[0] = "n/a";
cmchoices[1] = "Camera Local Control";
cmchoices[3] = "Computer Remote Control";
ctchoices[248] = "EOS High-end";
ctchoices[250] = "Compact";
ctchoices[252] = "EOS Mid-end";
ctchoices[255] = "DV Camera";
ctchoices[0x23] = "User Def. 3";
archoices[-1] = "Rotated by Software";
archoices[0] = "None";
archoices[1] = "Rotate 90 CW";
archoices[2] = "Rotate 180";
archoices[3] = "Rotate 270 CW";
ndchoices[0] = "Off";
ndchoices[1] = "On";
}
virtual std::string toString (Tag* t) {
std::ostringstream str;
str << "AutoISO = " << t->toInt(2,SHORT) << std::endl;
str << "BaseISO = " << pow (2, t->toInt(4,SHORT)/32.0 - 4) * 50 << std::endl;
str << "MeasuredEV = " << t->toInt(6,SHORT) << std::endl;
str << "TargetAperture = " << pow (2, t->toInt(8,SHORT)/64.0) << std::endl;
str << "TargetExposureTime = " << pow (2, -t->toInt(10,SHORT)/32.0) << std::endl;
str << "ExposureCompensation = " << t->toInt(12,SHORT)/32.0 << std::endl;
str << "WhiteBalance = " << wbchoices[t->toInt(14,SHORT)] << std::endl;
str << "SlowShutter = " << sschoices[t->toInt(16,SHORT)] << std::endl;
str << "SequenceNumber = " << t->toInt(18,SHORT) << std::endl;
str << "OpticalZoomCode = " << t->toInt(20,SHORT) << std::endl;
str << "FlashGuideNumber = " << t->toInt(26,SHORT) << std::endl;
str << "AFPointsInFocus = " << afchoices[t->toInt(28,SHORT)] << std::endl;
str << "FlashExposureComp = " << t->toInt(30,SHORT) << std::endl;
str << "AutoExposureBracketing = " << afchoices[t->toInt(32,SHORT)] << std::endl;
str << "AEBBracketValue = " << t->toInt(34,SHORT) << std::endl;
str << "ControlMode = " << cmchoices[t->toInt(36,SHORT)] << std::endl;
str << "FocusDistanceUpper = " << t->toInt(38,SHORT) << std::endl;
str << "FocusDistanceLower = " << t->toInt(40,SHORT) << std::endl;
str << "FNumber = " << pow (2, t->toInt(42,SHORT)/64.0) << std::endl;
str << "ExposureTime = " << pow (2, -t->toInt(44,SHORT)/32.0) << std::endl;
str << "BulbDuration = " << t->toInt(48,SHORT) << std::endl;
str << "CameraType = " << ctchoices[t->toInt(52,SHORT)] << std::endl;
str << "AutoRotate = " << archoices[t->toInt(54,SHORT)] << std::endl;
str << "NDFilter = " << ndchoices[t->toInt(56,SHORT)] << std::endl;
str << "Self-timer2 = " << t->toInt(58,SHORT) << std::endl;
str << "FlashOutput = " << t->toInt(66,SHORT);
return str.str();
}
};
CAShotInfoInterpreter caShotInfoInterpreter;
class CAFileInfoInterpreter : public Interpreter {
std::map<int,std::string> bmchoices;
std::map<int,std::string> rjqchoices;
std::map<int,std::string> rjschoices;
std::map<int,std::string> nrchoices;
std::map<int,std::string> wbchoices;
std::map<int,std::string> fechoices;
std::map<int,std::string> techoices;
public:
CAFileInfoInterpreter () {
bmchoices[0] = "Off";
bmchoices[1] = "AEB";
bmchoices[2] = "FEB";
bmchoices[3] = "ISO";
bmchoices[4] = "WB";
rjqchoices[1] = "Economy";
rjqchoices[2] = "Normal";
rjqchoices[3] = "Fine";
rjqchoices[4] = "RAW";
rjqchoices[5] = "Superfine";
rjschoices[0] = "Large";
rjschoices[1] = "Medium";
rjschoices[2] = "Small";
rjschoices[5] = "Medium 1";
rjschoices[6] = "Medium 2";
rjschoices[7] = "Medium 3";
rjschoices[8] = "Postcard";
rjschoices[9] = "Widescreen";
nrchoices[0] = "Off";
nrchoices[1] = "On (mode 1)";
nrchoices[2] = "On (mode 2)";
nrchoices[3] = "On (mode 3)";
nrchoices[4] = "On (mode 4)";
wbchoices[0] = "Off";
wbchoices[1] = "On (shift AB)";
wbchoices[2] = "On (shift GM)";
fechoices[0] = "None";
fechoices[1] = "Yellow";
fechoices[2] = "Orange";
fechoices[3] = "Red";
fechoices[4] = "Green";
techoices[0] = "None";
techoices[1] = "Sepia";
techoices[2] = "Blue";
techoices[3] = "Purple";
techoices[4] = "Green";
}
virtual std::string toString (Tag* t) {
std::ostringstream str;
str << "FileNumber = " << t->toInt(1,SHORT) << std::endl;
str << "ShutterCount = " << t->toInt(0,LONG) << std::endl;
str << "BracketMode = " << bmchoices[t->toInt(6,SHORT)] << std::endl;
str << "BracketValue = " << t->toInt(8,SHORT) << std::endl;
str << "BracketShotNumber = " << t->toInt(10,SHORT) << std::endl;
str << "RawJpgQuality = " << rjqchoices[t->toInt(12,SHORT)] << std::endl;
str << "RawJpgSize = " << rjschoices[t->toInt(14,SHORT)] << std::endl;
str << "NoiseReduction = " << nrchoices[t->toInt(16,SHORT)] << std::endl;
str << "WBBracketMode = " << t->toInt(18,SHORT) << std::endl;
str << "WBBracketValueAB = " << t->toInt(24,SHORT) << std::endl;
str << "FilterEffect = " << fechoices[t->toInt(26,SHORT)] << std::endl;
str << "ToningEffect = " << techoices[t->toInt(30,SHORT)];
return str.str();
}
};
CAFileInfoInterpreter caFileInfoInterpreter;
class CAModelIDInterpreter : public ChoiceInterpreter {
public:
CAModelIDInterpreter () {
choices[0x1010000] = "PowerShot A30";
choices[0x1040000] = "PowerShot S300 / Digital IXUS 300 / IXY Digital 300";
choices[0x1060000] = "PowerShot A20";
choices[0x1080000] = "PowerShot A10";
choices[0x1090000] = "PowerShot S110 / Digital IXUS v / IXY Digital 200";
choices[0x1100000] = "PowerShot G2";
choices[0x1110000] = "PowerShot S40";
choices[0x1120000] = "PowerShot S30";
choices[0x1130000] = "PowerShot A40";
choices[0x1140000] = "EOS D30";
choices[0x1150000] = "PowerShot A100";
choices[0x1160000] = "PowerShot S200 / Digital IXUS v2 / IXY Digital 200a";
choices[0x1170000] = "PowerShot A200";
choices[0x1180000] = "PowerShot S330 / Digital IXUS 330 / IXY Digital 300a";
choices[0x1190000] = "PowerShot G3";
choices[0x1210000] = "PowerShot S45";
choices[0x1230000] = "PowerShot SD100 / Digital IXUS II / IXY Digital 30";
choices[0x1240000] = "PowerShot S230 / Digital IXUS v3 / IXY Digital 320";
choices[0x1250000] = "PowerShot A70";
choices[0x1260000] = "PowerShot A60";
choices[0x1270000] = "PowerShot S400 / Digital IXUS 400 / IXY Digital 400";
choices[0x1290000] = "PowerShot G5";
choices[0x1300000] = "PowerShot A300";
choices[0x1310000] = "PowerShot S50";
choices[0x1340000] = "PowerShot A80";
choices[0x1350000] = "PowerShot SD10 / Digital IXUS i / IXY Digital L";
choices[0x1360000] = "PowerShot S1 IS";
choices[0x1370000] = "PowerShot Pro1";
choices[0x1380000] = "PowerShot S70";
choices[0x1390000] = "PowerShot S60";
choices[0x1400000] = "PowerShot G6";
choices[0x1410000] = "PowerShot S500 / Digital IXUS 500 / IXY Digital 500";
choices[0x1420000] = "PowerShot A75";
choices[0x1440000] = "PowerShot SD110 / Digital IXUS IIs / IXY Digital 30a";
choices[0x1450000] = "PowerShot A400";
choices[0x1470000] = "PowerShot A310";
choices[0x1490000] = "PowerShot A85";
choices[0x1520000] = "PowerShot S410 / Digital IXUS 430 / IXY Digital 450";
choices[0x1530000] = "PowerShot A95";
choices[0x1540000] = "PowerShot SD300 / Digital IXUS 40 / IXY Digital 50";
choices[0x1550000] = "PowerShot SD200 / Digital IXUS 30 / IXY Digital 40";
choices[0x1560000] = "PowerShot A520";
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[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[0x1740000] = "PowerShot A430";
choices[0x1750000] = "PowerShot A410";
choices[0x1760000] = "PowerShot S80";
choices[0x1780000] = "PowerShot A620";
choices[0x1790000] = "PowerShot A610";
choices[0x1800000] = "PowerShot SD630 / Digital IXUS 65 / IXY Digital 80";
choices[0x1810000] = "PowerShot SD450 / Digital IXUS 55 / IXY Digital 60";
choices[0x1820000] = "PowerShot TX1";
choices[0x1870000] = "PowerShot SD400 / Digital IXUS 50 / IXY Digital 55";
choices[0x1880000] = "PowerShot A420";
choices[0x1890000] = "PowerShot SD900 / Digital IXUS 900 Ti / IXY Digital 1000";
choices[0x1900000] = "PowerShot SD550 / Digital IXUS 750 / IXY Digital 700";
choices[0x1920000] = "PowerShot A700";
choices[0x1940000] = "PowerShot SD700 IS / Digital IXUS 800 IS / IXY Digital 800 IS";
choices[0x1950000] = "PowerShot S3 IS";
choices[0x1960000] = "PowerShot A540";
choices[0x1970000] = "PowerShot SD600 / Digital IXUS 60 / IXY Digital 70";
choices[0x1980000] = "PowerShot G7";
choices[0x1990000] = "PowerShot A530";
choices[0x2000000] = "PowerShot SD800 IS / Digital IXUS 850 IS / IXY Digital 900 IS";
choices[0x2010000] = "PowerShot SD40 / Digital IXUS i7 / IXY Digital L4";
choices[0x2020000] = "PowerShot A710 IS";
choices[0x2030000] = "PowerShot A640";
choices[0x2040000] = "PowerShot A630";
choices[0x2090000] = "PowerShot S5 IS";
choices[0x2100000] = "PowerShot A460";
choices[0x2120000] = "PowerShot SD850 IS / Digital IXUS 950 IS / IXY Digital 810 IS";
choices[0x2130000] = "PowerShot A570 IS";
choices[0x2140000] = "PowerShot A560";
choices[0x2150000] = "PowerShot SD750 / Digital IXUS 75 / IXY Digital 90";
choices[0x2160000] = "PowerShot SD1000 / Digital IXUS 70 / IXY Digital 10";
choices[0x2180000] = "PowerShot A550";
choices[0x2190000] = "PowerShot A450";
choices[0x2230000] = "PowerShot G9";
choices[0x2240000] = "PowerShot A650 IS";
choices[0x2260000] = "PowerShot A720 IS";
choices[0x2290000] = "PowerShot SX100 IS";
choices[0x2300000] = "PowerShot SD950 IS / Digital IXUS 960 IS / IXY Digital 2000 IS";
choices[0x2310000] = "PowerShot SD870 IS / Digital IXUS 860 IS / IXY Digital 910 IS";
choices[0x3010000] = "PowerShot Pro90 IS";
choices[0x4040000] = "PowerShot G1";
choices[0x6040000] = "PowerShot S100 / Digital IXUS / IXY Digital";
choices[0x4007d675] = "HV10";
choices[0x4007d777] = "iVIS DC50";
choices[0x4007d778] = "iVIS HV20";
choices[0x80000001] = "EOS-1D";
choices[0x80000167] = "EOS-1DS";
choices[0x80000168] = "EOS 10D";
choices[0x80000169] = "EOS-1D Mark III";
choices[0x80000170] = "EOS Digital Rebel / 300D / Kiss Digital";
choices[0x80000174] = "EOS-1D Mark II";
choices[0x80000175] = "EOS 20D";
choices[0x80000188] = "EOS-1Ds Mark II";
choices[0x80000189] = "EOS Digital Rebel XT / 350D / Kiss Digital N";
choices[0x80000190] = "EOS 40D";
choices[0x80000213] = "EOS 5D";
choices[0x80000215] = "EOS-1Ds Mark III";
choices[0x80000232] = "EOS-1D Mark II N";
choices[0x80000234] = "EOS 30D";
choices[0x80000236] = "EOS Digital Rebel XTi / 400D / Kiss Digital X";
choices[0x80000254] = "EOS Rebel XS / 1000D / Kiss F";
choices[0x80000261] = "EOS 50D";
}
};
CAModelIDInterpreter caModelIDInterpreter;
const TagAttrib canonAttribs[] = {
0, 1, 0, 0, 0x0001, "CanonCameraSettings", &caCameraSettingsInterpreter,
0, 1, 0, 0, 0x0002, "CanonFocalLength", &caFocalLengthInterpreter,
0, 1, 0, 0, 0x0003, "CanonFlashInfo", &stdInterpreter,
0, 1, 0, 0, 0x0004, "CanonShotInfo", &caShotInfoInterpreter,
0, 1, 0, 0, 0x0005, "CanonPanorama", &stdInterpreter,
0, 1, 0, 0, 0x0006, "CanonImageType", &stdInterpreter,
0, 1, 0, 0, 0x0007, "CanonFirmwareVersion", &stdInterpreter,
0, 1, 0, 0, 0x0008, "FileNumber", &stdInterpreter,
0, 1, 0, 0, 0x0009, "OwnerName", &stdInterpreter,
0, 1, 0, 0, 0x000a, "ColorInfoD30", &stdInterpreter,
0, 1, 0, 0, 0x000c, "SerialNumber", &stdInterpreter,
0, 1, 0, 0, 0x000d, "CanonCameraInfo", &stdInterpreter,
0, 1, 0, 0, 0x000e, "CanonFileLength", &stdInterpreter,
0, 1, 0, 0, 0x000f, "CustomFunctions", &stdInterpreter,
0, 1, 0, 0, 0x0010, "CanonModelID", &caModelIDInterpreter,
0, 1, 0, 0, 0x0012, "CanonAFInfo", &stdInterpreter,
0, 1, 0, 0, 0x0015, "SerialNumberFormat", &stdInterpreter,
0, 1, 0, 0, 0x001c, "DateStampMode", &stdInterpreter,
0, 1, 0, 0, 0x001d, "MyColors", &stdInterpreter,
0, 1, 0, 0, 0x001e, "FirmwareRevision", &stdInterpreter,
0, 3, 0, 0, 0x0024, "FaceDetect1", &stdInterpreter,
0, 3, 0, 0, 0x0025, "FaceDetect2", &stdInterpreter,
0, 1, 0, 0, 0x0026, "CanonAFInfo2", &stdInterpreter,
0, 1, 0, 0, 0x0083, "OriginalDecisionData", &stdInterpreter,
0, 1, 0, 0, 0x0090, "CustomFunctions1D", &stdInterpreter,
0, 1, 0, 0, 0x0091, "PersonalFunctions", &stdInterpreter,
0, 1, 0, 0, 0x0092, "PersonalFunctionValues", &stdInterpreter,
0, 1, 0, 0, 0x0093, "CanonFileInfo", &caFileInfoInterpreter,
0, 1, 0, 0, 0x0094, "AFPointsInFocus1D", &stdInterpreter,
0, 1, 0, 0, 0x0095, "LensType", &stdInterpreter,
0, 1, 0, 0, 0x0096, "InternalSerialNumber", &caIntSerNumInterpreter,
0, 1, 0, 0, 0x0097, "DustRemovalData", &stdInterpreter,
0, 1, 0, 0, 0x0099, "CustomFunctions2", &stdInterpreter,
0, 1, 0, 0, 0x00a0, "ProccessingInfo", &caProcessingInfoInterpreter,
0, 1, 0, 0, 0x00a1, "ToneCurveTable", &stdInterpreter,
0, 1, 0, 0, 0x00a2, "SharpnessTable", &stdInterpreter,
0, 1, 0, 0, 0x00a3, "SharpnessFreqTable", &stdInterpreter,
0, 1, 0, 0, 0x00a4, "WhiteBalanceTable", &stdInterpreter,
0, 1, 0, 0, 0x00a9, "ColorBalance", &stdInterpreter,
0, 1, 0, 0, 0x00ae, "ColorTemperature", &stdInterpreter,
0, 3, 0, 0, 0x00b0, "CanonFlags", &stdInterpreter,
0, 1, 0, 0, 0x00b1, "ModifiedInfo", &stdInterpreter,
0, 1, 0, 0, 0x00b2, "ToneCurveMatching", &stdInterpreter,
0, 1, 0, 0, 0x00b3, "WhiteBalanceMatching", &stdInterpreter,
0, 1, 0, 0, 0x00b4, "ColorSpace", &stdInterpreter,
1, 1, 0, 0, 0x00b6, "PreviewImageInfo", &stdInterpreter,
0, 1, 0, 0, 0x00d0, "VRDOffset", &stdInterpreter,
0, 1, 0, 0, 0x00e0, "SensorInfo", &stdInterpreter,
0, 1, 0, 0, 0x4001, "ColorBalance", &stdInterpreter,
0, 1, 0, 0, 0x4002, "UnknownBlock1", &stdInterpreter,
0, 1, 0, 0, 0x4003, "ColorInfo", &stdInterpreter,
1, 1, 0, 0, 0x4005, "UnknownBlock2", &stdInterpreter,
1, 1, 0, 0, 0x4008, "BlackLevel", &stdInterpreter,
-1, 0, 0, 0, 0, "", NULL};
};
#endif

263
rtexif/fujiattribs.cc Normal file
View File

@@ -0,0 +1,263 @@
/*
* This file is part of RawTherapee.
*
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
*
* RawTherapee is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* RawTherapee is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _FUJIATTRIBS_
#define _FUJIATTRIBS_
#include <rtexif.h>
#include <string>
#include <map>
#include <math.h>
#include <sstream>
#include <iomanip>
namespace rtexif {
class FAOnOffInterpreter : public ChoiceInterpreter {
public:
FAOnOffInterpreter () {
choices[0] = "Off";
choices[1] = "On";
}
};
FAOnOffInterpreter faOnOffInterpreter;
class FASharpnessInterpreter : public ChoiceInterpreter {
public:
FASharpnessInterpreter () {
choices[1] = "Soft";
choices[2] = "Soft2";
choices[3] = "Normal";
choices[4] = "Hard";
choices[5] = "Hard2";
choices[0x82] = "Medium Soft";
choices[0x84] = "Medium Hard";
choices[0x8000] = "Film Simulation";
choices[0xffff] = "n/a";
}
};
FASharpnessInterpreter faSharpnessInterpreter;
class FAWhiteBalanceInterpreter : public ChoiceInterpreter {
public:
FAWhiteBalanceInterpreter () {
choices[0] = "Auto";
choices[0x100] = "Daylight";
choices[0x200] = "Cloudy";
choices[0x300] = "Daylight Fluorescent";
choices[0x301] = "Day White Fluorescent";
choices[0x302] = "White Fluorescent";
choices[0x303] = "Warm White Fluorescent";
choices[0x304] = "Living Room Warm White Fluorescent";
choices[0x400] = "Incandescent";
choices[0x500] = "Flash";
choices[0xf00] = "Custom";
choices[0xf01] = "Custom2";
choices[0xf02] = "Custom3";
choices[0xf03] = "Custom4";
choices[0xf04] = "Custom5";
choices[0xff0] = "Kelvin";
}
};
FAWhiteBalanceInterpreter faWhiteBalanceInterpreter;
class FASaturationInterpreter : public ChoiceInterpreter {
public:
FASaturationInterpreter () {
choices[0] = "Normal";
choices[0x80] = "Medium High";
choices[0x100] = "High";
choices[0x180] = "Medium Low";
choices[0x200] = "Low";
choices[0x300] = "None (B&W)";
choices[0x8000] = "Film Simulation";
}
};
FASaturationInterpreter faSaturationInterpreter;
class FAContrastInterpreter : public ChoiceInterpreter {
public:
FAContrastInterpreter () {
choices[0] = "Normal";
choices[0x80] = "Medium High";
choices[0x100] = "High";
choices[0x180] = "Medium Low";
choices[0x200] = "Low";
choices[0x8000] = "Film Simulation";
}
};
FAContrastInterpreter faContrastInterpreter;
class FAContrast2Interpreter : public ChoiceInterpreter {
public:
FAContrast2Interpreter () {
choices[0] = "Normal";
choices[0x100] = "High";
choices[0x300] = "Low";
}
};
FAContrast2Interpreter faContrast2Interpreter;
class FANoiseReductionInterpreter : public ChoiceInterpreter {
public:
FANoiseReductionInterpreter () {
choices[0x40] = "Low";
choices[0x80] = "Normal";
}
};
FANoiseReductionInterpreter faNoiseReductionInterpreter;
class FAFlashInterpreter : public ChoiceInterpreter {
public:
FAFlashInterpreter () {
choices[0] = "Auto";
choices[1] = "On";
choices[2] = "Off";
choices[3] = "Red-eye reduction";
choices[4] = "External";
}
};
FAFlashInterpreter faFlashInterpreter;
class FAFocusModeInterpreter : public ChoiceInterpreter {
public:
FAFocusModeInterpreter () {
choices[0] = "Auto";
choices[1] = "Manual";
}
};
FAFocusModeInterpreter faFocusModeInterpreter;
class FAColorModeInterpreter : public ChoiceInterpreter {
public:
FAColorModeInterpreter () {
choices[0] = "Standard";
choices[0x10] = "Chrome";
choices[0x30] = "B & W";
}
};
FAColorModeInterpreter faColorModeInterpreter;
class FADynamicRangeInterpreter : public ChoiceInterpreter {
public:
FADynamicRangeInterpreter () {
choices[1] = "Standard";
choices[3] = "Wide";
}
};
FADynamicRangeInterpreter faDynamicRangeInterpreter;
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";
}
};
FAFilmModeInterpreter faFilmModeInterpreter;
class FADRSettingInterpreter : public ChoiceInterpreter {
public:
FADRSettingInterpreter () {
choices[0] = "Auto (100-400%)";
choices[0x1] = "RAW";
choices[0x100] = "Standard (100%)";
choices[0x200] = "Wide1 (230%)";
choices[0x201] = "Wide2 (400%)";
choices[0x8000] = "Film Simulation";
}
};
FADRSettingInterpreter faDRSettingInterpreter;
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[0x100] = "Aperture-priority AE";
choices[0x200] = "Shutter speed priority AE";
choices[0x300] = "Manual";
}
};
FAPictureModeInterpreter faPictureModeInterpreter;
const TagAttrib fujiAttribs[] = {
0, 1, 0, 0, 0x0000, "Version", &stdInterpreter,
0, 1, 0, 0, 0x0010, "InternalSerialNumber", &stdInterpreter,
0, 1, 0, 0, 0x1000, "Quality", &stdInterpreter,
0, 1, 0, 0, 0x1001, "Sharpness", &faSharpnessInterpreter,
0, 1, 0, 0, 0x1002, "WhiteBalance", &faWhiteBalanceInterpreter,
0, 1, 0, 0, 0x1003, "Saturation", &faSaturationInterpreter,
0, 1, 0, 0, 0x1004, "Contrast", &faContrastInterpreter,
0, 1, 0, 0, 0x1005, "ColorTemperature", &stdInterpreter,
0, 1, 0, 0, 0x1006, "Contrast2", &faContrast2Interpreter,
0, 1, 0, 0, 0x100a, "WhiteBalanceFineTune", &stdInterpreter,
0, 1, 0, 0, 0x100b, "NoiseReduction", &faNoiseReductionInterpreter,
0, 1, 0, 0, 0x100b, "FujiFlashMode", &faFlashInterpreter,
0, 1, 0, 0, 0x1011, "FlashExposureComp", &stdInterpreter,
0, 1, 0, 0, 0x1020, "Macro", &faOnOffInterpreter,
0, 1, 0, 0, 0x1021, "FocusMode", &faFocusModeInterpreter,
0, 1, 0, 0, 0x1023, "FocusPixel", &stdInterpreter,
0, 1, 0, 0, 0x1030, "SlowSync", &faOnOffInterpreter,
0, 1, 0, 0, 0x1031, "PictureMode", &faPictureModeInterpreter,
0, 1, 0, 0, 0x1100, "AutoBracketing", &faOnOffInterpreter,
0, 1, 0, 0, 0x1101, "SequenceNumber", &stdInterpreter,
0, 1, 0, 0, 0x1210, "ColorMode", &faColorModeInterpreter,
0, 1, 0, 0, 0x1300, "BlurWarning", &faOnOffInterpreter,
0, 1, 0, 0, 0x1301, "FocusWarning", &faOnOffInterpreter,
0, 1, 0, 0, 0x1302, "ExposureWarning", &faOnOffInterpreter,
0, 1, 0, 0, 0x1400, "DynamicRange", &faDynamicRangeInterpreter,
0, 1, 0, 0, 0x1401, "FilmMode", &faFilmModeInterpreter,
0, 1, 0, 0, 0x1402, "DynamicRangeSetting", &faDRSettingInterpreter,
0, 1, 0, 0, 0x1403, "DevelopmentDynamicRange", &stdInterpreter,
0, 1, 0, 0, 0x1404, "MinFocalLength", &stdInterpreter,
0, 1, 0, 0, 0x1405, "MaxFocalLength", &stdInterpreter,
0, 1, 0, 0, 0x1406, "MaxApertureAtMinFocal", &stdInterpreter,
0, 1, 0, 0, 0x1407, "MaxApertureAtMaxFocal", &stdInterpreter,
0, 1, 0, 0, 0x8000, "FileSource", &stdInterpreter,
0, 1, 0, 0, 0x8002, "OrderNumber", &stdInterpreter,
0, 1, 0, 0, 0x8003, "FrameNumber", &stdInterpreter,
-1, 0, 0, 0, 0, "", NULL};
};
#endif

718
rtexif/nikonattribs.cc Normal file
View File

@@ -0,0 +1,718 @@
/*
* This file is part of RawTherapee.
*
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
*
* RawTherapee is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* RawTherapee is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _NIKONATTRIBS_
#define _NIKONATTRIBS_
#include <rtexif.h>
#include <string>
#include <map>
#include <math.h>
#include <sstream>
#include <iomanip>
#include <string.h>
namespace rtexif {
class NAISOInterpreter : public Interpreter {
public:
NAISOInterpreter () {}
virtual std::string toString (Tag* t) {
sprintf (buffer, "%d", t->toInt(2));
return buffer;
}
};
NAISOInterpreter naISOInterpreter;
class NALensTypeInterpreter : public Interpreter {
public:
NALensTypeInterpreter () {}
virtual std::string toString (Tag* t) {
int a = t->toInt();
std::ostringstream str;
str << "MF = " << (a&1 ? "Yes" : "No") << std::endl;
str << "D = " << (a&2 ? "Yes" : "No") << std::endl;
str << "G = " << (a&4 ? "Yes" : "No") << std::endl;
str << "VR = " << (a&8 ? "Yes" : "No");
return str.str();
}
};
NALensTypeInterpreter naLensTypeInterpreter;
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";
}
};
NAFlashModeInterpreter naFlashModeInterpreter;
class NAHiISONRInterpreter : public ChoiceInterpreter {
public:
NAHiISONRInterpreter () {
choices[0] = "Off";
choices[1] = "Minimal";
choices[2] = "Low";
choices[4] = "Normal";
choices[6] = "High";
}
};
NAHiISONRInterpreter naHiISONRInterpreter;
class NAShootingModeInterpreter : public Interpreter {
public:
NAShootingModeInterpreter () {}
virtual std::string toString (Tag* t) {
int a = t->toInt();
std::ostringstream str;
str << "Continuous = " << (a&1 ? "Yes" : "No") << std::endl;
str << "Delay = " << (a&2 ? "Yes" : "No") << std::endl;
str << "PC Control = " << (a&4 ? "Yes" : "No") << std::endl;
str << "Exposure Bracketing = " << (a&8 ? "Yes" : "No") << std::endl;
str << "Auto ISO = " << (a&16 ? "Yes" : "No") << std::endl;
str << "White-Balance Bracketing = " << (a&32 ? "Yes" : "No") << std::endl;
str << "IR Control = " << (a&64 ? "Yes" : "No");
return str.str();
}
};
NAShootingModeInterpreter naShootingModeInterpreter;
class NAAFInfoInterpreter : public Interpreter {
std::map<int,std::string> amchoices;
std::map<int,std::string> afpchoices;
public:
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";
}
virtual std::string toString (Tag* t) {
int am = t->toInt (0, BYTE);
int afp = t->toInt (1, BYTE);
int aff = t->toInt (2, SHORT);
std::ostringstream str;
str << "AFAreaMode = " << amchoices[am] << std::endl;
str << "AFAreaMode = " << afpchoices[afp] << std::endl;
std::ostringstream af;
if (aff&1)
if (af.str()=="") af << "Center";
else af << ", Center";
else if (aff&2)
if (af.str()=="") af << "Top";
else af << ", Top";
else if (aff&4)
if (af.str()=="") af << "Bottom";
else af << ", Bottom";
else if (aff&8)
if (af.str()=="") af << "Left";
else af << ", Left";
else if (aff&16)
if (af.str()=="") af << "Right";
else af << ", Right";
else if (aff&32)
if (af.str()=="") af << "Upper-left";
else af << ", Upper-left";
else if (aff&64)
if (af.str()=="") af << "Upper-right";
else af << ", Upper-right";
else if (aff&128)
if (af.str()=="") af << " Lower-left";
else af << ", Lower-left";
else if (aff&256)
if (af.str()=="") af << "Lower-right";
else af << ", Lower-right";
else if (aff&512)
if (af.str()=="") af << "Far Left";
else af << ", Far Left";
else if (aff&1024)
if (af.str()=="") af << "Far Right";
else af << ", Far Right";
str << "AFPointsInFocus = " << af.str();
return str.str();
}
};
NAAFInfoInterpreter naAFInfoInterpreter;
class NALensDataInterpreter : public Interpreter {
std::map<std::string,std::string> lenses;
public:
NALensDataInterpreter () {
lenses["00 00 00 00 00 00 00 01"] = "Manual Lens No CPU ";
lenses["00 00 00 00 00 00 E1 12"] = "TC-17E II ";
lenses["00 00 00 00 00 00 F1 0C"] = "TC-14E [II] or Sigma APO Tele Converter 1.4x EX DG or Kenko Teleplus PRO 300 DG 1.4x";
lenses["00 00 00 00 00 00 F2 18"] = "TC-20E [II] or Sigma APO Tele Converter 2x EX DG or Kenko Teleplus PRO 300 DG 2.0x";
lenses["00 36 1C 2D 34 3C 00 06"] = "Tamron SP AF11-18mm f/4.5-5.6 Di II LD Aspherical (IF)";
lenses["00 3C 1F 37 30 30 00 06"] = "Tokina AT-X 124 AF PRO DX - AF 12-24mm F4";
lenses["00 3E 80 A0 38 3F 00 02"] = "Tamron SP AF200-500mm f/5-6.3 Di LD (IF)";
lenses["00 3F 2D 80 2B 40 00 06"] = "Tamron AF18-200mm f/3.5-6.3 XR Di II LD Aspherical (IF)";
lenses["00 3F 2D 80 2C 40 00 06"] = "Tamron AF18-200mm f/3.5-6.3 XR Di II LD Aspherical (IF) Macro";
lenses["00 3F 80 A0 38 3F 00 02"] = "Tamron SP AF200-500mm f/5-6.3 Di";
lenses["00 40 18 2B 2C 34 00 06"] = "Tokina AT-X 107 DX Fish-Eye - AF 10-17mm F3.5-4.5";
lenses["00 40 2A 72 2C 3C 00 06"] = "Tokina AT-X 16.5-135 DX (AF 16.5-135mm F3.5-5.6)";
lenses["00 40 2B 2B 2C 2C 00 02"] = "Tokina AT-X 17 AF PRO - AF 17mm F3.5";
lenses["00 40 2D 80 2C 40 00 06"] = "Tamron AF 18-200mm f/3.5-6.3 XR Di II LD Aspherical (IF) Macro (A14NII)";
lenses["00 40 2D 88 2C 40 00 06"] = "Tamron AF 18-250mm f/3.5-6.3 Di II LD Aspherical (IF) Macro (A18NII)";
lenses["00 40 2D 88 2C 40 62 06"] = "Tamron AF 18-250mm f/3.5-6.3 Di II LD Aspherical (IF) Macro (A18)";
lenses["00 40 31 31 2C 2C 00 00"] = "Voigtlander Color Skopar 20mm F3.5 SLII Aspherical";
lenses["00 44 60 98 34 3C 00 02"] = "Tokina AT-X 840D 80-400mm F4.5-5.6";
lenses["00 47 10 10 24 24 00 00"] = "Fisheye Nikkor 8mm f/2.8 AiS";
lenses["00 47 44 44 24 24 00 06"] = "Tokina AT-X M35 PRO DX (AF 35mm f/2.8 Macro)";
lenses["00 47 53 80 30 3C 00 06"] = "Tamron AF55-200mm f/4-5.6 Di II LD";
lenses["00 48 1C 29 24 24 00 06"] = "Tokina AT-X 116 PRO DX (AF 11-16mm f/2.8)";
lenses["00 48 29 50 24 24 00 06"] = "Tokina AT-X 165 PRO DX - AF 16-50mm F2.8";
lenses["00 48 3C 60 24 24 00 02"] = "Tokina AT-X 280 AF PRO 28-80mm F2.8 Aspherical";
lenses["00 48 3C 6A 24 24 00 02"] = "Tamron SP AF28-105mm f/2.8";
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 F2.8";
lenses["00 48 5C 8E 30 3C 00 06"] = "Tamron AF 70-300mm f/4-5.6 Di LD Macro 1:2 (A17)";
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";
lenses["00 49 30 48 22 2B 00 02"] = "Tamron SP AF20-40mm f/2.7-3.5";
lenses["00 4C 6A 6A 20 20 00 00"] = "Nikkor 105mm f/2.5 AiS";
lenses["00 4C 7C 7C 2C 2C 00 02"] = "Tamron SP AF180mm f/3.5 Di Model B01";
lenses["00 53 2B 50 24 24 00 06"] = "Tamron SP AF17-50mm f/2.8 (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 44 44 0C 0C 00 00"] = "Nikkor 35mm f/1.4 AiS";
lenses["00 54 48 48 18 18 00 00"] = "Voigtlander Ultron 40mm F2 SLII Aspherical";
lenses["00 54 55 55 0C 0C 00 00"] = "Voigtlander Nokton 58mm F1.4 SLII";
lenses["00 54 56 56 30 30 00 00"] = "Coastal Optical Systems 60mm 1:4 UV-VIS-IR Macro Apo";
lenses["00 54 68 68 24 24 00 02"] = "Tokina AT-X M100 PRO D - 100mm F2.8";
lenses["00 54 8E 8E 24 24 00 02"] = "Tokina AT-X 300 AF PRO 300mm F2.8";
lenses["01 00 00 00 00 00 02 00"] = "AF Teleconverter TC-16A 1.6x";
lenses["01 00 00 00 00 00 08 00"] = "AF Teleconverter TC-16A 1.6x";
lenses["01 58 50 50 14 14 02 00"] = "AF Nikkor 50mm f/1.8";
lenses["02 2F 98 98 3D 3D 02 00"] = "Sigma 400mm F5.6 APO";
lenses["02 37 5E 8E 35 3D 02 00"] = "Sigma 75-300mm F4.5-5.6 APO";
lenses["02 37 A0 A0 34 34 02 00"] = "Sigma APO 500mm F4.5";
lenses["02 3A 5E 8E 32 3D 02 00"] = "Sigma 75-300mm F4.0-5.6";
lenses["02 3B 44 61 30 3D 02 00"] = "Sigma 35-80mm F4-5.6";
lenses["02 3F 24 24 2C 2C 02 00"] = "Sigma 14mm F3.5";
lenses["02 3F 3C 5C 2D 35 02 00"] = "Sigma 28-70mm F3.5-4.5 UC";
lenses["02 40 44 73 2B 36 02 00"] = "Sigma 35-135mm F3.5-4.5 a";
lenses["02 42 44 5C 2A 34 02 00"] = "AF Zoom-Nikkor 35-70mm f/3.3-4.5";
lenses["02 42 44 5C 2A 34 08 00"] = "AF Zoom-Nikkor 35-70mm f/3.3-4.5";
lenses["02 46 37 37 25 25 02 00"] = "Sigma 24mm F2.8 Macro";
lenses["02 46 3C 5C 25 25 02 00"] = "Sigma 28-70mm F2.8";
lenses["02 46 5C 82 25 25 02 00"] = "Sigma 70-210mm F2.8 APO";
lenses["02 48 65 65 24 24 02 00"] = "Sigma 90mm F2.8 Macro";
lenses["03 43 5C 81 35 35 02 00"] = "Soligor AF C/D ZOOM UMCS 70-210mm 1:4.5";
lenses["03 48 5C 81 30 30 02 00"] = "AF Zoom-Nikkor 70-210mm f/4";
lenses["04 48 3C 3C 24 24 03 00"] = "AF Nikkor 28mm f/2.8";
lenses["05 54 50 50 0C 0C 04 00"] = "AF Nikkor 50mm f/1.4";
lenses["06 3F 68 68 2C 2C 06 00"] = "Cosina 100mm f/3.5 Macro";
lenses["06 54 53 53 24 24 06 00"] = "AF Micro-Nikkor 55mm f/2.8";
lenses["07 36 3D 5F 2C 3C 03 00"] = "Cosina AF Zoom 28-80mm F3.5-5.6 MC Macro";
lenses["07 3E 30 43 2D 35 03 00"] = "Soligor AF Zoom 19-35mm 1:3.5-4.5 MC";
lenses["07 40 2F 44 2C 34 03 02"] = "Tamron AF19-35mm f/3.5-4.5 N";
lenses["07 40 30 45 2D 35 03 02"] = "Tamron AF19-35mm f/3.5-4.5";
lenses["07 40 3C 62 2C 34 03 00"] = "AF Zoom-Nikkor 28-85mm f/3.5-4.5";
lenses["07 46 2B 44 24 30 03 02"] = "Tamron SP AF17-35mm f/2.8-4 Di LD Aspherical (IF)";
lenses["07 46 3D 6A 25 2F 03 00"] = "Cosina AF Zoom 28-105mm F2.8-3.8 MC";
lenses["07 47 3C 5C 25 35 03 00"] = "Tokina AF 287 SD (AF 28-70mm f/2.8-4.5)";
lenses["07 48 3C 5C 24 24 03 00"] = "Tokina AT-X 287 AF (AF 28-70mm f/2.8)";
lenses["08 40 44 6A 2C 34 04 00"] = "AF Zoom-Nikkor 35-105mm f/3.5-4.5";
lenses["09 48 37 37 24 24 04 00"] = "AF Nikkor 24mm f/2.8";
lenses["0A 48 8E 8E 24 24 03 00"] = "AF Nikkor 300mm f/2.8 IF-ED";
lenses["0B 3E 3D 7F 2F 3D 0E 00"] = "Tamron AF28-200mm f/3.8-5.6";
lenses["0B 3E 3D 7F 2F 3D 0E 02"] = "Tamron AF28-200mm f/3.8-5.6D";
lenses["0B 48 7C 7C 24 24 05 00"] = "AF Nikkor 180mm f/2.8 IF-ED";
lenses["0D 40 44 72 2C 34 07 00"] = "AF Zoom-Nikkor 35-135mm f/3.5-4.5";
lenses["0E 48 5C 81 30 30 05 00"] = "AF Zoom-Nikkor 70-210mm f/4";
lenses["0E 4A 31 48 23 2D 0E 02"] = "Tamron SP AF20-40mm f/2.7-3.5";
lenses["0F 58 50 50 14 14 05 00"] = "AF Nikkor 50mm f/1.8 N";
lenses["10 3D 3C 60 2C 3C D2 02"] = "Tamron AF28-80mm f/3.5-5.6 Aspherical";
lenses["10 48 8E 8E 30 30 08 00"] = "AF Nikkor 300mm f/4 IF-ED";
lenses["11 48 44 5C 24 24 08 00"] = "AF Zoom-Nikkor 35-70mm f/2.8";
lenses["12 36 5C 81 35 3D 09 00"] = "Cosina AF Zoom 70-210mm F4.5-5.6 MC Macro";
lenses["12 39 5C 8E 34 3D 08 02"] = "Cosina AF Zoom 70-300mm F4.5-5.6 MC Macro";
lenses["12 3B 68 8D 3D 43 09 02"] = "Unknown 100-290mm f/5.6-6.7";
lenses["12 3D 3C 80 2E 3C DF 02"] = "Tamron AF 28-200mm f/3.8-5.6 AF Aspherical LD (IF) (271D)";
lenses["12 48 5C 81 30 3C 09 00"] = "AF Nikkor 70-210mm f/4-5.6";
lenses["12 4A 5C 81 31 3D 09 00"] = "Soligor AF C/D Auto Zoom+Macro 70-210mm 1:4-5.6 UMCS";
lenses["13 42 37 50 2A 34 0B 00"] = "AF Zoom-Nikkor 24-50mm f/3.3-4.5";
lenses["14 48 60 80 24 24 0B 00"] = "AF Zoom-Nikkor 80-200mm f/2.8 ED";
lenses["14 48 68 8E 30 30 0B 00"] = "Tokina AT-X 340 AF II 100-300mm F4";
lenses["14 54 60 80 24 24 0B 00"] = "Tokina AT-X 828 AF 80-200mm F2.8";
lenses["15 4C 62 62 14 14 0C 00"] = "AF Nikkor 85mm f/1.8";
lenses["17 3C A0 A0 30 30 0F 00"] = "Nikkor 500mm f/4 P ED IF";
lenses["17 3C A0 A0 30 30 11 00"] = "Nikkor 500mm f/4 P ED IF";
lenses["18 40 44 72 2C 34 0E 00"] = "AF Zoom-Nikkor 35-135mm f/3.5-4.5 N";
lenses["1A 54 44 44 18 18 11 00"] = "AF Nikkor 35mm f/2";
lenses["1B 44 5E 8E 34 3C 10 00"] = "AF Zoom-Nikkor 75-300mm f/4.5-5.6";
lenses["1C 48 30 30 24 24 12 00"] = "AF Nikkor 20mm f/2.8";
lenses["1D 42 44 5C 2A 34 12 00"] = "AF Zoom-Nikkor 35-70mm f/3.3-4.5 N";
lenses["1E 54 56 56 24 24 13 00"] = "AF Micro-Nikkor 60mm f/2.8";
lenses["1E 5D 64 64 20 20 13 00"] = "Unknown 90mm f/2.5";
lenses["1F 54 6A 6A 24 24 14 00"] = "AF Micro-Nikkor 105mm f/2.8";
lenses["20 3C 80 98 3D 3D 1E 02"] = "Tamron AF200-400mm f/5.6 LD IF";
lenses["20 48 60 80 24 24 15 00"] = "AF Zoom-Nikkor ED 80-200mm f/2.8";
lenses["21 40 3C 5C 2C 34 16 00"] = "AF Zoom-Nikkor 28-70mm f/3.5-4.5";
lenses["22 48 72 72 18 18 16 00"] = "AF DC-Nikkor 135mm f/2";
lenses["23 30 BE CA 3C 48 17 00"] = "Zoom-Nikkor 1200-1700mm f/5.6-8 P ED IF";
lenses["24 44 60 98 34 3C 1A 02"] = "Tokina AT-X 840 AF II 80-400mm F4.5-5.6";
lenses["24 48 60 80 24 24 1A 02"] = "AF Zoom-Nikkor ED 80-200mm f/2.8D";
lenses["25 48 3C 5C 24 24 1B 02"] = "Tokina AT-X 287 AF PRO SV 28-70mm F2.8";
lenses["25 48 44 5C 24 24 1B 02"] = "AF Zoom-Nikkor 35-70mm f/2.8D";
lenses["25 48 44 5C 24 24 52 02"] = "AF Zoom-Nikkor 35-70mm f/2.8D";
lenses["26 3C 54 80 30 3C 1C 06"] = "Sigma 55-200mm F4-5.6 DC";
lenses["26 3C 5C 82 30 3C 1C 02"] = "Sigma 70-210mm F4-5.6 UC-II";
lenses["26 3C 5C 8E 30 3C 1C 02"] = "Sigma 70-300mm F4-5.6 DG Macro";
lenses["26 3D 3C 80 2F 3D 1C 02"] = "Sigma 28-300mm F3.8-5.6 Aspherical";
lenses["26 3E 3C 6A 2E 3C 1C 02"] = "Sigma 28-105mm F3.8-5.6 UC-III Aspherical IF";
lenses["26 40 27 3F 2C 34 1C 02"] = "Sigma 15-30mm F3.5-4.5 EX Aspherical DG DF";
lenses["26 40 2D 44 2B 34 1C 02"] = "Sigma 18-35 F3.5-4.5 Aspherical";
lenses["26 40 2D 50 2C 3C 1C 06"] = "Sigma 18-50mm F3.5-5.6 DC";
lenses["26 40 2D 70 2B 3C 1C 06"] = "Sigma 18-125mm F3.5-5.6 DC";
lenses["26 40 2D 80 2C 40 1C 06"] = "Sigma 18-200mm F3.5-6.3 DC";
lenses["26 40 37 5C 2C 3C 1C 02"] = "Sigma 24-70mm F3.5-5.6 Aspherical HF";
lenses["26 40 3C 60 2C 3C 1C 02"] = "Sigma 28-80mm F3.5-5.6 Mini Zoom Macro II Aspherical";
lenses["26 40 3C 65 2C 3C 1C 02"] = "Sigma 28-90mm F3.5-5.6 Macro";
lenses["26 40 3C 80 2B 3C 1C 02"] = "Sigma 28-200mm F3.5-5.6 Compact Aspherical Hyperzoom Macro";
lenses["26 40 3C 80 2C 3C 1C 02"] = "Sigma 28-200mm F3.5-5.6 Compact Aspherical Hyperzoom Macro";
lenses["26 40 3C 8E 2C 40 1C 02"] = "Sigma 28-300mm F3.5-6.3 Macro";
lenses["26 40 7B A0 34 40 1C 02"] = "Sigma APO 170-500mm F5-6.3 Aspherical RF";
lenses["26 41 3C 8E 2C 40 1C 02"] = "Sigma 28-300mm F3.5-6.3 DG Macro";
lenses["26 44 73 98 34 3C 1C 02"] = "Sigma 135-400mm F4.5-5.6 APO Aspherical";
lenses["26 48 11 11 30 30 1C 02"] = "Sigma 8mm F4 EX Circular Fisheye";
lenses["26 48 27 27 24 24 1C 02"] = "Sigma 15mm F2.8 EX Diagonal Fish-Eye";
lenses["26 48 2D 50 24 24 1C 06"] = "Sigma 18-50mm F2.8 EX DC";
lenses["26 48 31 49 24 24 1C 02"] = "Sigma 20-40mm F2.8";
lenses["26 48 37 56 24 24 1C 02"] = "Sigma 24-60mm F2.8 EX DG";
lenses["26 48 3C 5C 24 24 1C 06"] = "Sigma 28-70mm F2.8 EX DG";
lenses["26 48 3C 5C 24 30 1C 02"] = "Sigma 28-70mm F2.8-4 High Speed Zoom";
lenses["26 48 3C 6A 24 30 1C 02"] = "Sigma 28-105mm F2.8-4 Aspherical";
lenses["26 48 8E 8E 30 30 1C 02"] = "Sigma APO TELE MACRO 300mm F4";
lenses["26 54 2B 44 24 30 1C 02"] = "Sigma 17-35mm F2.8-4 EX Aspherical";
lenses["26 54 37 5C 24 24 1C 02"] = "Sigma 24-70mm F2.8 EX DG Macro";
lenses["26 54 37 73 24 34 1C 02"] = "Sigma 24-135mm F2.8-4.5";
lenses["26 54 3C 5C 24 24 1C 02"] = "Sigma 28-70mm F2.8 EX";
lenses["26 58 31 31 14 14 1C 02"] = "Sigma 20mm F1.8 EX Aspherical DG DF RF";
lenses["26 58 37 37 14 14 1C 02"] = "Sigma 24mm F1.8 EX Aspherical DG DF MACRO";
lenses["26 58 3C 3C 14 14 1C 02"] = "Sigma 28mm F1.8 EX DG DF";
lenses["27 48 8E 8E 24 24 1D 02"] = "AF-I Nikkor 300mm f/2.8D IF-ED";
lenses["27 48 8E 8E 24 24 E1 02"] = "AF-I Nikkor 300mm f/2.8D IF-ED + TC-17E";
lenses["27 48 8E 8E 24 24 F1 02"] = "AF-I Nikkor 300mm f/2.8D IF-ED + TC-14E";
lenses["27 48 8E 8E 24 24 F2 02"] = "AF-I Nikkor 300mm f/2.8D IF-ED + TC-20E";
lenses["28 3C A6 A6 30 30 1D 02"] = "AF-I Nikkor 600mm f/4D IF-ED";
lenses["28 3C A6 A6 30 30 E1 02"] = "AF-I Nikkor 600mm f/4D IF-ED + TC-17E";
lenses["28 3C A6 A6 30 30 F1 02"] = "AF-I Nikkor 600mm f/4D IF-ED + TC-14E";
lenses["28 3C A6 A6 30 30 F2 02"] = "AF-I Nikkor 600mm f/4D IF-ED + TC-20E";
lenses["2A 54 3C 3C 0C 0C 26 02"] = "AF Nikkor 28mm f/1.4D";
lenses["2B 3C 44 60 30 3C 1F 02"] = "AF Zoom-Nikkor 35-80mm f/4-5.6D";
lenses["2C 48 6A 6A 18 18 27 02"] = "AF DC-Nikkor 105mm f/2D";
lenses["2D 48 80 80 30 30 21 02"] = "AF Micro-Nikkor 200mm f/4D IF-ED";
lenses["2E 48 5C 82 30 3C 28 02"] = "AF Nikkor 70-210mm f/4-5.6D";
lenses["2F 40 30 44 2C 34 29 02"] = "Unknown 20-35mm f/3.5-4.5D";
lenses["2F 48 30 44 24 24 29 02"] = "Tokina AT-X 235 AF PRO - AF 20-35mm f/2.8";
lenses["30 48 98 98 24 24 24 02"] = "AF-I Nikkor 400mm f/2.8D IF-ED";
lenses["30 48 98 98 24 24 E1 02"] = "AF-I Nikkor 400mm f/2.8D IF-ED + TC-17E";
lenses["30 48 98 98 24 24 F1 02"] = "AF-I Nikkor 400mm f/2.8D IF-ED + TC-14E";
lenses["30 48 98 98 24 24 F2 02"] = "AF-I Nikkor 400mm f/2.8D IF-ED + TC-20E";
lenses["31 54 56 56 24 24 25 02"] = "AF Micro-Nikkor 60mm f/2.8D";
lenses["32 53 64 64 24 24 35 02"] = "Tamron SP AF90mm f/2.8 Di Macro 1:2 (272E)";
lenses["32 54 50 50 24 24 35 02"] = "Sigma 50mm F2.8 EX DG Macro";
lenses["32 54 6A 6A 24 24 35 02"] = "AF Micro-Nikkor 105mm f/2.8D";
lenses["33 48 2D 2D 24 24 31 02"] = "AF Nikkor 18mm f/2.8D";
lenses["33 54 3C 5E 24 24 62 02"] = "Tamron SP AF28-75mm f/2.8 XR Di LD Aspherical (IF) Macro";
lenses["34 48 29 29 24 24 32 02"] = "AF Fisheye Nikkor 16mm f/2.8D";
lenses["35 3C A0 A0 30 30 33 02"] = "AF-I Nikkor 500mm f/4D IF-ED";
lenses["35 3C A0 A0 30 30 E1 02"] = "AF-I Nikkor 500mm f/4D IF-ED + TC-17E";
lenses["35 3C A0 A0 30 30 F1 02"] = "AF-I Nikkor 500mm f/4D IF-ED + TC-14E";
lenses["35 3C A0 A0 30 30 F2 02"] = "AF-I Nikkor 500mm f/4D IF-ED + TC-20E";
lenses["36 48 37 37 24 24 34 02"] = "AF Nikkor 24mm f/2.8D";
lenses["37 48 30 30 24 24 36 02"] = "AF Nikkor 20mm f/2.8D";
lenses["38 4C 62 62 14 14 37 02"] = "AF Nikkor 85mm f/1.8D";
lenses["3A 40 3C 5C 2C 34 39 02"] = "AF Zoom-Nikkor 28-70mm f/3.5-4.5D";
lenses["3B 48 44 5C 24 24 3A 02"] = "AF Zoom-Nikkor 35-70mm f/2.8D N";
lenses["3C 48 60 80 24 24 3B 02"] = "AF Zoom-Nikkor 80-200mm f/2.8D ED";
lenses["3D 3C 44 60 30 3C 3E 02"] = "AF Zoom-Nikkor 35-80mm f/4-5.6D";
lenses["3E 48 3C 3C 24 24 3D 02"] = "AF Nikkor 28mm f/2.8D";
lenses["3F 40 44 6A 2C 34 45 02"] = "AF Zoom-Nikkor 35-105mm f/3.5-4.5D";
lenses["41 48 7C 7C 24 24 43 02"] = "AF Nikkor 180mm f/2.8D IF-ED";
lenses["42 54 44 44 18 18 44 02"] = "AF Nikkor 35mm f/2D";
lenses["43 54 50 50 0C 0C 46 02"] = "AF Nikkor 50mm f/1.4D";
lenses["44 44 60 80 34 3C 47 02"] = "AF Zoom-Nikkor 80-200mm f/4.5-5.6D ";
lenses["45 3D 3C 60 2C 3C 48 02"] = "Tamron AF28-80mm f/3.5-5.6 Aspherical";
lenses["45 40 3C 60 2C 3C 48 02"] = "AF Zoom-Nikkor 28-80mm F/3.5-5.6D";
lenses["45 41 37 72 2C 3C 48 02"] = "Tamron SP AF24-135mm f/3.5-5.6 AD Aspherical (IF) Macro";
lenses["46 3C 44 60 30 3C 49 02"] = "AF Zoom-Nikkor 35-80mm f/4-5.6D N";
lenses["47 42 37 50 2A 34 4A 02"] = "AF Zoom-Nikkor 24-50mm f/3.3-4.5D";
lenses["48 38 1F 37 34 3C 4B 06"] = "Sigma 12-24mm F4.5-5.6 EX Aspherical DG HSM";
lenses["48 3C 19 31 30 3C 4B 06"] = "Sigma 10-20mm F4-5.6 EX DC HSM";
lenses["48 3C 50 A0 30 40 4B 02"] = "Sigma 50-500mm F4-6.3 EX APO RF HSM";
lenses["48 3C 8E B0 3C 3C 4B 02"] = "Sigma APO 300-800 F5.6 EX DG HSM";
lenses["48 3C B0 B0 3C 3C 4B 02"] = "Sigma APO 800mm F5.6 EX HSM";
lenses["48 44 A0 A0 34 34 4B 02"] = "Sigma APO 500mm F4.5 EX HSM";
lenses["48 48 24 24 24 24 4B 02"] = "Sigma 14mm F2.8 EX Aspherical HSM";
lenses["48 48 2B 44 24 30 4B 06"] = "Sigma 17-35mm F2.8-4 EX DG Aspherical HSM";
lenses["48 48 68 8E 30 30 4B 02"] = "Sigma 100-300mm F4 EX IF HSM";
lenses["48 48 76 76 24 24 4B 06"] = "Sigma 150mm F2.8 EX DG APO Macro HSM";
lenses["48 48 8E 8E 24 24 4B 02"] = "AF-S Nikkor 300mm f/2.8D IF-ED";
lenses["48 48 8E 8E 24 24 E1 02"] = "AF-S Nikkor 300mm f/2.8D IF-ED + TC-17E";
lenses["48 48 8E 8E 24 24 F1 02"] = "AF-S Nikkor 300mm f/2.8D IF-ED + TC-14E";
lenses["48 48 8E 8E 24 24 F2 02"] = "AF-S Nikkor 300mm f/2.8D IF-ED + TC-20E";
lenses["48 4C 7C 7C 2C 2C 4B 02"] = "Sigma 180mm F3.5 EX DG Macro";
lenses["48 4C 7D 7D 2C 2C 4B 02"] = "Sigma APO MACRO 180mm F3.5 EX DG HSM";
lenses["48 54 3E 3E 0C 0C 4B 06"] = "Sigma 30mm F1.4 EX DC HSM";
lenses["48 54 5C 80 24 24 4B 02"] = "Sigma 70-200mm F2.8 EX APO IF HSM";
lenses["48 54 6F 8E 24 24 4B 02"] = "Sigma APO 120-300mm F2.8 EX DG HSM";
lenses["48 54 8E 8E 24 24 4B 02"] = "Sigma APO 300mm F2.8 EX DG HSM";
lenses["49 3C A6 A6 30 30 4C 02"] = "AF-S Nikkor 600mm f/4D IF-ED";
lenses["49 3C A6 A6 30 30 E1 02"] = "AF-S Nikkor 600mm f/4D IF-ED + TC-17E";
lenses["49 3C A6 A6 30 30 F1 02"] = "AF-S Nikkor 600mm f/4D IF-ED + TC-14E";
lenses["49 3C A6 A6 30 30 F2 02"] = "AF-S Nikkor 600mm f/4D IF-ED + TC-20E";
lenses["4A 54 62 62 0C 0C 4D 02"] = "AF Nikkor 85mm f/1.4D IF";
lenses["4B 3C A0 A0 30 30 4E 02"] = "AF-S Nikkor 500mm f/4D IF-ED";
lenses["4B 3C A0 A0 30 30 E1 02"] = "AF-S Nikkor 500mm f/4D IF-ED + TC-17E";
lenses["4B 3C A0 A0 30 30 F1 02"] = "AF-S Nikkor 500mm f/4D IF-ED + TC-14E";
lenses["4B 3C A0 A0 30 30 F2 02"] = "AF-S Nikkor 500mm f/4D IF-ED + TC-20E";
lenses["4C 40 37 6E 2C 3C 4F 02"] = "AF Zoom-Nikkor 24-120mm f/3.5-5.6D IF";
lenses["4D 40 3C 80 2C 3C 62 02"] = "AF Zoom-Nikkor 28-200mm f/3.5-5.6D IF";
lenses["4D 41 3C 8E 2B 40 62 02"] = "Tamron AF28-300mm f/3.5-6.3 XR Di LD Aspherical (IF)";
lenses["4D 41 3C 8E 2C 40 62 02"] = "Tamron AF28-300mm f/3.5-6.3 XR LD Aspherical (IF)";
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["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["54 44 5C 7C 34 3C 58 02"] = "AF Zoom-Micro Nikkor 70-180mm f/4.5-5.6D ED";
lenses["56 3C 5C 8E 30 3C 1C 02"] = "Sigma 70-300mm F4-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["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";
lenses["59 48 98 98 24 24 F2 02"] = "AF-S Nikkor 400mm f/2.8D IF-ED + TC-20E";
lenses["5A 3C 3E 56 30 3C 5E 06"] = "IX-Nikkor 30-60mm f/4-5.6";
lenses["5B 44 56 7C 34 3C 5F 06"] = "IX-Nikkor 60-180mm f/4.5-5.6";
lenses["5D 48 3C 5C 24 24 63 02"] = "AF-S Zoom-Nikkor 28-70mm f/2.8D IF-ED";
lenses["5E 48 60 80 24 24 64 02"] = "AF-S Zoom-Nikkor 80-200mm f/2.8D IF-ED";
lenses["5F 40 3C 6A 2C 34 65 02"] = "AF Zoom-Nikkor 28-105mm f/3.5-4.5D IF";
lenses["60 40 3C 60 2C 3C 66 02"] = "AF Zoom-Nikkor 28-80mm f/3.5-5.6D";
lenses["61 44 5E 86 34 3C 67 02"] = "AF Zoom-Nikkor 75-240mm f/4.5-5.6D";
lenses["63 48 2B 44 24 24 68 02"] = "AF-S Nikkor 17-35mm f/2.8D IF-ED";
lenses["64 00 62 62 24 24 6A 02"] = "PC Micro-Nikkor 85mm f/2.8D";
lenses["65 44 60 98 34 3C 6B 0A"] = "AF VR Zoom-Nikkor 80-400mm f/4.5-5.6D ED";
lenses["66 40 2D 44 2C 34 6C 02"] = "AF Zoom-Nikkor 18-35mm f/3.5-4.5D IF-ED";
lenses["67 48 37 62 24 30 6D 02"] = "AF Zoom-Nikkor 24-85mm f/2.8-4D IF";
lenses["67 54 37 5C 24 24 1C 02"] = "Sigma 24-70mm F2.8 EX DG Macro";
lenses["68 42 3C 60 2A 3C 6E 06"] = "AF Zoom-Nikkor 28-80mm f/3.3-5.6G";
lenses["69 48 5C 8E 30 3C 6F 02"] = "Tamron AF70-300mm f/4-5.6 LD Macro 1:2";
lenses["69 48 5C 8E 30 3C 6F 06"] = "AF Zoom-Nikkor 70-300mm f/4-5.6G";
lenses["6A 48 8E 8E 30 30 70 02"] = "AF-S Nikkor 300mm f/4D IF-ED";
lenses["6B 48 24 24 24 24 71 02"] = "AF Nikkor ED 14mm f/2.8D";
lenses["6D 48 8E 8E 24 24 73 02"] = "AF-S Nikkor 300mm f/2.8D IF-ED II";
lenses["6E 48 98 98 24 24 74 02"] = "AF-S Nikkor 400mm f/2.8D IF-ED II";
lenses["6F 3C A0 A0 30 30 75 02"] = "AF-S Nikkor 500mm f/4D IF-ED II";
lenses["70 3C A6 A6 30 30 76 02"] = "AF-S Nikkor 600mm f/4D IF-ED II";
lenses["72 48 4C 4C 24 24 77 00"] = "Nikkor 45mm f/2.8 P";
lenses["74 40 37 62 2C 34 78 06"] = "AF-S Zoom-Nikkor 24-85mm f/3.5-4.5G IF-ED";
lenses["75 40 3C 68 2C 3C 79 06"] = "AF Zoom-Nikkor 28-100mm f/3.5-5.6G";
lenses["76 58 50 50 14 14 7A 02"] = "AF Nikkor 50mm f/1.8D";
lenses["77 44 61 98 34 3C 7B 0E"] = "Sigma 80-400mm f4.5-5.6 EX OS";
lenses["77 48 5C 80 24 24 7B 0E"] = "AF-S VR Zoom-Nikkor 70-200mm f/2.8G IF-ED";
lenses["78 40 37 6E 2C 3C 7C 0E"] = "AF-S VR Zoom-Nikkor 24-120mm f/3.5-5.6G IF-ED";
lenses["79 40 11 11 2C 2C 1C 06"] = "Sigma 8mm F3.5 EX";
lenses["79 40 3C 80 2C 3C 7F 06"] = "AF Zoom-Nikkor 28-200mm f/3.5-5.6G IF-ED";
lenses["79 48 5C 5C 24 24 1C 06"] = "Sigma 70mm F2.8 EX DG Macro";
lenses["7A 3B 53 80 30 3C 4B 06"] = "Sigma 55-200mm F4-5.6 DC HSM";
lenses["7A 3C 1F 37 30 30 7E 06"] = "AF-S DX Zoom-Nikkor 12-24mm f/4G IF-ED";
lenses["7A 40 2D 50 2C 3C 4B 06"] = "Sigma 18-50mm F3.5-5.6 DC HSM";
lenses["7A 47 2B 5C 24 34 4B 06"] = "Sigma 17-70mm F2.8-4.5 DC Macro Asp. IF HSM";
lenses["7A 47 50 76 24 24 4B 06"] = "Sigma APO 50-150mm F2.8 EX DC HSM";
lenses["7A 48 2B 5C 24 34 4B 06"] = "Sigma 17-70mm F2.8-4.5 DC Macro Asp. IF HSM";
lenses["7A 48 2D 50 24 24 4B 06"] = "Sigma 18-50mm F2.8 EX DC HSM";
lenses["7A 48 5C 80 24 24 4B 06"] = "Sigma 70-200mm F2.8 EX APO DG Macro HSM II";
lenses["7A 54 6E 8E 24 24 4B 02"] = "Sigma APO 120-300mm F2.8 EX DG HSM";
lenses["7B 48 80 98 30 30 80 0E"] = "AF-S VR Zoom-Nikkor 200-400mm f/4G IF-ED";
lenses["7D 48 2B 53 24 24 82 06"] = "AF-S DX Zoom-Nikkor 17-55mm f/2.8G IF-ED";
lenses["7F 40 2D 5C 2C 34 84 06"] = "AF-S DX Zoom-Nikkor 18-70mm f/3.5-4.5G IF-ED";
lenses["7F 48 2B 5C 24 34 1C 06"] = "Sigma 17-70mm F2.8-4.5 DC Macro Asp. IF";
lenses["7F 48 2D 50 24 24 1C 06"] = "Sigma 18-50mm F2.8 EX DC Macro";
lenses["80 48 1A 1A 24 24 85 06"] = "AF DX Fisheye-Nikkor 10.5mm f/2.8G ED";
lenses["81 54 80 80 18 18 86 0E"] = "AF-S VR Nikkor 200mm f/2G IF-ED";
lenses["82 48 8E 8E 24 24 87 0E"] = "AF-S VR Nikkor 300mm f/2.8G IF-ED";
lenses["89 3C 53 80 30 3C 8B 06"] = "AF-S DX Zoom-Nikkor 55-200mm f/4-5.6G ED";
lenses["8A 54 6A 6A 24 24 8C 0E"] = "AF-S VR Micro-Nikkor 105mm f/2.8G IF-ED";
lenses["8B 40 2D 80 2C 3C 8D 0E"] = "AF-S DX VR Zoom-Nikkor 18-200mm f/3.5-5.6G IF-ED";
lenses["8B 40 2D 80 2C 3C FD 0E"] = "AF-S DX VR Zoom-Nikkor 18-200mm f/3.5-5.6G IF-ED";
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["8F 40 2D 72 2C 3C 91 06"] = "AF-S DX Zoom-Nikkor 18-135mm f/3.5-5.6G IF-ED";
lenses["90 3B 53 80 30 3C 92 0E"] = "AF-S DX VR Zoom-Nikkor 55-200mm f/4-5.6G IF-ED";
lenses["92 48 24 37 24 24 94 06"] = "AF-S Zoom-Nikkor 14-24mm f/2.8G ED";
lenses["93 48 37 5C 24 24 95 06"] = "AF-S Zoom-Nikkor 24-70mm f/2.8G ED";
lenses["94 40 2D 53 2C 3C 96 06"] = "AF-S DX Zoom-Nikkor 18-55mm f/3.5-5.6G ED II";
lenses["95 00 37 37 2C 2C 97 06"] = "PC-E Nikkor 24mm f/3.5D ED";
lenses["95 4C 37 37 2C 2C 97 02"] = "PC-E Nikkor 24mm f/3.5D ED";
lenses["96 48 98 98 24 24 98 0E"] = "AF-S VR Nikkor 400mm f/2.8G ED";
lenses["97 3C A0 A0 30 30 99 0E"] = "AF-S VR Nikkor 500mm f/4G ED";
lenses["98 3C A6 A6 30 30 9A 0E"] = "AF-S VR Nikkor 600mm f/4G ED";
lenses["99 40 29 62 2C 3C 9B 0E"] = "AF-S DX VR Zoom-Nikkor 16-85mm f/3.5-5.6G ED";
lenses["9A 40 2D 53 2C 3C 9C 0E"] = "AF-S DX VR Zoom-Nikkor 18-55mm f/3.5-5.6G";
lenses["9B 00 4C 4C 24 24 9D 06"] = "PC-E Micro Nikkor 45mm f/2.8D ED";
lenses["9B 54 4C 4C 24 24 9D 02"] = "PC-E Micro Nikkor 45mm f/2.8D ED";
lenses["9C 54 56 56 24 24 9E 06"] = "AF-S Micro Nikkor 60mm f/2.8G ED";
lenses["9D 00 62 62 24 24 9F 06"] = "PC-E Micro Nikkor 85mm f/2.8D";
lenses["9D 54 62 62 24 24 9F 02"] = "PC-E Micro Nikkor 85mm f/2.8D";
lenses["9E 40 2D 6A 2C 3C A0 0E"] = "AF-S DX VR Zoom-Nikkor 18-105mm f/3.5-5.6G ED";
lenses["9F 58 44 44 14 14 A1 06"] = "AF-S DX Nikkor 35mm f/1.8G";
lenses["A0 54 50 50 0C 0C A2 06"] = "AF-S Nikkor 50mm f/1.4G";
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 F3.5 EX DC HSM";
lenses["A2 48 5C 80 24 24 A4 0E"] = "AF-S Nikkor 70-200mm f/2.8G ED VR II";
lenses["A5 40 2D 88 2C 40 4B 0E"] = "Sigma 18-250mm F3.5-6.3 DC OS HSM";
lenses["A6 48 37 5C 24 24 4B 06"] = "Sigma 24-70mm F2.8 IF EX DG HSM";
lenses["B6 48 37 56 24 24 1C 02"] = "Sigma 24-60mm F2.8 EX DG";
lenses["CD 3D 2D 70 2E 3C 4B 0E"] = "Sigma 18-125mm F3.8-5.6 DC OS HSM";
lenses["CE 34 76 A0 38 40 4B 0E"] = "Sigma 150-500mm F5-6.3 DG OS APO HSM";
lenses["CF 38 6E 98 34 3C 4B 0E"] = "Sigma APO 120-400mm F4.5-5.6 DG OS HSM";
lenses["DC 48 19 19 24 24 4B 06"] = "Sigma 10mm F2.8 EX DC HSM Fisheye";
lenses["DE 54 50 50 0C 0C 4B 06"] = "Sigma 50mm F1.4 EX DG HSM";
lenses["E0 3C 5C 8E 30 3C 4B 06"] = "Sigma 70-300mm F4-5.6 APO DG Macro HSM";
lenses["E1 58 37 37 14 14 1C 02"] = "Sigma 24mm F1.8 EX DG Aspherical Macro";
lenses["E5 54 6A 6A 24 24 35 02"] = "Sigma Macro 105mm F2.8 EX DG";
lenses["E9 54 37 5C 24 24 1C 02"] = "Sigma 24-70mm F2.8 EX DG Macro";
lenses["ED 40 2D 80 2C 40 4B 0E"] = "Sigma 18-200mm F3.5-6.3 DC OS HSM";
lenses["EE 48 5C 80 24 24 4B 06"] = "Sigma 70-200mm F2.8 EX APO DG Macro HSM II";
lenses["F0 38 1F 37 34 3C 4B 06"] = "Sigma 12-24mm F4.5-5.6 EX DG Aspherical HSM";
lenses["F3 54 2B 50 24 24 84 0E"] = "Tamron SP AF 17-50mm F/2.8 XR Di II VC LD Aspherical (IF) (B005)";
lenses["F4 54 56 56 18 18 84 06"] = "Tamron SP AF 60mm f/2.0 Di II Macro 1:1 (G005)";
lenses["F5 40 2C 8A 2C 40 40 0E"] = "Tamron AF 18-270mm f/3.5-6.3 Di II VC LD Aspherical (IF) Macro (B003)";
lenses["F5 48 76 76 24 24 4B 06"] = "Sigma 150mm F2.8 EX DG APO Macro HSM";
lenses["F6 3F 18 37 2C 34 84 06"] = "Tamron SP AF 10-24mm f/3.5-4.5 Di II LD Aspherical (IF) (B001)";
lenses["F7 53 5C 80 24 24 84 06"] = "Tamron SP AF 70-200mm f/2.8 Di LD (IF) Macro (A001)";
lenses["F8 54 3E 3E 0C 0C 4B 06"] = "Sigma 30mm F1.4 EX DC HSM";
lenses["F8 55 64 64 24 24 84 06"] = "Tamron SP AF 90mm f/2.8 Di Macro 1:1 (272NII)";
lenses["F9 3C 19 31 30 3C 4B 06"] = "Sigma 10-20mm F4-5.6 EX DC HSM";
lenses["F9 40 3C 8E 2C 40 40 0E"] = "Tamron AF 28-300mm f/3.5-6.3 XR Di VC LD Aspherical (IF) Macro (A20)";
lenses["FA 54 3C 5E 24 24 84 06"] = "Tamron SP AF 28-75mm f/2.8 XR Di LD Aspherical (IF) Macro (A09NII)";
lenses["FB 54 8E 8E 24 24 4B 02"] = "Sigma APO 300mm F2.8 EX DG HSM";
lenses["FD 47 50 76 24 24 4B 06"] = "Sigma 50-150mm F2.8 EX APO DC HSM II";
lenses["FE 47 00 00 24 24 4B 06"] = "Sigma 4.5mm F2.8 EX DC Circular Fisheye HSM";
}
virtual std::string toString (Tag* t) {
static const unsigned char xlat[2][256] = {
{ 0xc1,0xbf,0x6d,0x0d,0x59,0xc5,0x13,0x9d,0x83,0x61,0x6b,0x4f,0xc7,0x7f,0x3d,0x3d,
0x53,0x59,0xe3,0xc7,0xe9,0x2f,0x95,0xa7,0x95,0x1f,0xdf,0x7f,0x2b,0x29,0xc7,0x0d,
0xdf,0x07,0xef,0x71,0x89,0x3d,0x13,0x3d,0x3b,0x13,0xfb,0x0d,0x89,0xc1,0x65,0x1f,
0xb3,0x0d,0x6b,0x29,0xe3,0xfb,0xef,0xa3,0x6b,0x47,0x7f,0x95,0x35,0xa7,0x47,0x4f,
0xc7,0xf1,0x59,0x95,0x35,0x11,0x29,0x61,0xf1,0x3d,0xb3,0x2b,0x0d,0x43,0x89,0xc1,
0x9d,0x9d,0x89,0x65,0xf1,0xe9,0xdf,0xbf,0x3d,0x7f,0x53,0x97,0xe5,0xe9,0x95,0x17,
0x1d,0x3d,0x8b,0xfb,0xc7,0xe3,0x67,0xa7,0x07,0xf1,0x71,0xa7,0x53,0xb5,0x29,0x89,
0xe5,0x2b,0xa7,0x17,0x29,0xe9,0x4f,0xc5,0x65,0x6d,0x6b,0xef,0x0d,0x89,0x49,0x2f,
0xb3,0x43,0x53,0x65,0x1d,0x49,0xa3,0x13,0x89,0x59,0xef,0x6b,0xef,0x65,0x1d,0x0b,
0x59,0x13,0xe3,0x4f,0x9d,0xb3,0x29,0x43,0x2b,0x07,0x1d,0x95,0x59,0x59,0x47,0xfb,
0xe5,0xe9,0x61,0x47,0x2f,0x35,0x7f,0x17,0x7f,0xef,0x7f,0x95,0x95,0x71,0xd3,0xa3,
0x0b,0x71,0xa3,0xad,0x0b,0x3b,0xb5,0xfb,0xa3,0xbf,0x4f,0x83,0x1d,0xad,0xe9,0x2f,
0x71,0x65,0xa3,0xe5,0x07,0x35,0x3d,0x0d,0xb5,0xe9,0xe5,0x47,0x3b,0x9d,0xef,0x35,
0xa3,0xbf,0xb3,0xdf,0x53,0xd3,0x97,0x53,0x49,0x71,0x07,0x35,0x61,0x71,0x2f,0x43,
0x2f,0x11,0xdf,0x17,0x97,0xfb,0x95,0x3b,0x7f,0x6b,0xd3,0x25,0xbf,0xad,0xc7,0xc5,
0xc5,0xb5,0x8b,0xef,0x2f,0xd3,0x07,0x6b,0x25,0x49,0x95,0x25,0x49,0x6d,0x71,0xc7 },
{ 0xa7,0xbc,0xc9,0xad,0x91,0xdf,0x85,0xe5,0xd4,0x78,0xd5,0x17,0x46,0x7c,0x29,0x4c,
0x4d,0x03,0xe9,0x25,0x68,0x11,0x86,0xb3,0xbd,0xf7,0x6f,0x61,0x22,0xa2,0x26,0x34,
0x2a,0xbe,0x1e,0x46,0x14,0x68,0x9d,0x44,0x18,0xc2,0x40,0xf4,0x7e,0x5f,0x1b,0xad,
0x0b,0x94,0xb6,0x67,0xb4,0x0b,0xe1,0xea,0x95,0x9c,0x66,0xdc,0xe7,0x5d,0x6c,0x05,
0xda,0xd5,0xdf,0x7a,0xef,0xf6,0xdb,0x1f,0x82,0x4c,0xc0,0x68,0x47,0xa1,0xbd,0xee,
0x39,0x50,0x56,0x4a,0xdd,0xdf,0xa5,0xf8,0xc6,0xda,0xca,0x90,0xca,0x01,0x42,0x9d,
0x8b,0x0c,0x73,0x43,0x75,0x05,0x94,0xde,0x24,0xb3,0x80,0x34,0xe5,0x2c,0xdc,0x9b,
0x3f,0xca,0x33,0x45,0xd0,0xdb,0x5f,0xf5,0x52,0xc3,0x21,0xda,0xe2,0x22,0x72,0x6b,
0x3e,0xd0,0x5b,0xa8,0x87,0x8c,0x06,0x5d,0x0f,0xdd,0x09,0x19,0x93,0xd0,0xb9,0xfc,
0x8b,0x0f,0x84,0x60,0x33,0x1c,0x9b,0x45,0xf1,0xf0,0xa3,0x94,0x3a,0x12,0x77,0x33,
0x4d,0x44,0x78,0x28,0x3c,0x9e,0xfd,0x65,0x57,0x16,0x94,0x6b,0xfb,0x59,0xd0,0xc8,
0x22,0x36,0xdb,0xd2,0x63,0x98,0x43,0xa1,0x04,0x87,0x86,0xf7,0xa6,0x26,0xbb,0xd6,
0x59,0x4d,0xbf,0x6a,0x2e,0xaa,0x2b,0xef,0xe6,0x78,0xb6,0x4e,0xe0,0x2f,0xdc,0x7c,
0xbe,0x57,0x19,0x32,0x7e,0x2a,0xd0,0xb8,0xba,0x29,0x00,0x3c,0x52,0x7d,0xa8,0x49,
0x3b,0x2d,0xeb,0x25,0x49,0xfa,0xa3,0xaa,0x39,0xa7,0xc5,0xa7,0x50,0x11,0x36,0xfb,
0xc6,0x67,0x4a,0xf5,0xa5,0x12,0x65,0x7e,0xb0,0xdf,0xaf,0x4e,0xb3,0x61,0x7f,0x2f } };
int ver = (t->toInt (0, BYTE) - '0') * 1000 + (t->toInt (1, BYTE) - '0') * 100 + (t->toInt (2, BYTE) - '0') * 10 + (t->toInt (3, BYTE) - '0');
std::ostringstream ld;
ld << "Version = " << ver << std::endl;
int lenstype = t->getParent()->getTag(0x0083)->toInt(0,BYTE);
std::ostringstream lid;
lid.setf (std::ios_base::hex, std::ios_base::basefield);
lid.setf (std::ios_base::uppercase);
std::string model = t->getParent()->getParent()->getParent()->getTag(0x0110)->valueToString();
int lidoffs = 7;
bool d100 = false;
if (model.substr(0,10)=="NIKON D100" || model.substr(0,9)=="NIKON D1X") {
lidoffs = 0;
d100 = true;
}
unsigned char buffer[15];
if (d100)
memcpy (buffer, t->getValue()+6, 7);
else
memcpy (buffer, t->getValue()+4, 15);
if (ver>=201) {
const unsigned char* serval = t->getParent()->getTag(0x001d)->getValue ();
int serial = 0;
for (int i=0; serval[i]; i++)
serial = serial*10 + (isdigit(serval[i]) ? serval[i] - '0' : serval[i] % 10);
const unsigned char* scval = t->getParent()->getTag(0x00a7)->getValue ();
int key = 0;
for (int i=0; i<4; i++)
key ^= scval[i];
unsigned char ci = xlat[0][serial & 0xff];
unsigned char cj = xlat[1][key];
unsigned char ck = 0x60;
for (int i=0; i < 15; i++)
buffer[i] ^= (cj += ci * ck++);
}
if (!d100) {
ld << "ExitPupilPosition = " << (int) buffer[0] << std::endl;
ld << "AFAperture = " << (int) buffer[1] << std::endl;
ld << "FocusPosition = " << (int) buffer[4] << std::endl;
ld << "FocusDistance = " << (int) buffer[5] << std::endl;
ld << "FocalLength = " << (int) buffer[6] << std::endl;
ld << "EffectiveMaxAperture = " << (int) buffer[14] << std::endl;
}
for (int i=0; i<7; i++)
lid << std::setw(2) << std::setfill('0') << (int)buffer[lidoffs+i] << ' ';
lid << std::setw(2) << std::setfill('0') << lenstype;
std::map<std::string,std::string>::iterator r = lenses.find (lid.str());
if (r!=lenses.end())
ld << "Lens = " << r->second;
else
ld << "Lens = Unknown, ID=" << lid.str();
return ld.str();
}
};
NALensDataInterpreter naLensDataInterpreter;
const TagAttrib nikon2Attribs[] = {
0, 1, 0, 0, 0x0002, "Unknown", &stdInterpreter,
0, 1, 0, 0, 0x0003, "Quality", &stdInterpreter,
0, 1, 0, 0, 0x0004, "ColorMode", &stdInterpreter,
0, 1, 0, 0, 0x0005, "ImageAdjustment", &stdInterpreter,
0, 1, 0, 0, 0x0006, "ISOSpeed", &naISOInterpreter,
0, 1, 0, 0, 0x0007, "WhiteBalance", &stdInterpreter,
0, 1, 0, 0, 0x0008, "Focus", &stdInterpreter,
0, 1, 0, 0, 0x0009, "Unknown", &stdInterpreter,
0, 1, 0, 0, 0x000a, "DigitalZoom", &stdInterpreter,
0, 1, 0, 0, 0x000b, "AuxiliaryLens", &stdInterpreter,
0, 1, 0, 0, 0x0f00, "Unknown", &stdInterpreter,
-1, 0, 0, 0, 0, "", NULL};
const TagAttrib nikon3Attribs[] = {
0, 1, 0, 0, 0x0001, "MakerNoteVersion", &stdInterpreter,
0, 1, 0, 0, 0x0002, "ISOSpeed", &naISOInterpreter,
0, 1, 0, 0, 0x0003, "ColorMode", &stdInterpreter,
0, 1, 0, 0, 0x0004, "Quality", &stdInterpreter,
0, 1, 0, 0, 0x0005, "WhiteBalance", &stdInterpreter,
0, 1, 0, 0, 0x0006, "Sharpness", &stdInterpreter,
0, 1, 0, 0, 0x0007, "FocusMode", &stdInterpreter,
0, 1, 0, 0, 0x0008, "FlashSetting", &stdInterpreter,
0, 1, 0, 0, 0x0009, "FlashType", &stdInterpreter,
0, 1, 0, 0, 0x000b, "WhiteBalanceFineTune", &stdInterpreter,
0, 3, 0, 0, 0x000c, "ColorBalance1", &stdInterpreter,
0, 1, 0, 0, 0x000d, "ProgramShift", &stdInterpreter,
0, 1, 0, 0, 0x000e, "ExposureDifference", &stdInterpreter,
0, 1, 0, 0, 0x000f, "ISOSelection", &naISOInterpreter,
0, 1, 0, 0, 0x0010, "DataDump", &stdInterpreter,
1, 1, 0, 0, 0x0011, "NikonPreview", &stdInterpreter,
0, 1, 0, 0, 0x0012, "FlashExposureComp", &stdInterpreter,
0, 1, 0, 0, 0x0013, "ISOSetting", &stdInterpreter,
0, 1, 0, 0, 0x0016, "ImageBoundary", &stdInterpreter,
0, 1, 0, 0, 0x0018, "FlashExposureBracketValue", &stdInterpreter,
0, 1, 0, 0, 0x0019, "ExposureBracketValue", &stdInterpreter,
0, 1, 0, 0, 0x001a, "ImageProcessing", &stdInterpreter,
0, 1, 0, 0, 0x001b, "CropHiSpeed", &stdInterpreter,
0, 1, 0, 0, 0x001d, "SerialNumber", &stdInterpreter,
0, 1, 0, 0, 0x001e, "ColorSpace", &stdInterpreter,
0, 1, 0, 0, 0x0020, "ImageAuthentication", &stdInterpreter,
0, 1, 0, 0, 0x0080, "ImageAdjustment", &stdInterpreter,
0, 1, 0, 0, 0x0081, "ToneComp", &stdInterpreter,
0, 1, 0, 0, 0x0082, "AuxiliaryLens", &stdInterpreter,
0, 1, 0, 0, 0x0083, "LensType", &naLensTypeInterpreter,
0, 1, 0, 0, 0x0084, "Lens", &stdInterpreter,
0, 1, 0, 0, 0x0085, "ManualFocusDistance", &stdInterpreter,
0, 1, 0, 0, 0x0086, "DigitalZoom", &stdInterpreter,
0, 1, 0, 0, 0x0087, "FlashMode", &naFlashModeInterpreter,
0, 1, 0, 0, 0x0088, "AFInfo", &naAFInfoInterpreter,
0, 1, 0, 0, 0x0089, "ShootingMode", &naShootingModeInterpreter,
0, 1, 0, 0, 0x008a, "AutoBracketRelease", &stdInterpreter,
0, 1, 0, 0, 0x008b, "LensFStops", &stdInterpreter,
0, 1, 0, 0, 0x008c, "NEFCurve1", &stdInterpreter,
0, 1, 0, 0, 0x008d, "ColorHue", &stdInterpreter,
0, 1, 0, 0, 0x008f, "SceneMode", &stdInterpreter,
0, 1, 0, 0, 0x0090, "LightSource", &stdInterpreter,
0, 1, 0, 0, 0x0091, "ShotInfo", &stdInterpreter,
0, 1, 0, 0, 0x0092, "HueAdjustment", &stdInterpreter,
0, 1, 0, 0, 0x0094, "Saturation", &stdInterpreter,
0, 1, 0, 0, 0x0095, "NoiseReduction", &stdInterpreter,
0, 1, 0, 0, 0x0096, "NEFCurve2", &stdInterpreter,
0, 3, 0, 0, 0x0097, "ColorBalance", &stdInterpreter,
0, 1, 0, 0, 0x0098, "LensData", &naLensDataInterpreter,
0, 1, 0, 0, 0x0099, "RawImageCenter", &stdInterpreter,
0, 1, 0, 0, 0x009a, "SensorPixelSize", &stdInterpreter,
0, 1, 0, 0, 0x00a0, "SerialNumber", &stdInterpreter,
0, 1, 0, 0, 0x00a2, "ImageDataSize", &stdInterpreter,
0, 1, 0, 0, 0x00a5, "ImageCount", &stdInterpreter,
0, 1, 0, 0, 0x00a6, "DeletedImageCount", &stdInterpreter,
0, 1, 0, 0, 0x00a7, "ShutterCount", &stdInterpreter,
0, 1, 0, 0, 0x00a9, "ImageOptimization", &stdInterpreter,
0, 1, 0, 0, 0x00aa, "Saturation", &stdInterpreter,
0, 1, 0, 0, 0x00ab, "VariProgram", &stdInterpreter,
0, 1, 0, 0, 0x00ac, "ImageStabilization", &stdInterpreter,
0, 1, 0, 0, 0x00ad, "AFResponse", &stdInterpreter,
0, 1, 0, 0, 0x00b0, "MultiExposure", &stdInterpreter,
0, 1, 0, 0, 0x00b1, "HighISONoiseReduction", &naHiISONRInterpreter,
0, 1, 0, 0, 0x0e00, "PrintIM", &stdInterpreter,
0, 0, 0, 0, 0x0e01, "NikonCaptureData", &stdInterpreter,
0, 0, 0, 0, 0x0e09, "NikonCaptureVersion", &stdInterpreter,
0, 0, 0, 0, 0x0e0e, "NikonCaptureOffsets", &stdInterpreter,
0, 0, 0, 0, 0x0e10, "NikonScanIFD", &stdInterpreter,
-1, 0, 0, 0, 0, "", NULL};
}
#endif

673
rtexif/olympusattribs.cc Normal file
View File

@@ -0,0 +1,673 @@
/*
* This file is part of RawTherapee.
*
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
*
* RawTherapee is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* RawTherapee is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _OLYMPUSATTRIBS_
#define _OLYMPUSATTRIBS_
#include <rtexif.h>
#include <string>
#include <map>
#include <math.h>
#include <sstream>
#include <iomanip>
namespace rtexif {
class OLOnOffInterpreter : public Interpreter {
public:
OLOnOffInterpreter () {}
virtual std::string toString (Tag* t) {
if (t->toInt()==0)
return "Off";
else
return "On";
}
};
OLOnOffInterpreter olOnOffInterpreter;
class OLYesNoInterpreter : public Interpreter {
public:
OLYesNoInterpreter () {}
virtual std::string toString (Tag* t) {
if (t->toInt()==0)
return "No";
else
return "Yes";
}
};
OLYesNoInterpreter olYesNoInterpreter;
class OLApertureInterpreter : public Interpreter {
public:
OLApertureInterpreter () {}
virtual std::string toString (Tag* t) {
std::ostringstream str;
str.precision(2);
str << pow(2, t->toInt() / 512.0);
return str.str();
}
};
OLApertureInterpreter olApertureInterpreter;
class OLLensTypeInterpreter : public Interpreter {
std::map<int, std::string> lenses;
public:
OLLensTypeInterpreter () {
lenses[1] = "Zuiko Digital ED 50mm F2.0 Macro";
lenses[1 +65536] = "Zuiko Digital 40-150mm F3.5-4.5";
lenses[2] = "Zuiko Digital ED 150mm F2.0";
lenses[3] = "Zuiko Digital ED 300mm F2.8";
lenses[5] = "Zuiko Digital 14-54mm F2.8-3.5";
lenses[5 +65536] = "Zuiko Digital Pro ED 90-250mm F2.8";
lenses[6] = "Zuiko Digital ED 50-200mm F2.8-3.5";
lenses[6 +65536] = "Zuiko Digital ED 8mm F3.5 Fisheye";
lenses[7] = "Zuiko Digital 11-22mm F2.8-3.5";
lenses[7 +65536] = "Zuiko Digital 18-180mm F3.5-6.3";
lenses[8] = "Zuiko Digital 70-300mm F4.0-5.6";
lenses[21] = "Zuiko Digital ED 7-14mm F4.0";
lenses[23] = "Zuiko Digital Pro ED 35-100mm F2.0";
lenses[24] = "Zuiko Digital 14-45mm F3.5-5.6";
lenses[32] = "Zuiko Digital 35mm F3.5 Macro";
lenses[34] = "Zuiko Digital 17.5-45mm F3.5-5.6";
lenses[35] = "Zuiko Digital ED 14-42mm F3.5-5.6";
lenses[36] = "Zuiko Digital ED 40-150mm F4.0-5.6";
lenses[48] = "Zuiko Digital ED 50-200mm SWD F2.8-3.5";
lenses[49] = "Zuiko Digital ED 12-60mm SWD F2.8-4.0";
lenses[256+ 1] = "18-50mm F3.5-5.6";
lenses[256+ 2] = "55-200mm F4.0-5.6 DC";
lenses[256+ 3] = "18-125mm F3.5-5.6 DC";
lenses[256+ 4] = "18-125mm F3.5-5.6";
lenses[256+ 5] = "30mm F1.4";
lenses[256+ 6] = "50-500mm F4.0-6.3 EX DG APO HSM RF";
lenses[256+ 7] = "105mm F2.8 DG";
lenses[256+ 8] = "150mm F2.8 DG HSM";
lenses[256+ 17] = "135-400mm F4.5-5.6 DG ASP APO RF";
lenses[256+ 18] = "300-800mm F5.6 EX DG APO";
lenses[512+ 1] = "D Vario Elmarit 14-50mm, F2.8-3.5 Asph.";
lenses[512+ 2] = "D Summilux 25mm, F1.4 Asph.";
lenses[512+ 4] = "Vario Elmar 14-150mm f3.5-5.6";
lenses[768+ 1] = "D Vario Elmarit 14-50mm, F2.8-3.5 Asph.";
lenses[768+ 2] = "D Summilux 25mm, F1.4 Asph.";
}
virtual std::string toString (Tag* t) {
int make = t->toInt(0);
int model = t->toInt(2);
int add = 0;
if (make==0 && (model==1 || model==5 || model==7 || model==6))
add += 65536 * t->toInt(3);
return lenses [256 * make + model + add];
}
};
OLLensTypeInterpreter olLensTypeInterpreter;
class OLFlashTypeInterpreter : public ChoiceInterpreter {
public:
OLFlashTypeInterpreter () {
choices[0] = "None";
choices[2] = "Simple E-System";
choices[3] = "E-System";
}
};
OLFlashTypeInterpreter olFlashTypeInterpreter;
class OLExposureModeInterpreter : public ChoiceInterpreter {
public:
OLExposureModeInterpreter () {
choices[1] = "Manual";
choices[2] = "Program";
choices[3] = "Aperture-priority AE";
choices[4] = "Shutter speed priority AE";
choices[5] = "Program-shift";
}
};
OLExposureModeInterpreter olExposureModeInterpreter;
class OLMeteringModeInterpreter : public ChoiceInterpreter {
public:
OLMeteringModeInterpreter () {
choices[2] = "Center-weighted average";
choices[3] = "Spot";
choices[5] = "ESP";
choices[261] = "Pattern+AF";
choices[515] = "Spot+Highlight control";
choices[1027] = "Spot+Shadow control";
}
};
OLMeteringModeInterpreter olMeteringModeInterpreter;
class OLFocusModeInterpreter : public ChoiceInterpreter {
public:
OLFocusModeInterpreter () {
choices[0] = "Single AF";
choices[1] = "Sequential shooting AF";
choices[2] = "Continuous AF";
choices[3] = "Multi AF";
choices[10] = "MF";
}
};
OLFocusModeInterpreter olFocusModeInterpreter;
class OLWhitebalance2Interpreter : public ChoiceInterpreter {
public:
OLWhitebalance2Interpreter () {
choices[0] = "Auto";
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[33] = "6600K (Daylight fluorescent)";
choices[34] = "4500K (Neutral white fluorescent)";
choices[35] = "4000K (Cool 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";
}
};
OLWhitebalance2Interpreter olWhitebalance2Interpreter;
class OLSceneModeInterpreter : public ChoiceInterpreter {
public:
OLSceneModeInterpreter () {
choices[0] = "Standard";
choices[6] = "Auto";
choices[7] = "Sport";
choices[8] = "Portrait";
choices[9] = "Landscape+Portrait";
choices[10] = "Landscape";
choices[11] = "Night Scene";
choices[12] = "Self Portrait";
choices[13] = "Panorama";
choices[14] = "2 in 1";
choices[15] = "Movie";
choices[16] = "Landscape+Portrait";
choices[17] = "Night+Portrait";
choices[18] = "Indoor";
choices[19] = "Fireworks";
choices[20] = "Sunset";
choices[22] = "Macro";
choices[23] = "Super Macro";
choices[24] = "Food";
choices[25] = "Documents";
choices[26] = "Museum";
choices[27] = "Shoot & Select";
choices[28] = "Beach & Snow";
choices[29] = "Self Protrait+Timer";
choices[30] = "Candle";
choices[31] = "Available Light";
choices[32] = "Behind Glass";
choices[33] = "My Mode";
choices[34] = "Pet";
choices[35] = "Underwater Wide1";
choices[36] = "Underwater Macro";
choices[37] = "Shoot & Select1";
choices[38] = "Shoot & Select2";
choices[39] = "High Key";
choices[40] = "Digital Image Stabilization";
choices[41] = "Auction";
choices[42] = "Beach";
choices[43] = "Snow";
choices[44] = "Underwater Wide2";
choices[45] = "Low Key";
choices[46] = "Children";
choices[47] = "Vivid";
choices[48] = "Nature Macro";
choices[49] = "Underwater Snapshot";
choices[50] = "Shooting Guide";
}
};
OLSceneModeInterpreter olSceneModeInterpreter;
class OLPictureModeBWFilterInterpreter : public ChoiceInterpreter {
public:
OLPictureModeBWFilterInterpreter () {
choices[0] = "n/a";
choices[1] = "Neutral";
choices[2] = "Yellow";
choices[3] = "Orange";
choices[4] = "Red";
choices[5] = "Green";
}
};
OLPictureModeBWFilterInterpreter olPictureModeBWFilterInterpreter;
class OLPictureModeToneInterpreter : public ChoiceInterpreter {
public:
OLPictureModeToneInterpreter () {
choices[0] = "n/a";
choices[1] = "Neutral";
choices[2] = "Sepia";
choices[3] = "Blue";
choices[4] = "Purple";
choices[5] = "Green";
}
};
OLPictureModeToneInterpreter olPictureModeToneInterpreter;
class OLImageQuality2Interpreter : public ChoiceInterpreter {
public:
OLImageQuality2Interpreter () {
choices[1] = "SQ";
choices[2] = "HQ";
choices[3] = "SHQ";
choices[4] = "RAW";
}
};
OLImageQuality2Interpreter olImageQuality2Interpreter;
class OLDevEngineInterpreter : public ChoiceInterpreter {
public:
OLDevEngineInterpreter () {
choices[0] = "High Speed";
choices[1] = "High Function";
choices[2] = "Advanced High Speed";
choices[3] = "Advanced High Function";
}
};
OLDevEngineInterpreter olDevEngineInterpreter;
class OLPictureModeInterpreter : public ChoiceInterpreter {
public:
OLPictureModeInterpreter () {
choices[1] = "Vivid";
choices[2] = "Natural";
choices[3] = "Muted";
choices[4] = "Portrait";
choices[256] = "Monotone";
choices[512] = "Sepia";
}
};
OLPictureModeInterpreter olPictureModeInterpreter;
class OLColorSpaceInterpreter : public ChoiceInterpreter {
public:
OLColorSpaceInterpreter () {
choices[0] = "sRGB";
choices[1] = "Adobe RGB";
choices[2] = "Pro Photo RGB";
}
};
OLColorSpaceInterpreter olColorSpaceInterpreter;
class OLNoiseFilterInterpreter : public Interpreter {
public:
OLNoiseFilterInterpreter () {}
virtual std::string toString (Tag* t) {
int a = t->toInt (0);
int b = t->toInt (2);
int c = t->toInt (4);
if (a==-1 && b==-2 && c==1)
return "Low";
else if (a==-2 && b==-2 && c==1)
return "Off";
else if (a==0 && b==-2 && c==1)
return "Standard";
else if (a==1 && b==-2 && c==1)
return "High";
else return "Unknown";
}
};
OLNoiseFilterInterpreter olNoiseFilterInterpreter;
class OLFlashModeInterpreter : public Interpreter {
public:
OLFlashModeInterpreter () {}
virtual std::string toString (Tag* t) {
std::ostringstream str;
int a = t->toInt ();
str << "Flash Used = " << ((a&1) ? "Yes" : "No") << std::endl;
str << "Fill-in = " << ((a&2) ? "On" : "Off") << std::endl;
str << "Red-eye = " << ((a&4) ? "On" : "Off") << std::endl;
str << "Slow-sync = " << ((a&8) ? "On" : "Off") << std::endl;
str << "Forced On = " << ((a&16) ? "On" : "Off") << std::endl;
str << "2nd Curtain = " << ((a&32) ? "On" : "Off");
return str.str();
}
};
OLFlashModeInterpreter olFlashModeInterpreter;
class OLNoiseReductionInterpreter : public Interpreter {
public:
OLNoiseReductionInterpreter () {}
virtual std::string toString (Tag* t) {
std::ostringstream str;
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");
return str.str();
}
};
OLNoiseReductionInterpreter olNoiseReductionInterpreter;
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";
}
};
OLFlashModelInterpreter olFlashModelInterpreter;
const TagAttrib olyFocusInfoAttribs[] = {
0, 1, 0, 0, 0x0000, "FocusInfoVersion", &stdInterpreter,
0, 1, 0, 0, 0x0209, "AutoFocus", &olOnOffInterpreter,
0, 1, 0, 0, 0x0210, "SceneDetect", &stdInterpreter,
0, 1, 0, 0, 0x0211, "SceneArea", &stdInterpreter,
0, 1, 0, 0, 0x0212, "SceneDetectData", &stdInterpreter,
0, 1, 0, 0, 0x0300, "ZoomStepCount", &stdInterpreter,
0, 1, 0, 0, 0x0301, "FocusStepCount", &stdInterpreter,
0, 1, 0, 0, 0x0303, "FocusStepInfinity", &stdInterpreter,
0, 1, 0, 0, 0x0304, "FocusStepNear", &stdInterpreter,
0, 1, 0, 0, 0x0305, "FocusDistance", &stdInterpreter,
0, 1, 0, 0, 0x0308, "AFPoint", &stdInterpreter,
0, 1, 0, 0, 0x1201, "ExternalFlash", &olOnOffInterpreter,
0, 1, 0, 0, 0x1203, "ExternalFlashGuideNumber", &stdInterpreter,
0, 1, 0, 0, 0x1204, "ExternalFlashBounce", &stdInterpreter,
0, 1, 0, 0, 0x1205, "ExternalFlashZoom", &stdInterpreter,
0, 1, 0, 0, 0x1208, "InternalFlash", &olOnOffInterpreter,
0, 1, 0, 0, 0x1209, "ManualFlash", &olOnOffInterpreter,
0, 1, 0, 0, 0x1500, "SensorTemperature", &stdInterpreter,
0, 1, 0, 0, 0x1600, "ImageStabilization", &stdInterpreter,
-1, 0, 0, 0, 0, "", NULL};
const TagAttrib olyImageProcessingAttribs[] = {
0, 1, 0, 0, 0x0000, "ImageProcessingVersion", &stdInterpreter,
0, 1, 0, 0, 0x0100, "WB_RBLevels", &stdInterpreter,
0, 1, 0, 0, 0x0102, "WB_RBLevels3000K", &stdInterpreter,
0, 1, 0, 0, 0x0103, "WB_RBLevels3300K", &stdInterpreter,
0, 1, 0, 0, 0x0104, "WB_RBLevels3600K", &stdInterpreter,
0, 1, 0, 0, 0x0105, "WB_RBLevels3900K", &stdInterpreter,
0, 1, 0, 0, 0x0106, "WB_RBLevels4000K", &stdInterpreter,
0, 1, 0, 0, 0x0107, "WB_RBLevels4300K", &stdInterpreter,
0, 1, 0, 0, 0x0108, "WB_RBLevels4500K", &stdInterpreter,
0, 1, 0, 0, 0x0109, "WB_RBLevels4800K", &stdInterpreter,
0, 1, 0, 0, 0x010a, "WB_RBLevels5300K", &stdInterpreter,
0, 1, 0, 0, 0x010b, "WB_RBLevels6000K", &stdInterpreter,
0, 1, 0, 0, 0x010c, "WB_RBLevels6600K", &stdInterpreter,
0, 1, 0, 0, 0x010d, "WB_RBLevels7500K", &stdInterpreter,
0, 1, 0, 0, 0x010e, "WB_RBLevelsCWB1", &stdInterpreter,
0, 1, 0, 0, 0x010f, "WB_RBLevelsCWB2", &stdInterpreter,
0, 1, 0, 0, 0x0110, "WB_RBLevelsCWB3", &stdInterpreter,
0, 1, 0, 0, 0x0111, "WB_RBLevelsCWB4", &stdInterpreter,
0, 1, 0, 0, 0x0113, "WB_GLevel3000K", &stdInterpreter,
0, 1, 0, 0, 0x0114, "WB_GLevel3300K", &stdInterpreter,
0, 1, 0, 0, 0x0115, "WB_GLevel3600K", &stdInterpreter,
0, 1, 0, 0, 0x0116, "WB_GLevel3900K", &stdInterpreter,
0, 1, 0, 0, 0x0117, "WB_GLevel4000K", &stdInterpreter,
0, 1, 0, 0, 0x0118, "WB_GLevel4300K", &stdInterpreter,
0, 1, 0, 0, 0x0119, "WB_GLevel4500K", &stdInterpreter,
0, 1, 0, 0, 0x011a, "WB_GLevel4800K", &stdInterpreter,
0, 1, 0, 0, 0x011b, "WB_GLevel5300K", &stdInterpreter,
0, 1, 0, 0, 0x011c, "WB_GLevel6000K", &stdInterpreter,
0, 1, 0, 0, 0x011d, "WB_GLevel6600K", &stdInterpreter,
0, 1, 0, 0, 0x011e, "WB_GLevel7500K", &stdInterpreter,
0, 1, 0, 0, 0x011f, "WB_GLevel", &stdInterpreter,
0, 1, 0, 0, 0x0200, "ColorMatrix", &stdInterpreter,
0, 1, 0, 0, 0x0300, "Enhancer", &stdInterpreter,
0, 1, 0, 0, 0x0301, "EnhancerValues", &stdInterpreter,
0, 1, 0, 0, 0x0310, "CoringFilter", &stdInterpreter,
0, 1, 0, 0, 0x0311, "CoringValues", &stdInterpreter,
0, 1, 0, 0, 0x0600, "BlackLevel2", &stdInterpreter,
0, 1, 0, 0, 0x0610, "GainBase", &stdInterpreter,
0, 1, 0, 0, 0x0611, "ValidBits", &stdInterpreter,
0, 1, 0, 0, 0x0612, "CropLeft", &stdInterpreter,
0, 1, 0, 0, 0x0613, "CropTop", &stdInterpreter,
0, 1, 0, 0, 0x0614, "CropWidth", &stdInterpreter,
0, 1, 0, 0, 0x0615, "CropHeight", &stdInterpreter,
0, 1, 0, 0, 0x1010, "NoiseReduction2", &stdInterpreter,
0, 1, 0, 0, 0x1011, "DistortionCorrection2", &olOnOffInterpreter,
0, 1, 0, 0, 0x1012, "ShadingCompensation2", &olOnOffInterpreter,
1, 1, 0, 0, 0x1103, "UnknownBlock", &stdInterpreter,
0, 1, 0, 0, 0x1200, "FaceDetect", &olOnOffInterpreter,
0, 1, 0, 0, 0x1201, "FaceDetectArea", &stdInterpreter,
-1, 0, 0, 0, 0, "", NULL};
const TagAttrib olyRawDevelopmentAttribs[] = {
0, 1, 0, 0, 0x0000, "RawDevVersion", &stdInterpreter,
0, 1, 0, 0, 0x0100, "RawDevExposureBiasValue", &stdInterpreter,
0, 1, 0, 0, 0x0101, "RawDevWhiteBalanceValue", &stdInterpreter,
0, 1, 0, 0, 0x0102, "RawDevWBFineAdjustment", &stdInterpreter,
0, 1, 0, 0, 0x0103, "RawDevGrayPoint", &stdInterpreter,
0, 1, 0, 0, 0x0104, "RawDevSaturationEmphasis", &stdInterpreter,
0, 1, 0, 0, 0x0105, "RawDevMemoryColorEmphasis", &stdInterpreter,
0, 1, 0, 0, 0x0106, "RawDevContrastValue", &stdInterpreter,
0, 1, 0, 0, 0x0107, "RawDevSharpnessValue", &stdInterpreter,
0, 1, 0, 0, 0x0108, "RawDevColorSpace", &olColorSpaceInterpreter,
0, 1, 0, 0, 0x0109, "RawDevEngine", &olDevEngineInterpreter,
0, 1, 0, 0, 0x010a, "RawDevNoiseReduction", &olNoiseReductionInterpreter,
0, 1, 0, 0, 0x010b, "RawDevEditStatus", &stdInterpreter,
0, 1, 0, 0, 0x010c, "RawDevSettings", &stdInterpreter,
-1, 0, 0, 0, 0, "", NULL};
const TagAttrib olyRawDevelopment2Attribs[] = {
0, 1, 0, 0, 0x0000, "RawDevVersion", &stdInterpreter,
0, 1, 0, 0, 0x0100, "RawDevExposureBiasValue", &stdInterpreter,
0, 1, 0, 0, 0x0101, "RawDevWhiteBalance", &stdInterpreter,
0, 1, 0, 0, 0x0102, "RawDevWhiteBalanceValue", &stdInterpreter,
0, 1, 0, 0, 0x0103, "RawDevWBFineAdjustment", &stdInterpreter,
0, 1, 0, 0, 0x0104, "RawDevGrayPoint", &stdInterpreter,
0, 1, 0, 0, 0x0105, "RawDevContrastValue", &stdInterpreter,
0, 1, 0, 0, 0x0106, "RawDevSharpnessValue", &stdInterpreter,
0, 1, 0, 0, 0x0107, "RawDevSaturationEmphasis", &stdInterpreter,
0, 1, 0, 0, 0x0108, "RawDevMemoryColorEmphasis", &stdInterpreter,
0, 1, 0, 0, 0x0109, "RawDevColorSpace", &olColorSpaceInterpreter,
0, 1, 0, 0, 0x010a, "RawDevNoiseReduction", &olNoiseReductionInterpreter,
0, 1, 0, 0, 0x010b, "RawDevEngine", &olDevEngineInterpreter,
0, 1, 0, 0, 0x010c, "RawDevPictureMode", &olPictureModeInterpreter,
0, 1, 0, 0, 0x010d, "RawDevPMSaturation", &stdInterpreter,
0, 1, 0, 0, 0x010e, "RawDevPMContrast", &stdInterpreter,
0, 1, 0, 0, 0x010f, "RawDevPMSharpness", &stdInterpreter,
0, 1, 0, 0, 0x0110, "RawDevPM_BWFilter", &olPictureModeBWFilterInterpreter,
0, 1, 0, 0, 0x0111, "RawDevPMPictureTone", &olPictureModeToneInterpreter,
0, 1, 0, 0, 0x0112, "RawDevGradation", &stdInterpreter,
0, 1, 0, 0, 0x0113, "RawDevSaturation3", &stdInterpreter,
0, 1, 0, 0, 0x0119, "RawDevAutoGradation", &olOnOffInterpreter,
0, 1, 0, 0, 0x0120, "RawDevPMNoiseFilter", &stdInterpreter,
-1, 0, 0, 0, 0, "", NULL};
const TagAttrib olyCameraSettingsAttribs[] = {
0, 1, 0, 0, 0x0000, "CameraSettingsVersion", &stdInterpreter,
1, 1, 0, 0, 0x0100, "PreviewImageValid", &olYesNoInterpreter,
1, 1, 0, 0, 0x0101, "PreviewImageStart", &stdInterpreter,
1, 1, 0, 0, 0x0102, "PreviewImageLength", &stdInterpreter,
0, 1, 0, 0, 0x0200, "ExposureMode", &olExposureModeInterpreter,
0, 1, 0, 0, 0x0201, "AELock", &olOnOffInterpreter,
0, 1, 0, 0, 0x0202, "MeteringMode", &olMeteringModeInterpreter,
0, 1, 0, 0, 0x0300, "MacroMode", &olOnOffInterpreter,
0, 1, 0, 0, 0x0301, "FocusMode", &olFocusModeInterpreter,
0, 1, 0, 0, 0x0302, "FocusProcess", &stdInterpreter,
0, 1, 0, 0, 0x0303, "AFSearch", &stdInterpreter,
0, 1, 0, 0, 0x0304, "AFAreas", &stdInterpreter,
0, 1, 0, 0, 0x0400, "FlashMode", &stdInterpreter,
0, 1, 0, 0, 0x0401, "FlashExposureComp", &stdInterpreter,
0, 1, 0, 0, 0x0500, "WhiteBalance2", &olWhitebalance2Interpreter,
0, 1, 0, 0, 0x0501, "WhiteBalanceTemperature", &stdInterpreter,
0, 1, 0, 0, 0x0502, "WhiteBalanceBracket", &stdInterpreter,
0, 1, 0, 0, 0x0503, "CustomSaturation", &stdInterpreter,
0, 1, 0, 0, 0x0504, "ModifiedSaturation", &stdInterpreter,
0, 1, 0, 0, 0x0505, "ContrastSetting", &stdInterpreter,
0, 1, 0, 0, 0x0506, "SharpnessSetting", &stdInterpreter,
0, 1, 0, 0, 0x0507, "ColorSpace", &olColorSpaceInterpreter,
0, 1, 0, 0, 0x0509, "SceneMode", &olSceneModeInterpreter,
0, 1, 0, 0, 0x050a, "NoiseReduction", &olNoiseReductionInterpreter,
0, 1, 0, 0, 0x050b, "DistortionCorrection", &olOnOffInterpreter,
0, 1, 0, 0, 0x050c, "ShadingCompensation", &olOnOffInterpreter,
0, 1, 0, 0, 0x050d, "CompressionFactor", &stdInterpreter,
0, 1, 0, 0, 0x050f, "Gradation", &stdInterpreter,
0, 1, 0, 0, 0x0520, "PictureMode", &olPictureModeInterpreter,
0, 1, 0, 0, 0x0521, "PictureModeSaturation", &stdInterpreter,
0, 1, 0, 0, 0x0522, "PictureModeHue", &stdInterpreter,
0, 1, 0, 0, 0x0523, "PictureModeContrast", &stdInterpreter,
0, 1, 0, 0, 0x0524, "PictureModeSharpness", &stdInterpreter,
0, 1, 0, 0, 0x0525, "PictureModeBWFilter", &olPictureModeBWFilterInterpreter,
0, 1, 0, 0, 0x0526, "PictureModeTone", &olPictureModeToneInterpreter,
0, 1, 0, 0, 0x0527, "NoiseFilter", &olNoiseFilterInterpreter,
0, 1, 0, 0, 0x0600, "DriveMode", &stdInterpreter,
0, 1, 0, 0, 0x0601, "PanoramaMode", &stdInterpreter,
0, 1, 0, 0, 0x0603, "ImageQuality2", &olImageQuality2Interpreter,
0, 1, 0, 0, 0x0900, "ManometerPressure", &stdInterpreter,
0, 1, 0, 0, 0x0901, "ManometerReading", &stdInterpreter,
0, 1, 0, 0, 0x0902, "ExtendedWBDetect", &olOnOffInterpreter,
-1, 0, 0, 0, 0, "", NULL};
const TagAttrib olyEquipmentAttribs[] = {
0, 1, 0, 0, 0x0000, "EquipmentVersion", &stdInterpreter,
0, 1, 0, 0, 0x0100, "CameraType2", &stdInterpreter,
0, 1, 0, 0, 0x0101, "SerialNumber", &stdInterpreter,
0, 1, 0, 0, 0x0102, "InternalSerialNumber", &stdInterpreter,
0, 1, 0, 0, 0x0103, "FocalPlaneDiagonal", &stdInterpreter,
0, 1, 0, 0, 0x0104, "BodyFirmwareVersion", &stdInterpreter,
0, 1, 0, 0, 0x0201, "LensType", &olLensTypeInterpreter,
0, 1, 0, 0, 0x0202, "LensSerialNumber", &stdInterpreter,
0, 1, 0, 0, 0x0204, "LensFirmwareVersion", &stdInterpreter,
0, 1, 0, 0, 0x0205, "MaxApertureAtMinFocal", &olApertureInterpreter,
0, 1, 0, 0, 0x0206, "MaxApertureAtMaxFocal", &olApertureInterpreter,
0, 1, 0, 0, 0x0207, "MinFocalLength", &stdInterpreter,
0, 1, 0, 0, 0x0208, "MaxFocalLength", &stdInterpreter,
0, 1, 0, 0, 0x020a, "MaxApertureAtCurrentFocal", &olApertureInterpreter,
0, 1, 0, 0, 0x020b, "LensProperties", &stdInterpreter,
0, 1, 0, 0, 0x0301, "Extender", &stdInterpreter,
0, 1, 0, 0, 0x0302, "ExtenderSerialNumber", &stdInterpreter,
0, 1, 0, 0, 0x0303, "ExtenderModel", &stdInterpreter,
0, 1, 0, 0, 0x0304, "ExtenderFirmwareVersion", &stdInterpreter,
0, 1, 0, 0, 0x1000, "FlashType", &olFlashTypeInterpreter,
0, 1, 0, 0, 0x1001, "FlashModel", &olFlashModelInterpreter,
0, 1, 0, 0, 0x1002, "FlashFirmwareVersion", &stdInterpreter,
0, 1, 0, 0, 0x1003, "FlashSerialNumber", &stdInterpreter,
-1, 0, 0, 0, 0, "", NULL};
const TagAttrib olympusAttribs[] = {
0, 1, 0, 0, 0x0104, "BodyFirmwareVersion", &stdInterpreter,
0, 1, 0, 0, 0x0200, "SpecialMode", &stdInterpreter,
0, 1, 0, 0, 0x0201, "Quality", &stdInterpreter,
0, 1, 0, 0, 0x0202, "Macro", &olOnOffInterpreter,
0, 1, 0, 0, 0x0203, "BWMode", &olOnOffInterpreter,
0, 1, 0, 0, 0x0204, "DigitalZoom", &stdInterpreter,
0, 1, 0, 0, 0x0205, "FocalPlaneDiagonal", &stdInterpreter,
0, 1, 0, 0, 0x0206, "LensDistortionParams", &stdInterpreter,
0, 1, 0, 0, 0x0207, "CameraType", &stdInterpreter,
1, 1, 0, 0, 0x0208, "TextInfo", &stdInterpreter,
0, 1, 0, 0, 0x0209, "CameraID", &stdInterpreter,
0, 1, 0, 0, 0x020b, "EpsonImageWidth", &stdInterpreter,
0, 1, 0, 0, 0x020c, "EpsonImageHeight", &stdInterpreter,
0, 1, 0, 0, 0x020d, "EpsonSoftware", &stdInterpreter,
0, 2, 0, 0, 0x0280, "PreviewImage", &stdInterpreter,
0, 1, 0, 0, 0x0300, "PreCaptureFrames", &stdInterpreter,
0, 1, 0, 0, 0x0301, "WhiteBoard", &stdInterpreter,
0, 1, 0, 0, 0x0302, "OneTouchWB", &olOnOffInterpreter,
0, 1, 0, 0, 0x0303, "WhiteBalanceBracket", &stdInterpreter,
0, 1, 0, 0, 0x0304, "WhiteBalanceBias", &stdInterpreter,
0, 1, 0, 0, 0x0403, "SceneMode", &stdInterpreter,
0, 1, 0, 0, 0x0404, "SerialNumber", &stdInterpreter,
0, 1, 0, 0, 0x0405, "Firmware", &stdInterpreter,
1, 1, 0, 0, 0x0e00, "PrintIM", &stdInterpreter,
0, 1, 0, 0, 0x0f00, "DataDump", &stdInterpreter,
0, 1, 0, 0, 0x0f01, "DataDump2", &stdInterpreter,
0, 1, 0, 0, 0x1000, "ShutterSpeedValue", &stdInterpreter,
0, 1, 0, 0, 0x1001, "ISOValue", &stdInterpreter,
0, 1, 0, 0, 0x1002, "ApertureValue", &stdInterpreter,
0, 1, 0, 0, 0x1003, "BrightnessValue", &stdInterpreter,
0, 1, 0, 0, 0x1004, "FlashMode", &stdInterpreter,
0, 1, 0, 0, 0x1005, "FlashDevice", &stdInterpreter,
0, 1, 0, 0, 0x1006, "ExposureCompensation", &stdInterpreter,
0, 1, 0, 0, 0x1007, "SensorTemperature", &stdInterpreter,
0, 1, 0, 0, 0x1008, "LensTemperature", &stdInterpreter,
0, 1, 0, 0, 0x1009, "LightCondition", &stdInterpreter,
0, 1, 0, 0, 0x100a, "FocusRange", &stdInterpreter,
0, 1, 0, 0, 0x100b, "FocusMode", &stdInterpreter,
0, 1, 0, 0, 0x100c, "ManualFocusDistance", &stdInterpreter,
0, 1, 0, 0, 0x100d, "ZoomStepCount", &stdInterpreter,
0, 1, 0, 0, 0x100e, "FocusStepCount", &stdInterpreter,
0, 1, 0, 0, 0x100f, "Sharpness", &stdInterpreter,
0, 1, 0, 0, 0x1010, "FlashChargeLevel", &stdInterpreter,
0, 1, 0, 0, 0x1011, "ColorMatrix", &stdInterpreter,
0, 1, 0, 0, 0x1012, "BlackLevel", &stdInterpreter,
0, 1, 0, 0, 0x1013, "ColorTemperatureBG", &stdInterpreter,
0, 1, 0, 0, 0x1014, "ColorTemperatureRG", &stdInterpreter,
0, 1, 0, 0, 0x1015, "WBMode", &stdInterpreter,
0, 1, 0, 0, 0x1017, "RedBalance", &stdInterpreter,
0, 1, 0, 0, 0x1018, "BlueBalance", &stdInterpreter,
0, 1, 0, 0, 0x1019, "ColorMatrixNumber", &stdInterpreter,
0, 1, 0, 0, 0x101a, "SerialNumber", &stdInterpreter,
0, 1, 0, 0, 0x101b, "ExternalFlashAE1_0", &stdInterpreter,
0, 1, 0, 0, 0x101c, "ExternalFlashAE2_0", &stdInterpreter,
0, 1, 0, 0, 0x101d, "InternalFlashAE1_0", &stdInterpreter,
0, 1, 0, 0, 0x101e, "InternalFlashAE2_0", &stdInterpreter,
0, 1, 0, 0, 0x101f, "ExternalFlashAE1", &stdInterpreter,
0, 1, 0, 0, 0x1020, "ExternalFlashAE2", &stdInterpreter,
0, 1, 0, 0, 0x1021, "InternalFlashAE1", &stdInterpreter,
0, 1, 0, 0, 0x1022, "InternalFlashAE2", &stdInterpreter,
0, 1, 0, 0, 0x1023, "FlashExposureComp", &stdInterpreter,
0, 1, 0, 0, 0x1024, "InternalFlashTable", &stdInterpreter,
0, 1, 0, 0, 0x1025, "ExternalFlashGValue", &stdInterpreter,
0, 1, 0, 0, 0x1026, "ExternalFlashBounce", &olYesNoInterpreter,
0, 1, 0, 0, 0x1027, "ExternalFlashZoom", &stdInterpreter,
0, 1, 0, 0, 0x1028, "ExternalFlashMode", &stdInterpreter,
0, 1, 0, 0, 0x1029, "Contrast", &stdInterpreter,
0, 1, 0, 0, 0x102a, "SharpnessFactor", &stdInterpreter,
0, 1, 0, 0, 0x102b, "ColorControl", &stdInterpreter,
0, 1, 0, 0, 0x102c, "ValidBits", &stdInterpreter,
0, 1, 0, 0, 0x102d, "CoringFilter", &stdInterpreter,
0, 1, 0, 0, 0x102e, "OlympusImageWidth", &stdInterpreter,
0, 1, 0, 0, 0x102f, "OlympusImageHeight", &stdInterpreter,
0, 1, 0, 0, 0x1030, "SceneDetect", &stdInterpreter,
0, 1, 0, 0, 0x1031, "SceneArea", &stdInterpreter,
0, 1, 0, 0, 0x1033, "SceneDetectData", &stdInterpreter,
0, 1, 0, 0, 0x1034, "CompressionRatio", &stdInterpreter,
1, 1, 0, 0, 0x1035, "PreviewImageValid", &olYesNoInterpreter,
1, 1, 0, 0, 0x1036, "PreviewImageStart", &stdInterpreter,
1, 1, 0, 0, 0x1037, "PreviewImageLength", &stdInterpreter,
0, 1, 0, 0, 0x1038, "AFResult", &stdInterpreter,
0, 1, 0, 0, 0x1039, "CCDScanMode", &stdInterpreter,
0, 1, 0, 0, 0x103a, "NoiseReduction", &olOnOffInterpreter,
0, 1, 0, 0, 0x103b, "InfinityLensStep", &stdInterpreter,
0, 1, 0, 0, 0x103c, "NearLensStep", &stdInterpreter,
0, 1, 0, 0, 0x103d, "LightValueCenter", &stdInterpreter,
0, 1, 0, 0, 0x103e, "LightValuePeriphery", &stdInterpreter,
0, 1, 0, 0, 0x103f, "FieldCount", &stdInterpreter,
0, 1, 0, olyEquipmentAttribs, 0x2010, "Equipment", &stdInterpreter,
0, 1, 0, olyCameraSettingsAttribs, 0x2020, "CameraSettings", &stdInterpreter,
0, 1, 0, olyRawDevelopmentAttribs, 0x2030, "RawDevelopment", &stdInterpreter,
0, 1, 0, olyRawDevelopment2Attribs, 0x2031, "RawDev2", &stdInterpreter,
0, 1, 0, olyImageProcessingAttribs, 0x2040, "ImageProcessing", &stdInterpreter,
0, 1, 0, olyFocusInfoAttribs, 0x2050, "FocusInfo", &stdInterpreter,
1, 1, 0, 0, 0x2100, "Olympus2100", &stdInterpreter,
1, 1, 0, 0, 0x2300, "Olympus2300", &stdInterpreter,
1, 1, 0, 0, 0x2400, "Olympus2400", &stdInterpreter,
1, 1, 0, 0, 0x2500, "Olympus2500", &stdInterpreter,
1, 1, 0, 0, 0x2600, "Olympus2600", &stdInterpreter,
1, 1, 0, 0, 0x2700, "Olympus2700", &stdInterpreter,
1, 1, 0, 0, 0x2800, "Olympus2800", &stdInterpreter,
1, 1, 0, 0, 0x2900, "Olympus2900", &stdInterpreter,
0, 1, 0, 0, 0x3000, "RawInfo", &stdInterpreter,
-1, 0, 0, 0, 0, "", NULL};
};
#endif

585
rtexif/pentaxattribs.cc Normal file
View File

@@ -0,0 +1,585 @@
/*
* This file is part of RawTherapee.
*
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
*
* RawTherapee is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* RawTherapee is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _PENTAXATTRIBS_
#define _PENTAXATTRIBS_
#include <rtexif.h>
#include <string>
#include <map>
#include <math.h>
#include <sstream>
#include <iomanip>
namespace rtexif {
class PAQualityInterpreter : public ChoiceInterpreter {
public:
PAQualityInterpreter () {
choices[0] = "Good";
choices[1] = "Better";
choices[2] = "Best";
choices[3] = "TIFF";
choices[4] = "RAW";
choices[5] = "Premium";
}
};
PAQualityInterpreter paQualityInterpreter;
class PAOnOffInterpreter : public ChoiceInterpreter {
public:
PAOnOffInterpreter () {
choices[0] = "Off";
choices[1] = "On";
}
};
PAOnOffInterpreter paOnOffInterpreter;
class PAPictureModeInterpreter : public ChoiceInterpreter {
public:
PAPictureModeInterpreter () {
choices[0] = "Program";
choices[1] = "Shutter Speed Priority";
choices[2] = "Program AE";
choices[3] = "Manual";
choices[5] = "Portrait";
choices[6] = "Landscape";
choices[8] = "Sport";
choices[9] = "Night Scene";
choices[11] = "Soft";
choices[12] = "Surf & Snow";
choices[13] = "Candlelight";
choices[14] = "Autumn";
choices[15] = "Macro";
choices[17] = "Fireworks";
choices[18] = "Text";
choices[19] = "Panorama";
choices[30] = "Self Portrait";
choices[31] = "Illustrations";
choices[33] = "Digital Filter";
choices[35] = "Night Scene Portrait";
choices[37] = "Museum";
choices[38] = "Food";
choices[39] = "Underwater";
choices[40] = "Green Mode";
choices[49] = "Light Pet";
choices[50] = "Dark Pet";
choices[51] = "Medium Pet";
choices[53] = "Underwater";
choices[54] = "Candlelight";
choices[55] = "Natural Skin Tone";
choices[56] = "Synchro Sound Record";
choices[58] = "Frame Composite";
choices[59] = "Report";
choices[60] = "Kids";
choices[61] = "Blur Reduction";
choices[65] = "Half-length Portrait";
}
};
PAPictureModeInterpreter paPictureModeInterpreter;
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";
}
};
PAFlashModeInterpreter paFlashModeInterpreter;
class PAFocusModeInterpreter : public ChoiceInterpreter {
public:
PAFocusModeInterpreter () {
choices[0] = "Normal";
choices[1] = "Macro";
choices[2] = "Infinity";
choices[3] = "Manual";
choices[4] = "Super Macro";
choices[5] = "Pan Focus";
choices[16] = "AF-S";
choices[17] = "AF-C";
choices[18] = "AF-A";
}
};
PAFocusModeInterpreter paFocusModeInterpreter;
class PAAFPointInterpreter : public ChoiceInterpreter {
public:
PAAFPointInterpreter () {
choices[1] = "Upper-left";
choices[2] = "Top";
choices[3] = "Upper-right";
choices[4] = "Left";
choices[5] = "Mid-left";
choices[6] = "Center";
choices[7] = "Mid-right";
choices[8] = "Right";
choices[9] = "Lower-left";
choices[10] = "Bottom";
choices[11] = "Lower-right";
choices[65532] = "Face Recognition AF";
choices[65533] = "Automatic Tracking AF";
choices[65534] = "Fixed Center";
choices[65535] = "Auto";
}
};
PAAFPointInterpreter paAFPointInterpreter;
class PAAFFocusInterpreter : public ChoiceInterpreter {
public:
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";
}
};
PAAFFocusInterpreter paAFFocusInterpreter;
class PAISOInterpreter : public ChoiceInterpreter {
public:
PAISOInterpreter () {
choices[3] = "50";
choices[4] = "64";
choices[5] = "80";
choices[6] = "100";
choices[7] = "125";
choices[8] = "160";
choices[9] = "200";
choices[10] = "250";
choices[11] = "320";
choices[12] = "400";
choices[13] = "500";
choices[14] = "640";
choices[15] = "800";
choices[16] = "1000";
choices[17] = "1250";
choices[18] = "1600";
choices[19] = "2000";
choices[20] = "2500";
choices[21] = "3200";
choices[50] = "50";
choices[100] = "100";
choices[200] = "200";
choices[258] = "50";
choices[259] = "70";
choices[260] = "100";
choices[261] = "140";
choices[262] = "200";
choices[263] = "280";
choices[264] = "400";
choices[265] = "560";
choices[266] = "800";
choices[267] = "1100";
choices[268] = "1600";
choices[269] = "2200";
choices[270] = "3200";
choices[400] = "400";
choices[800] = "800";
choices[1600] = "1600";
choices[3200] = "320";
}
};
PAISOInterpreter paISOInterpreter;
class PAMeteringModeInterpreter : public ChoiceInterpreter {
public:
PAMeteringModeInterpreter () {
choices[0] = "Multi-segment";
choices[1] = "Center-weighted average";
choices[2] = "Spot";
}
};
PAMeteringModeInterpreter paMeteringModeInterpreter;
class PAWhiteBalanceInterpreter : public ChoiceInterpreter {
public:
PAWhiteBalanceInterpreter () {
choices[0] = "Auto";
choices[1] = "Daylight";
choices[2] = "Shade";
choices[3] = "Fluorescent";
choices[4] = "Tungsten";
choices[5] = "Manual";
choices[6] = "DaylightFluorescent";
choices[7] = "DaywhiteFluorescent";
choices[8] = "WhiteFluorescent";
choices[9] = "Flash";
choices[10] = "Cloudy";
choices[17] = "Kelvin";
choices[65534] = "Unknown";
choices[65535] = "User Selected";
}
};
PAWhiteBalanceInterpreter paWhiteBalanceInterpreter;
class PAWhiteBalanceModeInterpreter : public ChoiceInterpreter {
public:
PAWhiteBalanceModeInterpreter () {
choices[1] = "Auto (Daylight)";
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[10] = "Auto (Cloudy)";
choices[65534] = "Preset (Fireworks?)";
choices[65535] = "User-Selected";
}
};
PAWhiteBalanceModeInterpreter paWhiteBalanceModeInterpreter;
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";
}
};
PASaturationInterpreter paSaturationInterpreter;
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";
}
};
PAContrastInterpreter paContrastInterpreter;
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";
}
};
PASharpnessInterpreter paSharpnessInterpreter;
class PALensTypeInterpreter : public ChoiceInterpreter {
public:
PALensTypeInterpreter () {
choices[256*0+ 0] = "M-42 or No Lens";
choices[256*1+ 0] = "K,M Lens";
choices[256*2+ 0] = "A Series Lens";
choices[256*3+ 0] = "SIGMA";
choices[256*3+ 17] = "smc PENTAX-FA SOFT 85mm F2.8";
choices[256*3+ 18] = "smc PENTAX-F 1.7X AF ADAPTER";
choices[256*3+ 19] = "smc PENTAX-F 24-50mm F4";
choices[256*3+ 20] = "smc PENTAX-F 35-80mm F4-5.6";
choices[256*3+ 21] = "smc PENTAX-F 80-200mm F4.7-5.6";
choices[256*3+ 22] = "smc PENTAX-F FISH-EYE 17-28mm F3.5-4.5";
choices[256*3+ 23] = "smc PENTAX-F 100-300mm F4.5-5.6";
choices[256*3+ 24] = "smc PENTAX-F 35-135mm F3.5-4.5";
choices[256*3+ 25] = "smc PENTAX-F 35-105mm F4-5.6 or SIGMA or Tokina";
choices[256*3+ 26] = "smc PENTAX-F* 250-600mm F5.6 ED[IF]";
choices[256*3+ 27] = "smc PENTAX-F 28-80mm F3.5-4.5";
choices[256*3+ 28] = "smc PENTAX-F 35-70mm F3.5-4.5";
choices[256*3+ 29] = "PENTAX-F 28-80mm F3.5-4.5 or SIGMA AF 18-125mm F3.5-5.6 DC";
choices[256*3+ 30] = "PENTAX-F 70-200mm F4-5.6";
choices[256*3+ 31] = "smc PENTAX-F 70-210mm F4-5.6";
choices[256*3+ 32] = "smc PENTAX-F 50mm F1.4";
choices[256*3+ 33] = "smc PENTAX-F 50mm F1.7";
choices[256*3+ 34] = "smc PENTAX-F 135mm F2.8 [IF]";
choices[256*3+ 35] = "smc PENTAX-F 28mm F2.8";
choices[256*3+ 36] = "SIGMA 20mm F1.8 EX DG ASPHERICAL RF";
choices[256*3+ 38] = "smc PENTAX-F* 300mm F4.5 ED[IF]";
choices[256*3+ 39] = "smc PENTAX-F* 600mm F4 ED[IF]";
choices[256*3+ 40] = "smc PENTAX-F MACRO 100mm F2.8";
choices[256*3+ 41] = "smc PENTAX-F MACRO 50mm F2.8 or Sigma 50mm F2,8 MACRO";
choices[256*3+ 44] = "Tamron 35-90mm F4 AF or various SIGMA models";
choices[256*3+ 46] = "SIGMA APO 70-200mm F2.8 EX";
choices[256*3+ 50] = "smc PENTAX-FA 28-70 F4 AL";
choices[256*3+ 51] = "SIGMA 28mm F1.8 EX DG ASPHERICAL MACRO";
choices[256*3+ 52] = "smc PENTAX-FA 28-200mm F3.8-5.6 AL[IF]";
choices[256*3+ 53] = "smc PENTAX-FA 28-80mm F3.5-5.6 AL";
choices[256*3+ 247] = "smc PENTAX-DA FISH-EYE 10-17mm F3.5-4.5 ED[IF]";
choices[256*3+ 248] = "smc PENTAX-DA 12-24mm F4 ED AL[IF]";
choices[256*3+ 250] = "smc PENTAX-DA 50-200mm F4-5.6 ED";
choices[256*3+ 251] = "smc PENTAX-DA 40mm F2.8 Limited";
choices[256*3+ 252] = "smc PENTAX-DA 18-55mm F3.5-5.6 AL";
choices[256*3+ 253] = "smc PENTAX-DA 14mm F2.8 ED[IF]";
choices[256*3+ 254] = "smc PENTAX-DA 16-45mm F4 ED AL";
choices[256*3+ 255] = "SIGMA";
choices[256*4+ 1] = "smc PENTAX-FA SOFT 28mm F2.8";
choices[256*4+ 2] = "smc PENTAX-FA 80-320mm F4.5-5.6";
choices[256*4+ 3] = "smc PENTAX-FA 43mm F1.9 Limited";
choices[256*4+ 6] = "smc PENTAX-FA 35-80mm F4-5.6";
choices[256*4+ 12] = "smc PENTAX-FA 50mm F1.4";
choices[256*4+ 15] = "smc PENTAX-FA 28-105mm F4-5.6 [IF]";
choices[256*4+ 16] = "TAMRON AF 80-210mm F4-5.6 (178D)";
choices[256*4+ 19] = "TAMRON SP AF 90mm F2.8 (172E)";
choices[256*4+ 20] = "smc PENTAX-FA 28-80mm F3.5-5.6";
choices[256*4+ 21] = "Cosina AF 100-300mm F5.6-6.7";
choices[256*4+ 22] = "TOKINA 28-80mm F3.5-5.6";
choices[256*4+ 23] = "smc PENTAX-FA 20-35mm F4 AL";
choices[256*4+ 24] = "smc PENTAX-FA 77mm F1.8 Limited";
choices[256*4+ 25] = "TAMRON SP AF 14mm F2.8";
choices[256*4+ 26] = "smc PENTAX-FA MACRO 100mm F3.5";
choices[256*4+ 27] = "TAMRON AF28-300mm F/3.5-6.3 LD Aspherical[IF] MACRO (285D)";
choices[256*4+ 28] = "smc PENTAX-FA 35mm F2 AL";
choices[256*4+ 29] = "TAMRON AF 28-200mm F/3.8-5.6 LD Super II MACRO (371D)";
choices[256*4+ 34] = "smc PENTAX-FA 24-90mm F3.5-4.5 AL[IF]";
choices[256*4+ 35] = "smc PENTAX-FA 100-300mm F4.7-5.8";
choices[256*4+ 36] = "TAMRON AF70-300mm F/4-5.6 LD MACRO";
choices[256*4+ 37] = "TAMRON SP AF 24-135mm F3.5-5.6 AD AL (190D)";
choices[256*4+ 38] = "smc PENTAX-FA 28-105mm F3.2-4.5 AL[IF]";
choices[256*4+ 39] = "smc PENTAX-FA 31mm F1.8AL Limited";
choices[256*4+ 41] = "TAMRON AF 28-200mm Super Zoom F3.8-5.6 Aspherical XR [IF] MACRO (A03)";
choices[256*4+ 43] = "smc PENTAX-FA 28-90mm F3.5-5.6";
choices[256*4+ 44] = "smc PENTAX-FA J 75-300mm F4.5-5.8 AL";
choices[256*4+ 45] = "TAMRON 28-300mm F3.5-6.3 Ultra zoom XR";
choices[256*4+ 46] = "smc PENTAX-FA J 28-80mm F3.5-5.6 AL";
choices[256*4+ 47] = "smc PENTAX-FA J 18-35mm F4-5.6 AL";
choices[256*4+ 49] = "TAMRON SP AF 28-75mm F2.8 XR Di (A09)";
choices[256*4+ 51] = "smc PENTAX-D FA 50mm F2.8 MACRO";
choices[256*4+ 52] = "smc PENTAX-D FA 100mm F2.8 MACRO";
choices[256*4+ 75] = "TAMRON SP AF 70-200 F2.8 Di LD [IF] Macro (A001)";
choices[256*4+ 229] = "smc PENTAX-DA 18-55mm F3.5-5.6 AL II";
choices[256*4+ 230] = "TAMRON SP AF 17-50mm F2.8 XR Di II";
choices[256*4+ 231] = "smc PENTAX-DA 18-250mm F3.5-6.3 ED AL [IF]";
choices[256*4+ 237] = "Samsung/Schneider D-XENOGON 10-17mm F3.5-4.5";
choices[256*4+ 239] = "Samsung D-XENON 12-24mm F4 ED AL [IF]";
choices[256*4+ 243] = "smc PENTAX-DA 70mm F2.4 Limited";
choices[256*4+ 244] = "smc PENTAX-DA 21mm F3.2 AL Limited";
choices[256*4+ 245] = "Schneider D-XENON 50-200mm";
choices[256*4+ 246] = "Schneider D-XENON 18-55mm";
choices[256*4+ 247] = "smc PENTAX-DA 10-17mm F3.5-4.5 ED [IF] Fisheye zoom";
choices[256*4+ 248] = "smc PENTAX-DA 12-24mm F4 ED AL [IF]";
choices[256*4+ 249] = "TAMRON XR DiII 18-200mm F3.5-6.3 (A14)";
choices[256*4+ 250] = "smc PENTAX-DA 50-200mm F4-5.6 ED";
choices[256*4+ 251] = "smc PENTAX-DA 40mm F2.8 Limited";
choices[256*4+ 252] = "smc PENTAX-DA 18-55mm F3.5-5.6 AL";
choices[256*4+ 253] = "smc PENTAX-DA 14mm F2.8 ED[IF]";
choices[256*4+ 254] = "smc PENTAX-DA 16-45mm F4 ED AL";
choices[256*5+ 1] = "smc PENTAX-FA* 24mm F2 AL[IF]";
choices[256*5+ 2] = "smc PENTAX-FA 28mm F2.8 AL";
choices[256*5+ 3] = "smc PENTAX-FA 50mm F1.7";
choices[256*5+ 4] = "smc PENTAX-FA 50mm F1.4";
choices[256*5+ 5] = "smc PENTAX-FA* 600mm F4 ED[IF]";
choices[256*5+ 6] = "smc PENTAX-FA* 300mm F4.5 ED[IF]";
choices[256*5+ 7] = "smc PENTAX-FA 135mm F2.8 [IF]";
choices[256*5+ 8] = "smc PENTAX-FA MACRO 50mm F2.8";
choices[256*5+ 9] = "smc PENTAX-FA MACRO 100mm F2.8";
choices[256*5+ 10] = "smc PENTAX-FA* 85mm F1.4 [IF]";
choices[256*5+ 11] = "smc PENTAX-FA* 200mm F2.8 ED[IF]";
choices[256*5+ 12] = "smc PENTAX-FA 28-80mm F3.5-4.7";
choices[256*5+ 13] = "smc PENTAX-FA 70-200mm F4-5.6";
choices[256*5+ 14] = "smc PENTAX-FA* 250-600mm F5.6 ED[IF]";
choices[256*5+ 15] = "smc PENTAX-FA 28-105mm F4-5.6";
choices[256*5+ 16] = "smc PENTAX-FA 100-300mm F4.5-5.6";
choices[256*5+ 98] = "smc PENTAX-FA 100-300mm F4.5-5.6";
choices[256*6+ 1] = "smc PENTAX-FA* 85mm F1.4 [IF]";
choices[256*6+ 2] = "smc PENTAX-FA* 200mm F2.8 ED[IF]";
choices[256*6+ 3] = "smc PENTAX-FA* 300mm F2.8 ED[IF]";
choices[256*6+ 4] = "smc PENTAX-FA* 28-70mm F2.8 AL";
choices[256*6+ 5] = "smc PENTAX-FA* 80-200mm F2.8 ED[IF]";
choices[256*6+ 6] = "smc PENTAX-FA* 28-70mm F2.8 AL";
choices[256*6+ 7] = "smc PENTAX-FA* 80-200mm F2.8 ED[IF]";
choices[256*6+ 8] = "smc PENTAX-FA 28-70mm F4AL";
choices[256*6+ 9] = "smc PENTAX-FA 20mm F2.8";
choices[256*6+ 10] = "smc PENTAX-FA* 400mm F5.6 ED[IF]";
choices[256*6+ 13] = "smc PENTAX-FA* 400mm F5.6 ED[IF]";
choices[256*6+ 14] = "smc PENTAX-FA* MACRO 200mm F4 ED[IF]";
choices[256*7+ 0] = "smc PENTAX-DA 21mm F3.2 AL Limited";
choices[256*7+ 75] = "TAMRON SP AF 70-200mm F2.8 Di LD [IF] Macro (A001)";
choices[256*7+ 217] = "smc PENTAX-DA 50-200mm F4-5.6 ED WR";
choices[256*7+ 218] = "smc PENTAX-DA 18-55mm F3.5-5.6 AL WR";
choices[256*7+ 220] = "TAMRON SP AF 10-24mm F3.5-4.5 Di II LD Aspherical [IF]";
choices[256*7+ 222] = "smc PENTAX-DA 18-55mm F3.5-5.6 AL II";
choices[256*7+ 223] = "Samsung D-XENON 18-55mm F3.5-5.6 II";
choices[256*7+ 224] = "smc PENTAX-DA 15mm F4 ED AL Limited";
choices[256*7+ 225] = "Samsung D-XENON 18-250mm F3.5-6.3";
choices[256*7+ 229] = "smc PENTAX-DA 18-55mm F3.5-5.6 AL II";
choices[256*7+ 230] = "TAMRON AF 17-50mm F2.8 XR Di-II LD (Model A16)";
choices[256*7+ 231] = "smc PENTAX-DA 18-250mm F3.5-6.3 ED AL [IF]";
choices[256*7+ 233] = "smc PENTAX-DA 35mm F2.8 Macro Limited";
choices[256*7+ 234] = "smc PENTAX-DA* 300mm F4 ED [IF] SDM (SDM unused)";
choices[256*7+ 235] = "smc PENTAX-DA* 200mm F2.8 ED [IF] SDM (SDM unused)";
choices[256*7+ 236] = "smc PENTAX-DA 55-300mm F4-5.8 ED";
choices[256*7+ 238] = "TAMRON AF 18-250mm F3.5-6.3 Di II LD Aspherical [IF] MACRO";
choices[256*7+ 241] = "smc PENTAX-DA* 50-135mm F2.8 ED [IF] SDM (SDM unused)";
choices[256*7+ 242] = "smc PENTAX-DA* 16-50mm F2.8 ED AL [IF] SDM (SDM unused)";
choices[256*7+ 243] = "smc PENTAX-DA 70mm F2.4 Limited";
choices[256*7+ 244] = "smc PENTAX-DA 21mm F3.2 AL Limited";
choices[256*8+ 226] = "smc PENTAX-DA* 55mm F1.4 SDM";
choices[256*8+ 227] = "smc PENTAX DA* 60-250mm F4 [IF] SDM";
choices[256*8+ 232] = "smc PENTAX-DA 17-70mm F4 AL [IF] SDM";
choices[256*8+ 234] = "smc PENTAX-DA* 300mm F4 ED [IF] SDM";
choices[256*8+ 235] = "smc PENTAX-DA* 200mm F2.8 ED [IF] SDM";
choices[256*8+ 241] = "smc PENTAX-DA* 50-135mm F2.8 ED [IF] SDM";
choices[256*8+ 242] = "smc PENTAX-DA* 16-50mm F2.8 ED AL [IF] SDM";
choices[256*8+ 255] = "Sigma 70-200mm F2.8 EX DG Macro HSM II or 150-500mm F5-6.3 DG OS";
}
virtual std::string toString (Tag* t) {
return choices[256*t->toInt(0,BYTE) + t->toInt(1,BYTE)];
}
};
PALensTypeInterpreter paLensTypeInterpreter;
class PASRInfoInterpreter : public Interpreter {
public:
PASRInfoInterpreter () { }
virtual std::string toString (Tag* t) {
std::ostringstream str;
int b = t->toInt(0,BYTE);
if (!b)
str << "SRResult = Not stabilized" << std::endl;
else if (b & 1)
str << "SRResult = Stabilized" << std::endl;
b = t->toInt(1,BYTE);
if (!b)
str << "ShakeReduction = Off" << std::endl;
else
str << "ShakeReduction = On" << std::endl;
str << "SRHalfPressTime = " << t->toInt(2,BYTE) << std::endl;
str << "SRFocalLength = " << t->toInt(3,BYTE);
return str.str();
}
};
PASRInfoInterpreter paSRInfoInterpreter;
const TagAttrib pentaxAttribs[] = {
0, 1, 0, 0, 0x0001, "PentaxVersion", &stdInterpreter,
0, 1, 0, 0, 0x0001, "PentaxModelType", &stdInterpreter,
0, 2, 0, 0, 0x0002, "PreviewImageSize", &stdInterpreter,
0, 2, 0, 0, 0x0003, "PreviewImageLength", &stdInterpreter,
0, 2, 0, 0, 0x0004, "PreviewImageStart", &stdInterpreter,
0, 1, 0, 0, 0x0005, "PentaxModelID", &stdInterpreter,
0, 1, 0, 0, 0x0006, "Date", &stdInterpreter,
0, 1, 0, 0, 0x0007, "Time", &stdInterpreter,
0, 1, 0, 0, 0x0008, "Quality", &paQualityInterpreter,
0, 1, 0, 0, 0x0009, "PentaxImageSize", &stdInterpreter,
0, 1, 0, 0, 0x000b, "PictureMode", &paPictureModeInterpreter,
0, 1, 0, 0, 0x000c, "FlashMode", &paFlashModeInterpreter,
0, 1, 0, 0, 0x000d, "FocusMode", &paFocusModeInterpreter,
0, 1, 0, 0, 0x000e, "AFPointSelected", &paAFPointInterpreter,
0, 1, 0, 0, 0x000f, "AFPointsInFocus", &paAFFocusInterpreter,
0, 1, 0, 0, 0x0010, "FocusPosition", &stdInterpreter,
0, 1, 0, 0, 0x0012, "ExposureTime", &stdInterpreter,
0, 1, 0, 0, 0x0013, "FNumber", &stdInterpreter,
0, 1, 0, 0, 0x0014, "ISO", &paISOInterpreter,
0, 1, 0, 0, 0x0015, "LightReading", &stdInterpreter,
0, 1, 0, 0, 0x0016, "ExposureCompensation", &stdInterpreter,
0, 1, 0, 0, 0x0017, "MeteringMode", &paMeteringModeInterpreter,
0, 1, 0, 0, 0x0018, "AutoBracketing", &stdInterpreter,
0, 1, 0, 0, 0x0019, "WhiteBalance", &paWhiteBalanceInterpreter,
0, 1, 0, 0, 0x001a, "WhiteBalanceMode", &paWhiteBalanceModeInterpreter,
0, 1, 0, 0, 0x001b, "BlueBalance", &stdInterpreter,
0, 1, 0, 0, 0x001c, "RedBalance", &stdInterpreter,
0, 1, 0, 0, 0x001d, "FocalLength", &stdInterpreter,
0, 1, 0, 0, 0x001e, "DigitalZoom", &stdInterpreter,
0, 1, 0, 0, 0x001f, "Saturation", &paSaturationInterpreter,
0, 1, 0, 0, 0x0020, "Contrast", &paContrastInterpreter,
0, 1, 0, 0, 0x0021, "Sharpness", &paSharpnessInterpreter,
0, 1, 0, 0, 0x0022, "WorldTimeLocation", &stdInterpreter,
0, 1, 0, 0, 0x0023, "HometownCity", &stdInterpreter,
0, 3, 0, 0, 0x0024, "DestinationCity", &stdInterpreter,
0, 3, 0, 0, 0x0025, "HometownDST", &stdInterpreter,
0, 1, 0, 0, 0x0026, "DestinationDST", &stdInterpreter,
0, 1, 0, 0, 0x0027, "DSPFirmwareVersion", &stdInterpreter,
0, 1, 0, 0, 0x0028, "CPUFirmwareVersion", &stdInterpreter,
0, 1, 0, 0, 0x0029, "FrameNumber", &stdInterpreter,
0, 1, 0, 0, 0x002d, "EffectiveLV", &stdInterpreter,
0, 1, 0, 0, 0x0032, "ImageProcessing", &stdInterpreter,
0, 1, 0, 0, 0x0033, "PictureMode", &stdInterpreter,
0, 1, 0, 0, 0x0034, "DriveMode", &stdInterpreter,
0, 1, 0, 0, 0x0037, "ColorSpace", &stdInterpreter,
0, 1, 0, 0, 0x0038, "ImageAreaOffset", &stdInterpreter,
0, 1, 0, 0, 0x0039, "RawImageSize", &stdInterpreter,
0, 1, 0, 0, 0x003c, "AFPointsInFocus", &stdInterpreter,
0, 1, 0, 0, 0x003e, "PreviewImageBorders", &stdInterpreter,
0, 1, 0, 0, 0x003f, "LensType", &paLensTypeInterpreter,
0, 1, 0, 0, 0x0040, "SensitivityAdjust", &stdInterpreter,
0, 1, 0, 0, 0x0041, "ImageProcessingCount", &stdInterpreter,
0, 1, 0, 0, 0x0047, "CameraTemperature", &stdInterpreter,
0, 1, 0, 0, 0x0048, "AELock", &paOnOffInterpreter,
0, 1, 0, 0, 0x0049, "NoiseReduction", &paOnOffInterpreter,
0, 1, 0, 0, 0x004d, "FlashExposureComp", &stdInterpreter,
0, 1, 0, 0, 0x004f, "ImageTone", &stdInterpreter,
0, 1, 0, 0, 0x0050, "ColorTemperature", &stdInterpreter,
0, 1, 0, 0, 0x005c, "ShakeReductionInfo", &paSRInfoInterpreter,
0, 1, 0, 0, 0x005d, "ShutterCount", &stdInterpreter,
0, 1, 0, 0, 0x0200, "BlackPoint", &stdInterpreter,
0, 1, 0, 0, 0x0201, "WhitePoint", &stdInterpreter,
0, 1, 0, 0, 0x0205, "ShotInfo", &stdInterpreter,
0, 1, 0, 0, 0x0206, "AEInfo", &stdInterpreter,
0, 1, 0, 0, 0x0207, "LensInfo", &stdInterpreter,
0, 1, 0, 0, 0x0208, "FlashInfo", &stdInterpreter,
0, 1, 0, 0, 0x0209, "AEMeteringSegments", &stdInterpreter,
0, 1, 0, 0, 0x020a, "FlashADump", &stdInterpreter,
0, 1, 0, 0, 0x020b, "FlashBDump", &stdInterpreter,
0, 1, 0, 0, 0x020d, "WB_RGGBLevelsDaylight", &stdInterpreter,
0, 1, 0, 0, 0x020e, "WB_RGGBLevelsShade", &stdInterpreter,
0, 1, 0, 0, 0x020f, "WB_RGGBLevelsCloudy", &stdInterpreter,
0, 1, 0, 0, 0x0210, "WB_RGGBLevelsTungsten", &stdInterpreter,
0, 1, 0, 0, 0x0211, "WB_RGGBLevelsFluorescentD", &stdInterpreter,
0, 1, 0, 0, 0x0212, "WB_RGGBLevelsFluorescentN", &stdInterpreter,
0, 1, 0, 0, 0x0213, "WB_RGGBLevelsFluorescentW", &stdInterpreter,
0, 1, 0, 0, 0x0214, "WB_RGGBLevelsFlash", &stdInterpreter,
0, 1, 0, 0, 0x0215, "CameraInfo", &stdInterpreter,
0, 1, 0, 0, 0x0216, "BatteryInfo", &stdInterpreter,
0, 1, 0, 0, 0x021f, "AFInfo", &stdInterpreter,
0, 1, 0, 0, 0x0222, "ColorInfo", &stdInterpreter,
0, 1, 0, 0, 0x03fe, "DataDump", &stdInterpreter,
0, 1, 0, 0, 0x03ff, "UnknownInfo", &stdInterpreter,
0, 1, 0, 0, 0x0402, "ToneCurve", &stdInterpreter,
0, 1, 0, 0, 0x0403, "ToneCurves", &stdInterpreter,
0, 1, 0, 0, 0x0e00, "PrintIM", &stdInterpreter,
-1, 0, 0, 0, 0, "", NULL};
};
#endif

1434
rtexif/rtexif.cc Normal file

File diff suppressed because it is too large Load Diff

249
rtexif/rtexif.h Normal file
View File

@@ -0,0 +1,249 @@
/*
* This file is part of RawTherapee.
*
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
*
* RawTherapee is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* RawTherapee is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _MEXIF3_
#define _MEXIF3_
#include <stdio.h>
#include <vector>
#include <map>
#include <string>
#include <stdlib.h>
namespace rtexif {
enum TagType {INVALID=0, BYTE=1, ASCII=2, SHORT=3, LONG=4, RATIONAL=5, UNDEFINED=7, SSHORT=8, SLONG=9, SRATIONAL=10, FLOAT=11, DOUBLE=12, OLYUNDEF=13, SUBDIR=99};
enum ActionCode {DONTWRITE=0, WRITE=1, SYSTEM=2};
enum ByteOrder {INTEL=0x4949, MOTOROLA=0x4D4D};
enum MNKind {NOMK, IFD, HEADERIFD, NIKON3, OLYMPUS2, FUJI};
struct TIFFHeader {
unsigned short byteOrder;
unsigned short fixed;
unsigned int ifdOffset;
};
class Tag;
class Interpreter;
// structure of informations describing an exif tag
struct TagAttrib {
int ignore; // =0: never ignore, =1: always ignore, =2: ignore if the subdir type is reduced image, =-1: end of table
int action; //=0: dont write it to the output, =1: write it to the output, =2: dont write, dont show, =3: write, dont show
int editable;
const TagAttrib* subdirAttribs; // =0 ->not subdir
unsigned short ID;
const char* name;
Interpreter* interpreter;
};
// a directory of tags
class TagDirectory {
protected:
std::vector<Tag*> tags; // tags in the directory
const TagAttrib* attribs; // descriptor table to decode the tags
ByteOrder order; // byte order
TagDirectory* parent; // parent directory (NULL if root)
public:
TagDirectory ();
TagDirectory (TagDirectory* p, FILE* f, int base, const TagAttrib* ta, ByteOrder border);
TagDirectory (TagDirectory* p, const TagAttrib* ta, ByteOrder border);
~TagDirectory ();
inline ByteOrder getOrder () const { return order; }
TagDirectory* getParent () { return parent; }
inline int getCount () const { return tags.size (); }
const TagAttrib* getAttrib (int id);
const TagAttrib* getAttrib (const char* name);
const TagAttrib* getAttribTable() { return attribs; }
Tag* getTag (const char* name);
Tag* getTag (int ID);
void addTag (Tag* a);
void addTagFront (Tag* a);
void replaceTag (Tag* a);
inline Tag* getTagByIndex (int ix) { return tags[ix]; }
inline void setOrder (ByteOrder bo) { order = bo; }
int calculateSize ();
int write (int start, unsigned char* buffer);
TagDirectory* clone (TagDirectory* parent);
void applyChange (std::string field, std::string value);
void printAll () const;
void sort ();
};
// a class representing a single tag
class Tag {
protected:
unsigned short tag;
TagType type;
unsigned int count;
unsigned char* value;
int valuesize;
bool keep;
const TagAttrib* attrib;
TagDirectory* parent;
TagDirectory** directory;
MNKind makerNoteKind;
public:
Tag (TagDirectory* parent, FILE* f, int base); // parse next tag from the file
Tag (TagDirectory* parent, const TagAttrib* attr);
Tag (TagDirectory* parent, const TagAttrib* attr, int data, TagType t); // create a new tag from array (used
Tag (TagDirectory* parent, const TagAttrib* attr, const char* data); // create a new tag from array (used
~Tag ();
void initInt (int data, TagType t, int count=1);
void initString (const char* text);
void initSubDir ();
void initMakerNote (MNKind mnk, const TagAttrib* ta);
void initUndefArray (const char* data, int len);
void initLongArray (const char* data, int len);
void initRational (int num, int den);
// get basic tag properties
int getID () const { return tag; }
int getCount () const { return count; }
TagType getType () const { return type; }
unsigned char* getValue () const { return value; }
const TagAttrib* getAttrib () const { return attrib; }
inline ByteOrder getOrder () const { return parent ? parent->getOrder() : INTEL; }
inline TagDirectory* getParent () const { return parent; }
int getValueSize () const { return valuesize; }
// read/write value
int toInt (int ofs=0, TagType astype=INVALID);
void fromInt (int v);
double toDouble (int ofs=0);
void toRational (int& num, int& denom, int ofs=0);
void toString (char* buffer, int ofs=0);
void fromString (const char* v, int size=-1);
void setInt (int v, int ofs=0, TagType astype=LONG);
// additional getter/setter for more confortable use
std::string valueToString ();
std::string nameToString (int i=0);
void valueFromString (const std::string& value);
// functions for writing
int calculateSize ();
int write (int offs, int dataOffs, unsigned char* buffer);
Tag* clone (TagDirectory* parent);
// to control if the tag shall be written
bool getKeep () { return keep; }
void setKeep (bool k) { keep = k; }
// get subdirectory (there can be several, the last is NULL)
bool isDirectory () { return directory!=NULL; }
TagDirectory* getDirectory (int i=0) { return directory[i]; }
MNKind getMakerNoteFormat () { return makerNoteKind; }
};
class ExifManager {
static std::vector<Tag*> defTags;
static Tag* saveCIFFMNTag (FILE* f, TagDirectory* root, int len, const char* name);
public:
static TagDirectory* parse (FILE*f, int base);
static TagDirectory* parseJPEG (FILE*f);
static TagDirectory* parseTIFF (FILE*f);
static TagDirectory* parseCIFF (FILE* f, int base, int length);
static void parseCIFF (FILE* f, int base, int length, TagDirectory* root);
static const std::vector<Tag*>& getDefaultTIFFTags (TagDirectory* forthis);
static int createJPEGMarker (const TagDirectory* root, const std::vector< std::pair<std::string,std::string> >& changeList, int W, int H, unsigned char* buffer);
static int createTIFFHeader (const TagDirectory* root, const std::vector< std::pair<std::string,std::string> >& changeList, int W, int H, int bps, const char* profiledata, int profilelen, const char* iptcdata, int iptclen, unsigned char* buffer);
};
class Interpreter {
protected:
char buffer[1024];
public:
Interpreter () {}
virtual std::string toString (Tag* t) { return ""; }
virtual void fromString (Tag* t, const std::string& value) {}
};
class StdInterpreter : public Interpreter {
public:
StdInterpreter () {}
virtual std::string toString (Tag* t) {
t->toString (buffer);
std::string s(buffer);
std::string::size_type p1 = s.find_first_not_of(' ');
if( p1 == std::string::npos )
return s;
else
return s.substr(p1, s.find_last_not_of(' ')-p1+1);
}
virtual void fromString (Tag* t, const std::string& value) {
if (t->getType()==SHORT || t->getType()==LONG)
t->fromInt (atoi(value.c_str()));
else
t->fromString (value.c_str());
}
};
extern StdInterpreter stdInterpreter;
class ChoiceInterpreter : public Interpreter {
protected:
std::map<int,std::string> choices;
public:
ChoiceInterpreter () {};
virtual std::string toString (Tag* t) {
std::map<int,std::string>::iterator r = choices.find (t->toInt());
if (r!=choices.end())
return r->second;
else {
t->toString (buffer);
return std::string (buffer);
}
}
};
inline unsigned short sget2 (unsigned char *s, ByteOrder order);
inline int sget4 (unsigned char *s, ByteOrder order);
inline unsigned short get2 (FILE* f, ByteOrder order);
inline int get4 (FILE* f, ByteOrder order);
inline void sset2 (unsigned short v, unsigned char *s, ByteOrder order);
inline void sset4 (int v, unsigned char *s, ByteOrder order);
inline float int_to_float (int i);
inline short int int2_to_signed (short unsigned int i);
bool extractLensInfo(std::string &fullname,double &minFocal, double &maxFocal, double &maxApertureAtMinFocal, double &maxApertureAtMaxFocal);
extern const TagAttrib exifAttribs[];
extern const TagAttrib gpsAttribs[];
extern const TagAttrib iopAttribs[];
extern const TagAttrib ifdAttribs[];
extern const TagAttrib nikon2Attribs[];
extern const TagAttrib nikon3Attribs[];
extern const TagAttrib canonAttribs[];
extern const TagAttrib pentaxAttribs[];
extern const TagAttrib fujiAttribs[];
extern const TagAttrib minoltaAttribs[];
extern const TagAttrib sonyAttribs[];
extern const TagAttrib olympusAttribs[];
};
#endif

View File

@@ -0,0 +1,616 @@
/*
* This file is part of RawTherapee.
*
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
*
* RawTherapee is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* RawTherapee is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _SONYMINOLTAATTRIBS_
#define _SONYMINOLTAATTRIBS_
#include <rtexif.h>
#include <string>
#include <map>
#include <math.h>
#include <sstream>
#include <iomanip>
#undef ABS
#define ABS(a) (((a) < 0) ? -(a) : (a))
namespace rtexif {
class SAOnOffInterpreter : public ChoiceInterpreter {
public:
SAOnOffInterpreter () {
choices[0] = "Off";
choices[1] = "On";
choices[5] = "On";
}
};
SAOnOffInterpreter saOnOffInterpreter;
class SASceneModeInterpreter : public ChoiceInterpreter {
public:
SASceneModeInterpreter () {
choices[0] = "Normal (P,A,S or M)";
choices[1] = "Portrait";
choices[2] = "Text";
choices[3] = "Night Scene";
choices[4] = "Sunset";
choices[5] = "Sports";
choices[6] = "Landscape";
choices[8] = "Macro";
choices[8] = "Super Macro";
choices[16] = "Auto";
choices[17] = "Night Portrait";
}
};
SASceneModeInterpreter saSceneModeInterpreter;
class SAZoneMatchingInterpreter : public ChoiceInterpreter {
public:
SAZoneMatchingInterpreter () {
choices[0] = "ISO Setting Used";
choices[1] = "High Key";
choices[2] = "Low Key";
}
};
SAZoneMatchingInterpreter saZoneMatchingInterpreter;
class SADynamicRangeOptimizerInterpreter : public ChoiceInterpreter {
public:
SADynamicRangeOptimizerInterpreter () {
choices[0] = "Off";
choices[1] = "Standard";
choices[2] = "Advanced";
choices[3] = "Auto";
choices[8] = "Advanced Lv1";
choices[9] = "Advanced Lv2";
choices[10] = "Advanced Lv3";
choices[11] = "Advanced Lv4";
choices[12] = "Advanced Lv5";
}
};
SADynamicRangeOptimizerInterpreter saDynamicRangeOptimizerInterpreter;
class SAColorModeInterpreter : public ChoiceInterpreter {
public:
SAColorModeInterpreter () {
choices[0] = "Standard";
choices[1] = "Vivid";
choices[2] = "Portrait";
choices[3] = "Landscape";
choices[4] = "Sunset";
choices[5] = "Night Scene";
choices[6] = "B&W";
choices[7] = "Adobe RGB";
choices[12] = "Neutral";
choices[100]= "Neutral";
choices[101]= "Clear";
choices[102]= "Deep";
choices[103]= "Light";
choices[104]= "Night View";
choices[105]= "Autumn Leaves";
}
};
SAColorModeInterpreter saColorModeInterpreter;
class SAExposureModeInterpreter : public ChoiceInterpreter {
public:
SAExposureModeInterpreter () {
choices[0] = "Auto";
choices[5] = "Landscape";
choices[6] = "Program";
choices[7] = "Aperture Priority";
choices[8] = "Shutter Priority";
choices[9] = "Night Scene";
choices[15] = "Manual";
choices[34] = "Panorama";
choices[35] = "Handheld Twilight";
choices[36] = "Anti Motion Blur";
}
};
SAExposureModeInterpreter saExposureModeInterpreter;
class SAQualityInterpreter : public ChoiceInterpreter {
public:
SAQualityInterpreter () {
choices[0] = "Normal";
choices[1] = "Fine";
}
};
SAQualityInterpreter saQualityInterpreter;
class SAAntiBlurInterpreter : public ChoiceInterpreter {
public:
SAAntiBlurInterpreter () {
choices[0] = "Off";
choices[1] = "On (Continuous)";
choices[2] = "On (Shooting)";
choices[65535] = "n/a";
}
};
SAAntiBlurInterpreter saAntiBlurInterpreter;
class SALensIDInterpreter : public Interpreter {
typedef std::multimap<int, std::string> container_t;
typedef std::pair<int,std::string> p_t;
protected:
container_t choices;
public:
SALensIDInterpreter () {
choices.insert(p_t(0, "Minolta AF 28-85mm f/3.5-4.5"));
choices.insert(p_t(1, "Minolta AF 80-200mm f/2.8 HS-APO G"));
choices.insert(p_t(2, "Minolta AF 28-70mm f/2.8 G"));
choices.insert(p_t(3, "Minolta AF 28-80mm f/4-5.6"));
choices.insert(p_t(5, "Minolta AF 35-70mm f/3.5-4.5"));
choices.insert(p_t(6, "Minolta AF 24-85mm f/3.5-4.5 [New]"));
choices.insert(p_t(7, "Minolta AF 100-300mm f/4.5-5.6 APO [New]"));
choices.insert(p_t(7, "Sigma AF 100-300mm f/4 EX DG IF"));
choices.insert(p_t(8, "Minolta AF 70-210mm f/4.5-5.6"));
choices.insert(p_t(9, "Minolta AF 50mm f/3.5 Macro"));
choices.insert(p_t(10, "Minolta AF 28-105mm f/3.5-4.5 [New]"));
choices.insert(p_t(11, "Minolta AF 300mm f/4 HS-APO G"));
choices.insert(p_t(12, "Minolta AF 100mm f/2.8 Soft Focus"));
choices.insert(p_t(13, "Minolta AF 75-300mm f/4.5-5.6"));
choices.insert(p_t(14, "Minolta AF 100-400mm f/4.5-6.7 APO"));
choices.insert(p_t(15, "Minolta AF 400mm f/4.5 HS-APO G"));
choices.insert(p_t(16, "Minolta AF 17-35mm f/3.5 G"));
choices.insert(p_t(17, "Minolta AF 20-35mm f/3.5-4.5"));
choices.insert(p_t(18, "Minolta AF 28-80mm f/3.5-5.6 II"));
choices.insert(p_t(19, "Minolta AF 35mm f/1.4"));
choices.insert(p_t(20, "Minolta/Sony STF 135mm F2.8 [T4.5]"));
choices.insert(p_t(22, "Minolta AF 35-80mm f/4-5.6"));
choices.insert(p_t(23, "Minolta AF 200mm f/4 G APO Macro"));
choices.insert(p_t(24, "Minolta/Sony AF 24-105mm f/3.5-4.5 (D)"));
choices.insert(p_t(24, "Sigma 18-50mm f/2.8 EX DC Macro"));
choices.insert(p_t(24, "Sigma 17-70mm f/2.8-4.5 DC Macro"));
choices.insert(p_t(24, "Sigma 20-40mm f/2.8 EX DG Aspherical IF"));
choices.insert(p_t(24, "Sigma 18-200mm f/3.5-6.3 DC"));
choices.insert(p_t(24, "Tamron SP AF 28-75mm f/2.8 XR Di (IF) Macro"));
choices.insert(p_t(25, "Minolta AF 100-300mm f/4.5-5.6 APO D"));
choices.insert(p_t(25, "Sigma 100-300mm f/4 EX DG APO"));
choices.insert(p_t(25, "Sigma 70mm f/2.8 EX DG Macro"));
choices.insert(p_t(25, "Sigma 20mm f/1.8 EX DG Aspherical RF"));
choices.insert(p_t(25, "Sigma 30mm f/1.4 EX DG"));
choices.insert(p_t(27, "Minolta AF 85mm f71.4 G"));
choices.insert(p_t(28, "Minolta AF 100mm f/2.8 Macro (D)"));
choices.insert(p_t(28, "Tamron SP AF 90mm f/2.8 Di Macro "));
choices.insert(p_t(29, "Minolta AF 75-300mm f/4.5-5.6 (D)"));
choices.insert(p_t(30, "Minolta AF 28-80mm f/3.5-5.6 (D)"));
choices.insert(p_t(30, "Sigma 10-20mm f/4-5.6 EX DC"));
choices.insert(p_t(30, "Sigma 12-24mm f/4.5-5.6 EX DG"));
choices.insert(p_t(30, "Sigma 28-70mm f/2.8 EX DG"));
choices.insert(p_t(30, "Sigma 55-200mm f/4-5.6 DC"));
choices.insert(p_t(31, "Minolta/Sony AF 50mm f/2.8 Macro (D)"));
choices.insert(p_t(32, "Minolta AF 300mm f/2.8 G"));
choices.insert(p_t(33, "Minolta/Sony AF 70-200mm f/2.8 G (D) SSM"));
choices.insert(p_t(35, "Minolta AF 85mm f/1.4 G (D) Limited"));
choices.insert(p_t(36, "Minolta AF 28-100mm f/3.5-5.6 (D)"));
choices.insert(p_t(38, "Minolta AF 17-35mm f/2.8-4 (D)"));
choices.insert(p_t(39, "Minolta AF 28-75mm f/2.8 (D)"));
choices.insert(p_t(40, "Minolta/Sony AF DT 18-70mm f/3.5-5.6 (D)"));
choices.insert(p_t(41, "Minolta/Sony AF DT 11-18mm f/4.5-5.6 (D)"));
choices.insert(p_t(42, "Minolta AF DT 18-200mm f/3.5-6.3 (D)"));
choices.insert(p_t(43, "Minolta AF 35mm f/1.4 G"));
choices.insert(p_t(44, "Sony AF 50mm f/1.4"));
choices.insert(p_t(45, "Carl Zeiss Planar T* 85mm f/1.4 ZA"));
choices.insert(p_t(46, "Carl Zeiss Vario-Sonnar T* DT 16-80mm f/3.5-4.5 ZA"));
choices.insert(p_t(47, "Carl Zeiss Sonnar T* 135mm F1.8 ZA"));
choices.insert(p_t(48, "Carl Zeiss Vario-Sonnar T* 24-70mm f/2.8 ZA SSM"));
choices.insert(p_t(49, "Sony AF DT 55-200mm f/4-5.6"));
choices.insert(p_t(50, "Sony AF DT 18-250mm f/3.5-6.3"));
choices.insert(p_t(51, "Sony AF DT 16-105mm f/3.5-5.6 or 55-200mm f/4-5.5"));
choices.insert(p_t(52, "Sony AF 70-300mm f/4.5-5.6 G SSM"));
choices.insert(p_t(53, "Sony AF 70-400mm f/4.5-5.6 G SSM"));
choices.insert(p_t(54, "Carl Zeiss Vario-Sonnar T* 16-35mm f/2.8 ZA SSM"));
choices.insert(p_t(55, "Sony DT 18-55mm f/3.5-5.6 SAM"));
choices.insert(p_t(56, "Sony AF DT 55-200mm f/4-5.6 SAM"));
choices.insert(p_t(57, "Sony AF DT 50mm f/1.8 SAM"));
choices.insert(p_t(58, "Sony AF DT 30mm f/2.8 SAM Macro"));
choices.insert(p_t(59, "Sony AF 28-75mm f/2.8 SAM"));
choices.insert(p_t(128, "Tamron AF 18-200mm f/3.5-6.3 XR Di II LD Aspherical (IF)"));
choices.insert(p_t(128, "Tamron AF 28-300mm f/3.5-6.3"));
choices.insert(p_t(128, "Tamron AF 28-200mm f/3.8-5.6 XR Di Aspherical (IF) Macro "));
choices.insert(p_t(128, "Tamron SP AF 17-35mm f/2.8-4 Di LD Aspherical IF"));
choices.insert(p_t(128, "Sigma 10-20mm f/3.5 EX DC"));
choices.insert(p_t(128, "Sigma 70-200mm f/2.8 II EX DG APO Macro"));
choices.insert(p_t(129, "Tamron 200-400mm f/5.6 LD (IF)"));
choices.insert(p_t(129, "Tamron 70-300mm f/4-5.6 LD"));
choices.insert(p_t(135, "Vivitar 28-210mm f/3.5-5.6"));
choices.insert(p_t(136, "Tokina EMZ M100 AF 100mm f/3.5"));
choices.insert(p_t(137, "Cosina 70-210mm f/2.8-4 AF"));
choices.insert(p_t(138, "Soligor 19-35mm f/3.5-4.5"));
choices.insert(p_t(142, "Voigtlander 70-300mm f/4.5-5.6"));
choices.insert(p_t(146, "Voigtlander Macro APO-Lanthar 125mm f/2.5 SL"));
choices.insert(p_t(255, "Tamron SP AF 17-50mm f/2.8 XR Di II LD Aspherical"));
choices.insert(p_t(255, "Tamron AF 18-250mm f/3.5-6.3 XR Di II LD"));
choices.insert(p_t(255, "Tamron AF 55-200mm f/4-5.6 Di II"));
choices.insert(p_t(255, "Tamron AF 70-300mm f/4-5.6 Di LD Macro 1:2"));
choices.insert(p_t(255, "Tamron SP AF 200-500mm f/5.0-6.3 Di LD (IF)"));
choices.insert(p_t(255, "Tamron SP AF 10-24mm f/3.5-4.5 Di II LD Aspherical (IF)"));
choices.insert(p_t(255, "Tamron SP AF 70-200mm f/2.8 Di LD Macro (IF)"));
choices.insert(p_t(255, "Tamron SP AF 28-75mm f/2.8 XR Di LD Aspherical (IF)"));
choices.insert(p_t(2550, "Minolta AF 50mm f/1.7"));
choices.insert(p_t(2551, "Minolta AF 35-70mm f/4"));
choices.insert(p_t(2551, "Sigma UC AF 28-70mm f/3.5-4.5"));
choices.insert(p_t(2551, "Sigma AF 28-70mm f/2.8"));
choices.insert(p_t(2551, "Sigma M-AF 70-200mm f/2.8 EX Aspherical"));
choices.insert(p_t(2551, "Quantaray M-AF 35-80mm f/4-5.6"));
choices.insert(p_t(2552, "Minolta AF 28-85mm f/3.5-4.5 [New]"));
choices.insert(p_t(2552, "Tokina 19-35mm f/3.5-4.5"));
choices.insert(p_t(2552, "Tokina 28-70mm f/2.8 AT-X"));
choices.insert(p_t(2552, "Tokina 80-400mm f/4.5-5.6 AT-X AF II 840"));
choices.insert(p_t(2552, "Tokina AF PRO 28-80mm f/2.8 AT-X 280"));
choices.insert(p_t(2552, "Tokina AT-X PRO II AF 28-70mm f/2.6-2.8 270"));
choices.insert(p_t(2552, "Tamron AF 19-35mm f/3.5-4.5"));
choices.insert(p_t(2552, "Angenieux AF 28-70mm f/2.6"));
choices.insert(p_t(2553, "Minolta AF 28-135mm f/4-4.5"));
choices.insert(p_t(2553, "Sigma ZOOM-alpha 35-135mm f/3.5-4.5"));
choices.insert(p_t(2553, "Sigma 28-105mm f/2.8-4 Aspherical"));
choices.insert(p_t(2554, "Minolta AF 35-105mm f/3.5-4.5"));
choices.insert(p_t(2555, "Minolta AF 70-210mm f/4 Macro"));
choices.insert(p_t(2555, "Sigma 70-210mm f/4-5.6 APO"));
choices.insert(p_t(2555, "Sigma M-AF 70-200mm f/2.8 EX APO"));
choices.insert(p_t(2555, "Sigma 75-200mm f/2.8-3.5"));
choices.insert(p_t(2556, "Minolta AF 135mm f/2.8"));
choices.insert(p_t(2557, "Minolta AF 28mm f/2.8"));
choices.insert(p_t(2558, "Minolta AF 24-50mm f/4"));
choices.insert(p_t(2560, "Minolta AF 100-200mm f/4.5"));
choices.insert(p_t(2561, "Minolta AF 75-300mm f/4.5-5.6"));
choices.insert(p_t(2561, "Sigma 70-300mm f/4-5.6 DL Macro"));
choices.insert(p_t(2561, "Sigma 300mm f/4 APO Macro"));
choices.insert(p_t(2561, "Sigma AF 500mm f/4.5 APO"));
choices.insert(p_t(2561, "Sigma AF 170-500mm f/5-6.3 APO Aspherical"));
choices.insert(p_t(2561, "Tokina AT-X AF 300mm f/4"));
choices.insert(p_t(2561, "Tokina AT-X AF 400mm f/5.6 SD"));
choices.insert(p_t(2561, "Tokina AF 730 II 75-300mm f/4.5-5.6"));
choices.insert(p_t(2562, "Minolta/Sony AF 50mm f/1.4 [New]"));
choices.insert(p_t(2563, "Minolta AF 300mm f/2.8 G"));
choices.insert(p_t(2563, "Sigma AF 50-500mm f/4-6.3 EX DG APO"));
choices.insert(p_t(2563, "Sigma AF 170-500mm f/5-6.3 APO Aspherical"));
choices.insert(p_t(2563, "Sigma AF 500mm f/4.5 EX DG APO"));
choices.insert(p_t(2563, "Sigma 400mm f/5.6 APO"));
choices.insert(p_t(2564, "Minolta AF 50mm f/2.8 Macro"));
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(2566, "Minolta AF 24mm f/2.8"));
choices.insert(p_t(2572, "Minolta/Sony AF 500mm f/8 Reflex"));
choices.insert(p_t(2578, "Minolta AF 16mm f/2.8 Fisheye"));
choices.insert(p_t(2578, "Sigma 8mm f/4 EX DG Fisheye"));
choices.insert(p_t(2578, "Sigma 14mm f/3.5"));
choices.insert(p_t(2578, "Sigma 15mm f/2.8 Fisheye"));
choices.insert(p_t(2579, "Minolta AF 20mm f/2.8"));
choices.insert(p_t(2581, "Minolta/Sony AF 100mm f/2.8 Macro"));
choices.insert(p_t(2581, "Sigma AF 90mm f/2.8 Macro"));
choices.insert(p_t(2581, "Sigma AF 105mm f/2.8 EX DG Macro"));
choices.insert(p_t(2581, "Sigma 180mm f/5.6 Macro"));
choices.insert(p_t(2581, "Tamron AF 90mm f/2.8 Macro"));
choices.insert(p_t(2585, "Minolta AF 35-105mm f/3.5-4.5 New"));
choices.insert(p_t(2585, "Tamron AF 24-135mm f/3.5-5.6"));
choices.insert(p_t(2588, "Minolta AF 70-210mm f/3.5-4.5"));
choices.insert(p_t(2589, "Minolta AF 80-200 f/2.8 APO"));
choices.insert(p_t(2589, "Tokina 80-200mm f/2.8"));
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(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"));
choices.insert(p_t(2598, "Minolta AF 100mm f/2"));
choices.insert(p_t(2604, "Minolta AF 80-200mm f/4.5-5.6"));
choices.insert(p_t(2605, "Minolta AF 35-80mm f/4-5.6"));
choices.insert(p_t(2606, "Minolta AF 100-300mm f/4.5-5.6 (D)"));
choices.insert(p_t(2607, "Minolta AF 35-80mm f/4-5.6"));
choices.insert(p_t(2608, "Minolta AF 300mm f/2.8 G"));
choices.insert(p_t(2609, "Minolta AF 600mm f/4 HS-APO G"));
choices.insert(p_t(2612, "Minolta AF 200mm f/2.8 G HS-APO"));
choices.insert(p_t(2613, "Minolta AF 50mm f/1.7 New"));
choices.insert(p_t(2615, "Minolta AF 28-105mm f/3.5-4.5 Power Zoom"));
choices.insert(p_t(2616, "Minolta AF 35-200mm f/4.5-5.6 Power Zoom"));
choices.insert(p_t(2618, "Minolta AF 28-80mm f/4-5.6 Power Zoom"));
choices.insert(p_t(2619, "Minolta AF 80-200mm f/4.5-5.6 Power Zoom"));
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 Power Zoom"));
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(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"));
choices.insert(p_t(2638, "Minolta AF 50mm f/2.8 Macro New"));
choices.insert(p_t(2639, "Minolta AF 100mm f/2.8 Macro"));
choices.insert(p_t(2641, "Minolta AF 20mm f/2.8 New"));
choices.insert(p_t(2642, "Minolta AF 24mm f/2.8 New"));
choices.insert(p_t(2644, "Minolta AF 100-400mm f/4.5-6.7 APO"));
choices.insert(p_t(2662, "Minolta AF 50mm f/1.4 New"));
choices.insert(p_t(2667, "Minolta AF 35mm f/2 New"));
choices.insert(p_t(2668, "Minolta AF 28mm f/2 New"));
choices.insert(p_t(2672, "Minolta AF 24-105mm f/3.5-4.5 (D)"));
choices.insert(p_t(4574, "Minolta AF 200mm f/2.8 G x2"));
choices.insert(p_t(4575, "1.4 x Teleconverter"));
choices.insert(p_t(4585, "Tamron SP AF 300mm f/2.8 LD IF"));
choices.insert(p_t(6553, "Arax MC 35mm f/2.8 Tilt+Shift"));
choices.insert(p_t(6553, "Arax MC 80mm f/2.8 Tilt+Shift"));
choices.insert(p_t(6553, "Zenitar MF 16mm f/2.8 Fisheye M42"));
choices.insert(p_t(6553, "Samyang 500mm Mirror f/8"));
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"));
choices.insert(p_t(25501, "Minolta AF 50mm f/1.7"));
choices.insert(p_t(25511, "Minolta AF 35-70mm f/4"));
choices.insert(p_t(25511, "Sigma UC AF 28-70mm f/3.5-4.5"));
choices.insert(p_t(25511, "Sigma AF 28-70mm f/2.8"));
choices.insert(p_t(25511, "Sigma M-AF 70-200mm f/2.8 EX Aspherical"));
choices.insert(p_t(25511, "Quantaray M-AF 35-80mm f/4-5.6"));
choices.insert(p_t(25521, "Minolta AF 28-85mm f/3.5-4.5 [New]"));
choices.insert(p_t(25521, "Tokina 19-35mm f/3.5-4.5"));
choices.insert(p_t(25521, "Tokina 28-70mm f/2.8 AT-X"));
choices.insert(p_t(25521, "Tokina 80-400mm f/4.5-5.6 AT-X AF II 840"));
choices.insert(p_t(25521, "Tokina AF PRO 28-80mm f/2.8 AT-X 280"));
choices.insert(p_t(25521, "Tokina AT-X PRO II AF 28-70mm f/2.6-2.8 270"));
choices.insert(p_t(25521, "Tamron AF 19-35mm f/3.5-4.5"));
choices.insert(p_t(25521, "Angenieux AF 28-70mm f/2.6"));
choices.insert(p_t(25531, "Minolta AF 28-135mm f/4-4.5"));
choices.insert(p_t(25531, "Sigma ZOOM-alpha 35-135mm f/3.5-4.5"));
choices.insert(p_t(25531, "Sigma 28-105mm f/2.8-4 Aspherical"));
choices.insert(p_t(25541, "Minolta AF 35-105mm f/3.5-4.5"));
choices.insert(p_t(25551, "Minolta AF 70-210mm f/4 Macro"));
choices.insert(p_t(25551, "Sigma 70-210mm f/4-5.6 APO"));
choices.insert(p_t(25551, "Sigma M-AF 70-200mm f/2.8 EX APO"));
choices.insert(p_t(25551, "Sigma 75-200mm f/2.8-3.5"));
choices.insert(p_t(25561, "Minolta AF 135mm f/2.8"));
choices.insert(p_t(25571, "Minolta AF 28mm f/2.8"));
choices.insert(p_t(25581, "Minolta AF 24-50mm f/4"));
choices.insert(p_t(25601, "Minolta AF 100-200mm f/4.5"));
choices.insert(p_t(25611, "Minolta AF 75-300mm f/4.5-5.6"));
choices.insert(p_t(25611, "Sigma 70-300mm f/4-5.6 DL Macro"));
choices.insert(p_t(25611, "Sigma 300mm f/4 APO Macro"));
choices.insert(p_t(25611, "Sigma AF 500mm f/4.5 APO"));
choices.insert(p_t(25611, "Sigma AF 170-500mm f/5-6.3 APO Aspherical"));
choices.insert(p_t(25611, "Tokina AT-X AF 300mm f/4"));
choices.insert(p_t(25611, "Tokina AT-X AF 400mm f/5.6 SD"));
choices.insert(p_t(25611, "Tokina AF 730 II 75-300mm f/4.5-5.6"));
choices.insert(p_t(25621, "Minolta AF 50mm f/1.4"));
choices.insert(p_t(25631, "Minolta AF 300mm f/2.8 G"));
choices.insert(p_t(25631, "Sigma AF 50-500mm f/4-6.3 EX DG APO"));
choices.insert(p_t(25631, "Sigma AF 170-500mm f/5-6.3 APO Aspherical"));
choices.insert(p_t(25631, "Sigma AF 500mm f/4.5 EX DG APO"));
choices.insert(p_t(25631, "Sigma 400mm f/5.6 APO"));
choices.insert(p_t(25641, "Minolta AF 50mm f/2.8 Macro"));
choices.insert(p_t(25641, "Sigma AF 50mm f/2.8 Macro"));
choices.insert(p_t(25651, "Minolta AF 600mm f/4"));
choices.insert(p_t(25661, "Minolta AF 24mm f/2.8"));
choices.insert(p_t(25721, "Minolta/Sony AF 500mm f/8 Reflex"));
choices.insert(p_t(25781, "Minolta AF 16mm f/2.8 Fisheye"));
choices.insert(p_t(25781, "Sigma 8mm f/4 EX DG Fisheye"));
choices.insert(p_t(25781, "Sigma 14mm f/3.5"));
choices.insert(p_t(25781, "Sigma 15mm f/2.8 Fisheye"));
choices.insert(p_t(25791, "Minolta AF 20mm f/2.8"));
choices.insert(p_t(25811, "Minolta/Sony AF 100mm f/2.8 Macro New"));
choices.insert(p_t(25811, "Sigma AF 90mm f/2.8 Macro"));
choices.insert(p_t(25811, "Sigma AF 105mm f/2.8 EX DG Macro"));
choices.insert(p_t(25811, "Sigma 180mm f/5.6 Macro"));
choices.insert(p_t(25811, "Tamron 90mm f/2.8 Macro"));
choices.insert(p_t(25851, "Beroflex 35-135mm f/3.5-4.5"));
choices.insert(p_t(25858, "Minolta AF 35-105mm f/3.5-4.5 New"));
choices.insert(p_t(25858, "Tamron 24-135mm f/3.5-5.6"));
choices.insert(p_t(25881, "Minolta AF 70-210mm f/3.5-4.5"));
choices.insert(p_t(25891, "Minolta AF 80-200 f/2.8 APO"));
choices.insert(p_t(25891, "Tokina 80-200mm f/2.8"));
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(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"));
choices.insert(p_t(25981, "Minolta AF 100mm f/2"));
choices.insert(p_t(26041, "Minolta AF 80-200mm f/4.5-5.6"));
choices.insert(p_t(26051, "Minolta AF 35-80mm f/4-5.6"));
choices.insert(p_t(26061, "Minolta AF 100-300mm f/4.5-5.6 (D)"));
choices.insert(p_t(26071, "Minolta AF 35-80mm f/4-5.6"));
choices.insert(p_t(26081, "Minolta AF 300mm f/2.8 HS-APO G"));
choices.insert(p_t(26091, "Minolta AF 600mm f/4 HS-APO G"));
choices.insert(p_t(26121, "Minolta AF 200mm f/2.8 HS-APO G"));
choices.insert(p_t(26131, "Minolta AF 50mm f/1.7 New"));
choices.insert(p_t(26151, "Minolta AF 28-105mm f/3.5-4.5 Power Zoom"));
choices.insert(p_t(26161, "Minolta AF 35-200mm f/4.5-5.6 Power Zoom"));
choices.insert(p_t(26181, "Minolta AF 28-80mm f/4-5.6 Power Zoom"));
choices.insert(p_t(26191, "Minolta AF 80-200mm f/4.5-5.6 Power Zoom"));
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 Power Zoom"));
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(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"));
choices.insert(p_t(26381, "Minolta AF 50mm f/2.8 Macro New"));
choices.insert(p_t(26391, "Minolta AF 100mm f/2.8 Macro"));
choices.insert(p_t(26411, "Minolta AF 20mm f/2.8 New"));
choices.insert(p_t(26421, "Minolta AF 24mm f/2.8 New"));
choices.insert(p_t(26441, "Minolta AF 100-400mm f/4.5-6.7 APO"));
choices.insert(p_t(26621, "Minolta AF 50mm f/1.4 New"));
choices.insert(p_t(26671, "Minolta AF 35mm f/2 New"));
choices.insert(p_t(26681, "Minolta AF 28mm f/2 New"));
choices.insert(p_t(26721, "Minolta AF 24-105mm f/3.5-4.5 (D)"));
choices.insert(p_t(45671, "Tokina 70-210mm f/4-5.6"));
choices.insert(p_t(45741, "Minolta AF 200mm f/2.8 G x2"));
choices.insert(p_t(45851, "Tamron SP AF 300mm f/2.8 LD IF"));
choices.insert(p_t(45871, "Tamron SP AF 70-210mm f/2.8 LD"));
choices.insert(p_t(65535, "Arax MC 35mm f/2.8 Tilt+Shift"));
choices.insert(p_t(65535, "Arax MC 80mm f/2.8 Tilt+Shift"));
choices.insert(p_t(65535, "Zenitar MF 16mm f/2.8 Fisheye M42"));
choices.insert(p_t(65535, "Samyang 500mm f/8 Mirror"));
choices.insert(p_t(65535, "Pentacon Auto 135mm f/2.8"));
choices.insert(p_t(65535, "Pentacon Auto 29mm f/2.8"));
choices.insert(p_t(65535, "Helios 44-2 58mm f/2"));
}
virtual std::string toString (Tag* t)
{
int lensID = t->toInt();
size_t nFound = choices.count( lensID );
container_t::iterator r;
switch( nFound )
{
case 0: // lens Unknown
t->toString (buffer);
return std::string (buffer);
case 1: // lens found
r = choices.find ( lensID );
return r->second;
default:
// More than one hit: we must guess
break;
}
double maxApertureAtFocal = pow(2.0, t->getParent()->getParent()->getTag(0x9205)->toDouble()/2.0); // MaxApertureValue at focal Length
double focalLength = t->getParent()->getParent()->getTag(0x920A)->toDouble(); // Focal Length
double deltaMin = 1000.;
/* Choose the best match: thanks to exiftool by Phil Harvey
* first throws for "out of focal range" and lower or upper aperture of the lens compared to MaxApertureAtFocal
* if the lens is not constant aperture, calculate aprox. aperture of the lens at focalLength
* and compare with actual aperture.
*/
std::string bestMatch("Unknown");
std::ostringstream candidates;
for ( r = choices.lower_bound( lensID ); r != choices.upper_bound(lensID); r++ ){
double a1,a2,f1,f2,lensAperture,dif;
if( !extractLensInfo( r->second ,f1,f2,a1,a2) )
continue;
if( f1 == 0. || a1 == 0.)
continue;
if( focalLength < f1 - .5 || focalLength > f2 + 0.5 )
continue;
if( maxApertureAtFocal < a1 - 0.15 || maxApertureAtFocal > a2 +0.15)
continue;
if( a1 == a2 || f1 == f2)
lensAperture = a1;
else
lensAperture = exp( log(a1)+(log(a2)-log(a1))/(log(f2)-log(f1))*(log(focalLength)-log(f1)) );
dif = ABS(lensAperture - maxApertureAtFocal);
if( dif < deltaMin ){
deltaMin = dif;
bestMatch = r->second;
}
if( dif < 0.15){
if( candidates.tellp() )
candidates << "\n or " << r->second;
else
candidates << r->second;
}
}
if( !candidates.tellp() )
return bestMatch;
else
return candidates.str();
}
};
SALensIDInterpreter saLensIDInterpreter;
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";
}
};
MATeleconverterInterpreter maTeleconverterInterpreter;
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";
}
};
MAQualityInterpreter maQualityInterpreter;
class MAImageSizeInterpreter : public ChoiceInterpreter {
public:
MAImageSizeInterpreter () {
choices[1] = "1600x1200";
choices[2] = "1280x960";
choices[3] = "640x480";
choices[5] = "2560x1920";
choices[6] = "2272x1704";
choices[7] = "2048x1536";
}
};
MAImageSizeInterpreter maImageSizeInterpreter;
const TagAttrib minoltaAttribs[] = {
0, 1, 0, 0, 0x0000, "MakerNoteVersion", &stdInterpreter,
0, 1, 0, 0, 0x0001, "MinoltaCameraSettingsOld", &stdInterpreter,
0, 1, 0, 0, 0x0003, "MinoltaCameraSettings", &stdInterpreter,
0, 1, 0, 0, 0x0004, "MinoltaCameraSettings7D", &stdInterpreter,
0, 1, 0, 0, 0x0018, "ImageStabilization", &stdInterpreter,
0, 1, 0, 0, 0x0040, "CompressedImageSize", &stdInterpreter,
1, 1, 0, 0, 0x0081, "PreviewImage", &stdInterpreter,
1, 1, 0, 0, 0x0088, "PreviewImageStart", &stdInterpreter,
1, 1, 0, 0, 0x0089, "PreviewImageLength", &stdInterpreter,
0, 1, 0, 0, 0x0100, "SceneMode", &saSceneModeInterpreter,
0, 1, 0, 0, 0x0101, "ColorMode", &saColorModeInterpreter,
0, 1, 0, 0, 0x0102, "MinoltaQuality", &maQualityInterpreter,
0, 1, 0, 0, 0x0103, "MinoltaImageSize", &maImageSizeInterpreter,
0, 1, 0, 0, 0x0104, "FlashExposureComp", &stdInterpreter,
0, 1, 0, 0, 0x0105, "Teleconverter", &maTeleconverterInterpreter,
0, 1, 0, 0, 0x0107, "ImageStabilization", &saOnOffInterpreter,
0, 1, 0, 0, 0x010a, "ZoneMatching", &saZoneMatchingInterpreter,
0, 1, 0, 0, 0x010b, "ColorTemperature", &stdInterpreter,
0, 1, 0, 0, 0x010c, "LensID", &saLensIDInterpreter,
0, 1, 0, 0, 0x0113, "ImageStabilization", &saOnOffInterpreter,
0, 1, 0, 0, 0x0114, "MinoltaCameraSettings", &stdInterpreter,
1, 1, 0, 0, 0x0e00, "PrintIM", &stdInterpreter,
0, 1, 0, 0, 0x0f00, "MinoltaCameraSettings2", &stdInterpreter,
-1, 0, 0, 0, 0, "", NULL};
const TagAttrib sonyAttribs[] = {
1, 1, 0, 0, 0x0e00, "PrintIM", &stdInterpreter,
1, 1, 0, 0, 0x2001, "PreviewImage", &stdInterpreter,
0, 1, 0, 0, 0xb020, "ColorReproduction", &stdInterpreter,
0, 1, 0, 0, 0xb021, "ColorTemperature", &stdInterpreter,
0, 1, 0, 0, 0xb023, "SceneMode", &saSceneModeInterpreter,
0, 1, 0, 0, 0xb024, "ZoneMatching", &saZoneMatchingInterpreter,
0, 1, 0, 0, 0xb025, "DynamicRangeOptimizer", &saDynamicRangeOptimizerInterpreter,
0, 1, 0, 0, 0xb026, "ImageStabilization", &saOnOffInterpreter,
0, 1, 0, 0, 0xb027, "LensID", &saLensIDInterpreter,
0, 1, 0, minoltaAttribs, 0xb028, "MinoltaMakerNote", &stdInterpreter,
0, 1, 0, 0, 0xb029, "ColorMode", &saColorModeInterpreter,
0, 1, 0, 0, 0xb040, "Macro", &saOnOffInterpreter,
0, 1, 0, 0, 0xb041, "ExposureMode", &saExposureModeInterpreter,
0, 1, 0, 0, 0xb047, "Quality", &saQualityInterpreter,
0, 1, 0, 0, 0xb04b, "AntiBlur", &saAntiBlurInterpreter,
0, 1, 0, 0, 0xb04e, "LongExposureNoiseReduction", &saOnOffInterpreter,
-1, 0, 0, 0, 0, "", NULL};
};
#endif

486
rtexif/stdattribs.cc Normal file
View File

@@ -0,0 +1,486 @@
/*
* This file is part of RawTherapee.
*
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
*
* RawTherapee is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* RawTherapee is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _STDATTRIBS_
#define _STDATTRIBS_
#include <rtexif.h>
#include <string>
#include <map>
#include <math.h>
#include <string.h>
namespace rtexif {
class ColorSpaceInterpreter : public ChoiceInterpreter {
public:
ColorSpaceInterpreter () {
choices[1] = "sRGB";
choices[0xffff] = "Uncalibrated";
}
};
ColorSpaceInterpreter colorSpaceInterpreter;
class ExposureProgramInterpreter : public ChoiceInterpreter {
public:
ExposureProgramInterpreter () {
choices[0] = "Not defined";
choices[1] = "Manual";
choices[2] = "Normal program";
choices[3] = "Aperture priority";
choices[4] = "Shutter priority";
choices[5] = "Creative program";
choices[6] = "Action program";
choices[7] = "Portrait mode";
choices[8] = "Landscape mode";
}
};
ExposureProgramInterpreter exposureProgramInterpreter;
class MeteringModeInterpreter : public ChoiceInterpreter {
public:
MeteringModeInterpreter () {
choices[0] = "Unknown";
choices[1] = "Average";
choices[2] = "Center weighted";
choices[3] = "Spot";
choices[4] = "Multispot";
choices[5] = "Pattern";
choices[6] = "Partial";
choices[255] = "Other";
}
};
MeteringModeInterpreter meteringModeInterpreter;
class ExposureModeInterpreter : public ChoiceInterpreter {
public:
ExposureModeInterpreter () {
choices[0] = "Auto exposure";
choices[1] = "Manual exposure";
choices[2] = "Auto bracket";
}
};
ExposureModeInterpreter exposureModeInterpreter;
class WhiteBalanceInterpreter : public ChoiceInterpreter {
public:
WhiteBalanceInterpreter () {
choices[0] = "Auto white balance";
choices[1] = "Manual white balance";
}
};
WhiteBalanceInterpreter whiteBalanceInterpreter;
class SceneCaptureInterpreter : public ChoiceInterpreter {
public:
SceneCaptureInterpreter () {
choices[0] = "Standard";
choices[1] = "Landscape";
choices[2] = "Portrait";
choices[3] = "Night scene";
}
};
SceneCaptureInterpreter sceneCaptureInterpreter;
class GainControlInterpreter : public ChoiceInterpreter {
public:
GainControlInterpreter () {
choices[0] = "None";
choices[1] = "Low gain up";
choices[2] = "High gain up";
choices[3] = "Low gain down";
choices[4] = "High gain down";
}
};
GainControlInterpreter gainControlInterpreter;
class ContrastInterpreter : public ChoiceInterpreter {
public:
ContrastInterpreter () {
choices[0] = "Normal";
choices[1] = "Soft";
choices[2] = "Hard";
}
};
ContrastInterpreter contrastInterpreter;
class SharpnessInterpreter : public ChoiceInterpreter {
public:
SharpnessInterpreter () {
choices[0] = "Normal";
choices[1] = "Soft";
choices[2] = "Hard";
}
};
SharpnessInterpreter sharpnessInterpreter;
class SaturationInterpreter : public ChoiceInterpreter {
public:
SaturationInterpreter () {
choices[0] = "Normal";
choices[1] = "Low saturation";
choices[2] = "High saturation";
}
};
SaturationInterpreter saturationInterpreter;
class FlashInterpreter : public ChoiceInterpreter {
public:
FlashInterpreter () {
choices[0x0000] = "Flash did not fire";
choices[0x0001] = "Flash fired";
choices[0x0005] = "Strobe return light not detected";
choices[0x0007] = "Strobe return light detected";
choices[0x0009] = "Flash fired, compulsory flash mode";
choices[0x000D] = "Flash fired, compulsory flash mode, return light not detected";
choices[0x000F] = "Flash fired, compulsory flash mode, return light detected";
choices[0x0010] = "Flash did not fire, compulsory flash mode";
choices[0x0018] = "Flash did not fire, auto mode";
choices[0x0019] = "Flash fired, auto mode";
choices[0x001D] = "Flash fired, auto mode, return light not detected";
choices[0x001F] = "Flash fired, auto mode, return light detected";
choices[0x0020] = "No flash function";
choices[0x0041] = "Flash fired, red-eye reduction mode";
choices[0x0045] = "Flash fired, red-eye reduction mode, return light not detected";
choices[0x0047] = "Flash fired, red-eye reduction mode, return light detected";
choices[0x0049] = "Flash fired, compulsory flash mode, red-eye reduction mode";
choices[0x004D] = "Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected";
choices[0x004F] = "Flash fired, compulsory flash mode, red-eye reduction mode, return light detected";
choices[0x0059] = "Flash fired, auto mode, red-eye reduction mode";
choices[0x005D] = "Flash fired, auto mode, return light not detected, red-eye reduction mode";
choices[0x005F] = "Flash fired, auto mode, return light detected, red-eye reduction mode";
}
};
FlashInterpreter flashInterpreter;
class LightSourceInterpreter : public ChoiceInterpreter {
public:
LightSourceInterpreter () {
choices[0] = "Unknown";
choices[1] = "Daylight";
choices[2] = "Fluorescent";
choices[3] = "Tungsten";
choices[4] = "Flash";
choices[9] = "Fine weather";
choices[10] = "Cloudy weather";
choices[11] = "Shade";
choices[12] = "Daylight fluorescent";
choices[13] = "Day white fluorescent";
choices[14] = "Cool white fluorescent";
choices[15] = "White fluorescent";
choices[17] = "Standard light A";
choices[18] = "Standard light B";
choices[19] = "Standard light C";
choices[20] = "D55";
choices[21] = "D65";
choices[22] = "D75";
choices[23] = "D50";
choices[24] = "ISO studio tungsten";
choices[255] = "Other light source";
}
};
LightSourceInterpreter lightSourceInterpreter;
class CompressionInterpreter : public ChoiceInterpreter {
public:
CompressionInterpreter () {
choices[1] = "Uncompressed";
choices[6] = "JPEG Compression";
}
};
CompressionInterpreter compressionInterpreter;
class PhotometricInterpreter : public ChoiceInterpreter {
public:
PhotometricInterpreter () {
choices[2] = "RGB";
choices[6] = "YCbCr";
}
};
PhotometricInterpreter photometricInterpreter;
class PlanarConfigInterpreter : public ChoiceInterpreter {
public:
PlanarConfigInterpreter () {
choices[1] = "Chunky format";
choices[2] = "Planar format";
}
};
PlanarConfigInterpreter planarConfigInterpreter;
class FNumberInterpreter : public Interpreter {
public:
FNumberInterpreter () {}
virtual std::string toString (Tag* t) {
sprintf (buffer, "%0.1f", t->toDouble());
return buffer;
}
};
FNumberInterpreter fNumberInterpreter;
class ApertureInterpreter : public Interpreter {
public:
ApertureInterpreter () {}
virtual std::string toString (Tag* t) {
sprintf (buffer, "%0.1f", pow(2.0, t->toDouble()/2.0));
return buffer;
}
};
ApertureInterpreter apertureInterpreter;
class ExposureBiasInterpreter : public Interpreter {
public:
ExposureBiasInterpreter () {}
virtual std::string toString (Tag* t) {
sprintf (buffer, "%+0.2f", t->toDouble());
return buffer;
}
};
ExposureBiasInterpreter exposureBiasInterpreter;
class ShutterSpeedInterpreter : public Interpreter {
public:
ShutterSpeedInterpreter () {}
virtual std::string toString (Tag* t) {
double d = pow (2.0, -t->toDouble());
if (d > 0.0 && d < 0.9)
sprintf (buffer, "1/%0.0f", 1.0 / d);
else
sprintf (buffer, "%0.1f", d);
return buffer;
}
};
ShutterSpeedInterpreter shutterSpeedInterpreter;
class ExposureTimeInterpreter : public Interpreter {
public:
ExposureTimeInterpreter () {}
virtual std::string toString (Tag* t) {
double d = t->toDouble();
if (d > 0.0 && d < 0.9)
sprintf (buffer, "1/%0.0f", 1.0 / d);
else
sprintf (buffer, "%0.1f", d);
return buffer;
}
};
ExposureTimeInterpreter exposureTimeInterpreter;
class FocalLengthInterpreter : public Interpreter {
public:
FocalLengthInterpreter () {}
virtual std::string toString (Tag* t) {
sprintf (buffer, "%0.1f", t->toDouble());
return buffer;
}
};
FocalLengthInterpreter focalLengthInterpreter;
class UserCommentInterpreter : public Interpreter {
public:
UserCommentInterpreter () {}
virtual std::string toString (Tag* t) {
if (!strncmp((char*)t->getValue(), "ASCII\0\0\0",8))
strncpy (buffer, (char*)t->getValue()+8, t->getCount()-8);
else
buffer[0]=0;
return buffer;
}
virtual void fromString (Tag* t, const std::string& value) {
memcpy (buffer, "ASCII\0\0\0", 8);
strcpy (buffer+8, value.c_str());
t->fromString (buffer, value.size() + 9);
}
};
UserCommentInterpreter userCommentInterpreter;
const TagAttrib exifAttribs[] = {
0, 2, 0, 0, 0x0103, "Compression", &compressionInterpreter,
0, 2, 0, 0, 0xA000, "FlashpixVersion", &stdInterpreter,
0, 2, 0, 0, 0xA001, "ColorSpace", &colorSpaceInterpreter,
0, 1, 0, 0, 0x9000, "ExifVersion", &stdInterpreter,
0, 1, 0, 0, 0x9003, "DateTimeOriginal", &stdInterpreter,
0, 1, 0, 0, 0x9004, "DateTimeDigitized", &stdInterpreter,
0, 2, 0, 0, 0x9101, "ComponentsConfiguration", &stdInterpreter,
0, 2, 0, 0, 0x9102, "CompressedBitsPerPixel", &stdInterpreter,
0, 2, 0, 0, 0xA002, "PixelXDimension", &stdInterpreter,
0, 2, 0, 0, 0xA003, "PixelYDimension", &stdInterpreter,
0, 1, 0, 0, 0x927C, "MakerNote", &stdInterpreter,
0, 1, 1, 0, 0x9286, "UserComment", &userCommentInterpreter,
1, 0, 0, 0, 0xA004, "RelatedSoundFile", &stdInterpreter,
0, 1, 0, 0, 0x9290, "SubSecTime", &stdInterpreter,
0, 1, 0, 0, 0x9291, "SubSecTimeOriginal", &stdInterpreter,
0, 1, 0, 0, 0x9292, "SubSecTimeDigitized", &stdInterpreter,
0, 1, 0, 0, 0xA420, "ImageUniqueID", &stdInterpreter,
0, 1, 0, 0, 0x829A, "ExposureTime", &exposureTimeInterpreter,
0, 1, 0, 0, 0x829D, "FNumber", &fNumberInterpreter,
0, 1, 0, 0, 0x8822, "ExposureProgram", &exposureProgramInterpreter,
0, 1, 0, 0, 0x8824, "SpectralSensitivity", &stdInterpreter,
0, 1, 0, 0, 0x8827, "ISOSpeedRatings", &stdInterpreter,
0, 1, 0, 0, 0x8828, "OECF", &stdInterpreter,
0, 1, 0, 0, 0x9201, "ShutterSpeedValue", &shutterSpeedInterpreter,
0, 1, 0, 0, 0x9202, "ApertureValue", &apertureInterpreter,
0, 1, 0, 0, 0x9203, "BrightnessValue", &stdInterpreter,
0, 1, 0, 0, 0x9204, "ExposureBiasValue", &exposureBiasInterpreter,
0, 1, 0, 0, 0x9205, "MaxApertureValue", &apertureInterpreter,
0, 1, 0, 0, 0x9206, "SubjectDistance", &stdInterpreter,
0, 1, 0, 0, 0x9207, "MeteringMode", &meteringModeInterpreter,
0, 1, 0, 0, 0x9208, "LightSource", &lightSourceInterpreter,
0, 1, 0, 0, 0x9209, "Flash", &flashInterpreter,
0, 1, 0, 0, 0x920A, "FocalLength", &focalLengthInterpreter,
0, 1, 0, 0, 0x9214, "SubjectArea", &stdInterpreter,
0, 0, 0, 0, 0x9216, "TIFFEPSStandardID", &stdInterpreter,
0, 1, 0, 0, 0x9217, "SensingMethod", &stdInterpreter,
0, 1, 0, 0, 0xA20B, "FlashEnergy", &stdInterpreter,
0, 1, 0, 0, 0xA20C, "SpatialFrequencyResponse", &stdInterpreter,
0, 1, 0, 0, 0xA20E, "FocalPlaneXResolution", &stdInterpreter,
0, 1, 0, 0, 0xA20F, "FocalPlaneYResolution", &stdInterpreter,
0, 1, 0, 0, 0xA210, "FocalPlaneResolutionUnit", &stdInterpreter,
0, 1, 0, 0, 0xA214, "SubjectLocation", &stdInterpreter,
0, 1, 0, 0, 0xA215, "ExposureIndex", &stdInterpreter,
0, 1, 0, 0, 0xA217, "SensingMethod", &stdInterpreter,
0, 1, 0, 0, 0xA300, "FileSource", &stdInterpreter,
0, 1, 0, 0, 0xA301, "SceneType", &stdInterpreter,
0, 0, 0, 0, 0xA302, "CFAPattern", &stdInterpreter,
0, 1, 0, 0, 0xA401, "CustomRendered", &stdInterpreter,
0, 1, 0, 0, 0xA402, "ExposureMode", &exposureModeInterpreter,
0, 1, 0, 0, 0xA403, "WhiteBalance", &whiteBalanceInterpreter,
0, 1, 0, 0, 0xA404, "DigitalZoomRatio", &stdInterpreter,
0, 1, 0, 0, 0xA405, "FocalLengthIn35mmFilm", &stdInterpreter,
0, 1, 0, 0, 0xA406, "SceneCaptureType", &sceneCaptureInterpreter,
0, 1, 0, 0, 0xA407, "GainControl", &gainControlInterpreter,
0, 1, 0, 0, 0xA408, "Contrast", &contrastInterpreter,
0, 1, 0, 0, 0xA409, "Saturation", &saturationInterpreter,
0, 1, 0, 0, 0xA40A, "Sharpness", &sharpnessInterpreter,
0, 1, 0, 0, 0xA40B, "DeviceSettingDescription", &stdInterpreter,
0, 1, 0, 0, 0xA40C, "SubjectDistanceRange", &stdInterpreter,
0, 0, 0, 0, 0x828d, "CFAPattern", &stdInterpreter,
0, 0, 0, 0, 0x828e, "CFARepeatPatternDim", &stdInterpreter,
-1, 0, 0, 0, 0, "", NULL };
// 0, 0xA005, LONG, 1, "Interoperability tag", "Interoperability IFD Pointer"};
const TagAttrib gpsAttribs[] = {
0, 1, 0, 0, 0x0000, "GPSVersionID", &stdInterpreter,
0, 1, 0, 0, 0x0001, "GPSLatitudeRef", &stdInterpreter,
0, 1, 0, 0, 0x0002, "GPSLatitude", &stdInterpreter,
0, 1, 0, 0, 0x0003, "GPSLongitudeRef", &stdInterpreter,
0, 1, 0, 0, 0x0004, "GPSLongitude", &stdInterpreter,
0, 1, 0, 0, 0x0005, "GPSAltitudeRef", &stdInterpreter,
0, 1, 0, 0, 0x0006, "GPSAltitude", &stdInterpreter,
0, 1, 0, 0, 0x0007, "GPSTimeStamp", &stdInterpreter,
0, 1, 0, 0, 0x0008, "GPSSatelites", &stdInterpreter,
0, 1, 0, 0, 0x0009, "GPSStatus", &stdInterpreter,
0, 1, 0, 0, 0x000a, "GPSMeasureMode", &stdInterpreter,
0, 1, 0, 0, 0x000b, "GPSDOP", &stdInterpreter,
0, 1, 0, 0, 0x000c, "GPSSpeedRef", &stdInterpreter,
0, 1, 0, 0, 0x000d, "GPSSpeed", &stdInterpreter,
0, 1, 0, 0, 0x000e, "GPSTrackRef", &stdInterpreter,
0, 1, 0, 0, 0x000f, "GPSTrack", &stdInterpreter,
0, 1, 0, 0, 0x0010, "GPSImgDirectionRef", &stdInterpreter,
0, 1, 0, 0, 0x0011, "GPSImgDirection", &stdInterpreter,
0, 1, 0, 0, 0x0012, "GPSMapDatum", &stdInterpreter,
0, 1, 0, 0, 0x0013, "GPSDestLatitudeRef", &stdInterpreter,
0, 1, 0, 0, 0x0014, "GPSDestLatitude", &stdInterpreter,
0, 1, 0, 0, 0x0015, "GPSDestLongitudeRef", &stdInterpreter,
0, 1, 0, 0, 0x0016, "GPSDestLongitude", &stdInterpreter,
0, 1, 0, 0, 0x0017, "GPSDestBearingRef", &stdInterpreter,
0, 1, 0, 0, 0x0018, "GPSDestBearing", &stdInterpreter,
0, 1, 0, 0, 0x0019, "GPSDestDistanceRef", &stdInterpreter,
0, 1, 0, 0, 0x001a, "GPSDestDistance", &stdInterpreter,
0, 1, 0, 0, 0x001b, "GPSProcessingMethod", &stdInterpreter,
0, 1, 0, 0, 0x001c, "GPSAreaInformation", &stdInterpreter,
0, 1, 0, 0, 0x001d, "GPSDateStamp", &stdInterpreter,
0, 1, 0, 0, 0x001e, "GPSDifferential", &stdInterpreter,
-1, 0, 0, 0, 0, "", NULL };
const TagAttrib iopAttribs[] = {
0, 1, 0, 0, 0x0001, "InteroperabilityIndex", &stdInterpreter,
0, 1, 0, 0, 0x0002, "InteroperabilityVersion", &stdInterpreter,
-1, 0, 0, 0, 0, "", NULL };
const TagAttrib ifdAttribs[] = {
0, 2, 0, 0, 0x0017, "PanaISO", &stdInterpreter,
0, 2, 0, 0, 0x0100, "ImageWidth", &stdInterpreter,
0, 2, 0, 0, 0x0101, "ImageHeight", &stdInterpreter,
0, 2, 0, 0, 0x0102, "BitsPerSample", &stdInterpreter,
0, 2, 0, 0, 0x0103, "Compression", &compressionInterpreter,
0, 2, 0, 0, 0x0106, "PhotometricInterpretation", &photometricInterpreter,
0, 2, 0, 0, 0x0112, "Orientation", &stdInterpreter,
0, 2, 0, 0, 0x0115, "SamplesPerPixel", &stdInterpreter,
0, 2, 0, 0, 0x011C, "PlanarConfiguration", &planarConfigInterpreter,
0, 2, 0, 0, 0x0212, "YCbCrSubSampling", &stdInterpreter,
0, 2, 0, 0, 0x0213, "YCbCrPositioning", &stdInterpreter,
0, 2, 0, 0, 0x011A, "XResolution", &stdInterpreter,
0, 2, 0, 0, 0x011B, "YResolution", &stdInterpreter,
0, 2, 0, 0, 0x0128, "ResolutionUnit", &stdInterpreter,
1, 0, 0, 0, 0x0111, "StripOffsets", &stdInterpreter,
1, 0, 0, 0, 0x0116, "RowsPerStrip", &stdInterpreter,
1, 0, 0, 0, 0x0117, "StripByteCounts", &stdInterpreter,
0, 2, 0, 0, 0x0201, "JPEGInterchangeFormat", &stdInterpreter,
0, 2, 0, 0, 0x0202, "JPEGInterchangeFormatLength", &stdInterpreter,
0, 2, 0, 0, 0x012D, "TransferFunction", &stdInterpreter,
0, 2, 0, 0, 0x013E, "WhitePoint", &stdInterpreter,
0, 2, 0, 0, 0x013F, "PriomaryChromaticities", &stdInterpreter,
0, 2, 0, 0, 0x0211, "YCbCrCoefficients", &stdInterpreter,
0, 2, 0, 0, 0x0214, "ReferenceBlackWhite", &stdInterpreter,
0, 1, 0, 0, 0x0132, "DateTime", &stdInterpreter,
0, 1, 1, 0, 0x010E, "ImageDescription", &stdInterpreter,
0, 1, 0, 0, 0x010F, "Make", &stdInterpreter,
0, 1, 0, 0, 0x0110, "Model", &stdInterpreter,
0, 2, 0, 0, 0x0131, "Software", &stdInterpreter,
0, 1, 1, 0, 0x013B, "Artist", &stdInterpreter,
0, 1, 1, 0, 0x8298, "Copyright", &stdInterpreter,
0, 1, 0, exifAttribs, 0x8769, "Exif", &stdInterpreter,
0, 2, 0, 0, 0x8773, "ICCProfile", &stdInterpreter,
0, 2, 0, 0, 0x83BB, "IPTCData", &stdInterpreter,
0, 1, 0, gpsAttribs, 0x8825, "GPSInfo", &stdInterpreter,
0, 1, 0, 0, 0x9003, "DateTimeOriginal", &stdInterpreter,
0, 1, 0, 0, 0x9004, "DateTimeDigitized", &stdInterpreter,
0, 1, 0, iopAttribs, 0xA005, "Interoperability", &stdInterpreter,
1, 2, 0, ifdAttribs, 0x014A, "SubIFD", &stdInterpreter,
0, 0, 0, 0, 0xC4A5, "PrintIMInformation", &stdInterpreter,
0, 2, 0, 0, 0x00fe, "NewSubFileType", &stdInterpreter,
-1, 0, 0, 0, 0, "", NULL};
};
/*#include <nikonattribs.h>
#include <canonattribs.h>
#include <pentaxattribs.h>
#include <olympusattribs.h>
#include <fujiattribs.h>
#include <sonyminoltaattribs.h>*/
#endif