Coverage Report

Created: 2025-11-24 06:15

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/exiv2/src/nikonmn_int.cpp
Line
Count
Source
1
// SPDX-License-Identifier: GPL-2.0-or-later
2
3
// included header files
4
#include "nikonmn_int.hpp"
5
#include "config.h"
6
#include "exif.hpp"
7
#include "i18n.h"  // NLS support.
8
#include "image_int.hpp"
9
#include "makernote_int.hpp"
10
#include "tags.hpp"
11
#include "tags_int.hpp"
12
#include "utils.hpp"
13
#include "value.hpp"
14
15
// + standard includes
16
#include <array>
17
#include <cmath>
18
#include <iomanip>
19
20
// *****************************************************************************
21
// class member definitions
22
namespace Exiv2::Internal {
23
//! OffOn, multiple tags
24
constexpr TagDetails nikonOffOn[] = {
25
    {0, N_("Off")},
26
    {1, N_("On")},
27
};
28
29
//! Off, Low, Normal, High, multiple tags
30
constexpr TagDetails nikonOlnh[] = {
31
    {0, N_("Off")},
32
    {1, N_("Low")},
33
    {3, N_("Normal")},
34
    {5, N_("High")},
35
};
36
37
//! Off, Low, Normal, High, multiple tags
38
constexpr TagDetails nikonActiveDLighting[] = {
39
    {0, N_("Off")}, {1, N_("Low")}, {3, N_("Normal")}, {5, N_("High")}, {7, N_("Extra High")}, {65535, N_("Auto")},
40
};
41
42
//! Focus area for Nikon cameras.
43
constexpr auto nikonFocusarea = std::array{
44
    N_("Single area"),   N_("Dynamic area"),       N_("Dynamic area, closest subject"),
45
    N_("Group dynamic"), N_("Single area (wide)"), N_("Dynamic area (wide)"),
46
};
47
48
// Roger Larsson: My guess is that focuspoints will follow autofocus sensor
49
// module. Note that relative size and position will vary depending on if
50
// "wide" or not
51
//! Focus points for Nikon cameras, used for Nikon 1 and Nikon 3 makernotes.
52
constexpr auto nikonFocuspoints = std::array{
53
    N_("Center"),      N_("Top"),        N_("Bottom"),      N_("Left"),      N_("Right"),      N_("Upper-left"),
54
    N_("Upper-right"), N_("Lower-left"), N_("Lower-right"), N_("Left-most"), N_("Right-most"),
55
};
56
57
//! Shutter Modes (credits to exiftool)
58
constexpr TagDetails nikonShutterModes[] = {
59
    {0, "Mechanical"},          {16, "Electronic"},        {48, "Electronic Front Curtain"},
60
    {64, "Electronic (Movie)"}, {80, "Auto (Mechanical)"}, {81, "Auto (Electronic Front Curtain)"},
61
};
62
63
//! FlashComp, tag 0x0012
64
constexpr TagDetails nikonFlashComp[] = {
65
    // From the PHP JPEG Metadata Toolkit
66
    {0x06, "+1.0 EV"}, {0x04, "+0.7 EV"}, {0x03, "+0.5 EV"}, {0x02, "+0.3 EV"}, {0x00, "0.0 EV"},  {0xfe, "-0.3 EV"},
67
    {0xfd, "-0.5 EV"}, {0xfc, "-0.7 EV"}, {0xfa, "-1.0 EV"}, {0xf8, "-1.3 EV"}, {0xf7, "-1.5 EV"}, {0xf6, "-1.7 EV"},
68
    {0xf4, "-2.0 EV"}, {0xf2, "-2.3 EV"}, {0xf1, "-2.5 EV"}, {0xf0, "-2.7 EV"}, {0xee, "-3.0 EV"},
69
};
70
71
//! ColorSpace, tag 0x001e
72
constexpr TagDetails nikonColorSpace[] = {
73
    {1, N_("sRGB")},
74
    {2, N_("Adobe RGB")},
75
};
76
77
//! FlashMode, tag 0x0087
78
constexpr TagDetails nikonFlashMode[] = {
79
    {0, N_("Did not fire")},   {1, N_("Fire, manual")},         {3, N_("Not ready")},      {6, N_("Off")},
80
    {7, N_("Fire, external")}, {8, N_("Fire, commander mode")}, {9, N_("Fire, TTL mode")}, {18, N_("LED Light")},
81
};
82
83
//! ShootingMode, tag 0x0089
84
constexpr TagDetailsBitmask nikonShootingMode[] = {
85
    {0x0001, N_("Continuous")},
86
    {0x0002, N_("Delay")},
87
    {0x0004, N_("PC Control")},
88
    {0x0008, N_("Self-timer")},
89
    {0x0010, N_("Exposure Bracketing")},
90
    {0x0020, N_("Auto ISO")},
91
    {0x0040, N_("White-Balance Bracketing")},
92
    {0x0080, N_("IR Control")},
93
    {0x0100, N_("D-Lighting Bracketing")},
94
};
95
96
//! ShootingMode D70, tag 0x0089
97
constexpr TagDetailsBitmask nikonShootingModeD70[] = {
98
    {0x0001, N_("Continuous")},
99
    {0x0002, N_("Delay")},
100
    {0x0004, N_("PC control")},
101
    {0x0010, N_("Exposure bracketing")},
102
    {0x0020, N_("Unused LE-NR slowdown")},
103
    {0x0040, N_("White balance bracketing")},
104
    {0x0080, N_("IR control")},
105
};
106
107
//! AutoBracketRelease, tag 0x008a
108
constexpr TagDetails nikonAutoBracketRelease[] = {
109
    {0, N_("None")},
110
    {1, N_("Auto release")},
111
    {2, N_("Manual release")},
112
};
113
114
//! NEFCompression, tag 0x0093
115
constexpr TagDetails nikonNefCompression[] = {
116
    {1, N_("Lossy (type 1)")},
117
    {2, N_("Uncompressed")},
118
    {3, N_("Lossless")},
119
    {4, N_("Lossy (type 2)")},
120
};
121
122
//! RetouchHistory, tag 0x009e
123
constexpr TagDetails nikonRetouchHistory[] = {
124
    {0, N_("None")},          {3, N_("B & W")},      {4, N_("Sepia")},         {5, N_("Trim")},
125
    {6, N_("Small picture")}, {7, N_("D-Lighting")}, {8, N_("Red eye")},       {9, N_("Cyanotype")},
126
    {10, N_("Sky light")},    {11, N_("Warm tone")}, {12, N_("Color custom")}, {13, N_("Image overlay")},
127
};
128
129
//! HighISONoiseReduction, tag 0x00b1
130
constexpr TagDetails nikonHighISONoiseReduction[] = {
131
    {0, N_("Off")}, {1, N_("Minimal")}, {2, N_("Low")}, {4, N_("Normal")}, {6, N_("High")},
132
};
133
134
// Nikon1 MakerNote Tag Info
135
constexpr TagInfo Nikon1MakerNote::tagInfo_[] = {
136
    {0x0001, "Version", N_("Version"), N_("Nikon Makernote version"), IfdId::nikon1Id, SectionId::makerTags, undefined,
137
     -1, printValue},
138
    {0x0002, "ISOSpeed", N_("ISO Speed"), N_("ISO speed setting"), IfdId::nikon1Id, SectionId::makerTags, unsignedShort,
139
     -1, print0x0002},
140
    {0x0003, "ColorMode", N_("Color Mode"), N_("Color mode"), IfdId::nikon1Id, SectionId::makerTags, asciiString, -1,
141
     printValue},
142
    {0x0004, "Quality", N_("Quality"), N_("Image quality setting"), IfdId::nikon1Id, SectionId::makerTags, asciiString,
143
     -1, printValue},
144
    {0x0005, "WhiteBalance", N_("White Balance"), N_("White balance"), IfdId::nikon1Id, SectionId::makerTags,
145
     asciiString, -1, printValue},
146
    {0x0006, "Sharpening", N_("Sharpening"), N_("Image sharpening setting"), IfdId::nikon1Id, SectionId::makerTags,
147
     asciiString, -1, printValue},
148
    {0x0007, "Focus", N_("Focus"), N_("Focus mode"), IfdId::nikon1Id, SectionId::makerTags, asciiString, -1,
149
     print0x0007},
150
    {0x0008, "FlashSetting", N_("Flash Setting"), N_("Flash setting"), IfdId::nikon1Id, SectionId::makerTags,
151
     asciiString, -1, printValue},
152
    {0x000a, "0x000a", "0x000a", N_("Unknown"), IfdId::nikon1Id, SectionId::makerTags, unsignedRational, -1,
153
     printValue},
154
    {0x000f, "ISOSelection", N_("ISO Selection"), N_("ISO selection"), IfdId::nikon1Id, SectionId::makerTags,
155
     asciiString, -1, printValue},
156
    {0x0010, "DataDump", N_("Data Dump"), N_("Data dump"), IfdId::nikon1Id, SectionId::makerTags, undefined, -1,
157
     printValue},
158
    {0x0080, "ImageAdjustment", N_("Image Adjustment"), N_("Image adjustment setting"), IfdId::nikon1Id,
159
     SectionId::makerTags, asciiString, -1, printValue},
160
    {0x0082, "AuxiliaryLens", N_("Auxiliary Lens"), N_("Auxiliary lens (adapter)"), IfdId::nikon1Id,
161
     SectionId::makerTags, asciiString, -1, printValue},
162
    {0x0085, "FocusDistance", N_("Focus Distance"), N_("Manual focus distance"), IfdId::nikon1Id, SectionId::makerTags,
163
     unsignedRational, -1, print0x0085},
164
    {0x0086, "DigitalZoom", N_("Digital Zoom"), N_("Digital zoom setting"), IfdId::nikon1Id, SectionId::makerTags,
165
     unsignedRational, -1, print0x0086},
166
    {0x0088, "AFFocusPos", N_("AF Focus Position"), N_("AF focus position information"), IfdId::nikon1Id,
167
     SectionId::makerTags, undefined, -1, print0x0088},
168
    // End of list marker
169
    {0xffff, "(UnknownNikon1MnTag)", "(UnknownNikon1MnTag)", N_("Unknown Nikon1MakerNote tag"), IfdId::nikon1Id,
170
     SectionId::makerTags, asciiString, -1, printValue},
171
};
172
173
2.33k
std::ostream& Nikon1MakerNote::print0x0002(std::ostream& os, const Value& value, const ExifData*) {
174
2.33k
  if (value.count() > 1) {
175
2.30k
    os << value.toInt64(1);
176
2.30k
  } else {
177
26
    os << "(" << value << ")";
178
26
  }
179
2.33k
  return os;
180
2.33k
}
181
182
15
static std::string getKeyString(const std::string& key, const ExifData* metadata) {
183
15
  std::string result;
184
15
  if (metadata->findKey(ExifKey(key)) != metadata->end()) {
185
15
    result = metadata->findKey(ExifKey(key))->toString();
186
15
  }
187
15
  return result;
188
15
}
189
190
38
std::ostream& Nikon1MakerNote::printBarValue(std::ostream& os, const Value& value, const ExifData* exifData) {
191
38
  if (!exifData)
192
19
    return os << "undefined";
193
194
19
  if (value.count() >= 9) {
195
15
    ByteOrder bo = getKeyString("Exif.MakerNote.ByteOrder", exifData) == "MM" ? bigEndian : littleEndian;
196
15
    byte p[4];
197
75
    for (int n = 0; n < 4; n++)
198
60
      p[n] = static_cast<byte>(value.toInt64(6 + n));
199
15
    os << getLong(p, bo);
200
15
  }
201
202
19
  return os;
203
38
}
204
205
150
std::ostream& Nikon1MakerNote::print0x0007(std::ostream& os, const Value& value, const ExifData*) {
206
150
  std::string focus = value.toString();
207
150
  if (focus == "AF-C  ")
208
6
    os << _("Continuous autofocus");
209
144
  else if (focus == "AF-S  ")
210
14
    os << _("Single autofocus");
211
130
  else if (focus == "AF-A  ")
212
14
    os << _("Automatic");
213
116
  else
214
116
    os << "(" << value << ")";
215
150
  return os;
216
150
}
217
218
46
std::ostream& Nikon1MakerNote::print0x0085(std::ostream& os, const Value& value, const ExifData*) {
219
46
  auto [r, s] = value.toRational();
220
46
  if (r == 0) {
221
16
    return os << _("Unknown");
222
16
  }
223
30
  if (s != 0) {
224
16
    return os << stringFormat("{:.2f} m", static_cast<float>(r) / s);
225
16
  }
226
14
  return os << "(" << value << ")";
227
30
}
228
229
40
std::ostream& Nikon1MakerNote::print0x0086(std::ostream& os, const Value& value, const ExifData*) {
230
40
  auto [r, s] = value.toRational();
231
40
  if (r == 0) {
232
18
    return os << _("Not used");
233
18
  }
234
22
  if (s == 0) {
235
8
    return os << "(" << value << ")";
236
8
  }
237
14
  return os << stringFormat("{:.1f}x", static_cast<float>(r) / s);
238
22
}
239
240
1.51k
std::ostream& Nikon1MakerNote::print0x0088(std::ostream& os, const Value& value, const ExifData*) {
241
1.51k
  if (value.count() >= 1) {
242
1.51k
    const uint32_t focusArea = value.toUint32(0);
243
1.51k
    if (focusArea >= nikonFocusarea.size()) {
244
1.22k
      os << "Invalid value";
245
1.22k
    } else {
246
288
      os << nikonFocusarea[focusArea];
247
288
    }
248
1.51k
  }
249
1.51k
  if (value.count() >= 2) {
250
1.28k
    os << "; ";
251
1.28k
    const uint32_t focusPoint = value.toUint32(1);
252
253
1.28k
    if (focusPoint <= 4) {
254
294
      os << nikonFocuspoints[focusPoint];
255
986
    } else {
256
986
      os << value;
257
986
      if (focusPoint < nikonFocuspoints.size()) {
258
68
        os << " " << _("guess") << " " << nikonFocuspoints[focusPoint];
259
68
      }
260
986
    }
261
1.28k
  }
262
1.51k
  if (value.count() >= 3) {
263
1.28k
    const uint32_t focusPointsUsed1 = value.toUint32(2);
264
1.28k
    const uint32_t focusPointsUsed2 = value.toUint32(3);
265
266
1.28k
    if (focusPointsUsed1 != 0 && focusPointsUsed2 != 0) {
267
836
      os << "; [";
268
269
836
      if (focusPointsUsed1 & 1)
270
366
        os << nikonFocuspoints[0] << " ";
271
836
      if (focusPointsUsed1 & 2)
272
464
        os << nikonFocuspoints[1] << " ";
273
836
      if (focusPointsUsed1 & 4)
274
444
        os << nikonFocuspoints[2] << " ";
275
836
      if (focusPointsUsed1 & 8)
276
298
        os << nikonFocuspoints[3] << " ";
277
836
      if (focusPointsUsed1 & 16)
278
112
        os << nikonFocuspoints[4] << " ";
279
836
      if (focusPointsUsed1 & 32)
280
462
        os << nikonFocuspoints[5] << " ";
281
836
      if (focusPointsUsed1 & 64)
282
684
        os << nikonFocuspoints[6] << " ";
283
836
      if (focusPointsUsed1 & 128)
284
152
        os << nikonFocuspoints[7] << " ";
285
286
836
      if (focusPointsUsed2 & 1)
287
406
        os << nikonFocuspoints[8] << " ";
288
836
      if (focusPointsUsed2 & 2)
289
190
        os << nikonFocuspoints[9] << " ";
290
836
      if (focusPointsUsed2 & 4)
291
612
        os << nikonFocuspoints[10] << " ";
292
293
836
      os << "]";
294
836
    }
295
1.28k
  } else {
296
234
    os << "(" << value << ")";
297
234
  }
298
1.51k
  return os;
299
1.51k
}
300
301
//! Quality, tag 0x0003
302
constexpr TagDetails nikon2Quality[] = {
303
    {1, N_("VGA Basic")},  {2, N_("VGA Normal")},  {3, N_("VGA Fine")},
304
    {4, N_("SXGA Basic")}, {5, N_("SXGA Normal")}, {6, N_("SXGA Fine")},
305
};
306
307
//! ColorMode, tag 0x0004
308
constexpr TagDetails nikon2ColorMode[] = {
309
    {1, N_("Color")},
310
    {2, N_("Monochrome")},
311
};
312
313
//! ImageAdjustment, tag 0x0005
314
constexpr TagDetails nikon2ImageAdjustment[] = {
315
    {0, N_("Normal")}, {1, N_("Bright+")}, {2, N_("Bright-")}, {3, N_("Contrast+")}, {4, N_("Contrast-")},
316
};
317
318
//! ISOSpeed, tag 0x0006
319
constexpr TagDetails nikon2IsoSpeed[] = {
320
    {0, "80"},
321
    {2, "160"},
322
    {4, "320"},
323
    {5, "100"},
324
};
325
326
//! WhiteBalance, tag 0x0007
327
constexpr TagDetails nikon2WhiteBalance[] = {
328
    {0, N_("Auto")},        {1, N_("Preset")}, {2, N_("Daylight")},   {3, N_("Incandescent")},
329
    {4, N_("Fluorescent")}, {5, N_("Cloudy")}, {6, N_("Speedlight")},
330
};
331
332
// Nikon2 MakerNote Tag Info
333
constexpr TagInfo Nikon2MakerNote::tagInfo_[] = {
334
    {0x0002, "0x0002", "0x0002", N_("Unknown"), IfdId::nikon2Id, SectionId::makerTags, asciiString, -1, printValue},
335
    {0x0003, "Quality", N_("Quality"), N_("Image quality setting"), IfdId::nikon2Id, SectionId::makerTags,
336
     unsignedShort, -1, EXV_PRINT_TAG(nikon2Quality)},
337
    {0x0004, "ColorMode", N_("Color Mode"), N_("Color mode"), IfdId::nikon2Id, SectionId::makerTags, unsignedShort, -1,
338
     EXV_PRINT_TAG(nikon2ColorMode)},
339
    {0x0005, "ImageAdjustment", N_("Image Adjustment"), N_("Image adjustment setting"), IfdId::nikon2Id,
340
     SectionId::makerTags, unsignedShort, -1, EXV_PRINT_TAG(nikon2ImageAdjustment)},
341
    {0x0006, "ISOSpeed", N_("ISO Speed"), N_("ISO speed setting"), IfdId::nikon2Id, SectionId::makerTags, unsignedShort,
342
     -1, EXV_PRINT_TAG(nikon2IsoSpeed)},
343
    {0x0007, "WhiteBalance", N_("White Balance"), N_("White balance"), IfdId::nikon2Id, SectionId::makerTags,
344
     unsignedShort, -1, EXV_PRINT_TAG(nikon2WhiteBalance)},
345
    {0x0008, "Focus", N_("Focus Mode"), N_("Focus mode"), IfdId::nikon2Id, SectionId::makerTags, unsignedRational, -1,
346
     printValue},
347
    {0x0009, "0x0009", "0x0009", N_("Unknown"), IfdId::nikon2Id, SectionId::makerTags, asciiString, -1, printValue},
348
    {0x000a, "DigitalZoom", N_("Digital Zoom"), N_("Digital zoom setting"), IfdId::nikon2Id, SectionId::makerTags,
349
     unsignedRational, -1, print0x000a},
350
    {0x000b, "AuxiliaryLens", N_("Auxiliary Lens"), N_("Auxiliary lens (adapter)"), IfdId::nikon2Id,
351
     SectionId::makerTags, unsignedShort, -1, printValue},
352
    {0x0f00, "0x0f00", "0x0f00", N_("Unknown"), IfdId::nikon2Id, SectionId::makerTags, unsignedLong, -1, printValue},
353
    // End of list marker
354
    {0xffff, "(UnknownNikon2MnTag)", "(UnknownNikon2MnTag)", N_("Unknown Nikon2MakerNote tag"), IfdId::nikon2Id,
355
     SectionId::makerTags, asciiString, -1, printValue},
356
};
357
358
50
std::ostream& Nikon2MakerNote::print0x000a(std::ostream& os, const Value& value, const ExifData*) {
359
50
  auto [r, s] = value.toRational();
360
50
  if (r == 0)
361
18
    return os << _("Not used");
362
32
  if (s == 0)
363
6
    return os << "(" << value << ")";
364
26
  return os << stringFormat("{:.1f}x", static_cast<float>(r) / s);
365
32
}
366
367
// Nikon3 MakerNote Tag Info
368
constexpr TagInfo Nikon3MakerNote::tagInfo_[] = {
369
    {0x0001, "Version", N_("Version"), N_("Nikon Makernote version"), IfdId::nikon3Id, SectionId::makerTags, undefined,
370
     -1, printExifVersion},
371
    {0x0002, "ISOSpeed", N_("ISO Speed"), N_("ISO speed setting"), IfdId::nikon3Id, SectionId::makerTags, unsignedShort,
372
     -1, print0x0002},
373
    {0x0003, "ColorMode", N_("Color Mode"), N_("Color mode"), IfdId::nikon3Id, SectionId::makerTags, asciiString, -1,
374
     printValue},
375
    {0x0004, "Quality", N_("Quality"), N_("Image quality setting"), IfdId::nikon3Id, SectionId::makerTags, asciiString,
376
     -1, printValue},
377
    {0x0005, "WhiteBalance", N_("White Balance"), N_("White balance"), IfdId::nikon3Id, SectionId::makerTags,
378
     asciiString, -1, printValue},
379
    {0x0006, "Sharpening", N_("Sharpening"), N_("Image sharpening setting"), IfdId::nikon3Id, SectionId::makerTags,
380
     asciiString, -1, printValue},
381
    {0x0007, "Focus", N_("Focus"), N_("Focus mode"), IfdId::nikon3Id, SectionId::makerTags, asciiString, -1,
382
     print0x0007},
383
    {0x0008, "FlashSetting", N_("Flash Setting"), N_("Flash setting"), IfdId::nikon3Id, SectionId::makerTags,
384
     asciiString, -1, printValue},
385
    {0x0009, "FlashDevice", N_("Flash Device"), N_("Flash device"), IfdId::nikon3Id, SectionId::makerTags, asciiString,
386
     -1, printValue},
387
    {0x000a, "0x000a", "0x000a", N_("Unknown"), IfdId::nikon3Id, SectionId::makerTags, unsignedRational, -1,
388
     printValue},
389
    {0x000b, "WhiteBalanceBias", N_("White Balance Bias"), N_("White balance bias"), IfdId::nikon3Id,
390
     SectionId::makerTags, signedShort, -1, printValue},
391
    {0x000c, "WB_RBLevels", N_("WB RB Levels"), N_("WB RB levels"), IfdId::nikon3Id, SectionId::makerTags,
392
     unsignedRational, -1, printValue},
393
    {0x000d, "ProgramShift", N_("Program Shift"), N_("Program shift"), IfdId::nikon3Id, SectionId::makerTags, undefined,
394
     -1, EXV_PRINT_TAG(nikonFlashComp)},
395
    {0x000e, "ExposureDiff", N_("Exposure Difference"), N_("Exposure difference"), IfdId::nikon3Id,
396
     SectionId::makerTags, undefined, -1, EXV_PRINT_TAG(nikonFlashComp)},
397
    {0x000f, "ISOSelection", N_("ISO Selection"), N_("ISO selection"), IfdId::nikon3Id, SectionId::makerTags,
398
     asciiString, -1, printValue},
399
    {0x0010, "DataDump", N_("Data Dump"), N_("Data dump"), IfdId::nikon3Id, SectionId::makerTags, undefined, -1,
400
     printValue},
401
    {0x0011, "Preview", N_("Pointer to a preview image"), N_("Offset to an IFD containing a preview image"),
402
     IfdId::nikon3Id, SectionId::makerTags, undefined, -1, printValue},
403
    {0x0012, "FlashComp", N_("Flash Comp"), N_("Flash compensation setting"), IfdId::nikon3Id, SectionId::makerTags,
404
     undefined, -1, EXV_PRINT_TAG(nikonFlashComp)},
405
    {0x0013, "ISOSettings", N_("ISO Settings"), N_("ISO setting"), IfdId::nikon3Id, SectionId::makerTags, unsignedShort,
406
     -1, print0x0002},  // use 0x0002 print fct
407
    {0x0016, "ImageBoundary", N_("Image Boundary"), N_("Image boundary"), IfdId::nikon3Id, SectionId::makerTags,
408
     unsignedShort, -1, printValue},
409
    {0x0017, "FlashExposureComp", "Flash Exposure Comp", N_("Flash exposure comp"), IfdId::nikon3Id,
410
     SectionId::makerTags, undefined, -1, EXV_PRINT_TAG(nikonFlashComp)},
411
    {0x0018, "FlashBracketComp", N_("Flash Bracket Comp"), N_("Flash bracket compensation applied"), IfdId::nikon3Id,
412
     SectionId::makerTags, undefined, -1, EXV_PRINT_TAG(nikonFlashComp)},  // use 0x0012 print fct
413
    {0x0019, "ExposureBracketComp", N_("Exposure Bracket Comp"), N_("AE bracket compensation applied"), IfdId::nikon3Id,
414
     SectionId::makerTags, signedRational, -1, printValue},
415
    {0x001a, "ImageProcessing", N_("Image Processing"), N_("Image processing"), IfdId::nikon3Id, SectionId::makerTags,
416
     asciiString, -1, printValue},
417
    {0x001b, "CropHiSpeed", N_("Crop High Speed"), N_("Crop high speed"), IfdId::nikon3Id, SectionId::makerTags,
418
     unsignedShort, -1, printValue},
419
    {0x001c, "ExposureTuning", N_("Exposure Tuning"), N_("Exposure tuning"), IfdId::nikon3Id, SectionId::makerTags,
420
     unsignedShort, -1, printValue},
421
    {0x001d, "SerialNumber", N_("Serial Number"), N_("Serial Number"), IfdId::nikon3Id, SectionId::makerTags,
422
     asciiString, -1, printValue},
423
    {0x001e, "ColorSpace", N_("Color Space"), N_("Color space"), IfdId::nikon3Id, SectionId::makerTags, unsignedShort,
424
     -1, EXV_PRINT_TAG(nikonColorSpace)},
425
    {0x001f, "VRInfo", N_("VR Info"), N_("VR info"), IfdId::nikon3Id, SectionId::makerTags, undefined, -1, printValue},
426
    {0x0020, "ImageAuthentication", N_("Image Authentication"), N_("Image authentication"), IfdId::nikon3Id,
427
     SectionId::makerTags, unsignedByte, -1, EXV_PRINT_TAG(nikonOffOn)},
428
    {0x0022, "ActiveDLighting", N_("ActiveD-Lighting"), N_("ActiveD-lighting"), IfdId::nikon3Id, SectionId::makerTags,
429
     unsignedShort, -1, EXV_PRINT_TAG(nikonActiveDLighting)},
430
    {0x0023, "PictureControl", N_("Picture Control"), N_(" Picture control"), IfdId::nikon3Id, SectionId::makerTags,
431
     undefined, -1, printValue},
432
    {0x0024, "WorldTime", N_("World Time"), N_("World time"), IfdId::nikon3Id, SectionId::makerTags, undefined, -1,
433
     printValue},
434
    {0x0025, "ISOInfo", N_("ISO Info"), N_("ISO info"), IfdId::nikon3Id, SectionId::makerTags, undefined, -1,
435
     printValue},
436
    {0x002a, "VignetteControl", N_("Vignette Control"), N_("Vignette control"), IfdId::nikon3Id, SectionId::makerTags,
437
     unsignedShort, -1, EXV_PRINT_TAG(nikonOlnh)},
438
    {0x0034, "ShutterMode", N_("Shutter Mode"), N_("Shutter mode"), IfdId::nikon3Id, SectionId::makerTags,
439
     unsignedShort, -1, EXV_PRINT_TAG(nikonShutterModes)},
440
    {0x0037, "MechanicalShutterCount", N_("Mechanical Shutter Count"), N_("Mechanical shutter count"), IfdId::nikon3Id,
441
     SectionId::makerTags, unsignedLong, -1, printValue},
442
    {0x003f, "WhiteBalanceBias2", N_("White Balance Bias 2"), N_("White balance bias 2"), IfdId::nikon3Id,
443
     SectionId::makerTags, signedRational, -1, printValue},
444
    {0x0080, "ImageAdjustment", N_("Image Adjustment"), N_("Image adjustment setting"), IfdId::nikon3Id,
445
     SectionId::makerTags, asciiString, -1, printValue},
446
    {0x0081, "ToneComp", N_("Tone Compensation"), N_("Tone compensation"), IfdId::nikon3Id, SectionId::makerTags,
447
     asciiString, -1, printValue},
448
    {0x0082, "AuxiliaryLens", N_("Auxiliary Lens"), N_("Auxiliary lens (adapter)"), IfdId::nikon3Id,
449
     SectionId::makerTags, asciiString, -1, printValue},
450
    {0x0083, "LensType", N_("Lens Type"), N_("Lens type"), IfdId::nikon3Id, SectionId::makerTags, unsignedByte, -1,
451
     print0x0083},
452
    {0x0084, "Lens", N_("Lens"), N_("Lens"), IfdId::nikon3Id, SectionId::makerTags, unsignedRational, -1,
453
     printLensSpecification},
454
    {0x0085, "FocusDistance", N_("Focus Distance"), N_("Manual focus distance"), IfdId::nikon3Id, SectionId::makerTags,
455
     unsignedRational, -1, print0x0085},
456
    {0x0086, "DigitalZoom", N_("Digital Zoom"), N_("Digital zoom setting"), IfdId::nikon3Id, SectionId::makerTags,
457
     unsignedRational, -1, print0x0086},
458
    {0x0087, "FlashMode", N_("Flash Mode"), N_("Mode of flash used"), IfdId::nikon3Id, SectionId::makerTags,
459
     unsignedByte, -1, EXV_PRINT_TAG(nikonFlashMode)},
460
    {0x0088, "AFInfo", N_("AF Info"), N_("AF info"), IfdId::nikon3Id, SectionId::makerTags, undefined, -1, printValue},
461
    {0x0089, "ShootingMode", N_("Shooting Mode"), N_("Shooting mode"), IfdId::nikon3Id, SectionId::makerTags,
462
     unsignedShort, -1, print0x0089},
463
    {0x008a, "AutoBracketRelease", N_("Auto Bracket Release"), N_("Auto bracket release"), IfdId::nikon3Id,
464
     SectionId::makerTags, unsignedShort, -1, EXV_PRINT_TAG(nikonAutoBracketRelease)},
465
    {0x008b, "LensFStops", N_("Lens FStops"), N_("Lens FStops"), IfdId::nikon3Id, SectionId::makerTags, undefined, -1,
466
     print0x008b},
467
    {0x008c, "ContrastCurve", N_("Contrast Curve"), N_("Contrast curve"), IfdId::nikon3Id, SectionId::makerTags,
468
     undefined, -1, printValue},
469
    {0x008d, "ColorHue", N_("Color Hue"), N_("Color hue"), IfdId::nikon3Id, SectionId::makerTags, asciiString, -1,
470
     printValue},
471
    {0x008f, "SceneMode", N_("Scene Mode"), N_("Scene mode"), IfdId::nikon3Id, SectionId::makerTags, asciiString, -1,
472
     printValue},
473
    {0x0090, "LightSource", N_("Light Source"), N_("Light source"), IfdId::nikon3Id, SectionId::makerTags, asciiString,
474
     -1, printValue},
475
    {0x0091, "ShotInfo", "Shot Info", N_("Shot info"), IfdId::nikon3Id, SectionId::makerTags, undefined, -1,
476
     printValue},
477
    {0x0092, "HueAdjustment", N_("Hue Adjustment"), N_("Hue adjustment"), IfdId::nikon3Id, SectionId::makerTags,
478
     signedShort, -1, printValue},
479
    {0x0093, "NEFCompression", N_("NEF Compression"), N_("NEF compression"), IfdId::nikon3Id, SectionId::makerTags,
480
     unsignedShort, -1, EXV_PRINT_TAG(nikonNefCompression)},
481
    {0x0094, "Saturation", N_("Saturation"), N_("Saturation"), IfdId::nikon3Id, SectionId::makerTags, signedShort, -1,
482
     printValue},
483
    {0x0095, "NoiseReduction", N_("Noise Reduction"), N_("Noise reduction"), IfdId::nikon3Id, SectionId::makerTags,
484
     asciiString, -1, printValue},
485
    {0x0096, "LinearizationTable", N_("Linearization Table"), N_("Linearization table"), IfdId::nikon3Id,
486
     SectionId::makerTags, undefined, -1, printValue},
487
    {0x0097, "ColorBalance", N_("Color Balance"), N_("Color balance"), IfdId::nikon3Id, SectionId::makerTags, undefined,
488
     -1, printValue},
489
    {0x0098, "LensData", N_("Lens Data"), N_("Lens data settings"), IfdId::nikon3Id, SectionId::makerTags, undefined,
490
     -1, printValue},
491
    {0x0099, "RawImageCenter", N_("Raw Image Center"), N_("Raw image center"), IfdId::nikon3Id, SectionId::makerTags,
492
     unsignedShort, -1, printValue},
493
    {0x009a, "SensorPixelSize", N_("Sensor Pixel Size"), N_("Sensor pixel size"), IfdId::nikon3Id, SectionId::makerTags,
494
     unsignedRational, -1, print0x009a},
495
    {0x009b, "0x009b", "0x009b", N_("Unknown"), IfdId::nikon3Id, SectionId::makerTags, unsignedShort, -1, printValue},
496
    {0x009c, "SceneAssist", N_("Scene Assist"), N_("Scene assist"), IfdId::nikon3Id, SectionId::makerTags, asciiString,
497
     -1, printValue},
498
    {0x009e, "RetouchHistory", N_("Retouch History"), N_("Retouch history"), IfdId::nikon3Id, SectionId::makerTags,
499
     unsignedShort, -1, print0x009e},
500
    {0x009f, "0x009f", "0x009f", N_("Unknown"), IfdId::nikon3Id, SectionId::makerTags, signedShort, -1, printValue},
501
    {0x00a0, "SerialNO", N_("Serial NO"), N_("Camera serial number, usually starts with \"NO= \""), IfdId::nikon3Id,
502
     SectionId::makerTags, asciiString, -1, printValue},
503
    {0x00a2, "ImageDataSize", N_("Image Data Size"), N_("Image data size"), IfdId::nikon3Id, SectionId::makerTags,
504
     unsignedLong, -1, printValue},
505
    {0x00a3, "0x00a3", "0x00a3", N_("Unknown"), IfdId::nikon3Id, SectionId::makerTags, unsignedByte, -1, printValue},
506
    {0x00a5, "ImageCount", N_("Image Count"), N_("Image count"), IfdId::nikon3Id, SectionId::makerTags, unsignedLong,
507
     -1, printValue},
508
    {0x00a6, "DeletedImageCount", N_("Deleted Image Count"), N_("Deleted image count"), IfdId::nikon3Id,
509
     SectionId::makerTags, unsignedLong, -1, printValue},
510
    {0x00a7, "ShutterCount", N_("Shutter Count"), N_("Number of shots taken by camera"), IfdId::nikon3Id,
511
     SectionId::makerTags, unsignedLong, -1, printValue},
512
    {0x00a8, "FlashInfo", "Flash Info", N_("Flash info"), IfdId::nikon3Id, SectionId::makerTags, undefined, -1,
513
     printValue},
514
    {0x00a9, "ImageOptimization", N_("Image Optimization"), N_("Image optimization"), IfdId::nikon3Id,
515
     SectionId::makerTags, asciiString, -1, printValue},
516
    {0x00aa, "Saturation2", N_("Saturation 2"), N_("Saturation 2"), IfdId::nikon3Id, SectionId::makerTags, asciiString,
517
     -1, printValue},
518
    {0x00ab, "VariProgram", N_("Program Variation"), N_("Program variation"), IfdId::nikon3Id, SectionId::makerTags,
519
     asciiString, -1, printValue},
520
    {0x00ac, "ImageStabilization", N_("Image Stabilization"), N_("Image stabilization"), IfdId::nikon3Id,
521
     SectionId::makerTags, asciiString, -1, printValue},
522
    {0x00ad, "AFResponse", N_("AF Response"), N_("AF response"), IfdId::nikon3Id, SectionId::makerTags, asciiString, -1,
523
     printValue},
524
    {0x00b0, "MultiExposure", "Multi Exposure", N_("Multi exposure"), IfdId::nikon3Id, SectionId::makerTags, undefined,
525
     -1, printValue},
526
    {0x00b1, "HighISONoiseReduction", N_("High ISO Noise Reduction"), N_("High ISO Noise Reduction"), IfdId::nikon3Id,
527
     SectionId::makerTags, unsignedShort, -1, EXV_PRINT_TAG(nikonHighISONoiseReduction)},
528
    {0x00b3, "ToningEffect", "Toning Effect", N_("Toning effect"), IfdId::nikon3Id, SectionId::makerTags, asciiString,
529
     -1, printValue},
530
    {0x00b7, "AFInfo2", "AF Info 2", N_("AF info 2"), IfdId::nikon3Id, SectionId::makerTags, undefined, -1, printValue},
531
    {0x00b8, "FileInfo", "File Info", N_("File info"), IfdId::nikon3Id, SectionId::makerTags, undefined, -1,
532
     printValue},
533
    {0x00b9, "AFTune", "AF Tune", N_("AF tune"), IfdId::nikon3Id, SectionId::makerTags, undefined, -1, printValue},
534
    {0x00c3, "BarometerInfo", "Barometer Info", N_("Barometer Info"), IfdId::nikon3Id, SectionId::makerTags, signedLong,
535
     -1, Nikon1MakerNote::printBarValue},
536
    {0x0e00, "PrintIM", N_("Print IM"), N_("PrintIM information"), IfdId::nikon3Id, SectionId::makerTags, undefined, -1,
537
     printValue},
538
    // TODO: Add Capture Data decoding implementation.
539
    {0x0e01, "CaptureData", N_("Capture Data"), N_("Capture data"), IfdId::nikon3Id, SectionId::makerTags, undefined,
540
     -1, printValue},
541
    {0x0e09, "CaptureVersion", N_("Capture Version"), N_("Capture version"), IfdId::nikon3Id, SectionId::makerTags,
542
     asciiString, -1, printValue},
543
    // TODO: Add Capture Offsets decoding implementation.
544
    {0x0e0e, "CaptureOffsets", N_("Capture Offsets"), N_("Capture offsets"), IfdId::nikon3Id, SectionId::makerTags,
545
     undefined, -1, printValue},
546
    {0x0e10, "ScanIFD", "Scan IFD", N_("Scan IFD"), IfdId::nikon3Id, SectionId::makerTags, undefined, -1, printValue},
547
    {0x0e1d, "ICCProfile", "ICC Profile", N_("ICC profile"), IfdId::nikon3Id, SectionId::makerTags, undefined, -1,
548
     printValue},
549
    {0x0e1e, "CaptureOutput", "Capture Output", N_("Capture output"), IfdId::nikon3Id, SectionId::makerTags, undefined,
550
     -1, printValue},
551
    // End of list marker
552
    {0xffff, "(UnknownNikon3MnTag)", "(UnknownNikon3MnTag)", N_("Unknown Nikon3MakerNote tag"), IfdId::nikon3Id,
553
     SectionId::makerTags, asciiString, -1, printValue},
554
};
555
556
//! YesNo, used for DaylightSavings, tag index 2, et al.
557
constexpr TagDetails nikonYesNo[] = {
558
    {0, N_("No")},
559
    {1, N_("Yes")},
560
};
561
562
//! DateDisplayFormat, tag index 3
563
constexpr TagDetails nikonDateDisplayFormat[] = {
564
    {0, N_("Y/M/D")},
565
    {1, N_("M/D/Y")},
566
    {2, N_("D/M/Y")},
567
};
568
569
//! OnOff
570
constexpr TagDetails nikonOnOff[] = {
571
    {1, N_("On")},
572
    {2, N_("Off")},
573
};
574
575
// Nikon3 Vibration Reduction Tag Info
576
constexpr TagInfo Nikon3MakerNote::tagInfoVr_[] = {
577
    {0, "Version", N_("Version"), N_("Version"), IfdId::nikonVrId, SectionId::makerTags, undefined, 4,
578
     printExifVersion},
579
    {4, "VibrationReduction", N_("Vibration Reduction"), N_("Vibration reduction"), IfdId::nikonVrId,
580
     SectionId::makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonOnOff)},
581
    // End of list marker
582
    {0xffff, "(UnknownNikonVrTag)", "(UnknownNikonVrTag)", N_("Unknown Nikon Vibration Reduction Tag"),
583
     IfdId::nikonVrId, SectionId::makerTags, unsignedByte, 1, printValue},
584
};
585
586
//! Adjust
587
constexpr TagDetails nikonAdjust[] = {
588
    {0, N_("Default Settings")},
589
    {1, N_("Quick Adjust")},
590
    {2, N_("Full Control")},
591
};
592
593
//! FilterEffect
594
constexpr TagDetails nikonFilterEffect[] = {
595
    {0x80, N_("Off")}, {0x81, N_("Yellow")}, {0x82, N_("Orange")},
596
    {0x83, N_("Red")}, {0x84, N_("Green")},  {0xff, N_("n/a")},
597
};
598
599
//! ToningEffect
600
constexpr TagDetails nikonToningEffect[] = {
601
    {0x80, N_("B&W")},         {0x81, N_("Sepia")},      {0x82, N_("Cyanotype")},  {0x83, N_("Red")},
602
    {0x84, N_("Yellow")},      {0x85, N_("Green")},      {0x86, N_("Blue-green")}, {0x87, N_("Blue")},
603
    {0x88, N_("Purple-blue")}, {0x89, N_("Red-purple")}, {0xff, N_("n/a")},
604
};
605
606
// Nikon3 Picture Control Tag Info
607
constexpr TagInfo Nikon3MakerNote::tagInfoPc_[] = {
608
    {0, "Version", N_("Version"), N_("Version"), IfdId::nikonPcId, SectionId::makerTags, undefined, 4,
609
     printExifVersion},
610
    {4, "Name", N_("Name"), N_("Name"), IfdId::nikonPcId, SectionId::makerTags, asciiString, 20, printValue},
611
    {24, "Base", N_("Base"), N_("Base"), IfdId::nikonPcId, SectionId::makerTags, asciiString, 20, printValue},
612
    {48, "Adjust", N_("Adjust"), N_("Adjust"), IfdId::nikonPcId, SectionId::makerTags, unsignedByte, 1,
613
     EXV_PRINT_TAG(nikonAdjust)},
614
    {49, "QuickAdjust", N_("Quick Adjust"), N_("Quick adjust"), IfdId::nikonPcId, SectionId::makerTags, unsignedByte, 1,
615
     printPictureControl},
616
    {50, "Sharpness", N_("Sharpness"), N_("Sharpness"), IfdId::nikonPcId, SectionId::makerTags, unsignedByte, 1,
617
     printPictureControl},
618
    {51, "Contrast", N_("Contrast"), N_("Contrast"), IfdId::nikonPcId, SectionId::makerTags, unsignedByte, 1,
619
     printPictureControl},
620
    {52, "Brightness", N_("Brightness"), N_("Brightness"), IfdId::nikonPcId, SectionId::makerTags, unsignedByte, 1,
621
     printPictureControl},
622
    {53, "Saturation", N_("Saturation"), N_("Saturation"), IfdId::nikonPcId, SectionId::makerTags, unsignedByte, 1,
623
     printPictureControl},
624
    {54, "HueAdjustment", N_("Hue Adjustment"), N_("Hue adjustment"), IfdId::nikonPcId, SectionId::makerTags,
625
     unsignedByte, 1, printPictureControl},
626
    {55, "FilterEffect", N_("Filter Effect"), N_("Filter effect"), IfdId::nikonPcId, SectionId::makerTags, unsignedByte,
627
     1, EXV_PRINT_TAG(nikonFilterEffect)},
628
    {56, "ToningEffect", N_("Toning Effect"), N_("Toning effect"), IfdId::nikonPcId, SectionId::makerTags, unsignedByte,
629
     1, EXV_PRINT_TAG(nikonToningEffect)},
630
    {57, "ToningSaturation", N_("Toning Saturation"), N_("Toning saturation"), IfdId::nikonPcId, SectionId::makerTags,
631
     unsignedByte, 1, printPictureControl},
632
    // End of list marker
633
    {0xffff, "(UnknownNikonPcTag)", "(UnknownNikonPcTag)", N_("Unknown Nikon Picture Control Tag"), IfdId::nikonPcId,
634
     SectionId::makerTags, unsignedByte, 1, printValue},
635
};
636
637
//! OnOff
638
constexpr TagDetails aftOnOff[] = {
639
    {0, N_("Off")},
640
    {1, N_("On")},
641
    {2, N_("On")},
642
};
643
644
// Nikon3 AF Fine Tune
645
constexpr TagInfo Nikon3MakerNote::tagInfoAFT_[] = {
646
    {0, "AFFineTune", N_("AF Fine Tune"), N_("AF fine tune"), IfdId::nikonAFTId, SectionId::makerTags, unsignedByte, 1,
647
     EXV_PRINT_TAG(aftOnOff)},
648
    {1, "AFFineTuneIndex", N_("AF Fine Tune Index"), N_("AF fine tune index"), IfdId::nikonAFTId, SectionId::makerTags,
649
     unsignedByte, 1, printValue},
650
    {2, "AFFineTuneAdj", N_("AF Fine Tune Adjustment"), N_("AF fine tune adjustment"), IfdId::nikonAFTId,
651
     SectionId::makerTags, signedByte, 1, printValue},
652
    // End of list marker
653
    {0xffff, "(UnknownNikonAFTTag)", "(UnknownNikonAFTTag)", N_("Unknown Nikon AF Fine Tune Tag"), IfdId::nikonAFTId,
654
     SectionId::makerTags, unsignedByte, 1, printValue},
655
};
656
657
// Nikon3 World Time Tag Info
658
constexpr TagInfo Nikon3MakerNote::tagInfoWt_[] = {
659
    {0, "Timezone", N_("Timezone"), N_("Timezone"), IfdId::nikonWtId, SectionId::makerTags, signedShort, 1,
660
     printTimeZone},
661
    {2, "DaylightSavings", N_("Daylight Savings"), N_("Daylight savings"), IfdId::nikonWtId, SectionId::makerTags,
662
     unsignedByte, 1, EXV_PRINT_TAG(nikonYesNo)},
663
    {3, "DateDisplayFormat", N_("Date Display Format"), N_("Date display format"), IfdId::nikonWtId,
664
     SectionId::makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonDateDisplayFormat)},
665
    // End of list marker
666
    {0xffff, "(UnknownNikonWtTag)", "(UnknownNikonWtTag)", N_("Unknown Nikon World Time Tag"), IfdId::nikonWtId,
667
     SectionId::makerTags, unsignedByte, 1, printValue},
668
};
669
670
//! ISOExpansion, tag index 4 and 10
671
constexpr TagDetails nikonIsoExpansion[] = {
672
    {0x000, N_("Off")},    {0x101, N_("Hi 0.3")}, {0x102, N_("Hi 0.5")}, {0x103, N_("Hi 0.7")}, {0x104, N_("Hi 1.0")},
673
    {0x105, N_("Hi 1.3")}, {0x106, N_("Hi 1.5")}, {0x107, N_("Hi 1.7")}, {0x108, N_("Hi 2.0")}, {0x109, N_("Hi 2.3")},
674
    {0x10a, N_("Hi 2.5")}, {0x10b, N_("Hi 2.7")}, {0x10c, N_("Hi 3.0")}, {0x10d, N_("Hi 3.3")}, {0x10e, N_("Hi 3.5")},
675
    {0x10f, N_("Hi 3.7")}, {0x110, N_("Hi 4.0")}, {0x111, N_("Hi 4.3")}, {0x112, N_("Hi 4.5")}, {0x113, N_("Hi 4.7")},
676
    {0x114, N_("Hi 5.0")}, {0x201, N_("Lo 0.3")}, {0x202, N_("Lo 0.5")}, {0x203, N_("Lo 0.7")}, {0x204, N_("Lo 1.0")},
677
};
678
679
// Nikon3 ISO Info Tag Info
680
constexpr TagInfo Nikon3MakerNote::tagInfoIi_[] = {
681
    {0, "ISO", N_("ISO"), N_("ISO"), IfdId::nikonIiId, SectionId::makerTags, unsignedByte, 1, printIiIso},
682
    {4, "ISOExpansion", N_("ISO Expansion"), N_("ISO expansion"), IfdId::nikonIiId, SectionId::makerTags, unsignedShort,
683
     1, EXV_PRINT_TAG(nikonIsoExpansion)},
684
    {6, "ISO2", N_("ISO 2"), N_("ISO 2"), IfdId::nikonIiId, SectionId::makerTags, unsignedByte, 1, printIiIso},
685
    {10, "ISOExpansion2", N_("ISO Expansion 2"), N_("ISO expansion 2"), IfdId::nikonIiId, SectionId::makerTags,
686
     unsignedShort, 1, EXV_PRINT_TAG(nikonIsoExpansion)},
687
    // End of list marker
688
    {0xffff, "(UnknownNikonIiTag)", "(UnknownNikonIiTag)", N_("Unknown Nikon Iso Info Tag"), IfdId::nikonIiId,
689
     SectionId::makerTags, unsignedByte, 1, printValue},
690
};
691
692
//! AfAreaMode
693
constexpr TagDetails nikonAfAreaMode[] = {
694
    {0, N_("Single Area")},   {1, N_("Dynamic Area")},       {2, N_("Dynamic Area, Closest Subject")},
695
    {3, N_("Group Dynamic")}, {4, N_("Single Area (wide)")}, {5, N_("Dynamic Area (wide)")},
696
};
697
698
//! AF2 Area Mode when Contrast Detect AF is off
699
constexpr TagDetails nikonAf2AreaModeContrastDetectAfOff[] = {
700
    {0, N_("Single-point AF")},
701
    {1, N_("Dynamic-area AF")},
702
    {2, N_("Closest Subject")},
703
    {3, N_("Group Dynamic AF")},
704
    {4, N_("Dynamic-area AF (9 points)")},
705
    {5, N_("Dynamic-area AF (21 points)")},
706
    {6, N_("Dynamic-area AF (51 points)")},
707
    {7, N_("Dynamic-area AF (51 points), 3D-tracking")},
708
    {8, N_("Auto-area AF")},
709
    {9, N_("3D-tracking")},
710
    {10, N_("Single Area AF, Wide")},
711
    {11, N_("Dynamic-area AF, Wide")},
712
    {12, N_("3D-tracking/Wide")},
713
    {13, N_("Group-area AF")},
714
    {14, N_("Dynamic-area AF (25 points)")},
715
    {15, N_("Dynamic-area AF (72 points)")},
716
    {16, N_("Group-area AF (HL)")},
717
    {17, N_("Group-area AF (VL)")},
718
};
719
720
//! AF2 Area Mode when Contrast Detect AF is on
721
constexpr TagDetails nikonAf2AreaModeContrastDetectAfOn[] = {
722
    {0, N_("Contrast AF")},      {1, N_("Normal-area AF")},      {2, N_("Wide-area AF")},
723
    {3, N_("Face-priority AF")}, {4, N_("Subject-tracking AF")}, {5, N_("Pinpoint AF")},
724
};
725
726
//! AfPoint
727
constexpr TagDetails nikonAfPoint[] = {
728
    {0, N_("Center")},      {1, N_("Top")},        {2, N_("Bottom")},      {3, N_("Mid-left")},
729
    {4, N_("Mid-right")},   {5, N_("Upper-left")}, {6, N_("Upper-right")}, {7, N_("Lower-left")},
730
    {8, N_("Lower-right")}, {9, N_("Far Left")},   {10, N_("Far Right")},
731
};
732
733
//! AfPointsInFocus
734
constexpr TagDetailsBitmask nikonAfPointsInFocus[] = {
735
    {0x0001, N_("Center")},      {0x0002, N_("Top")},        {0x0004, N_("Bottom")},      {0x0008, N_("Mid-left")},
736
    {0x0010, N_("Mid-right")},   {0x0020, N_("Upper-left")}, {0x0040, N_("Upper-right")}, {0x0080, N_("Lower-left")},
737
    {0x0100, N_("Lower-right")}, {0x0200, N_("Far Left")},   {0x0400, N_("Far Right")},
738
};
739
740
// Nikon3 Auto Focus Tag Info
741
constexpr TagInfo Nikon3MakerNote::tagInfoAf_[] = {
742
    {0, "AFAreaMode", N_("AF Area Mode"), N_("AF area mode"), IfdId::nikonAfId, SectionId::makerTags, unsignedByte, 1,
743
     EXV_PRINT_TAG(nikonAfAreaMode)},
744
    {1, "AFPoint", N_("AF Point"), N_("AF point"), IfdId::nikonAfId, SectionId::makerTags, unsignedByte, 1,
745
     EXV_PRINT_TAG(nikonAfPoint)},
746
    {2, "AFPointsInFocus", N_("AF Points In Focus"), N_("AF points in focus"), IfdId::nikonAfId, SectionId::makerTags,
747
     unsignedShort, 1, printAfPointsInFocus},
748
    // End of list marker
749
    {0xffff, "(UnknownNikonAfTag)", "(UnknownNikonAfTag)", N_("Unknown Nikon Auto Focus Tag"), IfdId::nikonAfId,
750
     SectionId::makerTags, unsignedByte, 1, printValue},
751
};
752
753
//! PhaseDetectAF
754
constexpr TagDetails nikonPhaseDetectAF[] = {
755
    {0, N_("Off")},           {1, N_("On (51-point)")},      {2, N_("On (11-point)")},  {3, N_("On (39-point)")},
756
    {4, N_("On (73-point)")}, {5, N_("On (73-point, new)")}, {6, N_("On (105-point)")}, {7, N_("On (153-point)")},
757
};
758
759
// Nikon3 Auto Focus Tag Info
760
constexpr TagInfo Nikon3MakerNote::tagInfoAf21_[] = {
761
    {0, "Version", N_("Version"), N_("Version"), IfdId::nikonAf21Id, SectionId::makerTags, undefined, 4,
762
     printExifVersion},
763
    {4, "ContrastDetectAF", N_("Contrast Detect AF"), N_("Contrast detect AF"), IfdId::nikonAf21Id,
764
     SectionId::makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonOffOn)},
765
    {5, "AFAreaMode", N_("AF Area Mode"), N_("AF area mode"), IfdId::nikonAf21Id, SectionId::makerTags, unsignedByte, 1,
766
     printAf2AreaMode},
767
    {6, "PhaseDetectAF", N_("Phase Detect AF"), N_("Phase detect AF"), IfdId::nikonAf21Id, SectionId::makerTags,
768
     unsignedByte, 1, EXV_PRINT_TAG(nikonPhaseDetectAF)},
769
    {7, "PrimaryAFPoint", N_("Primary AF Point"), N_("Primary AF point"), IfdId::nikonAf21Id, SectionId::makerTags,
770
     unsignedByte, 1, printValue},
771
    {8, "AFPointsUsed", N_("AF Points Used"), N_("AF points used"), IfdId::nikonAf21Id, SectionId::makerTags,
772
     unsignedByte, 7, printValue},
773
    {16, "AFImageWidth", N_("AF Image Width"), N_("AF image width"), IfdId::nikonAf21Id, SectionId::makerTags,
774
     unsignedShort, 1, printValue},
775
    {18, "AFImageHeight", N_("AF Image Height"), N_("AF image height"), IfdId::nikonAf21Id, SectionId::makerTags,
776
     unsignedShort, 1, printValue},
777
    {20, "AFAreaXPosition", N_("AF Area X Position"), N_("AF area x position"), IfdId::nikonAf21Id,
778
     SectionId::makerTags, unsignedShort, 1, printValue},
779
    {22, "AFAreaYPosition", N_("AF Area Y Position"), N_("AF area y position"), IfdId::nikonAf21Id,
780
     SectionId::makerTags, unsignedShort, 1, printValue},
781
    {24, "AFAreaWidth", N_("AF Area Width"), N_("AF area width"), IfdId::nikonAf21Id, SectionId::makerTags,
782
     unsignedShort, 1, printValue},
783
    {26, "AFAreaHeight", N_("AF Area Height"), N_("AF area height"), IfdId::nikonAf21Id, SectionId::makerTags,
784
     unsignedShort, 1, printValue},
785
    {28, "ContrastDetectAFInFocus", N_("Contrast Detect AF In Focus"), N_("Contrast detect AF in focus"),
786
     IfdId::nikonAf21Id, SectionId::makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonYesNo)},
787
    // End of list marker
788
    {0xffff, "(UnknownNikonAf2Tag)", "(UnknownNikonAf2Tag)", N_("Unknown Nikon Auto Focus 2 Tag"), IfdId::nikonAf21Id,
789
     SectionId::makerTags, unsignedByte, 1, printValue},
790
};
791
792
// Nikon3 Auto Focus Tag Info Version 1.01 https://github.com/Exiv2/exiv2/pull/900
793
constexpr TagInfo Nikon3MakerNote::tagInfoAf22_[] = {
794
    {0, "Version", N_("Version"), N_("Version"), IfdId::nikonAf22Id, SectionId::makerTags, undefined, 4,
795
     printExifVersion},
796
    {4, "ContrastDetectAF", N_("Contrast Detect AF"), N_("Contrast detect AF"), IfdId::nikonAf22Id,
797
     SectionId::makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonOffOn)},
798
    {5, "AFAreaMode", N_("AF Area Mode"), N_("AF area mode"), IfdId::nikonAf22Id, SectionId::makerTags, unsignedByte, 1,
799
     printValue},
800
    {6, "PhaseDetectAF", N_("Phase Detect AF"), N_("Phase detect AF"), IfdId::nikonAf22Id, SectionId::makerTags,
801
     unsignedByte, 1, EXV_PRINT_TAG(nikonPhaseDetectAF)},
802
    {7, "PrimaryAFPoint", N_("Primary AF Point"), N_("Primary AF point"), IfdId::nikonAf22Id, SectionId::makerTags,
803
     unsignedByte, 1, printValue},
804
    {8, "AFPointsUsed", N_("AF Points Used"), N_("AF points used"), IfdId::nikonAf22Id, SectionId::makerTags,
805
     unsignedByte, 7, printValue},
806
    {70, "AFImageWidth", N_("AF Image Width"), N_("AF image width"), IfdId::nikonAf22Id, SectionId::makerTags,
807
     unsignedShort, 1, printValue},
808
    {72, "AFImageHeight", N_("AF Image Height"), N_("AF image height"), IfdId::nikonAf22Id, SectionId::makerTags,
809
     unsignedShort, 1, printValue},
810
    {74, "AFAreaXPosition", N_("AF Area X Position"), N_("AF area x position"), IfdId::nikonAf22Id,
811
     SectionId::makerTags, unsignedShort, 1, printValue},
812
    {76, "AFAreaYPosition", N_("AF Area Y Position"), N_("AF area y position"), IfdId::nikonAf22Id,
813
     SectionId::makerTags, unsignedShort, 1, printValue},
814
    {78, "AFAreaWidth", N_("AF Area Width"), N_("AF area width"), IfdId::nikonAf22Id, SectionId::makerTags,
815
     unsignedShort, 1, printValue},
816
    {80, "AFAreaHeight", N_("AF Area Height"), N_("AF area height"), IfdId::nikonAf22Id, SectionId::makerTags,
817
     unsignedShort, 1, printValue},
818
    {82, "ContrastDetectAFInFocus", N_("Contrast Detect AF In Focus"), N_("Contrast detect AF in focus"),
819
     IfdId::nikonAf22Id, SectionId::makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonYesNo)},
820
    // End of list marker
821
    {0xffff, "(UnknownNikonAf2Tag)", "(UnknownNikonAf2Tag)", N_("Unknown Nikon Auto Focus 2 Tag"), IfdId::nikonAf22Id,
822
     SectionId::makerTags, unsignedByte, 1, printValue},
823
};
824
825
// Nikon3 File Info Tag Info
826
constexpr TagInfo Nikon3MakerNote::tagInfoFi_[] = {
827
    {0, "Version", N_("Version"), N_("Version"), IfdId::nikonFiId, SectionId::makerTags, undefined, 4,
828
     printExifVersion},
829
    {6, "DirectoryNumber", N_("Directory Number"), N_("Directory number"), IfdId::nikonFiId, SectionId::makerTags,
830
     unsignedShort, 1, printValue},
831
    {8, "FileNumber", N_("File Number"), N_("File number"), IfdId::nikonFiId, SectionId::makerTags, unsignedShort, 1,
832
     printValue},
833
    // End of list marker
834
    {0xffff, "(UnknownNikonFiTag)", "(UnknownNikonFiTag)", N_("Unknown Nikon File Info Tag"), IfdId::nikonFiId,
835
     SectionId::makerTags, unsignedByte, 1, printValue},
836
};
837
838
//! MultiExposureMode
839
constexpr TagDetails nikonMultiExposureMode[] = {
840
    {0, N_("Off")},
841
    {1, N_("Multiple Exposure")},
842
    {2, N_("Image Overlay")},
843
};
844
845
// Nikon3 Multi Exposure Tag Info
846
constexpr TagInfo Nikon3MakerNote::tagInfoMe_[] = {
847
    {0, "Version", N_("Version"), N_("Version"), IfdId::nikonMeId, SectionId::makerTags, undefined, 4,
848
     printExifVersion},
849
    {4, "MultiExposureMode", N_("Multi Exposure Mode"), N_("Multi exposure mode"), IfdId::nikonMeId,
850
     SectionId::makerTags, unsignedLong, 1, EXV_PRINT_TAG(nikonMultiExposureMode)},
851
    {8, "MultiExposureShots", N_("Multi Exposure Shots"), N_("Multi exposure shots"), IfdId::nikonMeId,
852
     SectionId::makerTags, unsignedLong, 1, printValue},
853
    {12, "MultiExposureAutoGain", N_("Multi Exposure Auto Gain"), N_("Multi exposure auto gain"), IfdId::nikonMeId,
854
     SectionId::makerTags, unsignedLong, 1, EXV_PRINT_TAG(nikonOffOn)},
855
    // End of list marker
856
    {0xffff, "(UnknownNikonMeTag)", "(UnknownNikonMeTag)", N_("Unknown Nikon Multi Exposure Tag"), IfdId::nikonMeId,
857
     SectionId::makerTags, unsignedByte, 1, printValue},
858
};
859
860
//! FlashSource
861
constexpr TagDetails nikonFlashSource[] = {
862
    {0, N_("None")},
863
    {1, N_("External")},
864
    {2, N_("Internal")},
865
};
866
867
//! FlashFirmware
868
constexpr TagDetails nikonFlashFirmware[] = {
869
    {0x0000, N_("n/a")},
870
    {0x0101, N_("1.01 (SB-800 or Metz 58 AF-1)")},
871
    {0x0103, "1.03 (SB-800)"},
872
    {0x0201, "2.01 (SB-800)"},
873
    {0x0204, "2.04 (SB-600)"},
874
    {0x0205, "2.05 (SB-600)"},
875
    {0x0301, "3.01 (SU-800 Remote Commander)"},
876
    {0x0401, "4.01 (SB-400)"},
877
    {0x0402, "4.02 (SB-400)"},
878
    {0x0404, "4.04 (SB-400)"},
879
    {0x0501, "5.01 (SB-900)"},
880
    {0x0502, "5.02 (SB-900)"},
881
    {0x0601, "6.01 (SB-700)"},
882
    {0x0701, "7.01 (SB-910)"},
883
    {0x0800, "8.01 (SB-N5)"},
884
    {0x0a00, "10.00 (SB-N7)"},
885
    {0x0b00, "11.00 (SB-300)"},
886
    {0x0d00, "13.00 (SB-500)"},
887
    {0x0e00, "14.00 (SB-5000)"},
888
};
889
890
//! FlashGNDistance
891
constexpr TagDetails nikonFlashGNDistance[] = {
892
    {0, N_("n/a")},   {1, "0.1 m"},     {2, "0.2 m"},     {3, "0.3 m"},     {4, "0.4 m"},     {5, "0.5 m"},
893
    {6, "0.6 m"},     {7, "0.7 m"},     {8, "0.8 m"},     {9, "0.9 m"},     {10, "1.0 m"},    {11, "1.1 m"},
894
    {12, "1.3 m"},    {13, "1.4 m"},    {14, "1.6 m"},    {15, "1.8 m"},    {16, "2.0 m"},    {17, "2.2 m"},
895
    {18, "2.5 m"},    {19, "2.8 m"},    {20, "3.2 m"},    {21, "3.6 m"},    {22, "4.0 m"},    {23, "4.5 m"},
896
    {24, "5.0 m"},    {25, "5.6 m"},    {26, "6.3 m"},    {27, "7.1 m"},    {28, "8.0 m"},    {29, "9.0 m"},
897
    {30, "10.0 m"},   {31, "11.0 m"},   {32, "13.0 m"},   {33, "14.0 m"},   {34, "16.0 m"},   {35, "18.0 m"},
898
    {36, "20.0 m"},   {37, "23.0 m"},   {38, "25.0 m"},   {39, "29.0 m"},   {128, N_("n/a")}, {129, "0.3 ft"},
899
    {130, "0.7 ft"},  {131, "1.0 ft"},  {132, "1.3 ft"},  {133, "1.7 ft"},  {134, "2.0 ft"},  {135, "2.3 ft"},
900
    {136, "2.6 ft"},  {137, "2.9 ft"},  {138, "3.3 ft"},  {139, "3.7 ft"},  {140, "4.1 ft"},  {141, "4.6 ft"},
901
    {142, "5.2 ft"},  {143, "5.8 ft"},  {144, "6.6 ft"},  {145, "7.4 ft"},  {146, "8.3 ft"},  {147, "9.3 ft"},
902
    {148, "10.0 ft"}, {149, "12.0 ft"}, {150, "13.0 ft"}, {151, "15.0 ft"}, {152, "17.0 ft"}, {153, "19.0 ft"},
903
    {154, "21.0 ft"}, {155, "23.0 ft"}, {156, "26.0 ft"}, {157, "29.0 ft"}, {158, "33.0 ft"}, {159, "37.0 ft"},
904
    {160, "42.0 ft"}, {161, "47.0 ft"}, {162, "52.0 ft"}, {163, "59.0 ft"}, {164, "66.0 ft"}, {165, "74.0 ft"},
905
    {166, "83.0 ft"}, {167, "94.0 ft"}, {255, N_("n/a")},
906
};
907
908
//! FlashControlMode
909
constexpr TagDetails nikonFlashControlMode[] = {
910
    {0, N_("Off")},       {1, N_("TTL")},
911
    {2, N_("iTTL")},      {3, N_("Auto Aperture")},
912
    {4, N_("Automatic")}, {5, N_("GN (distance priority)")},
913
    {6, N_("Manual")},    {7, N_("Repeating Flash")},
914
    // 8: When used with Group A (and possibly Group B), may have an additional "Quick Wireless Flash Control [A:B]"
915
    //    mode that applies to Groups A and B. May only be available with Radio AWL modes?
916
    // ?: Possibly includes "iTTL-BL", "i-AA" and "i-A" modes.
917
};
918
919
270
static constexpr bool flashModeUsesManualScale(const int64_t mode) {
920
270
  return (mode == 6 || mode == 7);
921
270
}
922
923
//! ExternalFlashFlags
924
constexpr TagDetails nikonExternalFlashFlags[] = {
925
    {0, N_("Fired")},
926
    {2, N_("Bounce Flash")},
927
    {4, N_("Wide Flash Adapter")},
928
};
929
930
//! FlashColorFilter
931
constexpr TagDetails nikonFlashColorFilter[] = {
932
    {0, N_("None")},
933
    {1, N_("FL-GL1 (for fluorescent light)")},
934
    {2, N_("FL-GL2 (for fluorescent light)")},
935
    {9, N_("TN-A1 (for incandescent light)")},
936
    {10, N_("TN-A2 (for incandescent light)")},
937
    {65, N_("Red")},
938
    {66, N_("Blue")},
939
    {67, N_("Yellow")},
940
    {68, N_("Amber")},
941
    {79, N_("Other")},
942
};
943
944
//! FlashWirelessOptions
945
constexpr TagDetails nikonFlashAWLMode[] = {
946
    {0, N_("AWL Off")},
947
    {1, N_("Optical AWL")},
948
    {2, N_("Optical/Radio AWL")},
949
    {3, N_("Radio AWL")},
950
};
951
952
//! FlashExposureComp
953
constexpr TagDetails nikonFlashExposureComp[] = {
954
    {0, N_("Exposure Comp.: Entire frame")},
955
    {4, N_("Exposure Comp.: Background Only")},
956
};
957
958
//! FlashIlluminationPattern
959
constexpr TagDetails nikonFlashIlluminationPat[] = {
960
    {0, N_("Illumination Pat.: Standard")},
961
    {1, N_("Illumination Pat.: Center-weighted")},
962
    {2, N_("Illumination Pat.: Even")},
963
};
964
965
//! FlashAdaptors
966
constexpr TagDetailsBitmask nikonFlashAdaptors[] = {
967
    {0x04, N_("Bounce Flash adaptor")},
968
    {0x10, N_("Wide Flash adaptor")},
969
    {0x20, N_("Nikon Diffusion Dome")},
970
};
971
972
462
static void printFlashCompensationValue(std::ostream& os, const unsigned char value, const bool manualScale) {
973
462
  std::ios::fmtflags f(os.flags());
974
462
  std::ostringstream oss;
975
462
  oss.copyfmt(os);
976
977
462
  if (manualScale) {
978
    /*
979
       // Format:
980
       0 = "1/1"
981
       1 = "1/1 (-1/6EV)"
982
       2 = "1/1 (-1/3EV)"
983
       3 = "1/1 (-1/2EV)"
984
       4 = "1/1 (-2/3EV)"
985
       5 = "1/1 (-5/6EV)"
986
       6 = "1/2"
987
       7 = "1/2 (-1/6EV)"
988
       ...
989
       48 = "1/256"
990
    */
991
149
    if (value > 48) {
992
59
      os << "(" << value << ")";
993
59
      os.flags(f);
994
59
      return;
995
59
    }
996
90
    const auto mod = value % 6;
997
90
    auto temp = (value < 6) ? 0 : (value - mod) / 6;
998
90
    os << "1/" << std::exp2(temp);
999
90
    if (mod != 0) {
1000
61
      os << " (-";
1001
61
      switch (mod) {
1002
14
        case 1:
1003
14
          os << "1/6 EV)";
1004
14
          break;
1005
14
        case 2:
1006
14
          os << "1/3 EV)";
1007
14
          break;
1008
14
        case 3:
1009
14
          os << "1/2 EV)";
1010
14
          break;
1011
9
        case 4:
1012
9
          os << "2/3 EV)";
1013
9
          break;
1014
10
        case 5:
1015
10
          os << "5/6 EV)";
1016
10
          break;
1017
61
      }
1018
61
    }
1019
313
  } else {
1020
    /*
1021
    // Format uses 127 as boundary between +/- then values descend:
1022
    0   = "0.0EV"
1023
    1   = "-0.2EV"
1024
    2   = "-0.3EV"
1025
    3   = "-0.5EV"
1026
    4   = "-0.7EV"
1027
    5   = "-0.8EV"
1028
    6   = "-1.0EV"
1029
    7   = "-1.2EV"
1030
    ...
1031
    127 = "-21.2EV"
1032
    128 = "+21.3EV"
1033
    129 = "+21.2EV"
1034
    130 = "+21.0EV"
1035
    ...
1036
    255 = "+0.2"
1037
     */
1038
313
    auto output = 0.0f;
1039
313
    if (value < 128) {
1040
203
      if (value != 0)
1041
151
        output = static_cast<float>(value) * -1.0f;
1042
203
    } else {
1043
110
      output = 256.0f - static_cast<float>(value);
1044
110
    }
1045
313
    os.precision(1);
1046
313
    if (value != 0)
1047
261
      os << std::showpos;
1048
313
    os << std::fixed << (output / 6) << " EV";
1049
313
  }
1050
403
  os.copyfmt(os);
1051
403
  os.flags(f);
1052
403
}
1053
1054
// Nikon3 Flash Info 1 Tag Info
1055
constexpr TagInfo Nikon3MakerNote::tagInfoFl1_[] = {
1056
    {0, "Version", N_("Version"), N_("Version"), IfdId::nikonFl1Id, SectionId::makerTags, undefined, 4,
1057
     printExifVersion},
1058
    {4, "FlashSource", N_("Flash Source"), N_("Flash source"), IfdId::nikonFl1Id, SectionId::makerTags, unsignedByte, 1,
1059
     EXV_PRINT_TAG(nikonFlashSource)},
1060
    {5, "0x0005", N_("0x0005"), N_("Unknown"), IfdId::nikonFl1Id, SectionId::makerTags, unsignedByte, 1, printValue},
1061
    {6, "ExternalFlashFirmware", N_("External Flash Firmware"), N_("External flash firmware"), IfdId::nikonFl1Id,
1062
     SectionId::makerTags, unsignedShort, 1, EXV_PRINT_TAG(nikonFlashFirmware)},
1063
    {8, "ExternalFlashFlags", N_("External Flash Flags"), N_("External flash flags"), IfdId::nikonFl1Id,
1064
     SectionId::makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonExternalFlashFlags)},
1065
    {11, "FlashFocalLength", N_("Flash Focal Length"), N_("Flash focal length"), IfdId::nikonFl1Id,
1066
     SectionId::makerTags, unsignedByte, 1, printFlashFocalLength},
1067
    {12, "RepeatingFlashRate", N_("Repeating Flash Rate"), N_("Repeating flash rate"), IfdId::nikonFl1Id,
1068
     SectionId::makerTags, unsignedByte, 1, printRepeatingFlashRate},
1069
    {13, "RepeatingFlashCount", N_("Repeating Flash Count"), N_("Repeating flash count"), IfdId::nikonFl1Id,
1070
     SectionId::makerTags, unsignedByte, 1, printRepeatingFlashCount},
1071
    {14, "FlashGNDistance", N_("Flash GN Distance"), N_("Flash GN distance"), IfdId::nikonFl1Id, SectionId::makerTags,
1072
     unsignedByte, 1, EXV_PRINT_TAG(nikonFlashGNDistance)},
1073
    {15, "FlashGroupAControlMode", N_("Flash Group A Control Mode"), N_("Flash group a control mode"),
1074
     IfdId::nikonFl1Id, SectionId::makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonFlashControlMode)},
1075
    {16, "FlashGroupBControlMode", N_("Flash Group B Control Mode"), N_("Flash group b control mode"),
1076
     IfdId::nikonFl1Id, SectionId::makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonFlashControlMode)},
1077
    // End of list marker
1078
    {0xffff, "(UnknownNikonMeTag)", "(UnknownNikonMeTag)", N_("Unknown Nikon Multi Exposure Tag"), IfdId::nikonFl1Id,
1079
     SectionId::makerTags, unsignedByte, 1, printValue},
1080
};
1081
1082
// Nikon3 Flash Info 2 Tag Info
1083
constexpr TagInfo Nikon3MakerNote::tagInfoFl2_[] = {
1084
    {0, "Version", N_("Version"), N_("Version"), IfdId::nikonFl2Id, SectionId::makerTags, undefined, 4,
1085
     printExifVersion},
1086
    {4, "FlashSource", N_("Flash Source"), N_("Flash source"), IfdId::nikonFl2Id, SectionId::makerTags, unsignedByte, 1,
1087
     EXV_PRINT_TAG(nikonFlashSource)},
1088
    {5, "0x0005", N_("0x0005"), N_("Unknown"), IfdId::nikonFl2Id, SectionId::makerTags, unsignedByte, 1, printValue},
1089
    {6, "ExternalFlashFirmware", N_("External Flash Firmware"), N_("External flash firmware"), IfdId::nikonFl2Id,
1090
     SectionId::makerTags, unsignedShort, 1, EXV_PRINT_TAG(nikonFlashFirmware)},
1091
    {8, "ExternalFlashFlags", N_("External Flash Flags"), N_("External flash flags"), IfdId::nikonFl2Id,
1092
     SectionId::makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonExternalFlashFlags)},
1093
    {12, "FlashFocalLength", N_("Flash Focal Length"), N_("Flash focal length"), IfdId::nikonFl2Id,
1094
     SectionId::makerTags, unsignedByte, 1, printFlashFocalLength},
1095
    {13, "RepeatingFlashRate", N_("Repeating Flash Rate"), N_("Repeating flash rate"), IfdId::nikonFl2Id,
1096
     SectionId::makerTags, unsignedByte, 1, printRepeatingFlashRate},
1097
    {14, "RepeatingFlashCount", N_("Repeating Flash Count"), N_("Repeating flash count"), IfdId::nikonFl2Id,
1098
     SectionId::makerTags, unsignedByte, 1, printRepeatingFlashCount},
1099
    {15, "FlashGNDistance", N_("Flash GN Distance"), N_("Flash GN distance"), IfdId::nikonFl2Id, SectionId::makerTags,
1100
     unsignedByte, 1, EXV_PRINT_TAG(nikonFlashGNDistance)},
1101
    // End of list marker
1102
    {0xffff, "(UnknownNikonMeTag)", "(UnknownNikonMeTag)", N_("Unknown Nikon Multi Exposure Tag"), IfdId::nikonFl2Id,
1103
     SectionId::makerTags, unsignedByte, 1, printValue},
1104
};
1105
1106
// Nikon3 Flash Info 3 Tag Info
1107
constexpr TagInfo Nikon3MakerNote::tagInfoFl3_[] = {
1108
    {0, "Version", N_("Version"), N_("Version"), IfdId::nikonFl3Id, SectionId::makerTags, undefined, 4,
1109
     printExifVersion},
1110
    {4, "FlashSource", N_("Flash Source"), N_("Flash source"), IfdId::nikonFl3Id, SectionId::makerTags, unsignedByte, 1,
1111
     EXV_PRINT_TAG(nikonFlashSource)},
1112
    {6, "ExternalFlashFirmware", N_("External Flash Firmware"), N_("External flash firmware"), IfdId::nikonFl3Id,
1113
     SectionId::makerTags, unsignedShort, 1, EXV_PRINT_TAG(nikonFlashFirmware)},
1114
    {8, "ExternalFlashFlags", N_("External Flash Flags"), N_("External flash flags"), IfdId::nikonFl3Id,
1115
     SectionId::makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonExternalFlashFlags)},
1116
    {12, "FlashFocalLength", N_("Flash Focal Length"), N_("Flash focal length"), IfdId::nikonFl3Id,
1117
     SectionId::makerTags, unsignedByte, 1, printFlashFocalLength},
1118
    {13, "RepeatingFlashRate", N_("Repeating Flash Rate"), N_("Repeating flash rate"), IfdId::nikonFl3Id,
1119
     SectionId::makerTags, unsignedByte, 1, printRepeatingFlashRate},
1120
    {14, "RepeatingFlashCount", N_("Repeating Flash Count"), N_("Repeating flash count"), IfdId::nikonFl3Id,
1121
     SectionId::makerTags, unsignedByte, 1, printRepeatingFlashCount},
1122
    {15, "FlashGNDistance", N_("Flash GN Distance"), N_("Flash GN distance"), IfdId::nikonFl3Id, SectionId::makerTags,
1123
     unsignedByte, 1, EXV_PRINT_TAG(nikonFlashGNDistance)},
1124
    {16, "FlashColorFilter", N_("Flash Color Filter"), N_("Flash color filter"), IfdId::nikonFl3Id,
1125
     SectionId::makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonFlashColorFilter)},
1126
    // End of list marker
1127
    {0xffff, "(UnknownNikonMeTag)", "(UnknownNikonMeTag)", N_("Unknown Nikon Multi Exposure Tag"), IfdId::nikonFl3Id,
1128
     SectionId::makerTags, unsignedByte, 1, printValue},
1129
};
1130
1131
// Nikon3 Flash Info 6 (0106) Tag Info
1132
constexpr TagInfo Nikon3MakerNote::tagInfoFl6_[] = {
1133
    {0, "Version", N_("Version"), N_("Identifies the NikonFl version"), IfdId::nikonFl6Id, SectionId::makerTags,
1134
     undefined, 4, printExifVersion},
1135
    {4, "FlashSource", N_("Flash source"), N_("The type of flash used"), IfdId::nikonFl6Id, SectionId::makerTags,
1136
     unsignedByte, 1, EXV_PRINT_TAG(nikonFlashSource)},
1137
    // 5: May be connected to high-speed shutter setting?
1138
    {6, "ExternalFlashFirmware", N_("External flash firmware"), N_("External flash firmware version"),
1139
     IfdId::nikonFl6Id, SectionId::makerTags, unsignedShort, 1, EXV_PRINT_TAG(nikonFlashFirmware)},
1140
    {8, "ExternalFlashData1", N_("External flash data 1"),
1141
     N_("The Speedlight flash status and any attached flash adapters"), IfdId::nikonFl6Id, SectionId::makerTags,
1142
     unsignedByte, 1, printExternalFlashData1Fl6},
1143
    {9, "ExternalFlashData2", N_("External flash data 2"),
1144
     N_("The external flash status and the mode used for the Master flash (see FlashSource)"), IfdId::nikonFl6Id,
1145
     SectionId::makerTags, unsignedByte, 1, printExternalFlashData2Fl6},
1146
    {10, "FlashCompensationMaster", N_("Flash compensation Master"),
1147
     N_("Flash compensation for the Master flash (see FlashSource)"), IfdId::nikonFl6Id, SectionId::makerTags,
1148
     unsignedByte, 1, printFlashMasterDataFl6},
1149
    {12, "FlashFocalLength", N_("Flash focal length"), N_("Flash focal length"), IfdId::nikonFl6Id,
1150
     SectionId::makerTags, unsignedByte, 1, printFlashFocalLength},
1151
    {13, "RepeatingFlashRate", N_("Repeating flash rate"), N_("For repeating flash mode, the rate (in Hz)"),
1152
     IfdId::nikonFl6Id, SectionId::makerTags, unsignedByte, 1, printRepeatingFlashRate},
1153
    {14, "RepeatingFlashCount", N_("Repeating flash count"),
1154
     N_("For repeating flash mode, the number of flash firings"), IfdId::nikonFl6Id, SectionId::makerTags, unsignedByte,
1155
     1, printRepeatingFlashCount},
1156
    {15, "FlashGNDistance", N_("Flash GN distance"),
1157
     N_("For GN (distance priority) mode on the Master flash (see FlashSource), the distance to the subject"),
1158
     IfdId::nikonFl6Id, SectionId::makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonFlashGNDistance)},
1159
    {16, "FlashColorFilter", N_("Flash color filter"), N_("The attached color filter"), IfdId::nikonFl6Id,
1160
     SectionId::makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonFlashColorFilter)},
1161
    {17, "FlashGroupAControlData", N_("Flash Group A control data"), N_("The mode used for Group A flashes"),
1162
     IfdId::nikonFl6Id, SectionId::makerTags, unsignedByte, 1, printFlashGroupAControlData},
1163
    {18, "FlashGroupBCControlData", N_("Flash Group B/C control data"), N_("The modes used for Group B and C flashes"),
1164
     IfdId::nikonFl6Id, SectionId::makerTags, unsignedByte, 1, printFlashGroupBCControlData},
1165
    {19, "FlashCompensationGroupA", N_("Flash compensation Group A"), N_("Flash compensation for Group A flashes"),
1166
     IfdId::nikonFl6Id, SectionId::makerTags, unsignedByte, 1, printFlashGroupADataFl6},
1167
    {20, "FlashCompensationGroupB", N_("Flash compensation Group B data"), N_("Flash compensation for Group B flashes"),
1168
     IfdId::nikonFl6Id, SectionId::makerTags, unsignedByte, 1, printFlashGroupBDataFl6},
1169
    {21, "FlashCompensationGroupC", N_("Flash Compensation Group C data"), N_("Flash compensation for Group C flashes"),
1170
     IfdId::nikonFl6Id, SectionId::makerTags, unsignedByte, 1, printFlashGroupCDataFl6},
1171
    // 22: Possibly includes nikonFlashExposureComp array?
1172
    {28, "CameraExposureCompensation", N_("Camera exposure compensation"), N_("The camera's exposure compensation"),
1173
     IfdId::nikonFl6Id, SectionId::makerTags, unsignedByte, 1, printCameraExposureCompensation},
1174
    {29, "CameraFlashCompensation", N_("Camera flash compensation"), N_("The camera's flash compensation"),
1175
     IfdId::nikonFl6Id, SectionId::makerTags, unsignedByte, 1, printCameraExposureCompensation},
1176
    {39, "FlashMasterOutput", N_("Flash Master output"),
1177
     N_("Total flash output for the Master (see FlashSource). FlashMasterOutput = CameraExposureCompensation "
1178
        "(if exposure uses \"Entire frame\" mode and Master uses a non-manual mode) + CameraFlashCompensation (if "
1179
        "Master uses a non-manual mode) + FlashCompensationMaster"),
1180
     IfdId::nikonFl6Id, SectionId::makerTags, unsignedByte, 1, printFlashMasterDataFl6},
1181
    {40, "FlashGroupAOutput", N_("Flash Group A output"),
1182
     N_("Total flash output for Group A. FlashGroupAOutput = CameraExposureCompensation (if exposure uses \"Entire "
1183
        "frame\" mode and Group A uses a non-manual mode) + CameraFlashCompensation (if Group A uses a non-manual "
1184
        "mode) + "
1185
        "FlashCompensationGroupA"),
1186
     IfdId::nikonFl6Id, SectionId::makerTags, unsignedByte, 1, printFlashGroupADataFl6},
1187
    {41, "FlashGroupBOutput", N_("Flash Group B output"),
1188
     N_("Total flash output for Group B. FlashGroupBOutput = CameraExposureCompensation (if exposure uses \"Entire "
1189
        "frame\" mode and Group B uses a non-manual mode) + CameraFlashCompensation (if Group B uses a non-manual "
1190
        "mode) + "
1191
        "FlashCompensationGroupB"),
1192
     IfdId::nikonFl6Id, SectionId::makerTags, unsignedByte, 1, printFlashGroupBDataFl6},
1193
    {42, "FlashGroupCOutput", N_("Flash Group C output"),
1194
     N_("Total flash output for Group C. FlashGroupCOutput = CameraExposureCompensation (if exposure uses \"Entire "
1195
        "frame\" mode and Group C uses a non-manual mode) + CameraFlashCompensation (if Group C uses a non-manual "
1196
        "mode) + "
1197
        "FlashCompensationGroupC"),
1198
     IfdId::nikonFl6Id, SectionId::makerTags, unsignedByte, 1, printFlashGroupCDataFl6},
1199
    // End of list marker
1200
    {0xffff, "(UnknownNikonFl6Tag)", "(UnknownNikonFl6Tag)", N_("Unknown Nikon Flash Info 6 Tag"), IfdId::nikonFl6Id,
1201
     SectionId::makerTags, unsignedByte, 1, printValue},
1202
};
1203
1204
// Nikon3 Flash Info 7 (0107 and 0108) Tag Info
1205
constexpr TagInfo Nikon3MakerNote::tagInfoFl7_[] = {
1206
    {0, "Version", N_("Version"), N_("Identifies the NikonFl version"), IfdId::nikonFl7Id, SectionId::makerTags,
1207
     undefined, 4, printExifVersion},
1208
    {4, "FlashSource", N_("Flash source"), N_("The type of flash used"), IfdId::nikonFl7Id, SectionId::makerTags,
1209
     unsignedByte, 1, EXV_PRINT_TAG(nikonFlashSource)},
1210
    // 5: Possibly connected to high-speed shutter setting?
1211
    {6, "ExternalFlashFirmware", N_("External flash firmware"), N_("The firmware version used by the external flash"),
1212
     IfdId::nikonFl7Id, SectionId::makerTags, unsignedShort, 1, EXV_PRINT_TAG(nikonFlashFirmware)},
1213
    {8, "ExternalFlashData1", N_("External flash data 1"),
1214
     N_("The external flash state, zoom status and attached flash adapters"), IfdId::nikonFl7Id, SectionId::makerTags,
1215
     unsignedByte, 1, printExternalFlashData1Fl7},
1216
    {9, "ExternalFlashData2", N_("External flash data 2"), N_("The mode used for the Master flash (see FlashSource)"),
1217
     IfdId::nikonFl7Id, SectionId::makerTags, unsignedByte, 1, printExternalFlashData2},
1218
    {10, "FlashCompensationMaster", N_("Flash compensation Master"),
1219
     N_("Flash compensation for the Master flash (see FlashSource)"), IfdId::nikonFl7Id, SectionId::makerTags,
1220
     unsignedByte, 1, printFlashMasterDataFl7},
1221
    // 12: Purpose of tag is unclear as manual zoom value is found in tag 38. Possibly connected to automatic zoom?
1222
    {12, "FlashFocalLength", N_("Flash focal length"), N_("Flash focal length"), IfdId::nikonFl7Id,
1223
     SectionId::makerTags, unsignedByte, 1, printFlashFocalLength},
1224
    {13, "RepeatingFlashRate", N_("Repeating flash rate"), N_("For repeating flash modes, the rate (in Hz)"),
1225
     IfdId::nikonFl7Id, SectionId::makerTags, unsignedByte, 1, printRepeatingFlashRate},
1226
    {14, "RepeatingFlashCount", N_("Repeating flash count"),
1227
     N_("For repeating flash modes, the number of flash firings"), IfdId::nikonFl7Id, SectionId::makerTags,
1228
     unsignedByte, 1, printRepeatingFlashCount},
1229
    {15, "FlashGNDistance", N_("Flash GN distance"),
1230
     N_("For GN (distance priority) mode on the Master flash (see FlashSource), the distance to the subject"),
1231
     IfdId::nikonFl7Id, SectionId::makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonFlashGNDistance)},
1232
    {16, "FlashColorFilter", N_("Flash color filter"), N_("The attached color filters"), IfdId::nikonFl7Id,
1233
     SectionId::makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonFlashColorFilter)},
1234
    // 17: Possibly also contains control data for Group D in upper nibble?
1235
    {17, "FlashGroupAControlData", N_("Flash Group A control data"), N_("The mode used for Group A flashes"),
1236
     IfdId::nikonFl7Id, SectionId::makerTags, unsignedByte, 1, printFlashGroupAControlData},
1237
    {18, "FlashGroupBCControlData", N_("Flash Groups B/C control data"), N_("The modes used for Group B and C flashes"),
1238
     IfdId::nikonFl7Id, SectionId::makerTags, unsignedByte, 1, printFlashGroupBCControlData},
1239
    {19, "FlashCompensationGroupA", N_("Flash compensation Group A"), N_("Flash compensation for Group A flashes"),
1240
     IfdId::nikonFl7Id, SectionId::makerTags, unsignedByte, 1, printFlashGroupADataFl7},
1241
    {20, "FlashCompensationGroupB", N_("Flash compensation Group B data"), N_("Flash compensation for Group B flashes"),
1242
     IfdId::nikonFl7Id, SectionId::makerTags, unsignedByte, 1, printFlashGroupBDataFl7},
1243
    {21, "FlashCompensationGroupC", N_("Flash Compensation Group C data"), N_("Flash compensation for Group C flashes"),
1244
     IfdId::nikonFl7Id, SectionId::makerTags, unsignedByte, 1, printFlashGroupCDataFl7},
1245
    {22, "ExternalFlashData3", N_("External flash data 3"),
1246
     N_("For the camera's exposure compensation, defines how the flash level is adjusted"), IfdId::nikonFl7Id,
1247
     SectionId::makerTags, unsignedByte, 1, printExternalFlashData3},
1248
    {27, "CameraFlashOutput", N_("Camera flash output"),
1249
     N_("Total flash output for the camera. CameraFlashOutput = CameraExposureCompensation (if ExternalFlashData3 "
1250
        "uses \"Entire frame\" mode) + CameraFlashCompensation"),
1251
     IfdId::nikonFl7Id, SectionId::makerTags, unsignedByte, 1, printCameraExposureCompensation},
1252
    {28, "CameraExposureCompensation", N_("Camera exposure compensation"), N_("The camera's exposure compensation"),
1253
     IfdId::nikonFl7Id, SectionId::makerTags, unsignedByte, 1, printCameraExposureCompensation},
1254
    {29, "CameraFlashCompensation", N_("Camera flash compensation"), N_("The camera's flash compensation"),
1255
     IfdId::nikonFl7Id, SectionId::makerTags, unsignedByte, 1, printCameraExposureCompensation},
1256
    // 34: Possible that FV Lock sets '0100 0000'?
1257
    {37, "ExternalFlashData4", N_("External flash data 4"), N_("The flash illumination pattern"), IfdId::nikonFl7Id,
1258
     SectionId::makerTags, unsignedByte, 1, printExternalFlashData4},
1259
    {38, "FlashZoomHeadPosition", N_("Flash zoom head position"), N_("Flash zoom head position (in mm)"),
1260
     IfdId::nikonFl7Id, SectionId::makerTags, unsignedByte, 1, printFlashZoomHeadPosition},
1261
    {39, "FlashMasterOutput", N_("Flash Master output"),
1262
     N_("Total flash output for the Master (see FlashSource). FlashMasterOutput = CameraFlashOutput (if Master uses a "
1263
        "non-manual mode) + "
1264
        "FlashCompensationMaster"),
1265
     IfdId::nikonFl7Id, SectionId::makerTags, unsignedByte, 1, printFlashMasterDataFl7},
1266
    {40, "FlashGroupAOutput", N_("Flash Group A output"),
1267
     N_("Total flash output for Group A. FlashGroupAOutput = CameraFlashOutput (if Group A uses a non-manual mode) + "
1268
        "FlashCompensationGroupA"),
1269
     IfdId::nikonFl7Id, SectionId::makerTags, unsignedByte, 1, printFlashGroupADataFl7},
1270
    {41, "FlashGroupBOutput", N_("Flash Group B output"),
1271
     N_("Total flash output for Group B. FlashGroupBOutput = CameraFlashOutput (if Group B uses a non-manual mode) + "
1272
        "FlashCompensationGroupB"),
1273
     IfdId::nikonFl7Id, SectionId::makerTags, unsignedByte, 1, printFlashGroupBDataFl7},
1274
    {42, "FlashGroupCOutput", N_("Flash Group C output"),
1275
     N_("Total flash output for Group C. FlashGroupCOutput = CameraFlashOutput (if Group C uses a non-manual mode) + "
1276
        "FlashCompensationGroupC"),
1277
     IfdId::nikonFl7Id, SectionId::makerTags, unsignedByte, 1, printFlashGroupCDataFl7},
1278
    // 43-46: Each corresponds to M/A/B/C - set when using TTL modes, otherwise is zero. Could be connected to the
1279
    //        monitor pre-flashes?
1280
    {67, "WirelessFlashData", N_("Wireless flash data"), N_("Advanced Wireless Lighting (AWL) communication mode"),
1281
     IfdId::nikonFl7Id, SectionId::makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonFlashAWLMode)},
1282
    // 68-72: Related to WirelessFlashData? Set if AWL is on, zero if AWL is off. 68-71 connected to M/A/B/C?
1283
    // ?:     1. Groups D/E/F will have equivalent tags to Groups A/B/C (see note in tag 17). This could also include
1284
    //           equivalent tags in 43-46?
1285
    //        2. Compatible remote flashes using 'Radio AWL' could transmit settings/data back to the Speedflash?
1286
    //        3. Automatic flash mode (A) uses an aperture value.
1287
    //        4. The Speedlight can detect if the Master is not pointed straight ahead. The vertical and horizontal
1288
    //           angles/positions of the flash could be recorded?
1289
    // End of list marker
1290
    {0xffff, "(UnknownNikonFl7Tag)", "(UnknownNikonFl7Tag)", N_("Unknown Nikon Flash Info 7 Tag"), IfdId::nikonFl7Id,
1291
     SectionId::makerTags, unsignedByte, 1, printValue},
1292
};
1293
1294
// Nikon3 Shot Info D80 Tag Info
1295
constexpr TagInfo Nikon3MakerNote::tagInfoSi1_[] = {
1296
    {0, "Version", N_("Version"), N_("Version"), IfdId::nikonSi1Id, SectionId::makerTags, unsignedByte, 4,
1297
     printExifVersion},
1298
    {586, "ShutterCount", N_("Shutter Count"), N_("Shutter count"), IfdId::nikonSi1Id, SectionId::makerTags,
1299
     unsignedLong, 1, printValue},
1300
    // End of list marker
1301
    {0xffff, "(UnknownNikonSi1Tag)", "(UnknownNikonSi1Tag)", N_("Unknown Nikon Shot Info D80 Tag"), IfdId::nikonSi1Id,
1302
     SectionId::makerTags, unsignedByte, 1, printValue},
1303
};
1304
1305
// Nikon3 Shot Info D40 Tag Info
1306
constexpr TagInfo Nikon3MakerNote::tagInfoSi2_[] = {
1307
    {0, "Version", N_("Version"), N_("Version"), IfdId::nikonSi2Id, SectionId::makerTags, unsignedByte, 4,
1308
     printExifVersion},
1309
    {582, "ShutterCount", N_("Shutter Count"), N_("Shutter count"), IfdId::nikonSi2Id, SectionId::makerTags,
1310
     unsignedLong, 1, printValue},
1311
    {738, "FlashLevel", N_("Flash Level"), N_("Flash level"), IfdId::nikonSi2Id, SectionId::makerTags, unsignedByte, 1,
1312
     printValue},
1313
    // End of list marker
1314
    {0xffff, "(UnknownNikonSi2Tag)", "(UnknownNikonSi2Tag)", N_("Unknown Nikon Shot Info D40 Tag"), IfdId::nikonSi2Id,
1315
     SectionId::makerTags, unsignedByte, 1, printValue},
1316
};
1317
1318
//! AfFineTuneAdj D300 (a)
1319
constexpr TagDetails nikonAfFineTuneAdj1[] = {
1320
    {0x0000, "0"},   {0x003a, "+1"},  {0x003b, "+2"},  {0x003c, "+4"},  {0x003d, "+8"},  {0x003e, "+16"},
1321
    {0x00c2, "-16"}, {0x00c3, "-8"},  {0x00c4, "-4"},  {0x00c5, "-2"},  {0x00c6, "-1"},  {0x103e, "+17"},
1322
    {0x10c2, "-17"}, {0x203d, "+9"},  {0x203e, "+18"}, {0x20c2, "-18"}, {0x20c3, "-9"},  {0x303e, "+19"},
1323
    {0x30c2, "-19"}, {0x403c, "+5"},  {0x403d, "+10"}, {0x403e, "+20"}, {0x40c2, "-20"}, {0x40c3, "-10"},
1324
    {0x40c4, "-5"},  {0x603d, "+11"}, {0x60c3, "-11"}, {0x803b, "+3"},  {0x803c, "+6"},  {0x803d, "+12"},
1325
    {0x80c3, "-12"}, {0x80c4, "-6"},  {0x80c5, "-3"},  {0xa03d, "+13"}, {0xa0c3, "-13"}, {0xc03c, "+7"},
1326
    {0xc03d, "+14"}, {0xc0c3, "-14"}, {0xc0c4, "-7"},  {0xe03d, "+15"}, {0xe0c3, "-15"},
1327
};
1328
1329
// Nikon3 Shot Info D300 (a) Tag Info
1330
constexpr TagInfo Nikon3MakerNote::tagInfoSi3_[] = {
1331
    {0, "Version", N_("Version"), N_("Version"), IfdId::nikonSi3Id, SectionId::makerTags, unsignedByte, 4,
1332
     printExifVersion},
1333
    {604, "ISO", N_("ISO"), N_("ISO"), IfdId::nikonSi3Id, SectionId::makerTags, unsignedByte, 1, printIiIso},
1334
    {633, "ShutterCount", N_("Shutter Count"), N_("Shutter count"), IfdId::nikonSi3Id, SectionId::makerTags,
1335
     unsignedLong, 1, printValue},
1336
    {721, "AFFineTuneAdj", N_("AF Fine Tune Adj"), N_("AF fine tune adj"), IfdId::nikonSi3Id, SectionId::makerTags,
1337
     unsignedShort, 1, EXV_PRINT_TAG(nikonAfFineTuneAdj1)},
1338
    // End of list marker
1339
    {0xffff, "(UnknownNikonSi3Tag)", "(UnknownNikonSi3Tag)", N_("Unknown Nikon Shot Info D300 (a) Tag"),
1340
     IfdId::nikonSi3Id, SectionId::makerTags, unsignedByte, 1, printValue},
1341
};
1342
1343
//! AfFineTuneAdj D300 (b)
1344
constexpr TagDetails nikonAfFineTuneAdj2[] = {
1345
    {0x0000, "0"},   {0x043e, "+13"}, {0x04c2, "-13"}, {0x183d, "+7"},  {0x183e, "+14"}, {0x18c2, "-14"},
1346
    {0x18c3, "-7"},  {0x2c3e, "+15"}, {0x2cc2, "-15"}, {0x403a, "+1"},  {0x403b, "+2"},  {0x403c, "+4"},
1347
    {0x403d, "+8"},  {0x403e, "+16"}, {0x40c2, "-16"}, {0x40c3, "-8"},  {0x40c4, "-4"},  {0x40c5, "-2"},
1348
    {0x40c6, "-1"},  {0x543e, "+17"}, {0x54c2, "-17"}, {0x683d, "+9"},  {0x683e, "+18"}, {0x68c2, "-18"},
1349
    {0x68c3, "-9"},  {0x7c3e, "+19"}, {0x7cc2, "-19"}, {0x903c, "+5"},  {0x903d, "+10"}, {0x903e, "+20"},
1350
    {0x90c2, "-20"}, {0x90c3, "-10"}, {0x90c4, "-5"},  {0xb83d, "+11"}, {0xb8c3, "-11"}, {0xe03b, "+3"},
1351
    {0xe03c, "+6"},  {0xe03d, "+12"}, {0xe0c3, "-12"}, {0xe0c4, "-6"},  {0xe0c5, "-3"},
1352
};
1353
1354
// Nikon3 Shot Info D300 (b) Tag Info
1355
constexpr TagInfo Nikon3MakerNote::tagInfoSi4_[] = {
1356
    {0, "Version", N_("Version"), N_("Version"), IfdId::nikonSi4Id, SectionId::makerTags, unsignedByte, 4,
1357
     printExifVersion},
1358
    {613, "ISO", N_("ISO"), N_("ISO"), IfdId::nikonSi4Id, SectionId::makerTags, unsignedByte, 1, printIiIso},
1359
    {644, "ShutterCount", N_("Shutter Count"), N_("Shutter count"), IfdId::nikonSi4Id, SectionId::makerTags,
1360
     unsignedLong, 1, printValue},
1361
    {732, "AFFineTuneAdj", N_("AF Fine Tune Adj"), N_("AF fine tune adj"), IfdId::nikonSi4Id, SectionId::makerTags,
1362
     unsignedShort, 1, EXV_PRINT_TAG(nikonAfFineTuneAdj2)},
1363
    // End of list marker
1364
    {0xffff, "(UnknownNikonSi4Tag)", "(UnknownNikonSi4Tag)", N_("Unknown Nikon Shot Info D300 (b) Tag"),
1365
     IfdId::nikonSi4Id, SectionId::makerTags, unsignedByte, 1, printValue},
1366
};
1367
1368
//! VibrationReduction
1369
constexpr TagDetails nikonOffOn2[] = {
1370
    {0, N_("Off")},
1371
    {1, N_("On (1)")},
1372
    {2, N_("On (2)")},
1373
    {3, N_("On (3)")},
1374
};
1375
1376
//! VibrationReduction2
1377
constexpr TagDetails nikonOffOn3[] = {
1378
    {0x0, N_("n/a")},
1379
    {0xc, N_("Off")},
1380
    {0xf, N_("On")},
1381
};
1382
1383
// Nikon3 Shot Info Tag Info
1384
constexpr TagInfo Nikon3MakerNote::tagInfoSi5_[] = {
1385
    {0, "Version", N_("Version"), N_("Version"), IfdId::nikonSi5Id, SectionId::makerTags, unsignedByte, 4,
1386
     printExifVersion},
1387
    {106, "ShutterCount1", N_("Shutter Count 1"), N_("Shutter count 1"), IfdId::nikonSi5Id, SectionId::makerTags,
1388
     unsignedLong, 1, printValue},
1389
    {110, "DeletedImageCount", N_("Deleted Image Count"), N_("Deleted image count"), IfdId::nikonSi5Id,
1390
     SectionId::makerTags, unsignedLong, 1, printValue},
1391
    {117, "VibrationReduction", N_("Vibration Reduction"), N_("Vibration reduction"), IfdId::nikonSi5Id,
1392
     SectionId::makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonOffOn2)},
1393
    {130, "VibrationReduction1", N_("Vibration Reduction 1"), N_("Vibration reduction 1"), IfdId::nikonSi5Id,
1394
     SectionId::makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonOffOn)},
1395
    {343, "ShutterCount2", N_("Shutter Count 2"), N_("Shutter count 2"), IfdId::nikonSi5Id, SectionId::makerTags,
1396
     undefined, 2, printValue},
1397
    {430, "VibrationReduction2", N_("Vibration Reduction 2"), N_("Vibration reduction 2"), IfdId::nikonSi5Id,
1398
     SectionId::makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonOffOn3)},
1399
    {598, "ISO", N_("ISO"), N_("ISO"), IfdId::nikonSi5Id, SectionId::makerTags, unsignedByte, 1, printIiIso},
1400
    {630, "ShutterCount", N_("Shutter Count"), N_("Shutter count"), IfdId::nikonSi5Id, SectionId::makerTags,
1401
     unsignedLong, 1, printValue},
1402
    // End of list marker
1403
    {0xffff, "(UnknownNikonSi5Tag)", "(UnknownNikonSi5Tag)", N_("Unknown Nikon Shot Info Tag"), IfdId::nikonSi5Id,
1404
     SectionId::makerTags, unsignedByte, 1, printValue},
1405
};
1406
1407
// Nikon3 Color Balance 1 Tag Info
1408
constexpr TagInfo Nikon3MakerNote::tagInfoCb1_[] = {
1409
    {0, "Version", N_("Version"), N_("Version"), IfdId::nikonCb1Id, SectionId::makerTags, undefined, 4,
1410
     printExifVersion},
1411
    {36, "WB_RBGGLevels", N_("WB RBGG Levels"), N_("WB RBGG levels"), IfdId::nikonCb1Id, SectionId::makerTags,
1412
     unsignedShort, 4, printValue},
1413
    // End of list marker
1414
    {0xffff, "(UnknownNikonCb1Tag)", "(UnknownNikonCb1Tag)", N_("Unknown Nikon Color Balance 1 Tag"), IfdId::nikonCb1Id,
1415
     SectionId::makerTags, unsignedShort, 1, printValue},
1416
};
1417
1418
// Nikon3 Color Balance 2 Tag Info
1419
constexpr TagInfo Nikon3MakerNote::tagInfoCb2_[] = {
1420
    {0, "Version", N_("Version"), N_("Version"), IfdId::nikonCb2Id, SectionId::makerTags, undefined, 4,
1421
     printExifVersion},
1422
    {5, "WB_RGGBLevels", N_("WB RGGB Levels"), N_("WB RGGB levels"), IfdId::nikonCb2Id, SectionId::makerTags,
1423
     unsignedShort, 4, printValue},
1424
    // End of list marker
1425
    {0xffff, "(UnknownNikonCb2Tag)", "(UnknownNikonCb2Tag)", N_("Unknown Nikon Color Balance 2 Tag"), IfdId::nikonCb2Id,
1426
     SectionId::makerTags, unsignedShort, 1, printValue},
1427
};
1428
1429
// Nikon3 Color Balance 2a Tag Info
1430
constexpr TagInfo Nikon3MakerNote::tagInfoCb2a_[] = {
1431
    {0, "Version", N_("Version"), N_("Version"), IfdId::nikonCb2aId, SectionId::makerTags, undefined, 4,
1432
     printExifVersion},
1433
    {9, "WB_RGGBLevels", N_("WB RGGB Levels"), N_("WB RGGB levels"), IfdId::nikonCb2aId, SectionId::makerTags,
1434
     unsignedShort, 4, printValue},
1435
    // End of list marker
1436
    {0xffff, "(UnknownNikonCb2aTag)", "(UnknownNikonCb2aTag)", N_("Unknown Nikon Color Balance 2a Tag"),
1437
     IfdId::nikonCb2aId, SectionId::makerTags, unsignedShort, 1, printValue},
1438
};
1439
1440
// Nikon3 Color Balance 2b Tag Info
1441
constexpr TagInfo Nikon3MakerNote::tagInfoCb2b_[] = {
1442
    {0, "Version", N_("Version"), N_("Version"), IfdId::nikonCb2bId, SectionId::makerTags, undefined, 4,
1443
     printExifVersion},
1444
    {145, "WB_RGGBLevels", N_("WB RGGB Levels"), N_("WB RGGB levels"), IfdId::nikonCb2bId, SectionId::makerTags,
1445
     unsignedShort, 4, printValue},
1446
    // End of list marker
1447
    {0xffff, "(UnknownNikonCb2bTag)", "(UnknownNikonCb2bTag)", N_("Unknown Nikon Color Balance 2b Tag"),
1448
     IfdId::nikonCb2bId, SectionId::makerTags, unsignedShort, 1, printValue},
1449
};
1450
1451
// Nikon3 Color Balance 3 Tag Info
1452
constexpr TagInfo Nikon3MakerNote::tagInfoCb3_[] = {
1453
    {0, "Version", N_("Version"), N_("Version"), IfdId::nikonCb3Id, SectionId::makerTags, undefined, 4,
1454
     printExifVersion},
1455
    {10, "WB_RGBGLevels", N_("WB RGBG Levels"), N_("WB RGBG levels"), IfdId::nikonCb3Id, SectionId::makerTags,
1456
     unsignedShort, 4, printValue},
1457
    // End of list marker
1458
    {0xffff, "(UnknownNikonCb3Tag)", "(UnknownNikonCb3Tag)", N_("Unknown Nikon Color Balance 3 Tag"), IfdId::nikonCb3Id,
1459
     SectionId::makerTags, unsignedShort, 1, printValue},
1460
};
1461
1462
// Nikon3 Color Balance 4 Tag Info
1463
constexpr TagInfo Nikon3MakerNote::tagInfoCb4_[] = {
1464
    {0, "Version", N_("Version"), N_("Version"), IfdId::nikonCb4Id, SectionId::makerTags, undefined, 4,
1465
     printExifVersion},
1466
    {147, "WB_GRBGLevels", N_("WB GRBG Levels"), N_("WB GRBG levels"), IfdId::nikonCb4Id, SectionId::makerTags,
1467
     unsignedShort, 4, printValue},
1468
    // End of list marker
1469
    {0xffff, "(UnknownNikonCb4Tag)", "(UnknownNikonCb4Tag)", N_("Unknown Nikon Color Balance 4 Tag"), IfdId::nikonCb4Id,
1470
     SectionId::makerTags, unsignedShort, 1, printValue},
1471
};
1472
1473
// Nikon3 Lens Data 1 Tag Info
1474
constexpr TagInfo Nikon3MakerNote::tagInfoLd1_[] = {
1475
    {0, "Version", N_("Version"), N_("Version"), IfdId::nikonLd1Id, SectionId::makerTags, undefined, 4,
1476
     printExifVersion},
1477
    {6, "LensIDNumber", N_("Lens ID Number"), N_("Lens ID number"), IfdId::nikonLd1Id, SectionId::makerTags,
1478
     unsignedByte, 1, printLensId1},
1479
    {7, "LensFStops", N_("Lens F-Stops"), N_("Lens F-stops"), IfdId::nikonLd1Id, SectionId::makerTags, unsignedByte, 1,
1480
     printFStops},
1481
    {8, "MinFocalLength", N_("Min Focal Length"), N_("Min focal length"), IfdId::nikonLd1Id, SectionId::makerTags,
1482
     unsignedByte, 1, printFocal},
1483
    {9, "MaxFocalLength", N_("Max Focal Length"), N_("Max focal length"), IfdId::nikonLd1Id, SectionId::makerTags,
1484
     unsignedByte, 1, printFocal},
1485
    {10, "MaxApertureAtMinFocal", N_("Max Aperture At Min Focal"), N_("Max aperture at min focal"), IfdId::nikonLd1Id,
1486
     SectionId::makerTags, unsignedByte, 1, printAperture},
1487
    {11, "MaxApertureAtMaxFocal", N_("Max Aperture At Max Focal"), N_("Max aperture at max focal"), IfdId::nikonLd1Id,
1488
     SectionId::makerTags, unsignedByte, 1, printAperture},
1489
    {12, "MCUVersion", N_("MCU Version"), N_("MCU version"), IfdId::nikonLd1Id, SectionId::makerTags, unsignedByte, 1,
1490
     printValue},
1491
    // End of list marker
1492
    {0xffff, "(UnknownNikonLd1Tag)", "(UnknownNikonLd1Tag)", N_("Unknown Nikon Lens Data 1 Tag"), IfdId::nikonLd1Id,
1493
     SectionId::makerTags, unsignedByte, 1, printValue},
1494
};
1495
1496
// Nikon3 Lens Data 2 Tag Info
1497
constexpr TagInfo Nikon3MakerNote::tagInfoLd2_[] = {
1498
    {0, "Version", N_("Version"), N_("Version"), IfdId::nikonLd2Id, SectionId::makerTags, undefined, 4,
1499
     printExifVersion},
1500
    {4, "ExitPupilPosition", N_("Exit Pupil Position"), N_("Exit pupil position"), IfdId::nikonLd2Id,
1501
     SectionId::makerTags, unsignedByte, 1, printExitPupilPosition},
1502
    {5, "AFAperture", N_("AF Aperture"), N_("AF aperture"), IfdId::nikonLd2Id, SectionId::makerTags, unsignedByte, 1,
1503
     printAperture},
1504
    {8, "FocusPosition", N_("Focus Position"), N_("Focus position"), IfdId::nikonLd2Id, SectionId::makerTags,
1505
     unsignedByte, 1, printValue},
1506
    {9, "FocusDistance", N_("Focus Distance"), N_("Focus distance"), IfdId::nikonLd2Id, SectionId::makerTags,
1507
     unsignedByte, 1, printFocusDistance},
1508
    {10, "FocalLength", N_("Focal Length"), N_("Focal length"), IfdId::nikonLd2Id, SectionId::makerTags, unsignedByte,
1509
     1, printFocal},
1510
    {11, "LensIDNumber", N_("Lens ID Number"), N_("Lens ID number"), IfdId::nikonLd2Id, SectionId::makerTags,
1511
     unsignedByte, 1, printLensId2},
1512
    {12, "LensFStops", N_("Lens F-Stops"), N_("Lens F-stops"), IfdId::nikonLd2Id, SectionId::makerTags, unsignedByte, 1,
1513
     printFStops},
1514
    {13, "MinFocalLength", N_("Min Focal Length"), N_("Min focal length"), IfdId::nikonLd2Id, SectionId::makerTags,
1515
     unsignedByte, 1, printFocal},
1516
    {14, "MaxFocalLength", N_("Max Focal Length"), N_("Max focal length"), IfdId::nikonLd2Id, SectionId::makerTags,
1517
     unsignedByte, 1, printFocal},
1518
    {15, "MaxApertureAtMinFocal", N_("Max Aperture At Min Focal"), N_("Max aperture at min focal"), IfdId::nikonLd2Id,
1519
     SectionId::makerTags, unsignedByte, 1, printAperture},
1520
    {16, "MaxApertureAtMaxFocal", N_("Max Aperture At Max Focal"), N_("Max aperture at max focal"), IfdId::nikonLd2Id,
1521
     SectionId::makerTags, unsignedByte, 1, printAperture},
1522
    {17, "MCUVersion", N_("MCU Version"), N_("MCU version"), IfdId::nikonLd2Id, SectionId::makerTags, unsignedByte, 1,
1523
     printValue},
1524
    {18, "EffectiveMaxAperture", N_("Effective Max Aperture"), N_("Effective max aperture"), IfdId::nikonLd2Id,
1525
     SectionId::makerTags, unsignedByte, 1, printAperture},
1526
    // End of list marker
1527
    {0xffff, "(UnknownNikonLd2Tag)", "(UnknownNikonLd2Tag)", N_("Unknown Nikon Lens Data 2 Tag"), IfdId::nikonLd2Id,
1528
     SectionId::makerTags, unsignedByte, 1, printValue},
1529
};
1530
1531
// Nikon3 Lens Data 3 Tag Info
1532
constexpr TagInfo Nikon3MakerNote::tagInfoLd3_[] = {
1533
    {0, "Version", N_("Version"), N_("Version"), IfdId::nikonLd3Id, SectionId::makerTags, undefined, 4,
1534
     printExifVersion},
1535
    {4, "ExitPupilPosition", N_("Exit Pupil Position"), N_("Exit pupil position"), IfdId::nikonLd3Id,
1536
     SectionId::makerTags, unsignedByte, 1, printExitPupilPosition},
1537
    {5, "AFAperture", N_("AF Aperture"), N_("AF aperture"), IfdId::nikonLd3Id, SectionId::makerTags, unsignedByte, 1,
1538
     printAperture},
1539
    {8, "FocusPosition", N_("Focus Position"), N_("Focus position"), IfdId::nikonLd3Id, SectionId::makerTags,
1540
     unsignedByte, 1, printValue},
1541
    {10, "FocusDistance", N_("Focus Distance"), N_("Focus distance"), IfdId::nikonLd3Id, SectionId::makerTags,
1542
     unsignedByte, 1, printFocusDistance},
1543
    {11, "FocalLength", N_("Focal Length"), N_("Focal length"), IfdId::nikonLd3Id, SectionId::makerTags, unsignedByte,
1544
     1, printFocal},
1545
    {12, "LensIDNumber", N_("Lens ID Number"), N_("Lens ID number"), IfdId::nikonLd3Id, SectionId::makerTags,
1546
     unsignedByte, 1, printLensId3},
1547
    {13, "LensFStops", N_("Lens F-Stops"), N_("Lens F-stops"), IfdId::nikonLd3Id, SectionId::makerTags, unsignedByte, 1,
1548
     printFStops},
1549
    {14, "MinFocalLength", N_("Min Focal Length"), N_("Min focal length"), IfdId::nikonLd3Id, SectionId::makerTags,
1550
     unsignedByte, 1, printFocal},
1551
    {15, "MaxFocalLength", N_("Max Focal Length"), N_("Max focal length"), IfdId::nikonLd3Id, SectionId::makerTags,
1552
     unsignedByte, 1, printFocal},
1553
    {16, "MaxApertureAtMinFocal", N_("Max Aperture At Min Focal"), N_("Max aperture at min focal length"),
1554
     IfdId::nikonLd3Id, SectionId::makerTags, unsignedByte, 1, printAperture},
1555
    {17, "MaxApertureAtMaxFocal", N_("Max Aperture At Max Focal"), N_("Max aperture at max focal length"),
1556
     IfdId::nikonLd3Id, SectionId::makerTags, unsignedByte, 1, printAperture},
1557
    {18, "MCUVersion", N_("MCU Version"), N_("MCU version"), IfdId::nikonLd3Id, SectionId::makerTags, unsignedByte, 1,
1558
     printValue},
1559
    {19, "EffectiveMaxAperture", N_("Effective Max Aperture"), N_("Effective max aperture"), IfdId::nikonLd3Id,
1560
     SectionId::makerTags, unsignedByte, 1, printAperture},
1561
    // End of list marker
1562
    {0xffff, "(UnknownNikonLd3Tag)", "(UnknownNikonLd3Tag)", N_("Unknown Nikon Lens Data 3 Tag"), IfdId::nikonLd3Id,
1563
     SectionId::makerTags, unsignedByte, 1, printValue},
1564
};
1565
1566
//! LensID, tag index 48
1567
// see https://github.com/exiftool/exiftool/blob/13.16/lib/Image/ExifTool/Nikon.pm#L5668
1568
constexpr TagDetails nikonZMountLensId[] = {
1569
    {0, N_("n/a")},
1570
    {1, "Nikon Nikkor Z 24-70mm f/4 S"},
1571
    {2, "Nikon Nikkor Z 14-30mm f/4 S"},
1572
    {4, "Nikon Nikkor Z 35mm f/1.8 S"},
1573
    {8, "Nikon Nikkor Z 58mm f/0.95 S Noct"},  // IB
1574
    {9, "Nikon Nikkor Z 50mm f/1.8 S"},
1575
    {11, "Nikon Nikkor Z DX 16-50mm f/3.5-6.3 VR"},
1576
    {12, "Nikon Nikkor Z DX 50-250mm f/4.5-6.3 VR"},
1577
    {13, "Nikon Nikkor Z 24-70mm f/2.8 S"},
1578
    {14, "Nikon Nikkor Z 85mm f/1.8 S"},
1579
    {15, "Nikon Nikkor Z 24mm f/1.8 S"},              // IB
1580
    {16, "Nikon Nikkor Z 70-200mm f/2.8 VR S"},       // IB
1581
    {17, "Nikon Nikkor Z 20mm f/1.8 S"},              // IB
1582
    {18, "Nikon Nikkor Z 24-200mm f/4-6.3 VR"},       // IB
1583
    {21, "Nikon Nikkor Z 50mm f/1.2 S"},              // IB
1584
    {22, "Nikon Nikkor Z 24-50mm f/4-6.3"},           // IB
1585
    {23, "Nikon Nikkor Z 14-24mm f/2.8 S"},           // IB
1586
    {24, "Nikon Nikkor Z MC 105mm f/2.8 VR S"},       // IB
1587
    {25, "Nikon Nikkor Z 40mm f/2"},                  // 28
1588
    {26, "Nikon Nikkor Z DX 18-140mm f/3.5-6.3 VR"},  // IB
1589
    {27, "Nikon Nikkor Z MC 50mm f/2.8"},             // IB
1590
    {28, "Nikon Nikkor Z 100-400mm f/4.5-5.6 VR S"},  // 28
1591
    {29, "Nikon Nikkor Z 28mm f/2.8"},                // IB
1592
    {30, "Nikon Nikkor Z 400mm f/2.8 TC VR S"},       // 28
1593
    {31, "Nikon Nikkor Z 24-120mm f/4 S"},            // 28
1594
    {32, "Nikon Nikkor Z 800mm f/6.3 VR S"},          // 28
1595
    {35, "Nikon Nikkor Z 28-75mm f/2.8"},             // IB
1596
    {36, "Nikon Nikkor Z 400mm f/4.5 VR S"},          // IB
1597
    {37, "Nikon Nikkor Z 600mm f/4 TC VR S"},         // 28
1598
    {38, "Nikon Nikkor Z 85mm f/1.2 S"},              // 28
1599
    {39, "Nikon Nikkor Z 17-28mm f/2.8"},             // IB
1600
    {40, "Nikon Nikkor Z 26mm f/2.8"},
1601
    {41, "Nikon Nikkor Z DX 12-28mm f/3.5-5.6 PZ VR"},
1602
    {42, "Nikon Nikkor Z 180-600mm f/5.6-6.3 VR"},
1603
    {43, "Nikon Nikkor Z DX 24mm f/1.7"},
1604
    {44, "Nikon Nikkor Z 70-180mm f/2.8"},
1605
    {45, "Nikon Nikkor Z 600mm f/6.3 VR S"},
1606
    {46, "Nikon Nikkor Z 135mm f/1.8 S Plena"},
1607
    {47, "Nikon Nikkor Z 35mm f/1.2 S"},
1608
    {48, "Nikon Nikkor Z 28-400mm f/4-8 VR"},
1609
    {49, "Nikon Nikkor Z 28-135mm f/4 PZ"},
1610
    {51, "Nikon Nikkor Z 35mm f/1.4"},
1611
    {52, "Nikon Nikkor Z 50mm f/1.4"},
1612
    {2305, "Laowa FFII 10mm F2.8 C&D Dreamer"},
1613
    {2820, "Viltrox AF 16mm F1.8"},
1614
    {2822, "Viltrox AF 20mm F2.8"},
1615
    {53251, "Sigma 56mm F1.4 DC DN | C"},
1616
    {57346, "Tamron 35-150mm F/2-2.8 Di III VXD"},
1617
};
1618
1619
// Nikon3 Lens Data 4 Tag Info
1620
// based on https://exiftool.org/TagNames/Nikon.html#LensData0800
1621
constexpr TagInfo Nikon3MakerNote::tagInfoLd4_[] = {
1622
    {0, "Version", N_("Version"), N_("Version"), IfdId::nikonLd4Id, SectionId::makerTags, undefined, 4,
1623
     printExifVersion},
1624
    {4, "ExitPupilPosition", N_("Exit Pupil Position"), N_("Exit pupil position"), IfdId::nikonLd4Id,
1625
     SectionId::makerTags, unsignedByte, 1, printExitPupilPosition},
1626
    {5, "AFAperture", N_("AF Aperture"), N_("AF aperture"), IfdId::nikonLd4Id, SectionId::makerTags, unsignedByte, 1,
1627
     printAperture},
1628
    {9, "FocusPosition", N_("Focus Position"), N_("Focus position"), IfdId::nikonLd4Id, SectionId::makerTags,
1629
     unsignedByte, 1, printValue},
1630
    {11, "FocusDistance", N_("Focus Distance"), N_("Focus distance"), IfdId::nikonLd4Id, SectionId::makerTags,
1631
     unsignedByte, 1, printFocusDistance},
1632
    {12, "FocalLength", N_("Focal Length"), N_("Focal length"), IfdId::nikonLd4Id, SectionId::makerTags, unsignedByte,
1633
     1, printFocal},
1634
    {13, "LensIDNumber", N_("Lens ID Number"), N_("Lens ID number"), IfdId::nikonLd4Id, SectionId::makerTags,
1635
     unsignedByte, 1, printLensId4},
1636
    {14, "LensFStops", N_("Lens F-Stops"), N_("Lens F-stops"), IfdId::nikonLd4Id, SectionId::makerTags, unsignedByte, 1,
1637
     printFStops},
1638
    {15, "MinFocalLength", N_("Min Focal Length"), N_("Min focal length"), IfdId::nikonLd4Id, SectionId::makerTags,
1639
     unsignedByte, 1, printFocal},
1640
    {16, "MaxFocalLength", N_("Max Focal Length"), N_("Max focal length"), IfdId::nikonLd4Id, SectionId::makerTags,
1641
     unsignedByte, 1, printFocal},
1642
    {17, "MaxApertureAtMinFocal", N_("Max Aperture At Min Focal"), N_("Max aperture at min focal length"),
1643
     IfdId::nikonLd4Id, SectionId::makerTags, unsignedByte, 1, printAperture},
1644
    {18, "MaxApertureAtMaxFocal", N_("Max Aperture At Max Focal"), N_("Max aperture at max focal length"),
1645
     IfdId::nikonLd4Id, SectionId::makerTags, unsignedByte, 1, printAperture},
1646
    {19, "MCUVersion", N_("MCU Version"), N_("MCU version"), IfdId::nikonLd4Id, SectionId::makerTags, unsignedByte, 1,
1647
     printValue},
1648
    {20, "EffectiveMaxAperture", N_("Effective Max Aperture"), N_("Effective max aperture"), IfdId::nikonLd4Id,
1649
     SectionId::makerTags, unsignedByte, 1, printAperture},
1650
    {48, "LensID", N_("LensID"), N_("Lens ID"), IfdId::nikonLd4Id, SectionId::makerTags, unsignedShort, 1,
1651
     EXV_PRINT_TAG(nikonZMountLensId)},
1652
    {54, "MaxAperture", N_("Max Aperture"), N_("Max aperture"), IfdId::nikonLd4Id, SectionId::makerTags, unsignedShort,
1653
     1, printApertureLd4},
1654
    {56, "FNumber", N_("F-Number"), N_("F-Number"), IfdId::nikonLd4Id, SectionId::makerTags, unsignedShort, 1,
1655
     printApertureLd4},
1656
    {60, "FocalLength2", N_("Focal Length 2"), N_("Focal length 2"), IfdId::nikonLd4Id, SectionId::makerTags,
1657
     unsignedShort, 1, printFocalLd4},
1658
    {78, "FocusDistance2", N_("Focus Distance 2"), N_("Focus distance 2"), IfdId::nikonLd4Id, SectionId::makerTags,
1659
     unsignedShort, 1, printFocusDistanceLd4},
1660
    // End of list marker
1661
    {0xffff, "(UnknownNikonLd4Tag)", "(UnknownNikonLd4Tag)", N_("Unknown Nikon Lens Data 3 Tag"), IfdId::nikonLd4Id,
1662
     SectionId::makerTags, unsignedByte, 1, printValue},
1663
};
1664
1665
50
std::ostream& Nikon3MakerNote::printIiIso(std::ostream& os, const Value& value, const ExifData*) {
1666
50
  auto v = std::lround(100.0 * std::exp2((value.toInt64() / 12.0) - 5));
1667
50
  return os << v;
1668
50
}
1669
1670
128
std::ostream& Nikon3MakerNote::print0x0002(std::ostream& os, const Value& value, const ExifData*) {
1671
128
  if (value.count() > 1) {
1672
86
    os << value.toInt64(1);
1673
86
  } else {
1674
42
    os << "(" << value << ")";
1675
42
  }
1676
128
  return os;
1677
128
}
1678
1679
82
std::ostream& Nikon3MakerNote::printAf2AreaMode(std::ostream& os, const Value& value, const ExifData* metadata) {
1680
82
  int contrastDetectAF = 0;
1681
82
  if (metadata) {
1682
41
    auto pos = metadata->findKey(ExifKey("Exif.NikonAf2.ContrastDetectAF"));
1683
41
    if (pos != metadata->end() && pos->count() != 0) {
1684
41
      contrastDetectAF = pos->toUint32();
1685
41
    }
1686
41
  }
1687
1688
82
  if (contrastDetectAF == 0)
1689
63
    return EXV_PRINT_TAG(nikonAf2AreaModeContrastDetectAfOff)(os, value, nullptr);
1690
19
  return EXV_PRINT_TAG(nikonAf2AreaModeContrastDetectAfOn)(os, value, nullptr);
1691
82
}
1692
1693
302
std::ostream& Nikon3MakerNote::print0x0007(std::ostream& os, const Value& value, const ExifData*) {
1694
302
  std::string focus = value.toString();
1695
302
  if (focus == "AF-C  ")
1696
6
    os << _("Continuous autofocus");
1697
296
  else if (focus == "AF-S  ")
1698
14
    os << _("Single autofocus");
1699
282
  else if (focus == "AF-A  ")
1700
6
    os << _("Automatic");
1701
276
  else
1702
276
    os << "(" << value << ")";
1703
302
  return os;
1704
302
}
1705
1706
308
std::ostream& Nikon3MakerNote::print0x0083(std::ostream& os, const Value& value, const ExifData*) {
1707
308
  const uint32_t lensType = value.toUint32();
1708
1709
308
  bool valid = false;
1710
308
  if (lensType & 1) {
1711
152
    os << "MF ";
1712
152
    valid = true;
1713
152
  }
1714
308
  if (lensType & 2) {
1715
104
    os << "D ";
1716
104
    valid = true;
1717
104
  }
1718
308
  if (lensType & 4) {
1719
92
    os << "G ";
1720
92
    valid = true;
1721
92
  }
1722
308
  if (lensType & 8) {
1723
112
    os << "VR";
1724
112
    valid = true;
1725
112
  }
1726
1727
308
  if (!valid)
1728
102
    os << "(" << lensType << ")";
1729
1730
308
  return os;
1731
308
}
1732
1733
0
std::ostream& Nikon3MakerNote::print0x0084(std::ostream& os, const Value& value, const ExifData*) {
1734
0
  std::ios::fmtflags f(os.flags());
1735
0
  if (value.count() != 4 || value.toRational(0).second == 0 || value.toRational(1).second == 0) {
1736
0
    os << "(" << value << ")";
1737
0
    return os;
1738
0
  }
1739
0
  const int64_t len1 = value.toInt64(0);
1740
0
  const int64_t len2 = value.toInt64(1);
1741
1742
0
  auto [r1, s1] = value.toRational(2);
1743
0
  auto [r2, s2] = value.toRational(3);
1744
0
  os << len1;
1745
0
  if (len2 != len1) {
1746
0
    os << "-" << len2;
1747
0
  }
1748
0
  os << "mm ";
1749
0
  std::ostringstream oss;
1750
0
  oss.copyfmt(os);
1751
0
  os << "F" << std::setprecision(2) << static_cast<float>(r1) / s1;
1752
0
  if (r2 != r1) {
1753
0
    os << "-" << std::setprecision(2) << static_cast<float>(r2) / s2;
1754
0
  }
1755
0
  os.copyfmt(oss);
1756
0
  os.flags(f);
1757
0
  return os;
1758
0
}
1759
1760
162
std::ostream& Nikon3MakerNote::print0x0085(std::ostream& os, const Value& value, const ExifData*) {
1761
162
  auto [r, s] = value.toRational();
1762
162
  if (r == 0)
1763
40
    return os << _("Unknown");
1764
122
  if (s == 0)
1765
30
    return os << "(" << value << ")";
1766
92
  return os << stringFormat("{:.2f} m", static_cast<float>(r) / s);
1767
122
}
1768
1769
150
std::ostream& Nikon3MakerNote::print0x0086(std::ostream& os, const Value& value, const ExifData*) {
1770
150
  auto [r, s] = value.toRational();
1771
150
  if (r == 0)
1772
38
    return os << _("Not used");
1773
112
  if (s == 0)
1774
6
    return os << "(" << value << ")";
1775
106
  return os << stringFormat("{:.1f}x", static_cast<float>(r) / s);
1776
112
}
1777
1778
0
std::ostream& Nikon3MakerNote::print0x0088(std::ostream& os, const Value& value, const ExifData*) {
1779
0
  if (value.size() != 4) {  // Size is 4 even for those who map this way...
1780
0
    os << "(" << value << ")";
1781
0
  } else {
1782
    // Mapping by Roger Larsson
1783
0
    const uint32_t focusmetering = value.toUint32(0);
1784
0
    const uint32_t focuspoint = value.toUint32(1);
1785
0
    const uint32_t focusused = (value.toUint32(2) << 8) + value.toUint32(3);
1786
    // TODO: enum {standard, wide} combination = standard;
1787
1788
0
    if (focusmetering == 0 && focuspoint == 0 && focusused == 0) {
1789
      // Special case, in Manual focus and with Nikon compacts
1790
      // this indicates that the field has no meaning.
1791
      // But when actually in "Single area, Center" this can mean
1792
      // that focus was not found (try this in AF-C mode)
1793
      // TODO: handle the meaningful case (interacts with other fields)
1794
0
      os << _("n/a");
1795
0
      return os;
1796
0
    }
1797
1798
0
    switch (focusmetering) {
1799
0
      case 0x00:
1800
0
        os << _("Single area");
1801
0
        break;  // D70, D200
1802
0
      case 0x01:
1803
0
        os << _("Dynamic area");
1804
0
        break;  // D70, D200
1805
0
      case 0x02:
1806
0
        os << _("Closest subject");
1807
0
        break;  // D70, D200
1808
0
      case 0x03:
1809
0
        os << _("Group dynamic-AF");
1810
0
        break;  // D200
1811
0
      case 0x04:
1812
0
        os << _("Single area (wide)"); /* TODO: combination = wide; */
1813
0
        break;                         // D200
1814
0
      case 0x05:
1815
0
        os << _("Dynamic area (wide)"); /* TODO: combination = wide; */
1816
0
        break;                          // D200
1817
0
      default:
1818
0
        os << "(" << focusmetering << ")";
1819
0
        break;
1820
0
    }
1821
1822
0
    char sep = ';';
1823
0
    if (focusmetering != 0x02) {  //  No user selected point for Closest subject
1824
0
      os << sep << ' ';
1825
1826
      // What focuspoint did the user select?
1827
0
      if (focuspoint < nikonFocuspoints.size()) {
1828
0
        os << nikonFocuspoints[focuspoint];
1829
        // TODO: os << position[focuspoint][combination]
1830
0
      } else
1831
0
        os << "(" << focuspoint << ")";
1832
1833
0
      sep = ',';
1834
0
    }
1835
1836
    // What focuspoints(!) did the camera use? add if differs
1837
0
    if (focusused == 0)
1838
0
      os << sep << " " << _("none");
1839
0
    else if (focusused != 1U << focuspoint) {
1840
      // selected point was not the actually used one
1841
      // (Roger Larsson: my interpretation, verify)
1842
0
      os << sep;
1843
0
      for (size_t fpid = 0; fpid < nikonFocuspoints.size(); fpid++)
1844
0
        if (focusused & 1 << fpid)
1845
0
          os << ' ' << nikonFocuspoints[fpid];
1846
0
    }
1847
1848
0
    os << " " << _("used");
1849
0
  }
1850
1851
0
  return os;
1852
0
}
1853
1854
126
std::ostream& Nikon3MakerNote::printAfPointsInFocus(std::ostream& os, const Value& value, const ExifData* metadata) {
1855
126
  if (value.typeId() != unsignedShort)
1856
0
    return os << "(" << value << ")";
1857
1858
126
  bool dModel = false;
1859
126
  if (metadata) {
1860
63
    auto pos = metadata->findKey(ExifKey("Exif.Image.Model"));
1861
63
    if (pos != metadata->end() && pos->count() != 0) {
1862
21
      std::string model = pos->toString();
1863
21
      if (Internal::contains(model, "NIKON D")) {
1864
10
        dModel = true;
1865
10
      }
1866
21
    }
1867
63
  }
1868
1869
126
  auto val = static_cast<uint16_t>(value.toInt64());
1870
126
  if (dModel)
1871
10
    val = (val >> 8) | ((val & 0x00ffU) << 8);
1872
1873
126
  if (val == 0x07ff)
1874
2
    return os << _("All 11 Points");
1875
1876
124
  UShortValue v;
1877
124
  v.value_.push_back(val);
1878
124
  return EXV_PRINT_TAG_BITMASK(nikonAfPointsInFocus)(os, v, nullptr);
1879
126
}
1880
1881
1.19k
std::ostream& Nikon3MakerNote::print0x0089(std::ostream& os, const Value& value, const ExifData* metadata) {
1882
1.19k
  if (value.count() != 1 || value.typeId() != unsignedShort) {
1883
76
    return os << "(" << value << ")";
1884
76
  }
1885
1.12k
  const auto l = value.toInt64(0);
1886
1.12k
  if (l == 0)
1887
62
    return os << _("Single-frame");
1888
1.05k
  if (!(l & 0x87))
1889
226
    os << _("Single-frame") << ", ";
1890
1.05k
  bool d70 = false;
1891
1.05k
  if (metadata) {
1892
529
    ExifKey key("Exif.Image.Model");
1893
529
    auto pos = metadata->findKey(key);
1894
529
    if (pos != metadata->end() && pos->count() != 0) {
1895
390
      std::string model = pos->toString();
1896
390
      if (Internal::contains(model, "D70")) {
1897
175
        d70 = true;
1898
175
      }
1899
390
    }
1900
529
  }
1901
1.05k
  if (d70) {
1902
175
    EXV_PRINT_TAG_BITMASK(nikonShootingModeD70)(os, value, nullptr);
1903
883
  } else {
1904
883
    EXV_PRINT_TAG_BITMASK(nikonShootingMode)(os, value, nullptr);
1905
883
  }
1906
1.05k
  return os;
1907
1.12k
}
1908
1909
98
std::ostream& Nikon3MakerNote::print0x008b(std::ostream& os, const Value& value, const ExifData*) {
1910
  // Decoded by Robert Rottmerhusen <email@rottmerhusen.com>
1911
98
  if (value.size() != 4 || value.typeId() != undefined) {
1912
20
    return os << "(" << value << ")";
1913
20
  }
1914
78
  float a = value.toFloat(0);
1915
78
  const auto b = value.toInt64(1);
1916
78
  const auto c = value.toInt64(2);
1917
78
  if (c == 0)
1918
16
    return os << "(" << value << ")";
1919
62
  return os << a * b / c;
1920
78
}
1921
1922
static bool testConfigFile(std::ostream& os, const Value& value);
1923
200
static bool testConfigFile(std::ostream& os, const Value& value) {
1924
200
  bool result = false;
1925
200
  const std::string undefined("undefined");
1926
200
  const std::string section("nikon");
1927
200
  if (Internal::readExiv2Config(section, value.toString(), undefined) != undefined) {
1928
0
    os << Internal::readExiv2Config(section, value.toString(), undefined);
1929
0
    result = true;
1930
0
  }
1931
200
  return result;
1932
200
}
1933
1934
6
std::ostream& Nikon3MakerNote::printLensId1(std::ostream& os, const Value& value, const ExifData* metadata) {
1935
6
  return testConfigFile(os, value) ? os : printLensId(os, value, metadata, "NikonLd1");
1936
6
}
1937
1938
18
std::ostream& Nikon3MakerNote::printLensId2(std::ostream& os, const Value& value, const ExifData* metadata) {
1939
18
  return testConfigFile(os, value) ? os : printLensId(os, value, metadata, "NikonLd2");
1940
18
}
1941
1942
4
std::ostream& Nikon3MakerNote::printLensId3(std::ostream& os, const Value& value, const ExifData* metadata) {
1943
4
  return testConfigFile(os, value) ? os : printLensId(os, value, metadata, "NikonLd3");
1944
4
}
1945
1946
172
std::ostream& Nikon3MakerNote::printLensId4(std::ostream& os, const Value& value, const ExifData* metadata) {
1947
172
  return testConfigFile(os, value) ? os : printLensId(os, value, metadata, "NikonLd4");
1948
172
}
1949
1950
std::ostream& Nikon3MakerNote::printLensId(std::ostream& os, const Value& value, const ExifData* metadata,
1951
200
                                           [[maybe_unused]] const std::string& group) {
1952
200
#ifdef EXV_HAVE_LENSDATA
1953
// 8< - - - 8< do not remove this line >8 - - - >8
1954
//------------------------------------------------------------------------------
1955
200
#ifndef FMOUNTLH
1956
200
#define FMOUNTLH
1957
//------------------------------------------------------------------------------
1958
// List of AF F-Mount lenses - Version 4.4.550.02                    2018-03-03
1959
//------------------------------------------------------------------------------
1960
200
#define FMLVERSION "4.4.550.02"
1961
200
#define FMLDATE "2018-03-03"
1962
  //------------------------------------------------------------------------------
1963
  //
1964
  // Created by Robert Rottmerhusen 2005 - 2018
1965
  // http://www.rottmerhusen.com (lens_id@rottmerhusen.com)
1966
  //
1967
  // Eight misidentified lenses due to double LensIDs:
1968
  //
1969
  // 2F 48 30 44 24 24 29 02.1: Nikon AF Zoom-Nikkor 20-35mm f/2.8D IF
1970
  // 2F 48 30 44 24 24 29 02.2: Tokina AT-X 235 AF PRO (AF 20-35mm f/2.8)
1971
  //
1972
  // 32 54 6A 6A 24 24 35 02.1: Nikon AF Micro-Nikkor 105mm f/2.8D
1973
  // 32 54 6A 6A 24 24 35 02.2: Sigma Macro 105mm F2.8 EX DG
1974
  //
1975
  // 7A 3C 1F 37 30 30 7E 06.1: Nikon AF-S DX Zoom-Nikkor 12-24mm f/4G IF-ED
1976
  // 7A 3C 1F 37 30 30 7E 06.2: Tokina AT-X 124 AF PRO DX II (AF 12-24mm f/4)
1977
  //
1978
  // 8B 40 2D 80 2C 3C FD 0E.1: Nikon AF-S DX VR Zoom-Nikkor 18-200mm f/3.5-5.6G IF-ED
1979
  // 8B 40 2D 80 2C 3C FD 0E.2: Nikon AF-S DX VR Zoom-Nikkor 18-200mm f/3.5-5.6G IF-ED II
1980
  //
1981
  // 32 53 64 64 24 24 35 02.1: Tamron SP AF 90mm F/2.8 Macro 1:1 (172E)
1982
  // 32 53 64 64 24 24 35 02.2: Tamron SP AF 90mm F/2.8 Di Macro 1:1 (272E)
1983
  //
1984
  // 2F 40 30 44 2C 34 29 02.1: Tokina AF 235 II (AF 20-35mm f/3.5-4.5)
1985
  // 2F 40 30 44 2C 34 29 02.2: Tokina AF 193 (AF 19-35mm f/3.5-4.5)
1986
  //
1987
  // 25 48 3C 5C 24 24 1B 02.1: Tokina AT-X 287 AF PRO SV (AF 28-70mm f/2.8)
1988
  // 25 48 3C 5C 24 24 1B 02.2: Tokina AT-X 270 AF PRO II (AF 28-70mm f/2.6-2.8)
1989
  //
1990
  // 4A 48 24 24 24 0C 4D 02.1: Samyang AE 14mm f/2.8 ED AS IF UMC
1991
  // 4A 48 24 24 24 0C 4D 02.2: Samyang 10mm f/2.8 ED AS NCS CS
1992
  //
1993
  //
1994
  // product number/order code not complete
1995
  //
1996
  // Free use in non-commercial, GPL or open source software only!
1997
  // Please contact me for adding lenses or use in commercial software.
1998
  //
1999
  //"data from TAG 0x98" "ltyp" " "TC" "MID" "maker" "PN" "lens name from manuf";
2000
  //
2001
  //------------------------------------------------------------------------------
2002
  // EXIF data necessary for new entries
2003
  //------------------------------------------------------------------------------
2004
  //
2005
  // lid:   LensIDNumber
2006
  // stps:  LensFStops
2007
  // focs:  MinFocalLength
2008
  // focl:  MaxFocalLength
2009
  // aps:   MaxApertureAtMinFocal
2010
  // apl:   MaxApertureAtMaxFocal
2011
  // lfw:   MCUVersion
2012
  // ltype: LensType
2013
  //
2014
  // The tcinfo, dblid and mid fields are being ignored.
2015
  //
2016
  // Please note that all fields except LensType have to be looked up in the
2017
  // Exif.NikonLd* prefix and not other Exif.Nikon* prefixes. For example: for modern
2018
  // Nikon bodies with modern lenses, there will be both a Exif.Nikon3.LensFStops and a
2019
  // Exif.NikonLd3.LensFStops entry in the EXIF data. You are looking for
2020
  // Exif.NikonLd3.LensFStops.
2021
  //
2022
  // In most cases the necessary hex values should be extracted from a test image using
2023
  // the following command:
2024
  //
2025
  // exiv2 -ph -g NikonLd3.LensIDNumber -g NikonLd3.LensFStops
2026
  // -g NikonLd3.MinFocalLength -g NikonLd3.MaxFocalLength
2027
  // -g NikonLd3.MaxApertureAtMinFocal -g NikonLd3.MaxApertureAtMaxFocal
2028
  // -g NikonLd3.MCUVersion -g Nikon3.LensType test.NEF
2029
  //
2030
  // Please consider, that sequence of output is sligthly different from sequence in
2031
  // data structure: LensType (ltype) is printed first, but has to be entered after
2032
  // MCUVersion (lfw).
2033
  //
2034
  //------------------------------------------------------------------------------
2035
  // Nikkor lenses by their LensID
2036
  //------------------------------------------------------------------------------
2037
2038
200
  static constexpr struct FMntLens {
2039
200
    unsigned char lid, stps, focs, focl, aps, apl, lfw, ltype, tcinfo, dblid, mid;
2040
200
    std::string_view manuf;
2041
200
    std::string_view lnumber;
2042
200
    std::string_view lensname;
2043
2044
20.9k
    bool operator==(unsigned char l) const {
2045
20.9k
      return lid == l;
2046
20.9k
    }
2047
200
  } fmountlens[] = {
2048
200
      {0x01, 0x58, 0x50, 0x50, 0x14, 0x14, 0x02, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA00901", "AF Nikkor 50mm f/1.8"},
2049
200
      {0x01, 0x58, 0x50, 0x50, 0x14, 0x14, 0x05, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA00901", "AF Nikkor 50mm f/1.8"},
2050
200
      {0x02, 0x42, 0x44, 0x5C, 0x2A, 0x34, 0x02, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA72701",
2051
200
       "AF Zoom-Nikkor 35-70mm f/3.3-4.5"},
2052
200
      {0x02, 0x42, 0x44, 0x5C, 0x2A, 0x34, 0x08, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA72701",
2053
200
       "AF Zoom-Nikkor 35-70mm f/3.3-4.5"},
2054
200
      {0x03, 0x48, 0x5C, 0x81, 0x30, 0x30, 0x02, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA72801",
2055
200
       "AF Zoom-Nikkor 70-210mm f/4"},
2056
200
      {0x04, 0x48, 0x3C, 0x3C, 0x24, 0x24, 0x03, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA12001", "AF Nikkor 28mm f/2.8"},
2057
200
      {0x05, 0x54, 0x50, 0x50, 0x0C, 0x0C, 0x04, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA01001", "AF Nikkor 50mm f/1.4"},
2058
200
      {0x06, 0x54, 0x53, 0x53, 0x24, 0x24, 0x06, 0x00, 0x40, 0x00, 0x00, "Nikon", "JAA62101",
2059
200
       "AF Micro-Nikkor 55mm f/2.8"},
2060
200
      {0x07, 0x40, 0x3C, 0x62, 0x2C, 0x34, 0x03, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA72901",
2061
200
       "AF Zoom-Nikkor 28-85mm f/3.5-4.5"},
2062
200
      {0x08, 0x40, 0x44, 0x6A, 0x2C, 0x34, 0x04, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA73001",
2063
200
       "AF Zoom-Nikkor 35-105mm f/3.5-4.5"},
2064
200
      {0x09, 0x48, 0x37, 0x37, 0x24, 0x24, 0x04, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA12101", "AF Nikkor 24mm f/2.8"},
2065
200
      {0x0A, 0x48, 0x8E, 0x8E, 0x24, 0x24, 0x03, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA322AA",
2066
200
       "AF Nikkor 300mm f/2.8 IF-ED"},
2067
200
      {0x0A, 0x48, 0x8E, 0x8E, 0x24, 0x24, 0x05, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA322AB",
2068
200
       "AF Nikkor 300mm f/2.8 IF-ED"},
2069
200
      {0x0B, 0x48, 0x7C, 0x7C, 0x24, 0x24, 0x05, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA32101",
2070
200
       "AF Nikkor 180mm f/2.8 IF-ED"},
2071
      // 0C
2072
200
      {0x0D, 0x40, 0x44, 0x72, 0x2C, 0x34, 0x07, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA73101",
2073
200
       "AF Zoom-Nikkor 35-135mm f/3.5-4.5"},
2074
200
      {0x0E, 0x48, 0x5C, 0x81, 0x30, 0x30, 0x05, 0x00, 0x00, 0x00, 0x00, "Nikon", "", "AF Zoom-Nikkor 70-210mm f/4"},
2075
200
      {0x0F, 0x58, 0x50, 0x50, 0x14, 0x14, 0x05, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA009AD", "AF Nikkor 50mm f/1.8 N"},
2076
200
      {0x10, 0x48, 0x8E, 0x8E, 0x30, 0x30, 0x08, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA32301",
2077
200
       "AF Nikkor 300mm f/4 IF-ED"},
2078
200
      {0x11, 0x48, 0x44, 0x5C, 0x24, 0x24, 0x08, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA73301",
2079
200
       "AF Zoom-Nikkor 35-70mm f/2.8"},
2080
200
      {0x11, 0x48, 0x44, 0x5C, 0x24, 0x24, 0x15, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA73301",
2081
200
       "AF Zoom-Nikkor 35-70mm f/2.8"},
2082
200
      {0x12, 0x48, 0x5C, 0x81, 0x30, 0x3C, 0x09, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA73201",
2083
200
       "AF Nikkor 70-210mm f/4-5.6"},
2084
200
      {0x13, 0x42, 0x37, 0x50, 0x2A, 0x34, 0x0B, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA73401",
2085
200
       "AF Zoom-Nikkor 24-50mm f/3.3-4.5"},
2086
200
      {0x14, 0x48, 0x60, 0x80, 0x24, 0x24, 0x0B, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA73501",
2087
200
       "AF Zoom-Nikkor 80-200mm f/2.8 ED"},
2088
200
      {0x15, 0x4C, 0x62, 0x62, 0x14, 0x14, 0x0C, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA32401", "AF Nikkor 85mm f/1.8"},
2089
      // 16
2090
200
      {0x17, 0x3C, 0xA0, 0xA0, 0x30, 0x30, 0x0F, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA518AA",
2091
200
       "Nikkor 500mm f/4 P ED IF"},
2092
200
      {0x17, 0x3C, 0xA0, 0xA0, 0x30, 0x30, 0x11, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA518AA",
2093
200
       "Nikkor 500mm f/4 P ED IF"},
2094
200
      {0x18, 0x40, 0x44, 0x72, 0x2C, 0x34, 0x0E, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA736AA",
2095
200
       "AF Zoom-Nikkor 35-135mm f/3.5-4.5 N"},
2096
      // 19
2097
200
      {0x1A, 0x54, 0x44, 0x44, 0x18, 0x18, 0x11, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA12201", "AF Nikkor 35mm f/2"},
2098
200
      {0x1B, 0x44, 0x5E, 0x8E, 0x34, 0x3C, 0x10, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA738AA",
2099
200
       "AF Zoom-Nikkor 75-300mm f/4.5-5.6"},
2100
200
      {0x1C, 0x48, 0x30, 0x30, 0x24, 0x24, 0x12, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA12301", "AF Nikkor 20mm f/2.8"},
2101
200
      {0x1D, 0x42, 0x44, 0x5C, 0x2A, 0x34, 0x12, 0x00, 0x00, 0x00, 0x00, "Nikon", "",
2102
200
       "AF Zoom-Nikkor 35-70mm f/3.3-4.5 N"},
2103
200
      {0x1E, 0x54, 0x56, 0x56, 0x24, 0x24, 0x13, 0x00, 0x40, 0x00, 0x00, "Nikon", "JAA62201",
2104
200
       "AF Micro-Nikkor 60mm f/2.8"},
2105
200
      {0x1F, 0x54, 0x6A, 0x6A, 0x24, 0x24, 0x14, 0x00, 0x40, 0x00, 0x00, "Nikon", "JAA62301",
2106
200
       "AF Micro-Nikkor 105mm f/2.8"},
2107
200
      {0x20, 0x48, 0x60, 0x80, 0x24, 0x24, 0x15, 0x00, 0x00, 0x00, 0x00, "Nikon", "",
2108
200
       "AF Zoom-Nikkor 80-200mm f/2.8 ED"},
2109
200
      {0x21, 0x40, 0x3C, 0x5C, 0x2C, 0x34, 0x16, 0x00, 0x00, 0x00, 0x00, "Nikon", "",
2110
200
       "AF Zoom-Nikkor 28-70mm f/3.5-4.5"},
2111
200
      {0x22, 0x48, 0x72, 0x72, 0x18, 0x18, 0x16, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA32501", "AF DC-Nikkor 135mm f/2"},
2112
200
      {0x23, 0x30, 0xBE, 0xCA, 0x3C, 0x48, 0x17, 0x00, 0x00, 0x00, 0x00, "Nikon", "",
2113
200
       "Zoom-Nikkor 1200-1700mm f/5.6-8 P ED IF"},
2114
      // - D - lenses from here
2115
200
      {0x24, 0x48, 0x60, 0x80, 0x24, 0x24, 0x1A, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA742DA",
2116
200
       "AF Zoom-Nikkor 80-200mm f/2.8D ED"},
2117
200
      {0x25, 0x48, 0x44, 0x5c, 0x24, 0x24, 0x1B, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA743DA",
2118
200
       "AF Zoom-Nikkor 35-70mm f/2.8D"},
2119
200
      {0x25, 0x48, 0x44, 0x5C, 0x24, 0x24, 0x3A, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA743DA",
2120
200
       "AF Zoom-Nikkor 35-70mm f/2.8D"},
2121
200
      {0x25, 0x48, 0x44, 0x5c, 0x24, 0x24, 0x52, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA743DA",
2122
200
       "AF Zoom-Nikkor 35-70mm f/2.8D"},
2123
200
      {0x26, 0x40, 0x3C, 0x5C, 0x2C, 0x34, 0x1C, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA744DA",
2124
200
       "AF Zoom-Nikkor 28-70mm f/3.5-4.5D"},
2125
      // ^- not yet verified
2126
200
      {0x27, 0x48, 0x8E, 0x8E, 0x24, 0x24, 0x1D, 0x02, 0x07, 0x00, 0x00, "Nikon", "JAA326DA",
2127
200
       "AF-I Nikkor 300mm f/2.8D IF-ED"},
2128
200
      {0x27, 0x48, 0x8E, 0x8E, 0x24, 0x24, 0xF1, 0x02, 0x0F, 0x00, 0x00, "Nikon", "JAA326DA",
2129
200
       "AF-I Nikkor 300mm f/2.8D IF-ED + TC-14E"},
2130
200
      {0x27, 0x48, 0x8E, 0x8E, 0x24, 0x24, 0xE1, 0x02, 0x0F, 0x00, 0x00, "Nikon", "JAA326DA",
2131
200
       "AF-I Nikkor 300mm f/2.8D IF-ED + TC-17E"},
2132
200
      {0x27, 0x48, 0x8E, 0x8E, 0x24, 0x24, 0xF2, 0x02, 0x0F, 0x00, 0x00, "Nikon", "JAA326DA",
2133
200
       "AF-I Nikkor 300mm f/2.8D IF-ED + TC-20E"},
2134
200
      {0x28, 0x3C, 0xA6, 0xA6, 0x30, 0x30, 0x1D, 0x02, 0x07, 0x00, 0x00, "Nikon", "JAA519DA",
2135
200
       "AF-I Nikkor 600mm f/4D IF-ED"},
2136
200
      {0x28, 0x3C, 0xA6, 0xA6, 0x30, 0x30, 0xF1, 0x02, 0x0F, 0x00, 0x00, "Nikon", "JAA519DA",
2137
200
       "AF-I Nikkor 600mm f/4D IF-ED + TC-14E"},
2138
200
      {0x28, 0x3C, 0xA6, 0xA6, 0x30, 0x30, 0xE1, 0x02, 0x0F, 0x00, 0x00, "Nikon", "JAA519DA",
2139
200
       "AF-I Nikkor 600mm f/4D IF-ED + TC-17E"},
2140
200
      {0x28, 0x3C, 0xA6, 0xA6, 0x30, 0x30, 0xF2, 0x02, 0x0F, 0x00, 0x00, "Nikon", "JAA519DA",
2141
200
       "AF-I Nikkor 600mm f/4D IF-ED + TC-20E"},
2142
      // 29
2143
200
      {0x2A, 0x54, 0x3C, 0x3C, 0x0C, 0x0C, 0x26, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA124DA", "AF Nikkor 28mm f/1.4D"},
2144
200
      {0x2B, 0x3C, 0x44, 0x60, 0x30, 0x3C, 0x1F, 0x02, 0x00, 0x00, 0x00, "Nikon", "",
2145
200
       "AF Zoom-Nikkor 35-80mm f/4-5.6D"},
2146
200
      {0x2C, 0x48, 0x6A, 0x6A, 0x18, 0x18, 0x27, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA327DA",
2147
200
       "AF DC-Nikkor 105mm f/2D"},
2148
200
      {0x2D, 0x48, 0x80, 0x80, 0x30, 0x30, 0x21, 0x02, 0x40, 0x00, 0x00, "Nikon", "JAA624DA",
2149
200
       "AF Micro-Nikkor 200mm f/4D IF-ED"},
2150
200
      {0x2E, 0x48, 0x5C, 0x82, 0x30, 0x3C, 0x22, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA747DA",
2151
200
       "AF Nikkor 70-210mm f/4-5.6D"},
2152
200
      {0x2E, 0x48, 0x5C, 0x82, 0x30, 0x3C, 0x28, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA747DA",
2153
200
       "AF Nikkor 70-210mm f/4-5.6D"},
2154
200
      {0x2F, 0x48, 0x30, 0x44, 0x24, 0x24, 0x29, 0x02, 0x00, 0x01, 0x00, "Nikon", "JAA746DA",
2155
200
       "AF Zoom-Nikkor 20-35mm f/2.8D IF"},
2156
200
      {0x30, 0x48, 0x98, 0x98, 0x24, 0x24, 0x24, 0x02, 0x07, 0x00, 0x00, "Nikon", "JAA520DA",
2157
200
       "AF-I Nikkor 400mm f/2.8D IF-ED"},
2158
200
      {0x30, 0x48, 0x98, 0x98, 0x24, 0x24, 0xF1, 0x02, 0x0F, 0x00, 0x00, "Nikon", "JAA520DA",
2159
200
       "AF-I Nikkor 400mm f/2.8D IF-ED + TC-14E"},
2160
200
      {0x30, 0x48, 0x98, 0x98, 0x24, 0x24, 0xE1, 0x02, 0x0F, 0x00, 0x00, "Nikon", "JAA520DA",
2161
200
       "AF-I Nikkor 400mm f/2.8D IF-ED + TC-17E"},
2162
200
      {0x30, 0x48, 0x98, 0x98, 0x24, 0x24, 0xF2, 0x02, 0x0F, 0x00, 0x00, "Nikon", "JAA520DA",
2163
200
       "AF-I Nikkor 400mm f/2.8D IF-ED + TC-20E"},
2164
200
      {0x31, 0x54, 0x56, 0x56, 0x24, 0x24, 0x25, 0x02, 0x40, 0x00, 0x00, "Nikon", "JAA625DA",
2165
200
       "AF Micro-Nikkor 60mm f/2.8D"},
2166
200
      {0x32, 0x54, 0x6A, 0x6A, 0x24, 0x24, 0x35, 0x02, 0x40, 0x01, 0x00, "Nikon", "JAA627DA",
2167
200
       "AF Micro-Nikkor 105mm f/2.8D"},
2168
200
      {0x33, 0x48, 0x2D, 0x2D, 0x24, 0x24, 0x31, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA126DA", "AF Nikkor 18mm f/2.8D"},
2169
200
      {0x34, 0x48, 0x29, 0x29, 0x24, 0x24, 0x32, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA626DA",
2170
200
       "AF Fisheye Nikkor 16mm f/2.8D"},
2171
200
      {0x35, 0x3C, 0xA0, 0xA0, 0x30, 0x30, 0x33, 0x02, 0x07, 0x00, 0x00, "Nikon", "JAA521DA",
2172
200
       "AF-I Nikkor 500mm f/4D IF-ED"},
2173
200
      {0x35, 0x3C, 0xA0, 0xA0, 0x30, 0x30, 0xF1, 0x02, 0x0F, 0x00, 0x00, "Nikon", "JAA521DA",
2174
200
       "AF-I Nikkor 500mm f/4D IF-ED + TC-14E"},
2175
200
      {0x35, 0x3C, 0xA0, 0xA0, 0x30, 0x30, 0xE1, 0x02, 0x0F, 0x00, 0x00, "Nikon", "JAA521DA",
2176
200
       "AF-I Nikkor 500mm f/4D IF-ED + TC-17E"},
2177
200
      {0x35, 0x3C, 0xA0, 0xA0, 0x30, 0x30, 0xF2, 0x02, 0x0F, 0x00, 0x00, "Nikon", "JAA521DA",
2178
200
       "AF-I Nikkor 500mm f/4D IF-ED + TC-20E"},
2179
200
      {0x36, 0x48, 0x37, 0x37, 0x24, 0x24, 0x34, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA125DA", "AF Nikkor 24mm f/2.8D"},
2180
200
      {0x37, 0x48, 0x30, 0x30, 0x24, 0x24, 0x36, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA127DA", "AF Nikkor 20mm f/2.8D"},
2181
200
      {0x38, 0x4C, 0x62, 0x62, 0x14, 0x14, 0x37, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA328DA", "AF Nikkor 85mm f/1.8D"},
2182
      // 39                38
2183
200
      {0x3A, 0x40, 0x3C, 0x5C, 0x2C, 0x34, 0x39, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA744DA",
2184
200
       "AF Zoom-Nikkor 28-70mm f/3.5-4.5D"},
2185
200
      {0x3B, 0x48, 0x44, 0x5C, 0x24, 0x24, 0x3A, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA743DA",
2186
200
       "AF Zoom-Nikkor 35-70mm f/2.8D N"},
2187
200
      {0x3C, 0x48, 0x60, 0x80, 0x24, 0x24, 0x3B, 0x02, 0x00, 0x00, 0x00, "Nikon", "",
2188
200
       "AF Zoom-Nikkor 80-200mm f/2.8D ED"},
2189
200
      {0x3D, 0x3C, 0x44, 0x60, 0x30, 0x3C, 0x3E, 0x02, 0x00, 0x00, 0x00, "Nikon", "",
2190
200
       "AF Zoom-Nikkor 35-80mm f/4-5.6D"},
2191
200
      {0x3E, 0x48, 0x3C, 0x3C, 0x24, 0x24, 0x3D, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA128DA", "AF Nikkor 28mm f/2.8D"},
2192
200
      {0x3F, 0x40, 0x44, 0x6A, 0x2C, 0x34, 0x45, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA748DA",
2193
200
       "AF Zoom-Nikkor 35-105mm f/3.5-4.5D"},
2194
      // 40
2195
200
      {0x41, 0x48, 0x7c, 0x7c, 0x24, 0x24, 0x43, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA330DA",
2196
200
       "AF Nikkor 180mm f/2.8D IF-ED"},
2197
200
      {0x42, 0x54, 0x44, 0x44, 0x18, 0x18, 0x44, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA129DA", "AF Nikkor 35mm f/2D"},
2198
200
      {0x43, 0x54, 0x50, 0x50, 0x0C, 0x0C, 0x46, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA011DB", "AF Nikkor 50mm f/1.4D"},
2199
200
      {0x44, 0x44, 0x60, 0x80, 0x34, 0x3C, 0x47, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA753DB",
2200
200
       "AF Zoom-Nikkor 80-200mm f/4.5-5.6D"},
2201
200
      {0x45, 0x40, 0x3C, 0x60, 0x2C, 0x3C, 0x48, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA752DA",
2202
200
       "AF Zoom-Nikkor 28-80mm f/3.5-5.6D"},
2203
200
      {0x46, 0x3C, 0x44, 0x60, 0x30, 0x3C, 0x49, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA754DA",
2204
200
       "AF Zoom-Nikkor 35-80mm f/4-5.6D N"},
2205
200
      {0x47, 0x42, 0x37, 0x50, 0x2A, 0x34, 0x4A, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA756DA",
2206
200
       "AF Zoom-Nikkor 24-50mm f/3.3-4.5D"},
2207
200
      {0x48, 0x48, 0x8E, 0x8E, 0x24, 0x24, 0x4B, 0x02, 0x07, 0x00, 0x00, "Nikon", "JAA333DA",
2208
200
       "AF-S Nikkor 300mm f/2.8D IF-ED"},
2209
200
      {0x48, 0x48, 0x8E, 0x8E, 0x24, 0x24, 0xF1, 0x02, 0x0F, 0x00, 0x00, "Nikon", "JAA333DA",
2210
200
       "AF-S Nikkor 300mm f/2.8D IF-ED + TC-14E"},
2211
200
      {0x48, 0x48, 0x8E, 0x8E, 0x24, 0x24, 0xE1, 0x02, 0x0F, 0x00, 0x00, "Nikon", "JAA333DA",
2212
200
       "AF-S Nikkor 300mm f/2.8D IF-ED + TC-17E"},
2213
200
      {0x48, 0x48, 0x8E, 0x8E, 0x24, 0x24, 0xF2, 0x02, 0x0F, 0x00, 0x00, "Nikon", "JAA333DA",
2214
200
       "AF-S Nikkor 300mm f/2.8D IF-ED + TC-20E"},
2215
200
      {0x49, 0x3C, 0xA6, 0xA6, 0x30, 0x30, 0x4C, 0x02, 0x07, 0x00, 0x00, "Nikon", "JAA522DA",
2216
200
       "AF-S Nikkor 600mm f/4D IF-ED"},
2217
200
      {0x49, 0x3C, 0xA6, 0xA6, 0x30, 0x30, 0xF1, 0x02, 0x0F, 0x00, 0x00, "Nikon", "JAA522DA",
2218
200
       "AF-S Nikkor 600mm f/4D IF-ED + TC-14E"},
2219
200
      {0x49, 0x3C, 0xA6, 0xA6, 0x30, 0x30, 0xE1, 0x02, 0x0F, 0x00, 0x00, "Nikon", "JAA522DA",
2220
200
       "AF-S Nikkor 600mm f/4D IF-ED + TC-17E"},
2221
200
      {0x49, 0x3C, 0xA6, 0xA6, 0x30, 0x30, 0xF2, 0x02, 0x0F, 0x00, 0x00, "Nikon", "JAA522DA",
2222
200
       "AF-S Nikkor 600mm f/4D IF-ED + TC-20E"},
2223
200
      {0x4A, 0x54, 0x62, 0x62, 0x0C, 0x0C, 0x4D, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA332DA",
2224
200
       "AF Nikkor 85mm f/1.4D IF"},
2225
200
      {0x4B, 0x3C, 0xA0, 0xA0, 0x30, 0x30, 0x4E, 0x02, 0x07, 0x00, 0x00, "Nikon", "JAA523DA",
2226
200
       "AF-S Nikkor 500mm f/4D IF-ED"},
2227
200
      {0x4B, 0x3C, 0xA0, 0xA0, 0x30, 0x30, 0xF1, 0x02, 0x0F, 0x00, 0x00, "Nikon", "JAA523DA",
2228
200
       "AF-S Nikkor 500mm f/4D IF-ED + TC-14E"},
2229
200
      {0x4B, 0x3C, 0xA0, 0xA0, 0x30, 0x30, 0xE1, 0x02, 0x0F, 0x00, 0x00, "Nikon", "JAA523DA",
2230
200
       "AF-S Nikkor 500mm f/4D IF-ED + TC-17E"},
2231
200
      {0x4B, 0x3C, 0xA0, 0xA0, 0x30, 0x30, 0xF2, 0x02, 0x0F, 0x00, 0x00, "Nikon", "JAA523DA",
2232
200
       "AF-S Nikkor 500mm f/4D IF-ED + TC-20E"},
2233
200
      {0x4C, 0x40, 0x37, 0x6E, 0x2C, 0x3C, 0x4F, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA757DA",
2234
200
       "AF Zoom-Nikkor 24-120mm f/3.5-5.6D IF"},
2235
200
      {0x4D, 0x40, 0x3C, 0x80, 0x2C, 0x3C, 0x62, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA758DA",
2236
200
       "AF Zoom-Nikkor 28-200mm f/3.5-5.6D IF"},
2237
200
      {0x4E, 0x48, 0x72, 0x72, 0x18, 0x18, 0x51, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA329DA",
2238
200
       "AF DC-Nikkor 135mm f/2D"},
2239
200
      {0x4F, 0x40, 0x37, 0x5C, 0x2C, 0x3C, 0x53, 0x06, 0x00, 0x00, 0x00, "Nikon", "JBA701AA",
2240
200
       "IX-Nikkor 24-70mm f/3.5-5.6"},
2241
200
      {0x50, 0x48, 0x56, 0x7C, 0x30, 0x3C, 0x54, 0x06, 0x00, 0x00, 0x00, "Nikon", "JBA702AA",
2242
200
       "IX-Nikkor 60-180mm f/4-5.6"},
2243
      //                                                  "JBA703AC" "IX-Nikkor 20-60 mm f/3.5-5.6";
2244
      // 51
2245
      // 52
2246
200
      {0x53, 0x48, 0x60, 0x80, 0x24, 0x24, 0x57, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA762DA",
2247
200
       "AF Zoom-Nikkor 80-200mm f/2.8D ED"},
2248
200
      {0x53, 0x48, 0x60, 0x80, 0x24, 0x24, 0x60, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA762DA",
2249
200
       "AF Zoom-Nikkor 80-200mm f/2.8D ED"},
2250
200
      {0x54, 0x44, 0x5C, 0x7C, 0x34, 0x3C, 0x58, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA763DA",
2251
200
       "AF Zoom-Micro Nikkor 70-180mm f/4.5-5.6D ED"},
2252
200
      {0x54, 0x44, 0x5C, 0x7C, 0x34, 0x3C, 0x61, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA763DA",
2253
200
       "AF Zoom-Micro Nikkor 70-180mm f/4.5-5.6D ED"},
2254
      // 55
2255
200
      {0x56, 0x48, 0x5C, 0x8E, 0x30, 0x3C, 0x5A, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA764DA",
2256
200
       "AF Zoom-Nikkor 70-300mm f/4-5.6D ED"},
2257
      // 57
2258
      // 58
2259
200
      {0x59, 0x48, 0x98, 0x98, 0x24, 0x24, 0x5D, 0x02, 0x07, 0x00, 0x00, "Nikon", "JAA524DA",
2260
200
       "AF-S Nikkor 400mm f/2.8D IF-ED"},
2261
200
      {0x59, 0x48, 0x98, 0x98, 0x24, 0x24, 0xF1, 0x02, 0x0F, 0x00, 0x00, "Nikon", "JAA524DA",
2262
200
       "AF-S Nikkor 400mm f/2.8D IF-ED + TC-14E"},
2263
200
      {0x59, 0x48, 0x98, 0x98, 0x24, 0x24, 0xE1, 0x02, 0x0F, 0x00, 0x00, "Nikon", "JAA524DA",
2264
200
       "AF-S Nikkor 400mm f/2.8D IF-ED + TC-17E"},
2265
200
      {0x59, 0x48, 0x98, 0x98, 0x24, 0x24, 0xF2, 0x02, 0x0F, 0x00, 0x00, "Nikon", "JAA524DA",
2266
200
       "AF-S Nikkor 400mm f/2.8D IF-ED + TC-20E"},
2267
200
      {0x5A, 0x3C, 0x3E, 0x56, 0x30, 0x3C, 0x5E, 0x06, 0x00, 0x00, 0x00, "Nikon", "JBA704AA",
2268
200
       "IX-Nikkor 30-60mm f/4-5.6"},
2269
200
      {0x5B, 0x44, 0x56, 0x7C, 0x34, 0x3C, 0x5F, 0x06, 0x00, 0x00, 0x00, "Nikon", "JBA705AA",
2270
200
       "IX-Nikkor 60-180mm f/4.5-5.6"},
2271
      //                                                  "JBA706AC" "IX-Nikkor 20-60 mm f/3.5-5.6N";
2272
      // 5C
2273
200
      {0x5D, 0x48, 0x3C, 0x5C, 0x24, 0x24, 0x63, 0x02, 0x01, 0x00, 0x00, "Nikon", "JAA767DA",
2274
200
       "AF-S Zoom-Nikkor 28-70mm f/2.8D IF-ED"},
2275
200
      {0x5E, 0x48, 0x60, 0x80, 0x24, 0x24, 0x64, 0x02, 0x03, 0x00, 0x00, "Nikon", "JAA765DA",
2276
200
       "AF-S Zoom-Nikkor 80-200mm f/2.8D IF-ED"},
2277
200
      {0x5F, 0x40, 0x3C, 0x6A, 0x2C, 0x34, 0x65, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA766DA",
2278
200
       "AF Zoom-Nikkor 28-105mm f/3.5-4.5D IF"},
2279
200
      {0x60, 0x40, 0x3C, 0x60, 0x2C, 0x3C, 0x66, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA769DA",
2280
200
       "AF Zoom-Nikkor 28-80mm f/3.5-5.6D"},
2281
200
      {0x61, 0x44, 0x5E, 0x86, 0x34, 0x3C, 0x67, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA768DA",
2282
200
       "AF Zoom-Nikkor 75-240mm f/4.5-5.6D"},
2283
      // 62                69
2284
200
      {0x63, 0x48, 0x2B, 0x44, 0x24, 0x24, 0x68, 0x02, 0x01, 0x00, 0x00, "Nikon", "JAA770DA",
2285
200
       "AF-S Nikkor 17-35mm f/2.8D IF-ED"},
2286
200
      {0x64, 0x00, 0x62, 0x62, 0x24, 0x24, 0x6A, 0x02, 0x40, 0x00, 0x00, "Nikon", "JAA628DA",
2287
200
       "PC Micro-Nikkor 85mm f/2.8D"},
2288
200
      {0x65, 0x44, 0x60, 0x98, 0x34, 0x3C, 0x6B, 0x0A, 0x00, 0x00, 0x00, "Nikon", "JAA771DA",
2289
200
       "AF VR Zoom-Nikkor 80-400mm f/4.5-5.6D ED"},
2290
200
      {0x66, 0x40, 0x2D, 0x44, 0x2C, 0x34, 0x6C, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA772DA",
2291
200
       "AF Zoom-Nikkor 18-35mm f/3.5-4.5D IF-ED"},
2292
200
      {0x67, 0x48, 0x37, 0x62, 0x24, 0x30, 0x6D, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA774DA",
2293
200
       "AF Zoom-Nikkor 24-85mm f/2.8-4D IF"},
2294
200
      {0x68, 0x42, 0x3C, 0x60, 0x2A, 0x3C, 0x6E, 0x06, 0x00, 0x00, 0x00, "Nikon", "JAA777DA",
2295
200
       "AF Zoom-Nikkor 28-80mm f/3.3-5.6G"},
2296
200
      {0x69, 0x48, 0x5C, 0x8E, 0x30, 0x3C, 0x6F, 0x06, 0x00, 0x00, 0x00, "Nikon", "JAA776DA",
2297
200
       "AF Zoom-Nikkor 70-300mm f/4-5.6G"},
2298
200
      {0x6A, 0x48, 0x8E, 0x8E, 0x30, 0x30, 0x70, 0x02, 0x03, 0x00, 0x00, "Nikon", "JAA334DA",
2299
200
       "AF-S Nikkor 300mm f/4D IF-ED"},
2300
200
      {0x6B, 0x48, 0x24, 0x24, 0x24, 0x24, 0x71, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA130DA",
2301
200
       "AF Nikkor ED 14mm f/2.8D"},
2302
      // 6C                72
2303
200
      {0x6D, 0x48, 0x8E, 0x8E, 0x24, 0x24, 0x73, 0x02, 0x03, 0x00, 0x00, "Nikon", "JAA335DA",
2304
200
       "AF-S Nikkor 300mm f/2.8D IF-ED II"},
2305
200
      {0x6E, 0x48, 0x98, 0x98, 0x24, 0x24, 0x74, 0x02, 0x03, 0x00, 0x00, "Nikon", "JAA525DA",
2306
200
       "AF-S Nikkor 400mm f/2.8D IF-ED II"},
2307
200
      {0x6F, 0x3C, 0xA0, 0xA0, 0x30, 0x30, 0x75, 0x02, 0x03, 0x00, 0x00, "Nikon", "JAA526DA",
2308
200
       "AF-S Nikkor 500mm f/4D IF-ED II"},
2309
200
      {0x70, 0x3C, 0xA6, 0xA6, 0x30, 0x30, 0x76, 0x02, 0x03, 0x00, 0x00, "Nikon", "JAA527DA",
2310
200
       "AF-S Nikkor 600mm f/4D IF-ED II"},
2311
      // 71
2312
200
      {0x72, 0x48, 0x4C, 0x4C, 0x24, 0x24, 0x77, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA012AA", "Nikkor 45mm f/2.8 P"},
2313
      // 73
2314
200
      {0x74, 0x40, 0x37, 0x62, 0x2C, 0x34, 0x78, 0x06, 0x01, 0x00, 0x00, "Nikon", "JAA780DA",
2315
200
       "AF-S Zoom-Nikkor 24-85mm f/3.5-4.5G IF-ED"},
2316
200
      {0x75, 0x40, 0x3C, 0x68, 0x2C, 0x3C, 0x79, 0x06, 0x00, 0x00, 0x00, "Nikon", "JAA778DA",
2317
200
       "AF Zoom-Nikkor 28-100mm f/3.5-5.6G"},
2318
200
      {0x76, 0x58, 0x50, 0x50, 0x14, 0x14, 0x7A, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA013DA", "AF Nikkor 50mm f/1.8D"},
2319
200
      {0x77, 0x48, 0x5C, 0x80, 0x24, 0x24, 0x7B, 0x0E, 0x03, 0x00, 0x00, "Nikon", "JAA781DA",
2320
200
       "AF-S VR Zoom-Nikkor 70-200mm f/2.8G IF-ED"},
2321
200
      {0x78, 0x40, 0x37, 0x6E, 0x2C, 0x3C, 0x7C, 0x0E, 0x01, 0x00, 0x00, "Nikon", "JAA782DA",
2322
200
       "AF-S VR Zoom-Nikkor 24-120mm f/3.5-5.6G IF-ED"},
2323
200
      {0x79, 0x40, 0x3C, 0x80, 0x2C, 0x3C, 0x7F, 0x06, 0x00, 0x00, 0x00, "Nikon", "JAA783DA",
2324
200
       "AF Zoom-Nikkor 28-200mm f/3.5-5.6G IF-ED"},
2325
200
      {0x7A, 0x3C, 0x1F, 0x37, 0x30, 0x30, 0x7E, 0x06, 0x01, 0x01, 0x00, "Nikon", "JAA784DA",
2326
200
       "AF-S DX Zoom-Nikkor 12-24mm f/4G IF-ED"},
2327
200
      {0x7B, 0x48, 0x80, 0x98, 0x30, 0x30, 0x80, 0x0E, 0x03, 0x00, 0x00, "Nikon", "JAA787DA",
2328
200
       "AF-S VR Zoom-Nikkor 200-400mm f/4G IF-ED"},
2329
      // 7C                81
2330
200
      {0x7D, 0x48, 0x2B, 0x53, 0x24, 0x24, 0x82, 0x06, 0x01, 0x00, 0x00, "Nikon", "JAA788DA",
2331
200
       "AF-S DX Zoom-Nikkor 17-55mm f/2.8G IF-ED"},
2332
      // 7E                83
2333
200
      {0x7F, 0x40, 0x2D, 0x5C, 0x2C, 0x34, 0x84, 0x06, 0x11, 0x00, 0x00, "Nikon", "JAA790DA",
2334
200
       "AF-S DX Zoom-Nikkor 18-70mm f/3.5-4.5G IF-ED"},
2335
200
      {0x80, 0x48, 0x1A, 0x1A, 0x24, 0x24, 0x85, 0x06, 0x00, 0x00, 0x00, "Nikon", "JAA629DA",
2336
200
       "AF DX Fisheye-Nikkor 10.5mm f/2.8G ED"},
2337
200
      {0x81, 0x54, 0x80, 0x80, 0x18, 0x18, 0x86, 0x0E, 0x03, 0x00, 0x00, "Nikon", "JAA336DA",
2338
200
       "AF-S VR Nikkor 200mm f/2G IF-ED"},
2339
200
      {0x82, 0x48, 0x8E, 0x8E, 0x24, 0x24, 0x87, 0x0E, 0x13, 0x00, 0x00, "Nikon", "JAA337DA",
2340
200
       "AF-S VR Nikkor 300mm f/2.8G IF-ED"},
2341
200
      {0x83, 0x00, 0xB0, 0xB0, 0x5A, 0x5A, 0x88, 0x04, 0x00, 0x00, 0x00, "Nikon", "", "FSA-L2, EDG 65, 800mm F13 G"},
2342
      // 84
2343
      // 85
2344
      // 86
2345
      // 87
2346
      // 88
2347
200
      {0x89, 0x3C, 0x53, 0x80, 0x30, 0x3C, 0x8B, 0x06, 0x01, 0x00, 0x00, "Nikon", "JAA793DA",
2348
200
       "AF-S DX Zoom-Nikkor 55-200mm f/4-5.6G ED"},
2349
200
      {0x8A, 0x54, 0x6A, 0x6A, 0x24, 0x24, 0x8C, 0x0E, 0x53, 0x00, 0x00, "Nikon", "JAA630DA",
2350
200
       "AF-S VR Micro-Nikkor 105mm f/2.8G IF-ED"},
2351
200
      {0x8B, 0x40, 0x2D, 0x80, 0x2C, 0x3C, 0x8D, 0x0E, 0x01, 0x00, 0x00, "Nikon", "JAA794DA",
2352
200
       "AF-S DX VR Zoom-Nikkor 18-200mm f/3.5-5.6G IF-ED"},
2353
      //{0x8B,0x40,0x2D,0x80,0x2C,0x3C,0xFD,0x0E,0x01,0x01,0x00, "Nikon", "JAA794DA", "AF-S DX VR Zoom-Nikkor
2354
      // 18-200mm f/3.5-5.6G IF-ED"}, // Fix bug #1026.
2355
200
      {0x8B, 0x40, 0x2D, 0x80, 0x2C, 0x3C, 0xFD, 0x0E, 0x01, 0x02, 0x00, "Nikon", "JAA813DA",
2356
200
       "AF-S DX VR Zoom-Nikkor 18-200mm f/3.5-5.6G IF-ED II"},
2357
200
      {0x8C, 0x40, 0x2D, 0x53, 0x2C, 0x3C, 0x8E, 0x06, 0x01, 0x00, 0x00, "Nikon", "JAA792DA",
2358
200
       "AF-S DX Zoom-Nikkor 18-55mm f/3.5-5.6G ED"},
2359
200
      {0x8D, 0x44, 0x5C, 0x8E, 0x34, 0x3C, 0x8F, 0x0E, 0x31, 0x00, 0x00, "Nikon", "JAA795DA",
2360
200
       "AF-S VR Zoom-Nikkor 70-300mm f/4.5-5.6G IF-ED"},
2361
      // 8E                90
2362
200
      {0x8F, 0x40, 0x2D, 0x72, 0x2C, 0x3C, 0x91, 0x06, 0x01, 0x00, 0x00, "Nikon", "JAA796DA",
2363
200
       "AF-S DX Zoom-Nikkor 18-135mm f/3.5-5.6G IF-ED"},
2364
200
      {0x90, 0x3B, 0x53, 0x80, 0x30, 0x3C, 0x92, 0x0E, 0x01, 0x00, 0x00, "Nikon", "JAA798DA",
2365
200
       "AF-S DX VR Zoom-Nikkor 55-200mm f/4-5.6G IF-ED"},
2366
      // 91                93
2367
200
      {0x92, 0x48, 0x24, 0x37, 0x24, 0x24, 0x94, 0x06, 0x01, 0x00, 0x00, "Nikon", "JAA801DA",
2368
200
       "AF-S Zoom-Nikkor 14-24mm f/2.8G ED"},
2369
200
      {0x93, 0x48, 0x37, 0x5C, 0x24, 0x24, 0x95, 0x06, 0x01, 0x00, 0x00, "Nikon", "JAA802DA",
2370
200
       "AF-S Zoom-Nikkor 24-70mm f/2.8G ED"},
2371
200
      {0x94, 0x40, 0x2D, 0x53, 0x2C, 0x3C, 0x96, 0x06, 0x01, 0x00, 0x00, "Nikon", "JAA797DA",
2372
200
       "AF-S DX Zoom-Nikkor 18-55mm f/3.5-5.6G ED II"},
2373
200
      {0x95, 0x4C, 0x37, 0x37, 0x2C, 0x2C, 0x97, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA631DA",
2374
200
       "PC-E Nikkor 24mm f/3.5D ED"},
2375
200
      {0x95, 0x00, 0x37, 0x37, 0x2C, 0x2C, 0x97, 0x06, 0x00, 0x00, 0x00, "Nikon", "JAA631DA",
2376
200
       "PC-E Nikkor 24mm f/3.5D ED"},
2377
200
      {0x96, 0x48, 0x98, 0x98, 0x24, 0x24, 0x98, 0x0E, 0x13, 0x00, 0x00, "Nikon", "JAA528DA",
2378
200
       "AF-S VR Nikkor 400mm f/2.8G ED"},
2379
200
      {0x97, 0x3C, 0xA0, 0xA0, 0x30, 0x30, 0x99, 0x0E, 0x13, 0x00, 0x00, "Nikon", "JAA529DA",
2380
200
       "AF-S VR Nikkor 500mm f/4G ED"},
2381
200
      {0x98, 0x3C, 0xA6, 0xA6, 0x30, 0x30, 0x9A, 0x0E, 0x13, 0x00, 0x00, "Nikon", "JAA530DA",
2382
200
       "AF-S VR Nikkor 600mm f/4G ED"},
2383
200
      {0x99, 0x40, 0x29, 0x62, 0x2C, 0x3C, 0x9B, 0x0E, 0x01, 0x00, 0x00, "Nikon", "JAA800DA",
2384
200
       "AF-S DX VR Zoom-Nikkor 16-85mm f/3.5-5.6G ED"},
2385
200
      {0x9A, 0x40, 0x2D, 0x53, 0x2C, 0x3C, 0x9C, 0x0E, 0x01, 0x00, 0x00, "Nikon", "JAA803DA",
2386
200
       "AF-S DX VR Zoom-Nikkor 18-55mm f/3.5-5.6G"},
2387
200
      {0x9B, 0x54, 0x4C, 0x4C, 0x24, 0x24, 0x9D, 0x02, 0x00, 0x00, 0x00, "Nikon", "JAA633DA",
2388
200
       "PC-E Micro Nikkor 45mm f/2.8D ED"},
2389
200
      {0x9B, 0x00, 0x4C, 0x4C, 0x24, 0x24, 0x9D, 0x06, 0x00, 0x00, 0x00, "Nikon", "JAA633DA",
2390
200
       "PC-E Micro Nikkor 45mm f/2.8D ED"},
2391
200
      {0x9C, 0x54, 0x56, 0x56, 0x24, 0x24, 0x9E, 0x06, 0x41, 0x00, 0x00, "Nikon", "JAA632DA",
2392
200
       "AF-S Micro Nikkor 60mm f/2.8G ED"},
2393
200
      {0x9D, 0x54, 0x62, 0x62, 0x24, 0x24, 0x9F, 0x02, 0x40, 0x00, 0x00, "Nikon", "JAA634DA",
2394
200
       "PC-E Micro Nikkor 85mm f/2.8D"},
2395
200
      {0x9D, 0x00, 0x62, 0x62, 0x24, 0x24, 0x9F, 0x06, 0x40, 0x00, 0x00, "Nikon", "JAA634DA",
2396
200
       "PC-E Micro Nikkor 85mm f/2.8D"},
2397
200
      {0x9E, 0x40, 0x2D, 0x6A, 0x2C, 0x3C, 0xA0, 0x0E, 0x01, 0x00, 0x00, "Nikon", "JAA805DA",
2398
200
       "AF-S DX VR Zoom-Nikkor 18-105mm f/3.5-5.6G ED"},
2399
200
      {0x9F, 0x58, 0x44, 0x44, 0x14, 0x14, 0xA1, 0x06, 0x01, 0x00, 0x00, "Nikon", "JAA132DA",
2400
200
       "AF-S DX Nikkor 35mm f/1.8G"},
2401
200
      {0xA0, 0x54, 0x50, 0x50, 0x0C, 0x0C, 0xA2, 0x06, 0x01, 0x00, 0x00, "Nikon", "JAA014DA",
2402
200
       "AF-S Nikkor 50mm f/1.4G"},
2403
200
      {0xA1, 0x40, 0x18, 0x37, 0x2C, 0x34, 0xA3, 0x06, 0x01, 0x00, 0x00, "Nikon", "JAA804DA",
2404
200
       "AF-S DX Nikkor 10-24mm f/3.5-4.5G ED"},
2405
200
      {0xA2, 0x38, 0x5C, 0x8E, 0x34, 0x40, 0xCD, 0x86, 0x00, 0x00, 0x00, "Nikon", "JAA829DA",
2406
200
       "AF-P DX Nikkor 70-300mm f/4.5-6.3G ED VR"},
2407
200
      {0xA2, 0x48, 0x5C, 0x80, 0x24, 0x24, 0xA4, 0x0E, 0x13, 0x00, 0x00, "Nikon", "JAA807DA",
2408
200
       "AF-S Nikkor 70-200mm f/2.8G ED VR II"},
2409
200
      {0xA3, 0x3C, 0x29, 0x44, 0x30, 0x30, 0xA5, 0x0E, 0x01, 0x00, 0x00, "Nikon", "JAA806DA",
2410
200
       "AF-S Nikkor 16-35mm f/4G ED VR"},
2411
200
      {0xA4, 0x54, 0x37, 0x37, 0x0C, 0x0C, 0xA6, 0x06, 0x01, 0x00, 0x00, "Nikon", "JAA131DA",
2412
200
       "AF-S Nikkor 24mm f/1.4G ED"},
2413
200
      {0xA5, 0x40, 0x3C, 0x8E, 0x2C, 0x3C, 0xA7, 0x0E, 0x01, 0x00, 0x00, "Nikon", "JAA808DA",
2414
200
       "AF-S Nikkor 28-300mm f/3.5-5.6G ED VR"},
2415
200
      {0xA6, 0x48, 0x8E, 0x8E, 0x24, 0x24, 0xA8, 0x0E, 0x13, 0x00, 0x00, "Nikon", "JAA339DA",
2416
200
       "AF-S Nikkor 300mm f/2.8G IF-ED VR II"},
2417
200
      {0xA7, 0x4B, 0x62, 0x62, 0x2C, 0x2C, 0xA9, 0x0E, 0x41, 0x00, 0x00, "Nikon", "JAA637DA",
2418
200
       "AF-S DX Micro Nikkor 85mm f/3.5G ED VR"},
2419
200
      {0xA8, 0x48, 0x80, 0x98, 0x30, 0x30, 0xAA, 0x0E, 0x03, 0x00, 0x00, "Nikon", "JAA809DA",
2420
200
       "AF-S Zoom-Nikkor 200-400mm f/4G IF-ED VR II"},
2421
200
      {0xA9, 0x54, 0x80, 0x80, 0x18, 0x18, 0xAB, 0x0E, 0x13, 0x00, 0x00, "Nikon", "JAA340DA",
2422
200
       "AF-S Nikkor 200mm f/2G ED VR II"},
2423
200
      {0xAA, 0x3C, 0x37, 0x6E, 0x30, 0x30, 0xAC, 0x0E, 0x01, 0x00, 0x00, "Nikon", "JAA811DA",
2424
200
       "AF-S Nikkor 24-120mm f/4G ED VR"},
2425
      // AB                AD                                          -- no lens --
2426
200
      {0xAC, 0x38, 0x53, 0x8E, 0x34, 0x3C, 0xAE, 0x0E, 0x01, 0x00, 0x00, "Nikon", "JAA814DA",
2427
200
       "AF-S DX Nikkor 55-300mm f/4.5-5.6G ED VR"},
2428
200
      {0xAD, 0x3C, 0x2D, 0x8E, 0x2C, 0x3C, 0xAF, 0x0E, 0x01, 0x00, 0x00, "Nikon", "JAA812DA",
2429
200
       "AF-S DX Nikkor 18-300mm f/3.5-5.6G ED VR"},
2430
200
      {0xAD, 0x3C, 0xA0, 0xA0, 0x3C, 0x3C, 0xD8, 0x4E, 0x00, 0x00, 0x00, "Nikon", "JAA535DA",
2431
200
       "AF-S Nikkor 500mm f/5.6E PF ED VR"},
2432
200
      {0xAE, 0x54, 0x62, 0x62, 0x0C, 0x0C, 0xB0, 0x06, 0x01, 0x00, 0x00, "Nikon", "JAA338DA",
2433
200
       "AF-S Nikkor 85mm f/1.4G"},
2434
200
      {0xAF, 0x54, 0x44, 0x44, 0x0C, 0x0C, 0xB1, 0x06, 0x01, 0x00, 0x00, "Nikon", "JAA134DA",
2435
200
       "AF-S Nikkor 35mm f/1.4G"},
2436
200
      {0xB0, 0x4C, 0x50, 0x50, 0x14, 0x14, 0xB2, 0x06, 0x01, 0x00, 0x00, "Nikon", "JAA015DA",
2437
200
       "AF-S Nikkor 50mm f/1.8G"},
2438
200
      {0xB1, 0x48, 0x48, 0x48, 0x24, 0x24, 0xB3, 0x06, 0x01, 0x00, 0x00, "Nikon", "JAA638DA",
2439
200
       "AF-S DX Micro Nikkor 40mm f/2.8G"},
2440
200
      {0xB2, 0x48, 0x5C, 0x80, 0x30, 0x30, 0xB4, 0x0E, 0x01, 0x00, 0x00, "Nikon", "JAA815DA",
2441
200
       "AF-S Nikkor 70-200mm f/4G ED VR"},
2442
200
      {0xB3, 0x4C, 0x62, 0x62, 0x14, 0x14, 0xB5, 0x06, 0x01, 0x00, 0x00, "Nikon", "JAA341DA",
2443
200
       "AF-S Nikkor 85mm f/1.8G"},
2444
200
      {0xB4, 0x40, 0x37, 0x62, 0x2C, 0x34, 0xB6, 0x0E, 0x01, 0x00, 0x00, "Nikon", "JAA816DA",
2445
200
       "AF-S Nikkor 24-85mm f/3.5-4.5G ED VR"},
2446
200
      {0xB5, 0x4C, 0x3C, 0x3C, 0x14, 0x14, 0xB7, 0x06, 0x01, 0x00, 0x00, "Nikon", "JAA135DA",
2447
200
       "AF-S Nikkor 28mm f/1.8G"},
2448
200
      {0xB6, 0x3C, 0xB0, 0xB0, 0x3C, 0x3C, 0xB8, 0x0E, 0x01, 0x00, 0x00, "Nikon", "JAA531DA",
2449
200
       "AF-S VR Nikkor 800mm f/5.6E FL ED"},
2450
200
      {0xB6, 0x3C, 0xB0, 0xB0, 0x3C, 0x3C, 0xB8, 0x4E, 0x01, 0x00, 0x00, "Nikon", "JAA531DA",
2451
200
       "AF-S VR Nikkor 800mm f/5.6E FL ED"},
2452
200
      {0xB7, 0x44, 0x60, 0x98, 0x34, 0x3C, 0xB9, 0x0E, 0x01, 0x00, 0x00, "Nikon", "JAA817DA",
2453
200
       "AF-S Nikkor 80-400mm f/4.5-5.6G ED VR"},
2454
200
      {0xB8, 0x40, 0x2D, 0x44, 0x2C, 0x34, 0xBA, 0x06, 0x01, 0x00, 0x00, "Nikon", "JAA818DA",
2455
200
       "AF-S Nikkor 18-35mm f/3.5-4.5G ED"},
2456
200
      {0xA0, 0x40, 0x2D, 0x74, 0x2C, 0x3C, 0xBB, 0x0E, 0x01, 0x00, 0x01, "Nikon", "JAA819DA",
2457
200
       "AF-S DX Nikkor 18-140mm f/3.5-5.6G ED VR"},
2458
200
      {0xA1, 0x54, 0x55, 0x55, 0x0C, 0x0C, 0xBC, 0x06, 0x01, 0x00, 0x01, "Nikon", "JAA136DA",
2459
200
       "AF-S Nikkor 58mm f/1.4G"},
2460
200
      {0xA2, 0x40, 0x2D, 0x53, 0x2C, 0x3C, 0xBD, 0x0E, 0x01, 0x00, 0x01, "Nikon", "JAA820DA",
2461
200
       "AF-S DX Nikkor 18-55mm f/3.5-5.6G VR II"},
2462
200
      {0xA4, 0x40, 0x2D, 0x8E, 0x2C, 0x40, 0xBF, 0x0E, 0x01, 0x00, 0x01, "Nikon", "JAA821DA",
2463
200
       "AF-S DX Nikkor 18-300mm f/3.5-6.3G ED VR"},
2464
200
      {0xA5, 0x4C, 0x44, 0x44, 0x14, 0x14, 0xC0, 0x06, 0x01, 0x00, 0x01, "Nikon", "JAA137DA",
2465
200
       "AF-S Nikkor 35mm f/1.8G ED"},
2466
200
      {0xA6, 0x48, 0x98, 0x98, 0x24, 0x24, 0xC1, 0x0E, 0x01, 0x00, 0x01, "Nikon", "JAA532DA",
2467
200
       "AF-S Nikkor 400mm f/2.8E FL ED VR"},
2468
200
      {0xA7, 0x3C, 0x53, 0x80, 0x30, 0x3C, 0xC2, 0x0E, 0x01, 0x00, 0x01, "Nikon", "JAA823DA",
2469
200
       "AF-S DX Nikkor 55-200mm f/4-5.6G ED VR II"},
2470
200
      {0xA8, 0x48, 0x8E, 0x8E, 0x30, 0x30, 0xC3, 0x4E, 0x01, 0x00, 0x01, "Nikon", "JAA342DA",
2471
200
       "AF-S Nikkor 300mm f/4E PF ED VR"},
2472
200
      {0xA8, 0x48, 0x8E, 0x8E, 0x30, 0x30, 0xC3, 0x0E, 0x01, 0x00, 0x01, "Nikon", "JAA342DA",
2473
200
       "AF-S Nikkor 300mm f/4E PF ED VR"},
2474
200
      {0xA9, 0x4C, 0x31, 0x31, 0x14, 0x14, 0xC4, 0x06, 0x01, 0x00, 0x01, "Nikon", "JAA138DA",
2475
200
       "AF-S Nikkor 20mm f/1.8G ED"},
2476
200
      {0xAA, 0x48, 0x37, 0x5C, 0x24, 0x24, 0xC5, 0x4E, 0x01, 0x00, 0x02, "Nikon", "JAA824DA",
2477
200
       "AF-S Nikkor 24-70mm f/2.8E ED VR"},
2478
200
      {0xAA, 0x48, 0x37, 0x5C, 0x24, 0x24, 0xC5, 0x0E, 0x01, 0x00, 0x02, "Nikon", "JAA824DA",
2479
200
       "AF-S Nikkor 24-70mm f/2.8E ED VR"},
2480
200
      {0xAB, 0x3C, 0xA0, 0xA0, 0x30, 0x30, 0xC6, 0x4E, 0x01, 0x00, 0x02, "Nikon", "JAA533DA",
2481
200
       "AF-S Nikkor 500mm f/4E FL ED VR"},
2482
200
      {0xAC, 0x3C, 0xA6, 0xA6, 0x30, 0x30, 0xC7, 0x4E, 0x01, 0x00, 0x02, "Nikon", "JAA534DA",
2483
200
       "AF-S Nikkor 600mm f/4E FL ED VR"},
2484
200
      {0xAD, 0x48, 0x28, 0x60, 0x24, 0x30, 0xC8, 0x4E, 0x01, 0x00, 0x02, "Nikon", "JAA825DA",
2485
200
       "AF-S DX Nikkor 16-80mm f/2.8-4E ED VR"},
2486
200
      {0xAD, 0x48, 0x28, 0x60, 0x24, 0x30, 0xC8, 0x0E, 0x01, 0x00, 0x02, "Nikon", "JAA825DA",
2487
200
       "AF-S DX Nikkor 16-80mm f/2.8-4E ED VR"},
2488
200
      {0xAE, 0x3C, 0x80, 0xA0, 0x3C, 0x3C, 0xC9, 0x4E, 0x01, 0x00, 0x02, "Nikon", "JAA822DA",
2489
200
       "AF-S Nikkor 200-500mm f/5.6E ED VR"},
2490
200
      {0xAE, 0x3C, 0x80, 0xA0, 0x3C, 0x3C, 0xC9, 0x0E, 0x01, 0x00, 0x02, "Nikon", "JAA822DA",
2491
200
       "AF-S Nikkor 200-500mm f/5.6E ED VR"},
2492
200
      {0xA0, 0x40, 0x2D, 0x53, 0x2C, 0x3C, 0xCA, 0x8E, 0x01, 0x00, 0x03, "Nikon", "JAA826DA",
2493
200
       "AF-P DX Nikkor 18-55mm f/3.5-5.6G VR"},
2494
200
      {0xA0, 0x40, 0x2D, 0x53, 0x2C, 0x3C, 0xCA, 0x0E, 0x01, 0x00, 0x03, "Nikon", "JAA827DA",
2495
200
       "AF-P DX Nikkor 18-55mm f/3.5-5.6G"},
2496
      //                  CB
2497
200
      {0xAF, 0x4C, 0x37, 0x37, 0x14, 0x14, 0xCC, 0x06, 0x01, 0x00, 0x03, "Nikon", "JAA139DA",
2498
200
       "AF-S Nikkor 24mm f/1.8G ED"},
2499
200
      {0xA3, 0x38, 0x5C, 0x8E, 0x34, 0x40, 0xCE, 0x8E, 0x01, 0x00, 0x03, "Nikon", "JAA829DA",
2500
200
       "AF-P DX Nikkor 70-300mm f/4.5-6.3G ED VR"},
2501
200
      {0xA3, 0x38, 0x5C, 0x8E, 0x34, 0x40, 0xCE, 0x0E, 0x01, 0x00, 0x03, "Nikon", "JAA828DA",
2502
200
       "AF-P DX Nikkor 70-300mm f/4.5-6.3G ED"},
2503
200
      {0xA4, 0x48, 0x5C, 0x80, 0x24, 0x24, 0xCF, 0x4E, 0x01, 0x00, 0x03, "Nikon", "JAA830DA",
2504
200
       "AF-S Nikkor 70-200mm f/2.8E FL ED VR"},
2505
200
      {0xA4, 0x48, 0x5C, 0x80, 0x24, 0x24, 0xCF, 0x0E, 0x01, 0x00, 0x03, "Nikon", "JAA830DA",
2506
200
       "AF-S Nikkor 70-200mm f/2.8E FL ED VR"},
2507
200
      {0xA5, 0x54, 0x6A, 0x6A, 0x0C, 0x0C, 0xD0, 0x46, 0x01, 0x00, 0x03, "Nikon", "JAA343DA",
2508
200
       "AF-S Nikkor 105mm f/1.4E ED"},
2509
200
      {0xA5, 0x54, 0x6A, 0x6A, 0x0C, 0x0C, 0xD0, 0x06, 0x01, 0x00, 0x03, "Nikon", "JAA343DA",
2510
200
       "AF-S Nikkor 105mm f/1.4E ED"},
2511
200
      {0xA6, 0x48, 0x2F, 0x2F, 0x30, 0x30, 0xD1, 0x46, 0x01, 0x00, 0x03, "Nikon", "JAA639DA", "PC Nikkor 19mm f/4E ED"},
2512
200
      {0xA6, 0x48, 0x2F, 0x2F, 0x30, 0x30, 0xD1, 0x06, 0x01, 0x00, 0x03, "Nikon", "JAA639DA", "PC Nikkor 19mm f/4E ED"},
2513
200
      {0xA7, 0x40, 0x11, 0x26, 0x2C, 0x34, 0xD2, 0x46, 0x01, 0x00, 0x03, "Nikon", "JAA831DA",
2514
200
       "AF-S Fisheye Nikkor 8-15mm f/3.5-4.5E ED"},
2515
200
      {0xA7, 0x40, 0x11, 0x26, 0x2C, 0x34, 0xD2, 0x06, 0x01, 0x00, 0x03, "Nikon", "JAA831DA",
2516
200
       "AF-S Fisheye Nikkor 8-15mm f/3.5-4.5E ED"},
2517
200
      {0xA8, 0x38, 0x18, 0x30, 0x34, 0x3C, 0xD3, 0x8E, 0x01, 0x00, 0x03, "Nikon", "JAA832DA",
2518
200
       "AF-P DX Nikkor 10-20mm f/4.5-5.6G VR"},
2519
200
      {0xA8, 0x38, 0x18, 0x30, 0x34, 0x3C, 0xD3, 0x0E, 0x01, 0x00, 0x03, "Nikon", "JAA832DA",
2520
200
       "AF-P DX Nikkor 10-20mm f/4.5-5.6G VR"},
2521
      // A9                D4
2522
      // AA                D5
2523
200
      {0xAB, 0x44, 0x5C, 0x8E, 0x34, 0x3C, 0xD6, 0xCE, 0x01, 0x00, 0x03, "Nikon", "JAA833DA",
2524
200
       "AF-P Nikkor 70-300mm f/4.5-5.6E ED VR"},
2525
200
      {0xAB, 0x44, 0x5C, 0x8E, 0x34, 0x3C, 0xD6, 0x0E, 0x01, 0x00, 0x03, "Nikon", "JAA833DA",
2526
200
       "AF-P Nikkor 70-300mm f/4.5-5.6E ED VR"},
2527
200
      {0xAC, 0x54, 0x3C, 0x3C, 0x0C, 0x0C, 0xD7, 0x46, 0x01, 0x00, 0x03, "Nikon", "JAA140DA",
2528
200
       "AF-S Nikkor 28mm f/1.4E ED"},
2529
200
      {0xAC, 0x54, 0x3C, 0x3C, 0x0C, 0x0C, 0xD7, 0x06, 0x01, 0x00, 0x03, "Nikon", "JAA140DA",
2530
200
       "AF-S Nikkor 28mm f/1.4E ED"},
2531
      //
2532
      //
2533
      //
2534
      //
2535
      //   "AF-S DX Nikkor 18-200mm f/3.5-5.6G ED VR II"
2536
      //
2537
200
      {0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA90701", "TC-16A"},
2538
200
      {0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA90701", "TC-16A"},
2539
      //
2540
      //------------------------------------------------------------------------------
2541
      // Sigma lenses by focal length, first fixed then zoom lenses
2542
      //------------------------------------------------------------------------------
2543
      //
2544
200
      {0xFE, 0x47, 0x00, 0x00, 0x24, 0x24, 0x4B, 0x06, 0x01, 0x00, 0x00, "Sigma", "486556",
2545
200
       "4.5mm F2.8 EX DC HSM Circular Fisheye"},
2546
200
      {0x26, 0x48, 0x11, 0x11, 0x30, 0x30, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "483", "8mm F4 EX Circular Fisheye"},
2547
200
      {0x79, 0x40, 0x11, 0x11, 0x2C, 0x2C, 0x1C, 0x06, 0x00, 0x00, 0x00, "Sigma", "485597",
2548
200
       "8mm F3.5 EX Circular Fisheye"},
2549
200
      {0xDC, 0x48, 0x19, 0x19, 0x24, 0x24, 0x4B, 0x06, 0x01, 0x00, 0x00, "Sigma", "477554",
2550
200
       "10mm F2.8 EX DC HSM Fisheye"},
2551
200
      {0x02, 0x3F, 0x24, 0x24, 0x2C, 0x2C, 0x02, 0x00, 0x00, 0x00, 0x00, "Sigma", "468", "14mm F3.5"},
2552
200
      {0x48, 0x48, 0x24, 0x24, 0x24, 0x24, 0x4B, 0x02, 0x01, 0x00, 0x00, "Sigma", "", "14mm F2.8 EX Aspherical HSM"},
2553
200
      {0x26, 0x48, 0x27, 0x27, 0x24, 0x24, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "476441",
2554
200
       "15mm F2.8 EX Diagonal Fisheye"},
2555
200
      {0xEA, 0x48, 0x27, 0x27, 0x24, 0x24, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "", "15mm F2.8 EX Diagonal Fisheye"},
2556
      // M                                         "Sigma" "410"    "18mm F3.5";
2557
200
      {0x26, 0x58, 0x31, 0x31, 0x14, 0x14, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "411442",
2558
200
       "20mm F1.8 EX DG Aspherical RF"},
2559
200
      {0x79, 0x54, 0x31, 0x31, 0x0C, 0x0C, 0x4B, 0x06, 0x00, 0x00, 0x00, "Sigma", "412555", "20mm F1.4 DG HSM | A"},
2560
200
      {0x7E, 0x54, 0x37, 0x37, 0x0C, 0x0C, 0x4B, 0x06, 0x00, 0x00, 0x00, "Sigma", "401559", "24mm F1.4 DG HSM | A"},
2561
200
      {0x26, 0x58, 0x37, 0x37, 0x14, 0x14, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "432447",
2562
200
       "24mm F1.8 EX DG Aspherical Macro"},
2563
200
      {0xE1, 0x58, 0x37, 0x37, 0x14, 0x14, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "432447",
2564
200
       "24mm F1.8 EX DG Aspherical Macro"},
2565
200
      {0x02, 0x46, 0x37, 0x37, 0x25, 0x25, 0x02, 0x00, 0x00, 0x00, 0x00, "Sigma", "438",
2566
200
       "24mm F2.8 Super Wide II Macro"},
2567
200
      {0xBC, 0x54, 0x3C, 0x3C, 0x0C, 0x0C, 0x4B, 0x46, 0x00, 0x00, 0x00, "Sigma", "441555", "28mm F1.4 DG HSM | A"},
2568
200
      {0x26, 0x58, 0x3C, 0x3C, 0x14, 0x14, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "440442",
2569
200
       "28mm F1.8 EX DG Aspherical Macro"},
2570
200
      {0x48, 0x54, 0x3E, 0x3E, 0x0C, 0x0C, 0x4B, 0x06, 0x01, 0x00, 0x00, "Sigma", "477554", "30mm F1.4 EX DC HSM"},
2571
200
      {0xF8, 0x54, 0x3E, 0x3E, 0x0C, 0x0C, 0x4B, 0x06, 0x01, 0x00, 0x00, "Sigma", "477554", "30mm F1.4 EX DC HSM"},
2572
200
      {0x91, 0x54, 0x44, 0x44, 0x0C, 0x0C, 0x4B, 0x06, 0x01, 0x00, 0x00, "Sigma", "", "35mm F1.4 DG HSM"},
2573
200
      {0xDE, 0x54, 0x50, 0x50, 0x0C, 0x0C, 0x4B, 0x06, 0x01, 0x00, 0x00, "Sigma", "310554", "50mm F1.4 EX DG HSM"},
2574
200
      {0x88, 0x54, 0x50, 0x50, 0x0C, 0x0C, 0x4B, 0x06, 0x00, 0x00, 0x00, "Sigma", "311551", "50mm F1.4 DG HSM | A"},
2575
200
      {0x02, 0x48, 0x50, 0x50, 0x24, 0x24, 0x02, 0x00, 0x00, 0x00, 0x00, "Sigma", "", "Macro 50mm F2.8"},
2576
200
      {0x32, 0x54, 0x50, 0x50, 0x24, 0x24, 0x35, 0x02, 0x00, 0x00, 0x00, "Sigma", "346447", "Macro 50mm F2.8 EX DG"},
2577
200
      {0xE3, 0x54, 0x50, 0x50, 0x24, 0x24, 0x35, 0x02, 0x00, 0x00, 0x00, "Sigma", "", "Macro 50mm F2.8 EX DG"},
2578
200
      {0x79, 0x48, 0x5C, 0x5C, 0x24, 0x24, 0x1C, 0x06, 0x00, 0x00, 0x00, "Sigma", "270599", "Macro 70mm F2.8 EX DG"},
2579
200
      {0x9B, 0x54, 0x62, 0x62, 0x0C, 0x0C, 0x4B, 0x06, 0x00, 0x00, 0x00, "Sigma", "", "85mm F1.4 EX DG HSM"},
2580
200
      {0x02, 0x48, 0x65, 0x65, 0x24, 0x24, 0x02, 0x00, 0x00, 0x00, 0x00, "Sigma", "", "Macro 90mm F2.8"},
2581
200
      {0x32, 0x54, 0x6A, 0x6A, 0x24, 0x24, 0x35, 0x02, 0x00, 0x02, 0x00, "Sigma", "256", "Macro 105mm F2.8 EX DG"},
2582
200
      {0xE5, 0x54, 0x6A, 0x6A, 0x24, 0x24, 0x35, 0x02, 0x40, 0x00, 0x00, "Sigma", "257446", "Macro 105mm F2.8 EX DG"},
2583
200
      {0x97, 0x48, 0x6A, 0x6A, 0x24, 0x24, 0x4B, 0x0E, 0x00, 0x00, 0x00, "Sigma", "", "Macro 105mm F2.8 EX DG OS HSM"},
2584
200
      {0x48, 0x48, 0x76, 0x76, 0x24, 0x24, 0x4B, 0x06, 0x43, 0x00, 0x00, "Sigma", "104559",
2585
200
       "APO Macro 150mm F2.8 EX DG HSM"},
2586
200
      {0xF5, 0x48, 0x76, 0x76, 0x24, 0x24, 0x4B, 0x06, 0x43, 0x00, 0x00, "Sigma", "104559",
2587
200
       "APO Macro 150mm F2.8 EX DG HSM"},
2588
200
      {0x99, 0x48, 0x76, 0x76, 0x24, 0x24, 0x4B, 0x0E, 0x43, 0x00, 0x00, "Sigma", "",
2589
200
       "APO Macro 150mm F2.8 EX DG OS HSM"},
2590
200
      {0x48, 0x4C, 0x7C, 0x7C, 0x2C, 0x2C, 0x4B, 0x02, 0x43, 0x00, 0x00, "Sigma", "", "APO Macro 180mm F3.5 EX DG HSM"},
2591
200
      {0x48, 0x4C, 0x7D, 0x7D, 0x2C, 0x2C, 0x4B, 0x02, 0x43, 0x00, 0x00, "Sigma", "105556",
2592
200
       "APO Macro 180mm F3.5 EX DG HSM"},
2593
200
      {0x94, 0x48, 0x7C, 0x7C, 0x24, 0x24, 0x4B, 0x0E, 0x43, 0x00, 0x00, "Sigma", "",
2594
200
       "APO Macro 180mm F2.8 EX DG OS HSM"},
2595
      // M                                         "Sigma" ""       "APO 300mm F2.8";
2596
200
      {0x48, 0x54, 0x8E, 0x8E, 0x24, 0x24, 0x4B, 0x02, 0x03, 0x00, 0x00, "Sigma", "", "APO 300mm F2.8 EX DG HSM"},
2597
200
      {0xFB, 0x54, 0x8E, 0x8E, 0x24, 0x24, 0x4B, 0x02, 0x13, 0x00, 0x00, "Sigma", "195557", "APO 300mm F2.8 EX DG HSM"},
2598
200
      {0x26, 0x48, 0x8E, 0x8E, 0x30, 0x30, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "", "APO Tele Macro 300mm F4"},
2599
200
      {0x02, 0x2F, 0x98, 0x98, 0x3D, 0x3D, 0x02, 0x00, 0x00, 0x00, 0x00, "Sigma", "", "APO 400mm F5.6"},
2600
200
      {0x26, 0x3C, 0x98, 0x98, 0x3C, 0x3C, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "", "APO Tele Macro 400mm F5.6"},
2601
200
      {0x02, 0x37, 0xA0, 0xA0, 0x34, 0x34, 0x02, 0x00, 0x00, 0x00, 0x00, "Sigma", "", "APO 500mm F4.5"},
2602
200
      {0x48, 0x44, 0xA0, 0xA0, 0x34, 0x34, 0x4B, 0x02, 0x03, 0x00, 0x00, "Sigma", "", "APO 500mm F4.5 EX HSM"},
2603
200
      {0xF1, 0x44, 0xA0, 0xA0, 0x34, 0x34, 0x4B, 0x02, 0x03, 0x00, 0x00, "Sigma", "184551", "APO 500mm F4.5 EX DG HSM"},
2604
200
      {0x02, 0x34, 0xA0, 0xA0, 0x44, 0x44, 0x02, 0x00, 0x00, 0x00, 0x00, "Sigma", "", "APO 500mm F7.2"},
2605
200
      {0x02, 0x3C, 0xB0, 0xB0, 0x3C, 0x3C, 0x02, 0x00, 0x00, 0x00, 0x00, "Sigma", "", "APO 800mm F5.6"},
2606
200
      {0x48, 0x3C, 0xB0, 0xB0, 0x3C, 0x3C, 0x4B, 0x02, 0x03, 0x00, 0x00, "Sigma", "", "APO 800mm F5.6 EX HSM"},
2607
      // M                                         "Sigma" "152550" "APO 800mm F5.6 EX DG HSM";
2608
      // M2    B8 B8 49 49 02" "00" "00" "00" "00" "Sigma" ""       "APO 1000mm F8.0";
2609
      //
2610
200
      {0x9E, 0x38, 0x11, 0x29, 0x34, 0x3C, 0x4B, 0x06, 0x01, 0x00, 0x00, "Sigma", "", "8-16mm F4.5-5.6 DC HSM"},
2611
200
      {0xA1, 0x41, 0x19, 0x31, 0x2C, 0x2C, 0x4B, 0x06, 0x01, 0x00, 0x00, "Sigma", "", "10-20mm F3.5 EX DC HSM"},
2612
200
      {0x48, 0x3C, 0x19, 0x31, 0x30, 0x3C, 0x4B, 0x06, 0x01, 0x00, 0x00, "Sigma", "201555", "10-20mm F4-5.6 EX DC HSM"},
2613
200
      {0xF9, 0x3C, 0x19, 0x31, 0x30, 0x3C, 0x4B, 0x06, 0x01, 0x00, 0x00, "Sigma", "201555", "10-20mm F4-5.6 EX DC HSM"},
2614
200
      {0xCA, 0x3C, 0x1F, 0x37, 0x30, 0x30, 0x4B, 0x46, 0x01, 0x00, 0x00, "Sigma", "205955", "12-24mm F4 DG HSM | A"},
2615
200
      {0x48, 0x38, 0x1F, 0x37, 0x34, 0x3C, 0x4B, 0x06, 0x00, 0x00, 0x00, "Sigma", "200558",
2616
200
       "12-24mm F4.5-5.6 EX DG Aspherical HSM"},
2617
200
      {0xF0, 0x38, 0x1F, 0x37, 0x34, 0x3C, 0x4B, 0x06, 0x00, 0x00, 0x00, "Sigma", "200558",
2618
200
       "12-24mm F4.5-5.6 EX DG Aspherical HSM"},
2619
200
      {0x96, 0x38, 0x1F, 0x37, 0x34, 0x3C, 0x4B, 0x06, 0x00, 0x00, 0x00, "Sigma", "", "12-24mm F4.5-5.6 II DG HSM"},
2620
200
      {0xC1, 0x48, 0x24, 0x37, 0x24, 0x24, 0x4B, 0x46, 0x00, 0x00, 0x00, "Sigma", "", "14-24mm F2.8 DG HSM | A"},
2621
200
      {0x26, 0x40, 0x27, 0x3F, 0x2C, 0x34, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "",
2622
200
       "15-30mm F3.5-4.5 EX DG Aspherical DF"},
2623
200
      {0x48, 0x48, 0x2B, 0x44, 0x24, 0x30, 0x4B, 0x06, 0x00, 0x00, 0x00, "Sigma", "",
2624
200
       "17-35mm F2.8-4 EX DG Aspherical HSM"},
2625
200
      {0x26, 0x54, 0x2B, 0x44, 0x24, 0x30, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "", "17-35mm F2.8-4 EX Aspherical"},
2626
200
      {0x9D, 0x48, 0x2B, 0x50, 0x24, 0x24, 0x4B, 0x0E, 0x00, 0x00, 0x00, "Sigma", "", "17-50mm F2.8 EX DC OS HSM"},
2627
200
      {0x8F, 0x48, 0x2B, 0x50, 0x24, 0x24, 0x4B, 0x0E, 0x00, 0x00, 0x00, "Sigma", "", "17-50mm F2.8 EX DC OS HSM"},
2628
200
      {0x7A, 0x47, 0x2B, 0x5C, 0x24, 0x34, 0x4B, 0x06, 0x00, 0x00, 0x00, "Sigma", "689599",
2629
200
       "17-70mm F2.8-4.5 DC Macro Asp. IF HSM"},
2630
200
      {0x7A, 0x48, 0x2B, 0x5C, 0x24, 0x34, 0x4B, 0x06, 0x00, 0x00, 0x00, "Sigma", "689599",
2631
200
       "17-70mm F2.8-4.5 DC Macro Asp. IF HSM"},
2632
200
      {0x7F, 0x48, 0x2B, 0x5C, 0x24, 0x34, 0x1C, 0x06, 0x00, 0x00, 0x00, "Sigma", "",
2633
200
       "17-70mm F2.8-4.5 DC Macro Asp. IF"},
2634
200
      {0x8E, 0x3C, 0x2B, 0x5C, 0x24, 0x30, 0x4B, 0x0E, 0x00, 0x00, 0x00, "Sigma", "",
2635
200
       "17-70mm F2.8-4 DC Macro OS HSM | C"},
2636
200
      {0xA0, 0x48, 0x2A, 0x5C, 0x24, 0x30, 0x4B, 0x0E, 0x00, 0x00, 0xFE, "Sigma", "", "17-70mm F2.8-4 DC Macro OS HSM"},
2637
200
      {0x8B, 0x4C, 0x2D, 0x44, 0x14, 0x14, 0x4B, 0x06, 0x00, 0x00, 0x00, "Sigma", "", "18-35mm F1.8 DC HSM"},
2638
200
      {0x26, 0x40, 0x2D, 0x44, 0x2B, 0x34, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "", "18-35mm F3.5-4.5 Aspherical"},
2639
200
      {0x26, 0x48, 0x2D, 0x50, 0x24, 0x24, 0x1C, 0x06, 0x00, 0x00, 0x00, "Sigma", "", "18-50mm F2.8 EX DC"},
2640
200
      {0x7F, 0x48, 0x2D, 0x50, 0x24, 0x24, 0x1C, 0x06, 0x00, 0x00, 0x00, "Sigma", "", "18-50mm F2.8 EX DC Macro"},
2641
200
      {0x7A, 0x48, 0x2D, 0x50, 0x24, 0x24, 0x4B, 0x06, 0x01, 0x00, 0x00, "Sigma", "582593", "18-50mm F2.8 EX DC Macro"},
2642
200
      {0xF6, 0x48, 0x2D, 0x50, 0x24, 0x24, 0x4B, 0x06, 0x01, 0x00, 0x00, "Sigma", "582593", "18-50mm F2.8 EX DC Macro"},
2643
200
      {0xA4, 0x47, 0x2D, 0x50, 0x24, 0x34, 0x4B, 0x0E, 0x01, 0x00, 0x00, "Sigma", "", "18-50mm F2.8-4.5 DC OS HSM"},
2644
200
      {0x26, 0x40, 0x2D, 0x50, 0x2C, 0x3C, 0x1C, 0x06, 0x00, 0x00, 0x00, "Sigma", "", "18-50mm F3.5-5.6 DC"},
2645
200
      {0x7A, 0x40, 0x2D, 0x50, 0x2C, 0x3C, 0x4B, 0x06, 0x01, 0x00, 0x00, "Sigma", "551551", "18-50mm F3.5-5.6 DC HSM"},
2646
200
      {0x26, 0x40, 0x2D, 0x70, 0x2B, 0x3C, 0x1C, 0x06, 0x00, 0x00, 0x00, "Sigma", "", "18-125mm F3.5-5.6 DC"},
2647
200
      {0xCD, 0x3D, 0x2D, 0x70, 0x2E, 0x3C, 0x4B, 0x0E, 0x01, 0x00, 0x00, "Sigma", "853556",
2648
200
       "18-125mm F3.8-5.6 DC OS HSM"},
2649
200
      {0x26, 0x40, 0x2D, 0x80, 0x2C, 0x40, 0x1C, 0x06, 0x00, 0x00, 0x00, "Sigma", "777555", "18-200mm F3.5-6.3 DC"},
2650
200
      {0xFF, 0x40, 0x2D, 0x80, 0x2C, 0x40, 0x4B, 0x06, 0x00, 0x00, 0x00, "Sigma", "", "18-200mm F3.5-6.3 DC"},
2651
200
      {0x7A, 0x40, 0x2D, 0x80, 0x2C, 0x40, 0x4B, 0x0E, 0x01, 0x00, 0x00, "Sigma", "888558",
2652
200
       "18-200mm F3.5-6.3 DC OS HSM"},
2653
200
      {0xED, 0x40, 0x2D, 0x80, 0x2C, 0x40, 0x4B, 0x0E, 0x01, 0x00, 0x00, "Sigma", "888558",
2654
200
       "18-200mm F3.5-6.3 DC OS HSM"},
2655
200
      {0x90, 0x40, 0x2D, 0x80, 0x2C, 0x40, 0x4B, 0x0E, 0x01, 0x00, 0x00, "Sigma", "", "18-200mm F3.5-6.3 II DC OS HSM"},
2656
200
      {0xA5, 0x40, 0x2D, 0x88, 0x2C, 0x40, 0x4B, 0x0E, 0x01, 0x00, 0x00, "Sigma", "", "18-250mm F3.5-6.3 DC OS HSM"},
2657
200
      {0x92, 0x39, 0x2D, 0x88, 0x2C, 0x40, 0x4B, 0x0E, 0x01, 0x00, 0x00, "Sigma", "",
2658
200
       "18-250mm F3.5-6.3 DC OS Macro HSM"},
2659
200
      {0x26, 0x48, 0x31, 0x49, 0x24, 0x24, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "", "20-40mm F2.8"},
2660
200
      {0x02, 0x3A, 0x37, 0x50, 0x31, 0x3D, 0x02, 0x00, 0x00, 0x00, 0x00, "Sigma", "", "24-50mm F4-5.6 UC"},
2661
200
      {0x26, 0x48, 0x37, 0x56, 0x24, 0x24, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "547448", "24-60mm F2.8 EX DG"},
2662
200
      {0xB6, 0x48, 0x37, 0x56, 0x24, 0x24, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "547448", "24-60mm F2.8 EX DG"},
2663
200
      {0xA6, 0x48, 0x37, 0x5C, 0x24, 0x24, 0x4B, 0x06, 0x01, 0x00, 0x00, "Sigma", "571559",
2664
200
       "24-70mm F2.8 IF EX DG HSM"},
2665
200
      {0x26, 0x54, 0x37, 0x5C, 0x24, 0x24, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "", "24-70mm F2.8 EX DG Macro"},
2666
200
      {0x67, 0x54, 0x37, 0x5C, 0x24, 0x24, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "548445", "24-70mm F2.8 EX DG Macro"},
2667
200
      {0xE9, 0x54, 0x37, 0x5C, 0x24, 0x24, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "548445", "24-70mm F2.8 EX DG Macro"},
2668
200
      {0x26, 0x40, 0x37, 0x5C, 0x2C, 0x3C, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "", "24-70mm F3.5-5.6 Aspherical HF"},
2669
200
      {0x8A, 0x3C, 0x37, 0x6A, 0x30, 0x30, 0x4B, 0x0E, 0x00, 0x00, 0x00, "Sigma", "", "24-105mm F4 DG OS HSM"},
2670
200
      {0x26, 0x54, 0x37, 0x73, 0x24, 0x34, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "", "24-135mm F2.8-4.5"},
2671
200
      {0x02, 0x46, 0x3C, 0x5C, 0x25, 0x25, 0x02, 0x00, 0x00, 0x00, 0x00, "Sigma", "", "28-70mm F2.8"},
2672
200
      {0x26, 0x54, 0x3C, 0x5C, 0x24, 0x24, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "", "28-70mm F2.8 EX"},
2673
200
      {0x26, 0x48, 0x3C, 0x5C, 0x24, 0x24, 0x1C, 0x06, 0x00, 0x00, 0x00, "Sigma", "549442", "28-70mm F2.8 EX DG"},
2674
200
      {0x79, 0x48, 0x3C, 0x5C, 0x24, 0x24, 0x1C, 0x06, 0x00, 0x00, 0x00, "Sigma", "", "28-70mm F2.8 EX DG"},
2675
200
      {0x26, 0x48, 0x3C, 0x5C, 0x24, 0x30, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "634445", "28-70mm F2.8-4 DG"},
2676
200
      {0x02, 0x3F, 0x3C, 0x5C, 0x2D, 0x35, 0x02, 0x00, 0x00, 0x00, 0x00, "Sigma", "", "28-70mm F3.5-4.5 UC"},
2677
200
      {0x26, 0x40, 0x3C, 0x60, 0x2C, 0x3C, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "",
2678
200
       "28-80mm F3.5-5.6 Mini Zoom Macro II Aspherical"},
2679
200
      {0x26, 0x40, 0x3C, 0x65, 0x2C, 0x3C, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "", "28-90mm F3.5-5.6 Macro"},
2680
200
      {0x26, 0x48, 0x3C, 0x6A, 0x24, 0x30, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "", "28-105mm F2.8-4 Aspherical"},
2681
200
      {0x26, 0x3E, 0x3C, 0x6A, 0x2E, 0x3C, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "",
2682
200
       "28-105mm F3.8-5.6 UC-III Aspherical IF"},
2683
200
      {0x26, 0x40, 0x3C, 0x80, 0x2C, 0x3C, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "",
2684
200
       "28-200mm F3.5-5.6 Compact Aspherical Hyperzoom Macro"},
2685
200
      {0x26, 0x40, 0x3C, 0x80, 0x2B, 0x3C, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "",
2686
200
       "28-200mm F3.5-5.6 Compact Aspherical Hyperzoom Macro"},
2687
200
      {0x26, 0x3D, 0x3C, 0x80, 0x2F, 0x3D, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "", "28-300mm F3.8-5.6 Aspherical"},
2688
200
      {0x26, 0x41, 0x3C, 0x8E, 0x2C, 0x40, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "795443",
2689
200
       "28-300mm F3.5-6.3 DG Macro"},
2690
200
      {0xE6, 0x41, 0x3C, 0x8E, 0x2C, 0x40, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "", "28-300mm F3.5-6.3 DG Macro"},
2691
200
      {0x26, 0x40, 0x3C, 0x8E, 0x2C, 0x40, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "", "28-300mm F3.5-6.3 Macro"},
2692
200
      {0x02, 0x3B, 0x44, 0x61, 0x30, 0x3D, 0x02, 0x00, 0x00, 0x00, 0x00, "Sigma", "", "35-80mm F4-5.6"},
2693
200
      {0x02, 0x40, 0x44, 0x73, 0x2B, 0x36, 0x02, 0x00, 0x00, 0x00, 0x00, "Sigma", "", "35-135mm F3.5-4.5 a"},
2694
200
      {0xCC, 0x4C, 0x50, 0x68, 0x14, 0x14, 0x4B, 0x06, 0x00, 0x00, 0x00, "Sigma", "", "50-100mm F1.8 DC HSM | A"},
2695
200
      {0x7A, 0x47, 0x50, 0x76, 0x24, 0x24, 0x4B, 0x06, 0x03, 0x00, 0x00, "Sigma", "", "50-150mm F2.8 EX APO DC HSM"},
2696
200
      {0xFD, 0x47, 0x50, 0x76, 0x24, 0x24, 0x4B, 0x06, 0x03, 0x00, 0x00, "Sigma", "691554",
2697
200
       "50-150mm F2.8 EX APO DC HSM II"},
2698
200
      {0x98, 0x48, 0x50, 0x76, 0x24, 0x24, 0x4B, 0x0E, 0x00, 0x00, 0x00, "Sigma", "", "50-150mm F2.8 EX DC APO OS HSM"},
2699
200
      {0x48, 0x3C, 0x50, 0xA0, 0x30, 0x40, 0x4B, 0x02, 0x03, 0x00, 0x00, "Sigma", "736552",
2700
200
       "APO 50-500mm F4-6.3 EX HSM"},
2701
200
      {0x9F, 0x37, 0x50, 0xA0, 0x34, 0x40, 0x4B, 0x0E, 0x03, 0x00, 0x00, "Sigma", "",
2702
200
       "50-500mm F4.5-6.3 APO DG OS HSM"},
2703
      // M                                         "Sigma" "686550" "50-200mm F4-5.6 DC OS HSM";
2704
200
      {0x26, 0x3C, 0x54, 0x80, 0x30, 0x3C, 0x1C, 0x06, 0x00, 0x00, 0x00, "Sigma", "", "55-200mm F4-5.6 DC"},
2705
200
      {0x7A, 0x3B, 0x53, 0x80, 0x30, 0x3C, 0x4B, 0x06, 0x01, 0x00, 0x00, "Sigma", "", "55-200mm F4-5.6 DC HSM"},
2706
200
      {0xBF, 0x38, 0x56, 0xA6, 0x34, 0x40, 0x4B, 0x4E, 0x00, 0x00, 0x00, "Sigma", "",
2707
200
       "60-600mm F4.5-6.3 DG OS HSM | S"},
2708
200
      {0x48, 0x54, 0x5C, 0x80, 0x24, 0x24, 0x4B, 0x02, 0x00, 0x00, 0x00, "Sigma", "", "70-200mm F2.8 EX APO IF HSM"},
2709
200
      {0x7A, 0x48, 0x5C, 0x80, 0x24, 0x24, 0x4B, 0x06, 0x03, 0x00, 0x00, "Sigma", "",
2710
200
       "70-200mm F2.8 EX APO DG Macro HSM II"},
2711
200
      {0xEE, 0x48, 0x5C, 0x80, 0x24, 0x24, 0x4B, 0x06, 0x03, 0x00, 0x00, "Sigma", "579555",
2712
200
       "70-200mm F2.8 EX APO DG Macro HSM II"},
2713
200
      {0x9C, 0x48, 0x5C, 0x80, 0x24, 0x24, 0x4B, 0x0E, 0x03, 0x00, 0x00, "Sigma", "", "70-200mm F2.8 EX DG OS HSM"},
2714
200
      {0x02, 0x46, 0x5C, 0x82, 0x25, 0x25, 0x02, 0x00, 0x00, 0x00, 0x00, "Sigma", "", "70-210mm F2.8 APO"},
2715
200
      {0x02, 0x40, 0x5C, 0x82, 0x2C, 0x35, 0x02, 0x00, 0x00, 0x00, 0x00, "Sigma", "", "APO 70-210mm F3.5-4.5"},
2716
200
      {0x26, 0x3C, 0x5C, 0x82, 0x30, 0x3C, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "", "70-210mm F4-5.6 UC-II"},
2717
200
      {0x26, 0x3C, 0x5C, 0x8E, 0x30, 0x3C, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "", "70-300mm F4-5.6 DG Macro"},
2718
200
      {0x56, 0x3C, 0x5C, 0x8E, 0x30, 0x3C, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "",
2719
200
       "70-300mm F4-5.6 APO Macro Super II"},
2720
200
      {0xE0, 0x3C, 0x5C, 0x8E, 0x30, 0x3C, 0x4B, 0x06, 0x00, 0x00, 0x00, "Sigma", "508555",
2721
200
       "APO 70-300mm F4-5.6 DG Macro"},
2722
200
      {0xA3, 0x3C, 0x5C, 0x8E, 0x30, 0x3C, 0x4B, 0x0E, 0x00, 0x00, 0x00, "Sigma", "572556", "70-300mm F4-5.6 DG OS"},
2723
200
      {0x02, 0x37, 0x5E, 0x8E, 0x35, 0x3D, 0x02, 0x00, 0x00, 0x00, 0x00, "Sigma", "", "75-300mm F4.5-5.6 APO"},
2724
200
      {0x02, 0x3A, 0x5E, 0x8E, 0x32, 0x3D, 0x02, 0x00, 0x00, 0x00, 0x00, "Sigma", "", "75-300mm F4.0-5.6"},
2725
200
      {0x77, 0x44, 0x61, 0x98, 0x34, 0x3C, 0x7B, 0x0E, 0x03, 0x00, 0x00, "Sigma", "", "80-400mm f4.5-5.6 EX OS"},
2726
200
      {0x77, 0x44, 0x60, 0x98, 0x34, 0x3C, 0x7B, 0x0E, 0x03, 0x00, 0x00, "Sigma", "", "80-400mm f4.5-5.6 APO DG D OS"},
2727
200
      {0x48, 0x48, 0x68, 0x8E, 0x30, 0x30, 0x4B, 0x02, 0x03, 0x00, 0x00, "Sigma", "134556",
2728
200
       "APO 100-300mm F4 EX IF HSM"},
2729
200
      {0xF3, 0x48, 0x68, 0x8E, 0x30, 0x30, 0x4B, 0x02, 0x13, 0x00, 0x00, "Sigma", "134556",
2730
200
       "APO 100-300mm F4 EX IF HSM"},
2731
200
      {0x48, 0x54, 0x6F, 0x8E, 0x24, 0x24, 0x4B, 0x02, 0x03, 0x00, 0x00, "Sigma", "", "APO 120-300mm F2.8 EX DG HSM"},
2732
200
      {0x7A, 0x54, 0x6E, 0x8E, 0x24, 0x24, 0x4B, 0x02, 0x03, 0x00, 0x00, "Sigma", "135553",
2733
200
       "APO 120-300mm F2.8 EX DG HSM"},
2734
200
      {0xFA, 0x54, 0x6E, 0x8E, 0x24, 0x24, 0x4B, 0x02, 0x03, 0x00, 0x00, "Sigma", "135553",
2735
200
       "APO 120-300mm F2.8 EX DG HSM"},
2736
200
      {0xCF, 0x38, 0x6E, 0x98, 0x34, 0x3C, 0x4B, 0x0E, 0x03, 0x00, 0x00, "Sigma", "728557",
2737
200
       "APO 120-400mm F4.5-5.6 DG OS HSM"},
2738
200
      {0xC3, 0x34, 0x68, 0x98, 0x38, 0x40, 0x4B, 0x4E, 0x03, 0x00, 0x00, "Sigma", "", "100-400mm F5-6.3 DG OS HSM | C"},
2739
200
      {0x8D, 0x48, 0x6E, 0x8E, 0x24, 0x24, 0x4B, 0x0E, 0x03, 0x00, 0x00, "Sigma", "", "120-300mm F2.8 DG OS HSM | S"},
2740
200
      {0x26, 0x44, 0x73, 0x98, 0x34, 0x3C, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "",
2741
200
       "135-400mm F4.5-5.6 APO Aspherical"},
2742
200
      {0xCE, 0x34, 0x76, 0xA0, 0x38, 0x40, 0x4B, 0x0E, 0x03, 0x00, 0x00, "Sigma", "737559",
2743
200
       "APO 150-500mm F5-6.3 DG OS HSM"},
2744
200
      {0x81, 0x34, 0x76, 0xA6, 0x38, 0x40, 0x4B, 0x0E, 0x03, 0x00, 0x00, "Sigma", "", "150-600mm F5-6.3 DG OS HSM | S"},
2745
200
      {0x82, 0x34, 0x76, 0xA6, 0x38, 0x40, 0x4B, 0x0E, 0x03, 0x00, 0x00, "Sigma", "", "150-600mm F5-6.3 DG OS HSM | C"},
2746
200
      {0x26, 0x40, 0x7B, 0xA0, 0x34, 0x40, 0x1C, 0x02, 0x00, 0x00, 0x00, "Sigma", "",
2747
200
       "APO 170-500mm F5-6.3 Aspherical RF"},
2748
200
      {0xA7, 0x49, 0x80, 0xA0, 0x24, 0x24, 0x4B, 0x06, 0x03, 0x00, 0x00, "Sigma", "", "APO 200-500mm F2.8 EX DG"},
2749
200
      {0x48, 0x3C, 0x8E, 0xB0, 0x3C, 0x3C, 0x4B, 0x02, 0x03, 0x00, 0x00, "Sigma", "595555",
2750
200
       "APO 300-800mm F5.6 EX DG HSM"},
2751
      //
2752
      //------------------------------------------------------------------------------
2753
      // Tamron lenses by focal length, first fixed then zoom lenses
2754
      //------------------------------------------------------------------------------
2755
      //
2756
200
      {0x00, 0x47, 0x25, 0x25, 0x24, 0x24, 0x00, 0x02, 0x00, 0x00, 0x00, "Tamron", "69E",
2757
200
       "SP AF 14mm F/2.8 Aspherical (IF)"},
2758
200
      {0xE8, 0x4C, 0x44, 0x44, 0x14, 0x14, 0xDF, 0x0E, 0x00, 0x00, 0x00, "Tamron", "F012", "SP 35mm F/1.8 Di VC USD"},
2759
200
      {0xE7, 0x4C, 0x4C, 0x4C, 0x14, 0x14, 0xDF, 0x0E, 0x00, 0x00, 0x00, "Tamron", "F013", "SP 45mm F/1.8 Di VC USD"},
2760
200
      {0xF4, 0x54, 0x56, 0x56, 0x18, 0x18, 0x84, 0x06, 0x01, 0x00, 0x00, "Tamron", "G005",
2761
200
       "SP AF 60mm F/2 Di II LD (IF) Macro 1:1"},
2762
200
      {0x1E, 0x5D, 0x64, 0x64, 0x20, 0x20, 0x13, 0x00, 0x40, 0x00, 0x00, "Tamron", "52E", "SP AF 90mm F/2.5"},
2763
200
      {0x20, 0x5A, 0x64, 0x64, 0x20, 0x20, 0x14, 0x00, 0x40, 0x00, 0x00, "Tamron", "152E", "SP AF 90mm F/2.5 Macro"},
2764
200
      {0x22, 0x53, 0x64, 0x64, 0x24, 0x24, 0xE0, 0x02, 0x40, 0x00, 0x00, "Tamron", "72E", "SP AF 90mm F/2.8 Macro 1:1"},
2765
200
      {0x32, 0x53, 0x64, 0x64, 0x24, 0x24, 0x35, 0x02, 0x40, 0x01, 0x00, "Tamron", "172E",
2766
200
       "SP AF 90mm F/2.8 Macro 1:1"},
2767
200
      {0x32, 0x53, 0x64, 0x64, 0x24, 0x24, 0x35, 0x02, 0x40, 0x02, 0x00, "Tamron", "272E",
2768
200
       "SP AF 90mm F/2.8 Di Macro 1:1"},
2769
200
      {0xF8, 0x55, 0x64, 0x64, 0x24, 0x24, 0x84, 0x06, 0x41, 0x00, 0x00, "Tamron", "272NII",
2770
200
       "SP AF 90mm F/2.8 Di Macro 1:1"},
2771
200
      {0xF8, 0x54, 0x64, 0x64, 0x24, 0x24, 0xDF, 0x06, 0x41, 0x00, 0x00, "Tamron", "272NII",
2772
200
       "SP AF 90mm F/2.8 Di Macro 1:1"},
2773
200
      {0xFE, 0x54, 0x64, 0x64, 0x24, 0x24, 0xDF, 0x0E, 0x00, 0x00, 0x00, "Tamron", "F004",
2774
200
       "SP 90mm F/2.8 Di VC USD Macro 1:1"},
2775
200
      {0xE4, 0x54, 0x64, 0x64, 0x24, 0x24, 0xDF, 0x0E, 0x00, 0x00, 0x00, "Tamron", "F017",
2776
200
       "SP 90mm F/2.8 Di VC USD Macro 1:1"},
2777
200
      {0x00, 0x4C, 0x7C, 0x7C, 0x2C, 0x2C, 0x00, 0x02, 0x00, 0x00, 0x00, "Tamron", "B01", "SP AF 180mm F/3.5 Di Model"},
2778
200
      {0x21, 0x56, 0x8E, 0x8E, 0x24, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00, "Tamron", "60E", "SP AF 300mm F/2.8 LD-IF"},
2779
200
      {0x27, 0x54, 0x8E, 0x8E, 0x24, 0x24, 0x1D, 0x02, 0x00, 0x00, 0x00, "Tamron", "360E", "SP AF 300mm F/2.8 LD-IF"},
2780
      //
2781
200
      {0xF6, 0x3F, 0x18, 0x37, 0x2C, 0x34, 0x84, 0x06, 0x01, 0x00, 0x00, "Tamron", "B001",
2782
200
       "SP AF 10-24mm F/3.5-4.5 Di II LD Aspherical (IF)"},
2783
200
      {0xF6, 0x3F, 0x18, 0x37, 0x2C, 0x34, 0xDF, 0x06, 0x01, 0x00, 0x00, "Tamron", "B001",
2784
200
       "SP AF 10-24mm F/3.5-4.5 Di II LD Aspherical (IF)"},
2785
200
      {0x00, 0x36, 0x1C, 0x2D, 0x34, 0x3C, 0x00, 0x06, 0x00, 0x00, 0x00, "Tamron", "A13",
2786
200
       "SP AF 11-18mm F/4.5-5.6 Di II LD Aspherical (IF)"},
2787
200
      {0xCA, 0x48, 0x27, 0x3E, 0x24, 0x24, 0xDF, 0x4E, 0x00, 0x00, 0x00, "Tamron", "A041",
2788
200
       "SP 15-30mm F/2.8 Di VC USD G2"},
2789
200
      {0xE9, 0x48, 0x27, 0x3E, 0x24, 0x24, 0xDF, 0x0E, 0x00, 0x00, 0x00, "Tamron", "A012",
2790
200
       "SP 15-30mm F/2.8 Di VC USD"},
2791
200
      {0xEA, 0x40, 0x29, 0x8E, 0x2C, 0x40, 0xDF, 0x0E, 0x00, 0x00, 0x00, "Tamron", "B016",
2792
200
       "16-300mm F/3.5-6.3 Di II VC PZD Macro"},
2793
200
      {0x07, 0x46, 0x2B, 0x44, 0x24, 0x30, 0x03, 0x02, 0x00, 0x00, 0x00, "Tamron", "A05",
2794
200
       "SP AF 17-35mm F/2.8-4 Di LD Aspherical (IF)"},
2795
200
      {0x00, 0x53, 0x2B, 0x50, 0x24, 0x24, 0x00, 0x06, 0x00, 0x00, 0x00, "Tamron", "A16",
2796
200
       "SP AF 17-50mm F/2.8 XR Di II LD Aspherical (IF)"},
2797
200
      {0x00, 0x54, 0x2B, 0x50, 0x24, 0x24, 0x00, 0x06, 0x01, 0x00, 0x00, "Tamron", "A16NII",
2798
200
       "SP AF 17-50mm F/2.8 XR Di II LD Aspherical (IF)"},
2799
200
      {0xFB, 0x54, 0x2B, 0x50, 0x24, 0x24, 0x84, 0x06, 0x01, 0x00, 0x00, "Tamron", "A16NII",
2800
200
       "SP AF 17-50mm F/2.8 XR Di II LD Aspherical (IF)"},
2801
200
      {0xF3, 0x54, 0x2B, 0x50, 0x24, 0x24, 0x84, 0x0E, 0x01, 0x00, 0x00, "Tamron", "B005",
2802
200
       "SP AF 17-50mm F/2.8 XR Di II VC LD Aspherical (IF)"},
2803
200
      {0x00, 0x3F, 0x2D, 0x80, 0x2B, 0x40, 0x00, 0x06, 0x00, 0x00, 0x00, "Tamron", "A14",
2804
200
       "AF 18-200mm F/3.5-6.3 XR Di II LD Aspherical (IF)"},
2805
200
      {0x00, 0x3F, 0x2D, 0x80, 0x2C, 0x40, 0x00, 0x06, 0x00, 0x00, 0x00, "Tamron", "A14",
2806
200
       "AF 18-200mm F/3.5-6.3 XR Di II LD Aspherical (IF) Macro"},
2807
200
      {0x00, 0x40, 0x2D, 0x80, 0x2C, 0x40, 0x00, 0x06, 0x01, 0x00, 0x00, "Tamron", "A14NII",
2808
200
       "AF 18-200mm F/3.5-6.3 XR Di II LD Aspherical (IF) Macro"},
2809
200
      {0xFC, 0x40, 0x2D, 0x80, 0x2C, 0x40, 0xDF, 0x06, 0x01, 0x00, 0x00, "Tamron", "A14NII",
2810
200
       "AF 18-200mm F/3.5-6.3 XR Di II LD Aspherical (IF) Macro"},
2811
200
      {0xE6, 0x40, 0x2D, 0x80, 0x2C, 0x40, 0xDF, 0x0E, 0x01, 0x00, 0x00, "Tamron", "B018",
2812
200
       "18-200mm F/3.5-6.3 Di II VC"},
2813
200
      {0x00, 0x40, 0x2D, 0x88, 0x2C, 0x40, 0x62, 0x06, 0x00, 0x00, 0x00, "Tamron", "A18",
2814
200
       "AF 18-250mm F/3.5-6.3 Di II LD Aspherical (IF) Macro"},
2815
200
      {0x00, 0x40, 0x2D, 0x88, 0x2C, 0x40, 0x00, 0x06, 0x01, 0x00, 0x00, "Tamron", "A18NII",
2816
200
       "AF 18-250mm F/3.5-6.3 Di II LD Aspherical (IF) Macro "},
2817
200
      {0xF5, 0x40, 0x2C, 0x8A, 0x2C, 0x40, 0x40, 0x0E, 0x01, 0x00, 0x00, "Tamron", "B003",
2818
200
       "AF 18-270mm F/3.5-6.3 Di II VC LD Aspherical (IF) Macro"},
2819
200
      {0xF0, 0x3F, 0x2D, 0x8A, 0x2C, 0x40, 0xDF, 0x0E, 0x01, 0x00, 0x00, "Tamron", "B008",
2820
200
       "AF 18-270mm F/3.5-6.3 Di II VC PZD"},
2821
200
      {0xE0, 0x40, 0x2D, 0x98, 0x2C, 0x41, 0xDF, 0x4E, 0x01, 0x00, 0x00, "Tamron", "B028",
2822
200
       "18-400mm F/3.5-6.3 Di II VC HLD"},
2823
200
      {0x07, 0x40, 0x2F, 0x44, 0x2C, 0x34, 0x03, 0x02, 0x00, 0x00, 0x00, "Tamron", "A10", "AF 19-35mm F/3.5-4.5"},
2824
200
      {0x07, 0x40, 0x30, 0x45, 0x2D, 0x35, 0x03, 0x02, 0x00, 0x00, 0x00, "Tamron", "A10", "AF 19-35mm F/3.5-4.5"},
2825
200
      {0x00, 0x49, 0x30, 0x48, 0x22, 0x2B, 0x00, 0x02, 0x00, 0x00, 0x00, "Tamron", "166D", "SP AF 20-40mm F/2.7-3.5"},
2826
200
      {0x0E, 0x4A, 0x31, 0x48, 0x23, 0x2D, 0x0E, 0x02, 0x00, 0x00, 0x00, "Tamron", "166D", "SP AF 20-40mm F/2.7-3.5"},
2827
      // M                                         "Tamron" "266D"   "SP AF 20-40mm F/2.7-3.5 Aspherical-IF";
2828
200
      {0xFE, 0x48, 0x37, 0x5C, 0x24, 0x24, 0xDF, 0x0E, 0x01, 0x00, 0x00, "Tamron", "A007",
2829
200
       "SP 24-70mm F/2.8 Di VC USD"},
2830
      // M                                         "Tamron" "73D"    "AF 24-70mm F/3.3-5.6 Aspherical";
2831
200
      {0xCE, 0x47, 0x37, 0x5C, 0x25, 0x25, 0xDF, 0x4E, 0x00, 0x00, 0x00, "Tamron", "A032",
2832
200
       "SP 24-70mm F/2.8 Di VC USD G2"},
2833
200
      {0xCE, 0x47, 0x37, 0x5C, 0x25, 0x25, 0xDF, 0x0E, 0x00, 0x00, 0x00, "Tamron", "A032",
2834
200
       "SP 24-70mm F/2.8 Di VC USD G2"},
2835
200
      {0x45, 0x41, 0x37, 0x72, 0x2C, 0x3C, 0x48, 0x02, 0x00, 0x00, 0x00, "Tamron", "190D",
2836
200
       "SP AF 24-135mm F/3.5-5.6 AD Aspherical (IF) Macro"},
2837
      // M                                         "Tamron" "159D"   "AF 28-70mm F/3.5-4.5";
2838
      // M                                         "Tamron" "259D"   "AF 28-70mm F/3.5-4.5";
2839
200
      {0x33, 0x54, 0x3C, 0x5E, 0x24, 0x24, 0x62, 0x02, 0x00, 0x00, 0x00, "Tamron", "A09",
2840
200
       "SP AF 28-75mm F/2.8 XR Di LD Aspherical (IF) Macro"},
2841
200
      {0xFA, 0x54, 0x3C, 0x5E, 0x24, 0x24, 0x84, 0x06, 0x01, 0x00, 0x00, "Tamron", "A09NII",
2842
200
       "SP AF 28-75mm F/2.8 XR Di LD Aspherical (IF) Macro"},
2843
200
      {0xFA, 0x54, 0x3C, 0x5E, 0x24, 0x24, 0xDF, 0x06, 0x01, 0x00, 0x00, "Tamron", "A09NII",
2844
200
       "SP AF 28-75mm F/2.8 XR Di LD Aspherical (IF) Macro"},
2845
200
      {0x10, 0x3D, 0x3C, 0x60, 0x2C, 0x3C, 0xD2, 0x02, 0x00, 0x00, 0x00, "Tamron", "177D",
2846
200
       "AF 28-80mm F/3.5-5.6 Aspherical"},
2847
200
      {0x45, 0x3D, 0x3C, 0x60, 0x2C, 0x3C, 0x48, 0x02, 0x00, 0x00, 0x00, "Tamron", "177D",
2848
200
       "AF 28-80mm F/3.5-5.6 Aspherical"},
2849
200
      {0x00, 0x48, 0x3C, 0x6A, 0x24, 0x24, 0x00, 0x02, 0x00, 0x00, 0x00, "Tamron", "176D",
2850
200
       "SP AF 28-105mm F/2.8 LD Aspherical IF"},
2851
      // M                                         "Tamron" "276D"   "SP AF 28-105mm F/2.8 LD Aspherical IF";
2852
      // M                                         "Tamron" "179D"   "AF 28-105mm F4.0-5.6 IF";
2853
200
      {0x4D, 0x3E, 0x3C, 0x80, 0x2E, 0x3C, 0x62, 0x02, 0x00, 0x00, 0x00, "Tamron", "A03N",
2854
200
       "AF 28-200mm F/3.8-5.6 XR Aspherical (IF) Macro"},
2855
      // M                                         "Tamron" "471D"   "AF 28-200mm F/3.8-5.6 Aspherical IF Super2
2856
      // Silver";
2857
200
      {0x0B, 0x3E, 0x3D, 0x7F, 0x2F, 0x3D, 0x0E, 0x00, 0x00, 0x00, 0x00, "Tamron", "71D", "AF 28-200mm F/3.8-5.6"},
2858
200
      {0x0B, 0x3E, 0x3D, 0x7F, 0x2F, 0x3D, 0x0E, 0x02, 0x00, 0x00, 0x00, "Tamron", "171D", "AF 28-200mm F/3.8-5.6D"},
2859
200
      {0x12, 0x3D, 0x3C, 0x80, 0x2E, 0x3C, 0xDF, 0x02, 0x00, 0x00, 0x00, "Tamron", "271D",
2860
200
       "AF 28-200mm F/3.8-5.6 LD Aspherical (IF)"},
2861
200
      {0x4D, 0x41, 0x3C, 0x8E, 0x2B, 0x40, 0x62, 0x02, 0x00, 0x00, 0x00, "Tamron", "A061",
2862
200
       "AF 28-300mm F/3.5-6.3 XR Di LD Aspherical (IF)"},
2863
200
      {0x4D, 0x41, 0x3C, 0x8E, 0x2C, 0x40, 0x62, 0x02, 0x00, 0x00, 0x00, "Tamron", "185D",
2864
200
       "AF 28-300mm F/3.5-6.3 XR LD Aspherical (IF)"},
2865
      // M                                         "Tamron" "285D"   "AF 28-300mm F/3.8-6.3 LD Aspherical IF
2866
      // Silver";
2867
200
      {0xF9, 0x40, 0x3C, 0x8E, 0x2C, 0x40, 0x40, 0x0E, 0x01, 0x00, 0x00, "Tamron", "A20",
2868
200
       "AF 28-300mm F/3.5-6.3 XR Di VC LD Aspherical (IF) Macro"},
2869
      // M                                         "Tamron" "63D"    "AF 35-90mm F/4-5.6";
2870
      // M                                         "Tamron" "65D"    "SP AF 35-105mm F/2.8 Aspherical";
2871
      // M                                         "Tamron" ""       "AF 35-135mm F/3.5-4.5";
2872
200
      {0xC9, 0x3C, 0x44, 0x76, 0x25, 0x31, 0xDF, 0x4E, 0x00, 0x00, 0x00, "Tamron", "A043",
2873
200
       "35-150mm F/2.8-4 Di VC OSD"},
2874
200
      {0x00, 0x47, 0x53, 0x80, 0x30, 0x3C, 0x00, 0x06, 0x00, 0x00, 0x00, "Tamron", "A15",
2875
200
       "AF 55-200mm F/4-5.6 Di II LD"},
2876
200
      {0xF7, 0x53, 0x5C, 0x80, 0x24, 0x24, 0x84, 0x06, 0x01, 0x00, 0x00, "Tamron", "A001",
2877
200
       "SP AF 70-200mm F/2.8 Di LD (IF) Macro"},
2878
200
      {0xFE, 0x53, 0x5C, 0x80, 0x24, 0x24, 0x84, 0x06, 0x01, 0x00, 0x00, "Tamron", "A001",
2879
200
       "SP AF 70-200mm F/2.8 Di LD (IF) Macro"},
2880
200
      {0xF7, 0x53, 0x5C, 0x80, 0x24, 0x24, 0x40, 0x06, 0x01, 0x00, 0x00, "Tamron", "A001",
2881
200
       "SP AF 70-200mm F/2.8 Di LD (IF) Macro"},
2882
200
      {0xFE, 0x54, 0x5C, 0x80, 0x24, 0x24, 0xDF, 0x0E, 0x01, 0x00, 0x00, "Tamron", "A009",
2883
200
       "SP 70-200mm F/2.8 Di VC USD"},
2884
200
      {0xE2, 0x47, 0x5C, 0x80, 0x24, 0x24, 0xDF, 0x4E, 0x00, 0x00, 0x00, "Tamron", "A025",
2885
200
       "SP 70-200mm F/2.8 Di VC USD G2"},
2886
200
      {0xCD, 0x47, 0x5C, 0x82, 0x31, 0x31, 0xDF, 0x4E, 0x00, 0x00, 0x00, "Tamron", "A034", "70-210mm F/4 Di VC USD"},
2887
      // M                                         "Tamron" "67D"    "SP AF 70-210mm f/2.8 LD";
2888
      // M                                         "Tamron" ""       "AF 70-210mm F/3.5-4.5";
2889
      // M                                         "Tamron" "158D"   "AF 70-210mm F/4-5.6";
2890
      // M                                         "Tamron" "258D"   "AF 70-210mm F/4-5.6";
2891
      // M                                         "Tamron" "172D"   "AF 70-300mm F/4-5.6";
2892
      // M                                         "Tamron" "472D"   "AF 70-300mm F/4-5.6 LD";
2893
200
      {0x69, 0x48, 0x5C, 0x8E, 0x30, 0x3C, 0x6F, 0x02, 0x00, 0x00, 0x00, "Tamron", "572D/772D",
2894
200
       "AF 70-300mm F/4-5.6 LD Macro 1:2"},
2895
200
      {0x69, 0x47, 0x5C, 0x8E, 0x30, 0x3C, 0x00, 0x02, 0x00, 0x00, 0x00, "Tamron", "A17N",
2896
200
       "AF 70-300mm F/4-5.6 Di LD Macro 1:2"},
2897
200
      {0x00, 0x48, 0x5C, 0x8E, 0x30, 0x3C, 0x00, 0x06, 0x01, 0x00, 0x00, "Tamron", "A17NII",
2898
200
       "AF 70-300mm F/4-5.6 Di LD Macro 1:2"},
2899
200
      {0xF1, 0x47, 0x5C, 0x8E, 0x30, 0x3C, 0xDF, 0x0E, 0x00, 0x00, 0x00, "Tamron", "A005",
2900
200
       "SP 70-300mm F4-5.6 Di VC USD"},
2901
      // M                                         "Tamron" "872D"   "AF 75-300mm F/4-5.6 LD";
2902
      // M                                         "Tamron" "278D"   "AF 80-210mm F/4.5-5.6";
2903
      // M                                         "Tamron" "62D"    "AF 90-300mm F/4.5-5.6";
2904
      // M                                         "Tamron" "186D"   "AF 100-300mm F/5-6.3";
2905
200
      {0xEB, 0x40, 0x76, 0xA6, 0x38, 0x40, 0xDF, 0x0E, 0x00, 0x00, 0x00, "Tamron", "A011",
2906
200
       "SP AF 150-600mm F/5-6.3 VC USD"},
2907
200
      {0xE3, 0x40, 0x76, 0xA6, 0x38, 0x40, 0xDF, 0x4E, 0x00, 0x00, 0x00, "Tamron", "A022",
2908
200
       "SP AF 150-600mm F/5-6.3 Di VC USD G2"},
2909
200
      {0x20, 0x3C, 0x80, 0x98, 0x3D, 0x3D, 0x1E, 0x02, 0x00, 0x00, 0x00, "Tamron", "75D", "AF 200-400mm F/5.6 LD IF"},
2910
200
      {0x00, 0x3E, 0x80, 0xA0, 0x38, 0x3F, 0x00, 0x02, 0x00, 0x00, 0x00, "Tamron", "A08",
2911
200
       "SP AF 200-500mm F/5-6.3 Di LD (IF)"},
2912
200
      {0x00, 0x3F, 0x80, 0xA0, 0x38, 0x3F, 0x00, 0x02, 0x00, 0x00, 0x00, "Tamron", "A08", "SP AF 200-500mm F/5-6.3 Di"},
2913
      //
2914
      //------------------------------------------------------------------------------
2915
      // Tokina Lenses by focal length, first fixed then zoom lenses
2916
      //------------------------------------------------------------------------------
2917
      //
2918
200
      {0x00, 0x40, 0x2B, 0x2B, 0x2C, 0x2C, 0x00, 0x02, 0x00, 0x00, 0x00, "Tokina", "",
2919
200
       "AT-X 17 AF PRO (AF 17mm f/3.5)"},
2920
200
      {0x00, 0x47, 0x44, 0x44, 0x24, 0x24, 0x00, 0x06, 0x40, 0x00, 0x00, "Tokina", "T303503",
2921
200
       "AT-X M35 PRO DX (AF 35mm f/2.8 Macro)"},
2922
200
      {0x00, 0x54, 0x68, 0x68, 0x24, 0x24, 0x00, 0x02, 0x40, 0x00, 0x00, "Tokina", "T310003N",
2923
200
       "AT-X M100 AF PRO D (AF 100mm f/2.8 Macro)"},
2924
200
      {0x27, 0x48, 0x8E, 0x8E, 0x30, 0x30, 0x1D, 0x02, 0x00, 0x00, 0x00, "Tokina", "", "AT-X 304 AF (AF 300mm f/4)"},
2925
200
      {0x00, 0x54, 0x8E, 0x8E, 0x24, 0x24, 0x00, 0x02, 0x00, 0x00, 0x00, "Tokina", "",
2926
200
       "AT-X 300 AF PRO (AF 300mm f/2.8)"},
2927
200
      {0x12, 0x3B, 0x98, 0x98, 0x3D, 0x3D, 0x09, 0x00, 0x00, 0x00, 0x00, "Tokina", "",
2928
200
       "AT-X 400 AF SD (AF 400mm f/5.6)"},
2929
      //
2930
200
      {0x00, 0x40, 0x18, 0x2B, 0x2C, 0x34, 0x00, 0x06, 0x00, 0x00, 0x00, "Tokina", "T4101703",
2931
200
       "AT-X 107 AF DX Fisheye (AF 10-17mm f/3.5-4.5)"},
2932
200
      {0x00, 0x48, 0x1C, 0x29, 0x24, 0x24, 0x00, 0x06, 0x00, 0x00, 0x00, "Tokina", "T4111603",
2933
200
       "AT-X 116 PRO DX (AF 11-16mm f/2.8)"},
2934
200
      {0x7A, 0x48, 0x1C, 0x29, 0x24, 0x24, 0x7E, 0x06, 0x00, 0x00, 0x00, "Tokina", "",
2935
200
       "AT-X 116 PRO DX II (AF 11-16mm f/2.8)"},
2936
200
      {0x7A, 0x48, 0x1C, 0x30, 0x24, 0x24, 0x7E, 0x06, 0x00, 0x00, 0x00, "Tokina", "",
2937
200
       "AT-X 11-20 F2.8 PRO DX (AF 11-20mm f/2.8)"},
2938
200
      {0x8B, 0x48, 0x1C, 0x30, 0x24, 0x24, 0x85, 0x06, 0x00, 0x00, 0x00, "Tokina", "", "ATX-i 11-20mm F2.8 CF"},
2939
200
      {0x00, 0x3C, 0x1F, 0x37, 0x30, 0x30, 0x00, 0x06, 0x00, 0x00, 0x00, "Tokina", "T4122403",
2940
200
       "AT-X 124 AF PRO DX (AF 12-24mm f/4)"},
2941
200
      {0x7A, 0x3C, 0x1F, 0x37, 0x30, 0x30, 0x7E, 0x06, 0x01, 0x02, 0x00, "Tokina", "T4122423",
2942
200
       "AT-X 124 AF PRO DX II (AF 12-24mm f/4)"},
2943
200
      {0x7A, 0x3C, 0x1F, 0x3C, 0x30, 0x30, 0x7E, 0x06, 0x00, 0x00, 0x00, "Tokina", "",
2944
200
       "AT-X 12-28 PRO DX (AF 12-28mm f/4)"},
2945
200
      {0x94, 0x54, 0x24, 0x30, 0x18, 0x18, 0x4a, 0x06, 0x00, 0x00, 0x00, "Tokina", "",
2946
200
       "AT-X 14-20 F2 PRO DX (AF 14-20mm f/2)"},
2947
200
      {0x00, 0x48, 0x29, 0x3C, 0x24, 0x24, 0x00, 0x06, 0x00, 0x00, 0x00, "Tokina", "",
2948
200
       "AT-X 16-28 AF PRO FX (AF 16-28mm f/2.8)"},
2949
200
      {0x00, 0x48, 0x29, 0x50, 0x24, 0x24, 0x00, 0x06, 0x00, 0x00, 0x00, "Tokina", "",
2950
200
       "AT-X 165 PRO DX (AF 16-50mm f/2.8)"},
2951
200
      {0x00, 0x40, 0x2A, 0x72, 0x2C, 0x3C, 0x00, 0x06, 0x00, 0x00, 0x00, "Tokina", "",
2952
200
       "AT-X 16.5-135 DX (AF 16.5-135mm f/3.5-5.6)"},
2953
200
      {0x00, 0x3C, 0x2B, 0x44, 0x30, 0x30, 0x00, 0x06, 0x00, 0x00, 0x00, "Tokina", "",
2954
200
       "AT-X 17-35 F4 PRO FX (AF 17-35mm f/4)"},
2955
200
      {0x2F, 0x40, 0x30, 0x44, 0x2C, 0x34, 0x29, 0x02, 0x00, 0x02, 0x00, "Tokina", "", "AF 193 (AF 19-35mm f/3.5-4.5)"},
2956
200
      {0x2F, 0x48, 0x30, 0x44, 0x24, 0x24, 0x29, 0x02, 0x00, 0x02, 0x00, "Tokina", "",
2957
200
       "AT-X 235 AF PRO (AF 20-35mm f/2.8)"},
2958
      // M                                         "Tokina" ""          "AF 235 (AF 20-35mm f/3.5-4.5)"
2959
200
      {0x2F, 0x40, 0x30, 0x44, 0x2C, 0x34, 0x29, 0x02, 0x00, 0x01, 0x00, "Tokina", "",
2960
200
       "AF 235 II (AF 20-35mm f/3.5-4.5)"},
2961
      // M                                         "Tokina" ""          "AT-X 240 AF (AF 24-40mm f/2.8)"
2962
200
      {0x00, 0x48, 0x37, 0x5C, 0x24, 0x24, 0x00, 0x06, 0x00, 0x00, 0x00, "Tokina", "",
2963
200
       "AT-X 24-70MM F2.8 PRO FX (AF 24-70mm f/2.8)"},
2964
200
      {0x00, 0x40, 0x37, 0x80, 0x2C, 0x3C, 0x00, 0x02, 0x00, 0x00, 0x00, "Tokina", "",
2965
200
       "AT-X 242 AF (AF 24-200mm f/3.5-5.6)"},
2966
200
      {0x25, 0x48, 0x3C, 0x5C, 0x24, 0x24, 0x1B, 0x02, 0x00, 0x02, 0x00, "Tokina", "",
2967
200
       "AT-X 270 AF PRO II (AF 28-70mm f/2.6-2.8)"},
2968
200
      {0x25, 0x48, 0x3C, 0x5C, 0x24, 0x24, 0x1B, 0x02, 0x00, 0x01, 0x00, "Tokina", "",
2969
200
       "AT-X 287 AF PRO SV (AF 28-70mm f/2.8)"},
2970
200
      {0x07, 0x48, 0x3C, 0x5C, 0x24, 0x24, 0x03, 0x00, 0x00, 0x00, 0x00, "Tokina", "",
2971
200
       "AT-X 287 AF (AF 28-70mm f/2.8)"},
2972
200
      {0x07, 0x47, 0x3C, 0x5C, 0x25, 0x35, 0x03, 0x00, 0x00, 0x00, 0x00, "Tokina", "",
2973
200
       "AF 287 SD (AF 28-70mm f/2.8-4.5)"},
2974
200
      {0x07, 0x40, 0x3C, 0x5C, 0x2C, 0x35, 0x03, 0x00, 0x00, 0x00, 0x00, "Tokina", "",
2975
200
       "AF 270 II (AF 28-70mm f/3.5-4.5)"},
2976
200
      {0x00, 0x48, 0x3C, 0x60, 0x24, 0x24, 0x00, 0x02, 0x00, 0x00, 0x00, "Tokina", "",
2977
200
       "AT-X 280 AF PRO (AF 28-80mm f/2.8)"},
2978
      // M                                         "Tokina" ""          "AF 280 II EMZ (AF 28-80mm f/3.5-5.6)"
2979
      // M                                         "Tokina" ""          "AF 205 (AF 28-105mm f/3.5-4.5)"
2980
      // M                                         "Tokina" ""          "AF 282 (AF 28-200mm 3.5-5.6)"
2981
      // M                                         "Tokina" ""          "AF 282 EMZ II (AF 28-210mm f/4.2-6.5)"
2982
      // M                                         "Tokina" ""          "AF 370 (AF 35-70mm f/3.5-4.6)"
2983
      // M                                         "Tokina" ""          "AF 370 II (AF 35-70mm f/3.5-4.6)"
2984
200
      {0x25, 0x44, 0x44, 0x8E, 0x34, 0x42, 0x1B, 0x02, 0x00, 0x00, 0x00, "Tokina", "",
2985
200
       "AF 353 (AF 35-300mm f/4.5-6.7)"},
2986
200
      {0x00, 0x48, 0x50, 0x72, 0x24, 0x24, 0x00, 0x06, 0x00, 0x00, 0x00, "Tokina", "",
2987
200
       "AT-X 535 PRO DX (AF 50-135mm f/2.8)"},
2988
200
      {0x00, 0x3C, 0x5C, 0x80, 0x30, 0x30, 0x00, 0x0E, 0x00, 0x00, 0x00, "Tokina", "",
2989
200
       "AT-X 70-200 F4 FX VCM-S (AF 70-200mm f/4)"},
2990
200
      {0x00, 0x48, 0x5C, 0x80, 0x30, 0x30, 0x00, 0x0E, 0x00, 0x00, 0x00, "Tokina", "",
2991
200
       "AT-X 70-200 F4 FX VCM-S (AF 70-200mm f/4)"},
2992
      // M                                         "Tokina" ""          "AF 745 (AF 70-210mm f/4.5)"
2993
      // M                                         "Tokina" ""          "AF 210 (AF 70-210mm f/4.0-5.6)"
2994
      // M                                         "Tokina" ""          "AF 210 II SD (AF 70-210mm f/4.0-5.6)"
2995
200
      {0x12, 0x44, 0x5E, 0x8E, 0x34, 0x3C, 0x09, 0x00, 0x00, 0x00, 0x00, "Tokina", "",
2996
200
       "AF 730 (AF 75-300mm f/4.5-5.6)"},
2997
      // M                                         "Tokina" ""          "AF 730 II (AF 75-300mm f/4.5-5.6)"
2998
200
      {0x14, 0x54, 0x60, 0x80, 0x24, 0x24, 0x0B, 0x00, 0x00, 0x00, 0x00, "Tokina", "",
2999
200
       "AT-X 828 AF (AF 80-200mm f/2.8)"},
3000
200
      {0x24, 0x54, 0x60, 0x80, 0x24, 0x24, 0x1A, 0x02, 0x00, 0x00, 0x00, "Tokina", "",
3001
200
       "AT-X 828 AF PRO (AF 80-200mm f/2.8)"},
3002
      // M                                         "Tokina" ""          "AT-X 840 AF (AF 80-400mm f/4.5-5.6)"
3003
200
      {0x24, 0x44, 0x60, 0x98, 0x34, 0x3C, 0x1A, 0x02, 0x00, 0x00, 0x00, "Tokina", "",
3004
200
       "AT-X 840 AF-II (AF 80-400mm f/4.5-5.6)"},
3005
200
      {0x00, 0x44, 0x60, 0x98, 0x34, 0x3C, 0x00, 0x02, 0x00, 0x00, 0x00, "Tokina", "",
3006
200
       "AT-X 840 D (AF 80-400mm f/4.5-5.6)"},
3007
200
      {0x14, 0x48, 0x68, 0x8E, 0x30, 0x30, 0x0B, 0x00, 0x00, 0x00, 0x00, "Tokina", "",
3008
200
       "AT-X 340 AF (AF 100-300mm f/4)"},
3009
      // M                                         "Tokina" ""          "AT-X 340 AF-II (AF 100-300mm f/4)"
3010
      // M                                         "Tokina" ""          "AF 130 EMZ II (AF 100-300mm f/5.6-6.7)"
3011
      // M                                         "Tokina" ""          "AF 140 EMZ (AF 100-400mm f/4.5-6.3)"
3012
      //
3013
      //------------------------------------------------------------------------------
3014
      // Lenses from various other brands
3015
      //------------------------------------------------------------------------------
3016
      //
3017
200
      {0x06, 0x3F, 0x68, 0x68, 0x2C, 0x2C, 0x06, 0x00, 0x00, 0x00, 0x00, "Cosina", "", "AF 100mm F3.5 Macro"},
3018
200
      {0x07, 0x36, 0x3D, 0x5F, 0x2C, 0x3C, 0x03, 0x00, 0x00, 0x00, 0x00, "Cosina", "",
3019
200
       "AF Zoom 28-80mm F3.5-5.6 MC Macro"},
3020
200
      {0x07, 0x46, 0x3D, 0x6A, 0x25, 0x2F, 0x03, 0x00, 0x00, 0x00, 0x00, "Cosina", "", "AF Zoom 28-105mm F2.8-3.8 MC"},
3021
      // M                                         "Cosina" "" "AF Zoom 28-210mm F3.5-5.6";
3022
      // M                                         "Cosina" "" "AF Zoom 28-210mm F4.2-6.5 Aspherical IF";
3023
      // M                                         "Cosina" "" "AF Zoom 28-300mm F4.0-6.3";
3024
      // M                                         "Cosina" "" "AF Zoom 70-210mm F2.8-4.0";
3025
200
      {0x12, 0x36, 0x5C, 0x81, 0x35, 0x3D, 0x09, 0x00, 0x00, 0x00, 0x00, "Cosina", "",
3026
200
       "AF Zoom 70-210mm F4.5-5.6 MC Macro"},
3027
200
      {0x12, 0x39, 0x5C, 0x8E, 0x34, 0x3D, 0x08, 0x02, 0x00, 0x00, 0x00, "Cosina", "",
3028
200
       "AF Zoom 70-300mm F4.5-5.6 MC Macro"},
3029
200
      {0x12, 0x3B, 0x68, 0x8D, 0x3D, 0x43, 0x09, 0x02, 0x00, 0x00, 0x00, "Cosina", "",
3030
200
       "AF Zoom 100-300mm F5.6-6.7 MC Macro"},
3031
      // M                                         "Cosina" "" "AF Zoom 100-400mm F5.6-6.7 MC";
3032
      //
3033
200
      {0x12, 0x38, 0x69, 0x97, 0x35, 0x42, 0x09, 0x02, 0x00, 0x00, 0x00, "Promaster", "",
3034
200
       "Spectrum 7 100-400mm 1:4.5-6.7"},
3035
      //
3036
200
      {0x00, 0x40, 0x31, 0x31, 0x2C, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x00, "Voigtlander", "BA295AN",
3037
200
       "Color Skopar 20mm F3.5 SLII Aspherical"},
3038
200
      {0x00, 0x48, 0x3C, 0x3C, 0x24, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, "Voigtlander", "",
3039
200
       "Color Skopar 28mm F2.8 SL II"},
3040
200
      {0x00, 0x54, 0x48, 0x48, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, "Voigtlander", "BA229DN",
3041
200
       "Ultron 40mm F2 SLII Aspherical"},
3042
200
      {0x00, 0x54, 0x55, 0x55, 0x0C, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, "Voigtlander", "BA239BN",
3043
200
       "Nokton 58mm F1.4 SLII"},
3044
200
      {0x00, 0x40, 0x64, 0x64, 0x2C, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x00, "Voigtlander", "",
3045
200
       "APO-Lanthar 90mm F3.5 SLII Close Focus"},
3046
      //
3047
200
      {0x00, 0x40, 0x2D, 0x2D, 0x2C, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x00, "Carl Zeiss", "", "Distagon T* 3,5/18 ZF.2"},
3048
200
      {0x00, 0x48, 0x32, 0x32, 0x24, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, "Carl Zeiss", "", "Distagon T* 2,8/21 ZF.2"},
3049
200
      {0x00, 0x54, 0x38, 0x38, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, "Carl Zeiss", "", "Distagon T* 2/25 ZF.2"},
3050
200
      {0x00, 0x54, 0x3C, 0x3C, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, "Carl Zeiss", "", "Distagon T* 2/28 ZF.2"},
3051
200
      {0x00, 0x54, 0x44, 0x44, 0x0C, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, "Carl Zeiss", "", "Distagon T* 1.4/35 ZF.2"},
3052
200
      {0x00, 0x54, 0x44, 0x44, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, "Carl Zeiss", "", "Distagon T* 2/35 ZF.2"},
3053
200
      {0x00, 0x54, 0x50, 0x50, 0x0C, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, "Carl Zeiss", "", "Planar T* 1,4/50 ZF.2"},
3054
200
      {0x00, 0x54, 0x50, 0x50, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, "Carl Zeiss", "", "Makro-Planar T* 2/50 ZF.2"},
3055
200
      {0x00, 0x54, 0x62, 0x62, 0x0C, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, "Carl Zeiss", "", "Planar T* 1,4/85 ZF.2"},
3056
200
      {0x00, 0x54, 0x68, 0x68, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, "Carl Zeiss", "",
3057
200
       "Makro-Planar T* 2/100 ZF.2"},
3058
200
      {0x00, 0x54, 0x72, 0x72, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, "Carl Zeiss", "", "Apo Sonnar T* 2/135 ZF.2"},
3059
200
      {0x02, 0x54, 0x3C, 0x3C, 0x0C, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, "Zeiss", "", "Otus 1.4/28"},
3060
200
      {0x00, 0x54, 0x53, 0x53, 0x0C, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, "Zeiss", "", "Otus 1.4/55"},
3061
200
      {0x01, 0x54, 0x62, 0x62, 0x0C, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, "Zeiss", "", "Otus 1.4/85"},
3062
200
      {0x03, 0x54, 0x68, 0x68, 0x0C, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, "Zeiss", "", "Otus 1.4/100"},
3063
      //                    " "00" "00" "00" "00" "Zeiss" "" "Milvus 2.8/15"
3064
      //                    " "00" "00" "00" "00" "Zeiss" "" "Milvus 2.8/18"
3065
      //                    " "00" "00" "00" "00" "Zeiss" "" "Milvus 2.8/21"
3066
      //                    " "00" "00" "00" "00" "Zeiss" "" "Milvus 1.4/25"
3067
200
      {0x52, 0x54, 0x44, 0x44, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, "Zeiss", "", "Milvus 2/35"},
3068
200
      {0x53, 0x54, 0x50, 0x50, 0x0C, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, "Zeiss", "", "Milvus 1.4/50"},
3069
200
      {0x54, 0x54, 0x50, 0x50, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, "Zeiss", "", "Milvus 2/50M"},
3070
200
      {0x55, 0x54, 0x62, 0x62, 0x0C, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, "Zeiss", "", "Milvus 1.4/85"},
3071
200
      {0x56, 0x54, 0x68, 0x68, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, "Zeiss", "", "Milvus 2/100M"},
3072
      //                    " "00" "00" "00" "00" "Zeiss" "" "Milvus 2/135"
3073
      //
3074
200
      {0x00, 0x54, 0x56, 0x56, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, "Coastal Optical Systems", "",
3075
200
       "60mm 1:4 UV-VIS-IR Macro Apo"},
3076
      //
3077
200
      {0xBF, 0x4E, 0x26, 0x26, 0x1E, 0x1E, 0x01, 0x04, 0x00, 0x00, 0x00, "Irix", "", "15mm f/2.4 Firefly"},
3078
200
      {0xBF, 0x3C, 0x1B, 0x1B, 0x30, 0x30, 0x01, 0x04, 0x00, 0x00, 0x00, "Irix", "", "11mm f/4.0 Blackstone/Firefly"},
3079
      //
3080
200
      {0x4A, 0x40, 0x11, 0x11, 0x2C, 0x0C, 0x4D, 0x02, 0x00, 0x00, 0x00, "Samyang", "", "8mm f/3.5 Fish-Eye CS"},
3081
200
      {0x4A, 0x48, 0x24, 0x24, 0x24, 0x0C, 0x4D, 0x02, 0x00, 0x02, 0x00, "Samyang", "", "10mm f/2.8 ED AS NCS CS"},
3082
200
      {0x4A, 0x48, 0x1E, 0x1E, 0x24, 0x0C, 0x4D, 0x02, 0x00, 0x00, 0x00, "Samyang", "",
3083
200
       "12mm f/2.8 ED AS NCS Fish-eye"},
3084
200
      {0x4A, 0x4C, 0x24, 0x24, 0x1E, 0x6C, 0x4D, 0x06, 0x00, 0x00, 0x00, "Samyang", "", "14mm f/2.4 Premium"},
3085
200
      {0x4A, 0x48, 0x24, 0x24, 0x24, 0x0C, 0x4D, 0x02, 0x00, 0x01, 0x00, "Samyang", "", "AE 14mm f/2.8 ED AS IF UMC"},
3086
200
      {0x4A, 0x54, 0x29, 0x29, 0x18, 0x0C, 0x4D, 0x02, 0x00, 0x00, 0x00, "Samyang", "", "16mm F2.0 ED AS UMC CS"},
3087
200
      {0x4A, 0x60, 0x36, 0x36, 0x0C, 0x0C, 0x4D, 0x02, 0x00, 0x00, 0x00, "Samyang", "", "24mm f/1.4 ED AS UMC"},
3088
200
      {0x4A, 0x60, 0x44, 0x44, 0x0C, 0x0C, 0x4D, 0x02, 0x00, 0x00, 0x00, "Samyang", "", "35mm f/1.4 AS UMC"},
3089
200
      {0x4A, 0x60, 0x62, 0x62, 0x0C, 0x0C, 0x4D, 0x02, 0x00, 0x00, 0x00, "Samyang", "", "AE 85mm f/1.4 AS IF UMC"},
3090
      //
3091
200
      {0x9F, 0x48, 0x23, 0x23, 0x24, 0x24, 0xA1, 0x06, 0x00, 0x00, 0x00, "Yongnuo", "", "YN14mm F2.8N"},
3092
200
      {0x9F, 0x4C, 0x44, 0x44, 0x18, 0x18, 0xA1, 0x06, 0x00, 0x00, 0x00, "Yongnuo", "", "YN35mm F2N"},
3093
200
      {0x9F, 0x48, 0x48, 0x48, 0x24, 0x24, 0xA1, 0x06, 0x00, 0x00, 0x00, "Yongnuo", "", "YN40mm F2.8N"},
3094
200
      {0x9A, 0x4C, 0x50, 0x50, 0x14, 0x14, 0x9C, 0x06, 0x00, 0x00, 0x00, "Yongnuo", "", "YN50mm F1.8N"},
3095
200
      {0x9F, 0x4D, 0x50, 0x50, 0x14, 0x14, 0xA0, 0x06, 0x00, 0x00, 0x00, "Yongnuo", "", "YN50mm F1.8N"},
3096
200
      {0x9F, 0x54, 0x68, 0x68, 0x18, 0x18, 0xA2, 0x06, 0x00, 0x00, 0x00, "Yongnuo", "", "YN100mm F2N"},
3097
      //
3098
200
      {0x02, 0x40, 0x44, 0x5C, 0x2C, 0x34, 0x02, 0x00, 0x00, 0x00, 0x00, "Exakta", "", "AF 35-70mm 1:3.5-4.5 MC"},
3099
200
      {0x07, 0x3E, 0x30, 0x43, 0x2D, 0x35, 0x03, 0x00, 0x00, 0x00, 0x00, "Soligor", "", "AF Zoom 19-35mm 1:3.5-4.5 MC"},
3100
200
      {0x03, 0x43, 0x5C, 0x81, 0x35, 0x35, 0x02, 0x00, 0x00, 0x00, 0x00, "Soligor", "",
3101
200
       "AF C/D Zoom UMCS 70-210mm 1:4.5"},
3102
200
      {0x12, 0x4A, 0x5C, 0x81, 0x31, 0x3D, 0x09, 0x00, 0x00, 0x00, 0x00, "Soligor", "",
3103
200
       "AF C/D Auto Zoom+Macro 70-210mm 1:4-5.6 UMCS"},
3104
200
      {0x12, 0x36, 0x69, 0x97, 0x35, 0x42, 0x09, 0x00, 0x00, 0x00, 0x00, "Soligor", "",
3105
200
       "AF Zoom 100-400mm 1:4.5-6.7 MC"},
3106
      //
3107
200
      {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, "Manual Lens", "", "No CPU"},
3108
200
      {0x00, 0x00, 0x48, 0x48, 0x53, 0x53, 0x00, 0x01, 0x00, 0x00, 0x00, "Loreo", "",
3109
200
       "40mm F11-22 3D Lens in a Cap 9005"},
3110
      //
3111
      //------------------------------------------------------------------------------
3112
      //
3113
      // Lenses, that were upgraded with custom CPU
3114
      //
3115
200
      {0x00, 0x47, 0x10, 0x10, 0x24, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA604AC",
3116
200
       "Fisheye Nikkor 8mm f/2.8 AiS"},
3117
200
      {0x00, 0x47, 0x3C, 0x3C, 0x24, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, "Nikon", "", "Nikkor 28mm f/2.8 AiS"},
3118
      //"00 54 44 44 0C 0C 00" "00" "00" "00" "00" "Nikon"   "JAA115AD" "Nikkor 35mm f/1.4 AiS" double ID with
3119
      // Zeiss
3120
200
      {0x00, 0x57, 0x50, 0x50, 0x14, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, "Nikon", "", "Nikkor 50mm f/1.8 AI"},
3121
200
      {0x00, 0x48, 0x50, 0x50, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, "Nikon", "", "Nikkor H 50mm f/2"},
3122
200
      {0x00, 0x48, 0x68, 0x68, 0x24, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA304AA", "Series E 100mm f/2.8"},
3123
200
      {0x00, 0x4C, 0x6A, 0x6A, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA305AA", "Nikkor 105mm f/2.5 AiS"},
3124
200
      {0x00, 0x48, 0x80, 0x80, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, "Nikon", "JAA313AA", "Nikkor 200mm f/4 AiS"},
3125
200
      {0x00, 0x40, 0x11, 0x11, 0x2C, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x00, "Samyang", "", "8mm f/3.5 Fish-Eye"},
3126
200
      {0x00, 0x58, 0x64, 0x64, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, "Soligor", "", "C/D Macro MC 90mm f/2.5"},
3127
      // https://github.com/Exiv2/exiv2/issues/743
3128
200
      {0xc9, 0x48, 0x37, 0x5c, 0x24, 0x24, 0x4b, 0x4e, 0x01, 0x00, 0x00, "Sigma", "", "24-70mm F2.8 DG OS HSM Art"},
3129
      //  https://github.com/Exiv2/exiv2/issues/598 , https://github.com/Exiv2/exiv2/pull/891
3130
200
      {0xCF, 0x47, 0x5C, 0x8E, 0x31, 0x3D, 0xDF, 0x0E, 0x00, 0x00, 0x00, "Tamron", "A030",
3131
200
       "SP 70-300mm F/4-5.6 Di VC USD"},
3132
      //
3133
200
      {0xf4, 0x4c, 0x7c, 0x7c, 0x2c, 0x2c, 0x4b, 0x02, 0x00, 0x00, 0x00, "Sigma", "", "APO Macro 180mm F3.5 EX DG HSM"},
3134
      // https://github.com/Exiv2/exiv2/issues/1078
3135
200
      {0x80, 0x48, 0x1C, 0x29, 0x24, 0x24, 0x7A, 0x06, 0x00, 0x00, 0x00, "Tokina", "", "atx-i 11-16mm F2.8 CF"},
3136
      // https://github.com/Exiv2/exiv2/issues/1069
3137
200
      {0xc8, 0x54, 0x44, 0x44, 0x0d, 0x0d, 0xdf, 0x46, 0x00, 0x00, 0x00, "Tamron", "F045", "SP 35mm f/1.4 Di USD"},
3138
      // https://github.com/Exiv2/exiv2/pull/1105
3139
200
      {0xCB, 0x3C, 0x2B, 0x44, 0x24, 0x31, 0xDF, 0x46, 0x00, 0x00, 0x00, "Tamron", "A037", "17-35mm F/2.8-4 Di OSD"},
3140
      // https://github.com/Exiv2/exiv2/issues/1208
3141
200
      {0xC8, 0x54, 0x62, 0x62, 0x0C, 0x0C, 0x4B, 0x46, 0x00, 0x00, 0x00, "Sigma", "321550", "85mm F1.4 DG HSM | A"},
3142
200
  };
3143
//------------------------------------------------------------------------------
3144
200
#endif
3145
  // 8< - - - 8< do not remove this line >8 - - - >8
3146
3147
  /* if no meta obj is provided, try to use the value param that *may*
3148
   * be the pre-parsed lensid
3149
   */
3150
200
  if (!metadata) {
3151
100
    const auto vid = static_cast<unsigned char>(value.toInt64(0));
3152
3153
    /* the 'FMntLens' name is added to the anonymous struct for
3154
     * fmountlens[]
3155
     *
3156
     * remember to name the struct when importing/updating the lens info
3157
     * from:
3158
     *
3159
     * www.rottmerhusen.com/objektives/lensid/files/c-header/fmountlens4.h
3160
     */
3161
100
    if (auto pf = Exiv2::find(fmountlens, vid))
3162
97
      return os << pf->manuf << " " << pf->lensname;
3163
3
    return os << "(" << value << ")";
3164
100
  }
3165
3166
100
  byte raw[] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
3167
3168
100
  static constexpr auto tags = std::array{
3169
100
      "LensIDNumber",          "LensFStops", "MinFocalLength", "MaxFocalLength", "MaxApertureAtMinFocal",
3170
100
      "MaxApertureAtMaxFocal", "MCUVersion",
3171
100
  };
3172
3173
100
  const std::string pre = std::string("Exif.") + group + std::string(".");
3174
774
  for (unsigned int i = 0; i < 7; ++i) {
3175
679
    ExifKey key(pre + std::string(tags[i]));
3176
679
    auto md = metadata->findKey(key);
3177
679
    if (md == metadata->end() || md->typeId() != unsignedByte || md->count() == 0) {
3178
5
      return os << "(" << value << ")";
3179
5
    }
3180
674
    raw[i] = static_cast<byte>(md->toInt64());
3181
674
  }
3182
3183
95
  auto md = metadata->findKey(ExifKey("Exif.Nikon3.LensType"));
3184
95
  if (md == metadata->end() || md->typeId() != unsignedByte || md->count() == 0) {
3185
56
    return os << "(" << value << ")";
3186
56
  }
3187
39
  raw[7] = static_cast<byte>(md->toInt64());
3188
3189
22.2k
  for (const auto& f : fmountlens) {
3190
22.2k
    if (raw[0] == f.lid) {
3191
      // #1034
3192
1.08k
      const std::string undefined("undefined");
3193
1.08k
      const std::string section("nikon");
3194
1.08k
      auto lensIDStream = std::to_string(raw[7]);
3195
1.08k
      if (Internal::readExiv2Config(section, lensIDStream, undefined) != undefined) {
3196
0
        return os << Internal::readExiv2Config(section, lensIDStream, undefined);
3197
0
      }
3198
1.08k
    }
3199
3200
22.2k
    if (raw[0] == f.lid
3201
        // stps varies with focal length for some Sigma zoom lenses.
3202
1.08k
        && (raw[1] == f.stps || f.manuf == "Sigma") && raw[2] == f.focs && raw[3] == f.focl && raw[4] == f.aps &&
3203
8
        raw[5] == f.apl && raw[6] == f.lfw && raw[7] == f.ltype) {
3204
      // Lens found in database
3205
1
      return os << f.manuf << " " << f.lensname;
3206
1
    }
3207
22.2k
  }
3208
  // Lens not found in database
3209
38
  return os << "(" << value << ")";
3210
#else
3211
  return os << "(" << value << ")";
3212
#endif  // EXV_HAVE_LENSDATA
3213
39
}
3214
3215
196
std::ostream& Nikon3MakerNote::printFocusDistance(std::ostream& os, const Value& value, const ExifData*) {
3216
196
  if (value.count() != 1 || value.typeId() != unsignedByte)
3217
0
    return os << "(" << value << ")";
3218
196
  auto val = value.toInt64();
3219
196
  if (val == 0)
3220
70
    return os << _("n/a");
3221
3222
126
  return os << stringFormat("{:.2f} m", std::pow(10.0, (val / 40.0) - 2.0));
3223
196
}
3224
3225
766
std::ostream& Nikon3MakerNote::printAperture(std::ostream& os, const Value& value, const ExifData*) {
3226
766
  if (value.count() != 1 || value.typeId() != unsignedByte)
3227
0
    return os << "(" << value << ")";
3228
3229
766
  auto val = value.toInt64();
3230
766
  if (val == 0)
3231
376
    return os << _("n/a");
3232
3233
390
  return os << stringFormat("F{:.1f}", std::exp2(val / 24.0));
3234
766
}
3235
3236
578
std::ostream& Nikon3MakerNote::printFocal(std::ostream& os, const Value& value, const ExifData*) {
3237
578
  if (value.count() != 1 || value.typeId() != unsignedByte) {
3238
0
    return os << "(" << value << ")";
3239
0
  }
3240
578
  auto val = value.toInt64();
3241
578
  if (val == 0)
3242
250
    return os << _("n/a");
3243
3244
328
  return os << stringFormat("{:.1f} mm", 5.0 * std::exp2(val / 24.0));
3245
578
}
3246
3247
196
std::ostream& Nikon3MakerNote::printFStops(std::ostream& os, const Value& value, const ExifData*) {
3248
196
  if (value.count() != 1 || value.typeId() != unsignedByte)
3249
0
    return os << "(" << value << ")";
3250
196
  return os << stringFormat("F{:.1f}", value.toInt64() / 12.0);
3251
196
}
3252
3253
202
std::ostream& Nikon3MakerNote::printExitPupilPosition(std::ostream& os, const Value& value, const ExifData*) {
3254
202
  if (value.count() != 1 || value.typeId() != unsignedByte || value.toInt64() == 0)
3255
16
    return os << "(" << value << ")";
3256
186
  return os << stringFormat("{:.1f} mm", 2048.0 / value.toInt64());
3257
202
}
3258
3259
156
std::ostream& Nikon3MakerNote::printFlashFocalLength(std::ostream& os, const Value& value, const ExifData*) {
3260
156
  if (value.count() != 1 || value.typeId() != unsignedByte) {
3261
0
    os << "(" << value << ")";
3262
0
    return os;
3263
0
  }
3264
156
  auto temp = value.toInt64();
3265
156
  if (temp == 0 || temp == 255)
3266
30
    return os << _("n/a");
3267
3268
126
  return os << stringFormat("{:1} mm", temp);
3269
156
}
3270
3271
152
std::ostream& Nikon3MakerNote::printRepeatingFlashRate(std::ostream& os, const Value& value, const ExifData*) {
3272
152
  if (value.count() != 1 || value.typeId() != unsignedByte) {
3273
0
    return os << "(" << value << ")";
3274
0
  }
3275
152
  auto temp = value.toInt64();
3276
152
  if (temp == 0 || temp == 255)
3277
20
    return os << _("n/a");
3278
3279
132
  return os << stringFormat("{:2} Hz", temp);
3280
152
}
3281
3282
152
std::ostream& Nikon3MakerNote::printRepeatingFlashCount(std::ostream& os, const Value& value, const ExifData*) {
3283
152
  if (value.count() != 1 || value.typeId() != unsignedByte) {
3284
0
    return os << "(" << value << ")";
3285
0
  }
3286
152
  auto temp = value.toInt64();
3287
152
  if (temp == 0 || temp == 255)
3288
44
    return os << _("n/a");
3289
3290
108
  return os << stringFormat("{:1}", temp);
3291
152
}
3292
3293
std::ostream& Nikon3MakerNote::printExternalFlashData1Fl6(std::ostream& os, const Value& value,
3294
48
                                                          const ExifData* metadata) {
3295
48
  std::ios::fmtflags f(os.flags());
3296
48
  if (value.count() != 1 || value.typeId() != unsignedByte) {
3297
0
    os << "(" << value << ")";
3298
0
    os.flags(f);
3299
0
    return os;
3300
0
  }
3301
48
  std::ostringstream oss;
3302
48
  oss.copyfmt(os);
3303
48
  const auto v0 = value.toUint32(0);
3304
48
  os << (v0 & 0x01 ? _("Fired") : _("Did not fire"));
3305
3306
48
  if (v0 & 0x01) {
3307
26
    std::ostringstream ossTemp;
3308
26
    printTagBitmask<std::size(nikonFlashAdaptors), nikonFlashAdaptors>(ossTemp, value, metadata);
3309
26
    std::string tempStr = ossTemp.str();
3310
26
    if (!tempStr.empty()) {
3311
20
      os << ", " << tempStr;
3312
20
    }
3313
26
  }
3314
48
  os.copyfmt(oss);
3315
48
  os.flags(f);
3316
48
  return os;
3317
48
}
3318
3319
std::ostream& Nikon3MakerNote::printExternalFlashData2Fl6(std::ostream& os, const Value& value,
3320
48
                                                          const ExifData* metadata) {
3321
48
  std::ios::fmtflags f(os.flags());
3322
48
  if (value.count() != 1 || value.typeId() != unsignedByte) {
3323
0
    os << "(" << value << ")";
3324
0
    os.flags(f);
3325
0
    return os;
3326
0
  }
3327
48
  std::ostringstream oss;
3328
48
  oss.copyfmt(os);
3329
48
  const auto v0 = value.toUint32(0);
3330
48
  os << (v0 & 0x80 ? _("External flash on") : _("External flash off"));
3331
3332
48
  if (v0 & 0x80) {
3333
40
    os << ", ";
3334
40
    printTag<std::size(nikonFlashControlMode), nikonFlashControlMode>(os, (value.toUint32() & 0x0F), metadata);
3335
40
  }
3336
48
  os.copyfmt(oss);
3337
48
  os.flags(f);
3338
48
  return os;
3339
48
}
3340
3341
std::ostream& Nikon3MakerNote::printExternalFlashData1Fl7(std::ostream& os, const Value& value,
3342
74
                                                          const ExifData* metadata) {
3343
74
  std::ios::fmtflags f(os.flags());
3344
74
  if (value.count() != 1 || value.typeId() != unsignedByte) {
3345
0
    os << "(" << value << ")";
3346
0
    os.flags(f);
3347
0
    return os;
3348
0
  }
3349
74
  std::ostringstream oss;
3350
74
  oss.copyfmt(os);
3351
74
  const auto v0 = value.toUint32();
3352
74
  os << (v0 & 0x01 ? _("External flash on") : _("External flash off"));
3353
3354
74
  if (v0 & 0x01) {
3355
44
    os << ", ";
3356
44
    os << (v0 & 0x80 ? _("External flash zoom override") : _("No external flash zoom override"));
3357
3358
44
    std::ostringstream ossTemp;
3359
44
    printTagBitmask<std::size(nikonFlashAdaptors), nikonFlashAdaptors>(ossTemp, value, metadata);
3360
44
    std::string tempStr = ossTemp.str();
3361
44
    if (!tempStr.empty()) {
3362
20
      os << ", " << tempStr;
3363
20
    }
3364
44
  }
3365
74
  os.copyfmt(oss);
3366
74
  os.flags(f);
3367
74
  return os;
3368
74
}
3369
3370
74
std::ostream& Nikon3MakerNote::printExternalFlashData2(std::ostream& os, const Value& value, const ExifData* metadata) {
3371
74
  std::ios::fmtflags f(os.flags());
3372
74
  if (value.count() != 1 || value.typeId() != unsignedByte) {
3373
0
    os << "(" << value << ")";
3374
0
    os.flags(f);
3375
0
    return os;
3376
0
  }
3377
3378
74
  printTag<std::size(nikonFlashControlMode), nikonFlashControlMode>(os, (value.toUint32() & 0x0F), metadata);
3379
3380
74
  os.flags(f);
3381
74
  return os;
3382
74
}
3383
3384
70
std::ostream& Nikon3MakerNote::printFlashMasterDataFl6(std::ostream& os, const Value& value, const ExifData* metadata) {
3385
70
  std::ios::fmtflags f(os.flags());
3386
70
  if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
3387
35
    os << "(" << value << ")";
3388
35
    os.flags(f);
3389
35
    return os;
3390
35
  }
3391
3392
  // Check if using an automated or manual mode
3393
35
  auto pos = metadata->findKey(ExifKey("Exif.NikonFl6.ExternalFlashData1"));
3394
35
  if (pos == metadata->end() || pos->count() != 1 || pos->typeId() != unsignedByte) {
3395
0
    os << "(" << value << ")";
3396
0
    os.flags(f);
3397
0
    return os;
3398
0
  }
3399
3400
35
  const auto mode = pos->toUint32(0) & 0x0F;
3401
35
  if (mode == 0) {
3402
6
    os << _("n/a");
3403
6
    os.flags(f);
3404
6
    return os;
3405
6
  }
3406
3407
29
  printFlashCompensationValue(os, static_cast<unsigned char>(value.toUint32(0)), flashModeUsesManualScale(mode));
3408
3409
29
  os.flags(f);
3410
29
  return os;
3411
35
}
3412
3413
114
std::ostream& Nikon3MakerNote::printFlashMasterDataFl7(std::ostream& os, const Value& value, const ExifData* metadata) {
3414
114
  std::ios::fmtflags f(os.flags());
3415
114
  if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
3416
57
    os << "(" << value << ")";
3417
57
    os.flags(f);
3418
57
    return os;
3419
57
  }
3420
3421
  // Check if using an automated or manual mode
3422
57
  auto pos = metadata->findKey(ExifKey("Exif.NikonFl7.ExternalFlashData2"));
3423
57
  if (pos == metadata->end() || pos->count() != 1 || pos->typeId() != unsignedByte) {
3424
0
    os << "(" << value << ")";
3425
0
    os.flags(f);
3426
0
    return os;
3427
0
  }
3428
3429
57
  const auto mode = pos->toUint32(0) & 0x0F;
3430
57
  if (mode == 0) {
3431
7
    os << _("n/a");
3432
7
    os.flags(f);
3433
7
    return os;
3434
7
  }
3435
3436
50
  printFlashCompensationValue(os, static_cast<unsigned char>(value.toUint32(0)), flashModeUsesManualScale(mode));
3437
3438
50
  os.flags(f);
3439
50
  return os;
3440
57
}
3441
3442
116
std::ostream& Nikon3MakerNote::printFlashGroupAControlData(std::ostream& os, const Value& value, const ExifData* data) {
3443
116
  std::ios::fmtflags f(os.flags());
3444
116
  if (value.count() != 1 || value.typeId() != unsignedByte) {
3445
0
    os << "(" << value << ")";
3446
0
    os.flags(f);
3447
0
    return os;
3448
0
  }
3449
116
  std::ostringstream oss;
3450
116
  oss.copyfmt(os);
3451
3452
116
  printTag<std::size(nikonFlashControlMode), nikonFlashControlMode>(os, (value.toUint32() & 0x0F), data);
3453
3454
116
  os.copyfmt(oss);
3455
116
  os.flags(f);
3456
116
  return os;
3457
116
}
3458
3459
std::ostream& Nikon3MakerNote::printFlashGroupBCControlData(std::ostream& os, const Value& value,
3460
116
                                                            const ExifData* data) {
3461
116
  std::ios::fmtflags f(os.flags());
3462
116
  if (value.count() != 1 || value.typeId() != unsignedByte) {
3463
0
    os << "(" << value << ")";
3464
0
    os.flags(f);
3465
0
    return os;
3466
0
  }
3467
116
  std::ostringstream oss;
3468
116
  oss.copyfmt(os);
3469
116
  const auto temp = value.toUint32();
3470
3471
116
  printTag<std::size(nikonFlashControlMode), nikonFlashControlMode>(os, (temp >> 4), data);
3472
116
  os << ", ";
3473
116
  printTag<std::size(nikonFlashControlMode), nikonFlashControlMode>(os, (temp & 0x0f), data);
3474
3475
116
  os.copyfmt(oss);
3476
116
  os.flags(f);
3477
116
  return os;
3478
116
}
3479
3480
68
std::ostream& Nikon3MakerNote::printFlashGroupADataFl6(std::ostream& os, const Value& value, const ExifData* metadata) {
3481
68
  std::ios::fmtflags f(os.flags());
3482
68
  if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
3483
34
    os << "(" << value << ")";
3484
34
    os.flags(f);
3485
34
    return os;
3486
34
  }
3487
3488
  // Check if using an automated or manual mode
3489
34
  auto pos = metadata->findKey(ExifKey("Exif.NikonFl6.FlashGroupAControlData"));
3490
34
  if (pos == metadata->end() || pos->count() != 1 || pos->typeId() != unsignedByte) {
3491
0
    os << "(" << value << ")";
3492
0
    os.flags(f);
3493
0
    return os;
3494
0
  }
3495
3496
34
  const auto mode = pos->toUint32(0) & 0x0F;
3497
34
  if (mode == 0) {
3498
11
    os << _("n/a");
3499
11
    os.flags(f);
3500
11
    return os;
3501
11
  }
3502
3503
23
  printFlashCompensationValue(os, static_cast<unsigned char>(value.toUint32(0)), flashModeUsesManualScale(mode));
3504
3505
23
  os.flags(f);
3506
23
  return os;
3507
34
}
3508
3509
110
std::ostream& Nikon3MakerNote::printFlashGroupADataFl7(std::ostream& os, const Value& value, const ExifData* metadata) {
3510
110
  std::ios::fmtflags f(os.flags());
3511
110
  if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
3512
55
    os << "(" << value << ")";
3513
55
    os.flags(f);
3514
55
    return os;
3515
55
  }
3516
3517
  // Check if using an automated or manual mode
3518
55
  auto pos = metadata->findKey(ExifKey("Exif.NikonFl7.FlashGroupAControlData"));
3519
55
  if (pos == metadata->end() || pos->count() != 1 || pos->typeId() != unsignedByte) {
3520
0
    os << "(" << value << ")";
3521
0
    os.flags(f);
3522
0
    return os;
3523
0
  }
3524
3525
55
  const auto mode = pos->toUint32(0) & 0x0F;
3526
55
  if (mode == 0) {
3527
10
    os << _("n/a");
3528
10
    os.flags(f);
3529
10
    return os;
3530
10
  }
3531
3532
45
  printFlashCompensationValue(os, static_cast<unsigned char>(value.toUint32(0)), flashModeUsesManualScale(mode));
3533
3534
45
  os.flags(f);
3535
45
  return os;
3536
55
}
3537
3538
68
std::ostream& Nikon3MakerNote::printFlashGroupBDataFl6(std::ostream& os, const Value& value, const ExifData* metadata) {
3539
68
  std::ios::fmtflags f(os.flags());
3540
68
  if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
3541
34
    os << "(" << value << ")";
3542
34
    os.flags(f);
3543
34
    return os;
3544
34
  }
3545
3546
  // Check if using an automated or manual mode
3547
34
  auto pos = metadata->findKey(ExifKey("Exif.NikonFl6.FlashGroupBCControlData"));
3548
34
  if (pos == metadata->end() || pos->count() != 1 || pos->typeId() != unsignedByte) {
3549
0
    os << "(" << value << ")";
3550
0
    os.flags(f);
3551
0
    return os;
3552
0
  }
3553
3554
34
  const auto mode = pos->toUint32(0) >> 4;
3555
34
  if (mode == 0) {
3556
4
    os << _("n/a");
3557
4
    os.flags(f);
3558
4
    return os;
3559
4
  }
3560
3561
30
  printFlashCompensationValue(os, static_cast<unsigned char>(value.toUint32(0)), flashModeUsesManualScale(mode));
3562
3563
30
  os.flags(f);
3564
30
  return os;
3565
34
}
3566
3567
108
std::ostream& Nikon3MakerNote::printFlashGroupBDataFl7(std::ostream& os, const Value& value, const ExifData* metadata) {
3568
108
  std::ios::fmtflags f(os.flags());
3569
108
  if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
3570
54
    os << "(" << value << ")";
3571
54
    os.flags(f);
3572
54
    return os;
3573
54
  }
3574
3575
  // Check if using an automated or manual mode
3576
54
  auto pos = metadata->findKey(ExifKey("Exif.NikonFl7.FlashGroupBCControlData"));
3577
54
  if (pos == metadata->end() || pos->count() != 1 || pos->typeId() != unsignedByte) {
3578
0
    os << "(" << value << ")";
3579
0
    os.flags(f);
3580
0
    return os;
3581
0
  }
3582
3583
54
  const auto mode = pos->toUint32(0) >> 4;
3584
54
  if (mode == 0) {
3585
14
    os << _("n/a");
3586
14
    os.flags(f);
3587
14
    return os;
3588
14
  }
3589
3590
40
  printFlashCompensationValue(os, static_cast<unsigned char>(value.toUint32(0)), flashModeUsesManualScale(mode));
3591
3592
40
  os.flags(f);
3593
40
  return os;
3594
54
}
3595
3596
60
std::ostream& Nikon3MakerNote::printFlashGroupCDataFl6(std::ostream& os, const Value& value, const ExifData* metadata) {
3597
60
  std::ios::fmtflags f(os.flags());
3598
60
  if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
3599
30
    os << "(" << value << ")";
3600
30
    os.flags(f);
3601
30
    return os;
3602
30
  }
3603
3604
  // Check if using an automated or manual mode
3605
30
  auto pos = metadata->findKey(ExifKey("Exif.NikonFl6.FlashGroupBCControlData"));
3606
30
  if (pos == metadata->end() || pos->count() != 1 || pos->typeId() != unsignedByte) {
3607
0
    os << "(" << value << ")";
3608
0
    os.flags(f);
3609
0
    return os;
3610
0
  }
3611
3612
30
  const auto mode = pos->toUint32(0) & 0x000F;
3613
30
  if (mode == 0) {
3614
9
    os << _("n/a");
3615
9
    os.flags(f);
3616
9
    return os;
3617
9
  }
3618
3619
21
  printFlashCompensationValue(os, static_cast<unsigned char>(value.toUint32(0)), flashModeUsesManualScale(mode));
3620
3621
21
  os.flags(f);
3622
21
  return os;
3623
30
}
3624
3625
82
std::ostream& Nikon3MakerNote::printFlashGroupCDataFl7(std::ostream& os, const Value& value, const ExifData* metadata) {
3626
82
  std::ios::fmtflags f(os.flags());
3627
82
  if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
3628
41
    os << "(" << value << ")";
3629
41
    os.flags(f);
3630
41
    return os;
3631
41
  }
3632
3633
  // Check if using an automated or manual mode
3634
41
  auto pos = metadata->findKey(ExifKey("Exif.NikonFl7.FlashGroupBCControlData"));
3635
41
  if (pos == metadata->end() || pos->count() != 1 || pos->typeId() != unsignedByte) {
3636
0
    os << "(" << value << ")";
3637
0
    os.flags(f);
3638
0
    return os;
3639
0
  }
3640
3641
41
  const auto mode = pos->toUint32(0) & 0x000F;
3642
41
  if (mode == 0) {
3643
9
    os << _("n/a");
3644
9
    os.flags(f);
3645
9
    return os;
3646
9
  }
3647
3648
32
  printFlashCompensationValue(os, static_cast<unsigned char>(value.toUint32(0)), flashModeUsesManualScale(mode));
3649
3650
32
  os.flags(f);
3651
32
  return os;
3652
41
}
3653
3654
42
std::ostream& Nikon3MakerNote::printExternalFlashData3(std::ostream& os, const Value& value, const ExifData* data) {
3655
42
  std::ios::fmtflags f(os.flags());
3656
42
  if (value.count() != 1 || value.typeId() != unsignedByte) {
3657
0
    os << "(" << value << ")";
3658
0
    os.flags(f);
3659
0
    return os;
3660
0
  }
3661
3662
42
  printTag<std::size(nikonFlashExposureComp), nikonFlashExposureComp>(os, (value.toUint32(0) & 0x04), data);
3663
3664
42
  os.flags(f);
3665
42
  return os;
3666
42
}
3667
3668
192
std::ostream& Nikon3MakerNote::printCameraExposureCompensation(std::ostream& os, const Value& value, const ExifData*) {
3669
192
  std::ios::fmtflags f(os.flags());
3670
192
  if (value.count() != 1 || value.typeId() != unsignedByte) {
3671
0
    os << "(" << value << ")";
3672
0
    os.flags(f);
3673
0
    return os;
3674
0
  }
3675
192
  printFlashCompensationValue(os, static_cast<unsigned char>(value.toUint32(0)), false);
3676
192
  os.flags(f);
3677
192
  return os;
3678
192
}
3679
3680
40
std::ostream& Nikon3MakerNote::printExternalFlashData4(std::ostream& os, const Value& value, const ExifData* metadata) {
3681
40
  std::ios::fmtflags f(os.flags());
3682
40
  if (value.count() != 1 || value.typeId() != unsignedByte) {
3683
0
    os << "(" << value << ")";
3684
0
    os.flags(f);
3685
0
    return os;
3686
0
  }
3687
3688
40
  printTag<std::size(nikonFlashIlluminationPat), nikonFlashIlluminationPat>(os, value.toUint32(0), metadata);
3689
3690
40
  os.flags(f);
3691
40
  return os;
3692
40
}
3693
3694
40
std::ostream& Nikon3MakerNote::printFlashZoomHeadPosition(std::ostream& os, const Value& value, const ExifData*) {
3695
40
  if (value.count() != 1 || value.typeId() != unsignedByte) {
3696
0
    return os << "(" << value << ")";
3697
0
  }
3698
3699
40
  auto v0 = value.toUint32(0);
3700
40
  if (v0 == 0) {
3701
6
    return os << _("n/a");
3702
6
  }
3703
3704
34
  return os << stringFormat("{} mm", v0);
3705
40
}
3706
3707
80
std::ostream& Nikon3MakerNote::printTimeZone(std::ostream& os, const Value& value, const ExifData*) {
3708
80
  if (value.count() != 1 || value.typeId() != signedShort) {
3709
0
    return os << "(" << value << ")";
3710
0
  }
3711
80
  char sign = value.toInt64() < 0 ? '-' : '+';
3712
80
  long h = static_cast<long>(std::fabs(value.toFloat() / 60.0F)) % 24;
3713
80
  long min = static_cast<long>(std::fabs(value.toFloat() - (h * 60))) % 60;
3714
80
  return os << stringFormat("UTC {}{:02}:{:02}", sign, h, min);
3715
80
}
3716
3717
478
std::ostream& Nikon3MakerNote::printPictureControl(std::ostream& os, const Value& value, const ExifData*) {
3718
478
  if (value.count() != 1 || value.typeId() != unsignedByte) {
3719
0
    return os << "(" << value << ")";
3720
0
  }
3721
478
  const auto pcval = value.toInt64() - 0x80;
3722
478
  std::ostringstream oss;
3723
478
  oss.copyfmt(os);
3724
478
  switch (pcval) {
3725
58
    case 0:
3726
58
      os << _("Normal");
3727
58
      break;
3728
22
    case 127:
3729
22
      os << _("n/a");
3730
22
      break;
3731
22
    case -127:
3732
22
      os << _("User");
3733
22
      break;
3734
130
    case -128:
3735
130
      os << _("Auto");
3736
130
      break;
3737
246
    default:
3738
246
      os << pcval;
3739
246
      break;
3740
478
  }
3741
478
  os.copyfmt(oss);
3742
478
  return os;
3743
478
}
3744
3745
40
std::ostream& Nikon3MakerNote::print0x009a(std::ostream& os, const Value& value, const ExifData*) {
3746
40
  if (value.count() != 2 || value.typeId() != unsignedRational) {
3747
20
    return os << value;
3748
20
  }
3749
20
  float f1 = value.toFloat(0);
3750
20
  float f2 = value.toFloat(1);
3751
20
  return os << f1 << " x " << f2 << " um";
3752
40
}
3753
3754
976
std::ostream& Nikon3MakerNote::print0x009e(std::ostream& os, const Value& value, const ExifData*) {
3755
976
  if (value.count() != 10 || value.typeId() != unsignedShort)
3756
122
    return os << value;
3757
3758
854
  std::vector<std::string> sv;
3759
854
  bool trim = true;
3760
3761
9.39k
  for (int i = 9; i >= 0; --i) {
3762
8.54k
    const auto l = value.toInt64(i);
3763
8.54k
    if (i > 0 && l == 0 && trim)
3764
714
      continue;
3765
7.82k
    if (l != 0)
3766
6.51k
      trim = false;
3767
3768
7.82k
    if (auto td = Exiv2::find(nikonRetouchHistory, l))
3769
2.46k
      sv.emplace_back(_(td->label_));
3770
5.35k
    else
3771
5.35k
      sv.emplace_back(stringFormat("{} ({})", _("Unknown"), l));
3772
7.82k
  }
3773
3774
854
  if (!sv.empty()) {
3775
854
    std::copy(sv.begin(), sv.end() - 1, std::ostream_iterator<std::string>(os, "; "));
3776
854
    os << sv.back();
3777
854
  }
3778
3779
854
  return os;
3780
976
}
3781
3782
254
std::ostream& Nikon3MakerNote::printApertureLd4(std::ostream& os, const Value& value, const ExifData*) {
3783
254
  if (value.count() != 1 || value.typeId() != unsignedShort) {
3784
0
    return os << "(" << value << ")";
3785
0
  }
3786
254
  auto temp = value.toInt64();
3787
254
  if (temp == 0)
3788
34
    return os << _("n/a");
3789
3790
220
  return os << stringFormat("F{:.1f}", std::exp2((temp / 384.0) - 1.0));
3791
254
}
3792
84
std::ostream& Nikon3MakerNote::printFocalLd4(std::ostream& os, const Value& value, const ExifData*) {
3793
84
  if (value.count() != 1 || value.typeId() != unsignedShort) {
3794
0
    return os << "(" << value << ")";
3795
0
  }
3796
84
  auto temp = value.toInt64();
3797
84
  if (temp == 0)
3798
6
    return os << _("n/a");
3799
3800
78
  return os << stringFormat("{} mm", temp);
3801
84
}
3802
3803
84
std::ostream& Nikon3MakerNote::printFocusDistanceLd4(std::ostream& os, const Value& value, const ExifData*) {
3804
84
  if (value.count() != 1 || value.typeId() != unsignedShort) {
3805
0
    return os << "(" << value << ")";
3806
0
  }
3807
84
  auto temp = value.toInt64();
3808
84
  if (temp == 0)
3809
2
    return os << _("n/a");
3810
3811
82
  return os << stringFormat("{:.2f} m", std::pow(10.0, (temp / (256.0 * 40.0)) - 2.0));
3812
84
}
3813
3814
}  // namespace Exiv2::Internal