Coverage Report

Created: 2026-08-13 07:05

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/exiv2/src/pentaxmn_int.cpp
Line
Count
Source
1
// SPDX-License-Identifier: GPL-2.0-or-later
2
3
#include "pentaxmn_int.hpp"
4
5
// included header files
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 "types.hpp"
13
#include "value.hpp"
14
15
#include <iomanip>
16
17
namespace {
18
// Exception thrown by findLensInfo when the lens info can't be found.
19
class LensInfoNotFound : public std::exception {
20
  using std::exception::exception;
21
};
22
}  // namespace
23
24
// *****************************************************************************
25
// class member definitions
26
namespace Exiv2::Internal {
27
/*!
28
  @brief Print function to translate Pentax "combi-values" to a description
29
         by looking up a reference table.
30
 */
31
template <size_t N, const TagDetails (&array)[N], int count, int ignoredcount, int ignoredcountmax>
32
15.3k
static std::ostream& printCombiTag(std::ostream& os, const Value& value, const ExifData* metadata) {
33
15.3k
  static_assert(N > 0, "Passed zero length printCombiTag");
34
15.3k
  std::ios::fmtflags f(os.flags());
35
15.3k
  if ((value.count() != count &&
36
1.78k
       (value.count() < (count + ignoredcount) || value.count() > (count + ignoredcountmax))) ||
37
869
      count > 4) {
38
869
    return printValue(os, value, metadata);
39
869
  }
40
14.4k
  uint32_t l = 0;
41
51.7k
  for (int c = 0; c < count; ++c) {
42
42.4k
    if (value.toInt64(c) < 0 || value.toInt64(c) > 255) {
43
5.18k
      return printValue(os, value, metadata);
44
5.18k
    }
45
37.2k
    l += (value.toUint32(c) << ((count - c - 1) * 8));
46
37.2k
  }
47
48
9.29k
  if (auto td = Exiv2::find(array, l)) {
49
7.87k
    os << _(td->label_);
50
7.87k
  } else {
51
1.41k
    os << _("Unknown") << " (0x" << std::setw(2 * count) << std::setfill('0') << std::hex << l << std::dec << ")";
52
1.41k
  }
53
54
9.29k
  os.flags(f);
55
9.29k
  return os;
56
14.4k
}
pentaxmn_int.cpp:_ZN5Exiv28InternalL13printCombiTagILm298ETnRAT__KNS0_10TagDetailsEL_ZNS0_L14pentaxLensTypeEELi2ELi1ELi2EEERNSt3__113basic_ostreamIcNS6_11char_traitsIcEEEESB_RKNS_5ValueEPKNS_8ExifDataE
Line
Count
Source
32
1.51k
static std::ostream& printCombiTag(std::ostream& os, const Value& value, const ExifData* metadata) {
33
1.51k
  static_assert(N > 0, "Passed zero length printCombiTag");
34
1.51k
  std::ios::fmtflags f(os.flags());
35
1.51k
  if ((value.count() != count &&
36
1.02k
       (value.count() < (count + ignoredcount) || value.count() > (count + ignoredcountmax))) ||
37
113
      count > 4) {
38
113
    return printValue(os, value, metadata);
39
113
  }
40
1.39k
  uint32_t l = 0;
41
3.01k
  for (int c = 0; c < count; ++c) {
42
2.33k
    if (value.toInt64(c) < 0 || value.toInt64(c) > 255) {
43
720
      return printValue(os, value, metadata);
44
720
    }
45
1.61k
    l += (value.toUint32(c) << ((count - c - 1) * 8));
46
1.61k
  }
47
48
678
  if (auto td = Exiv2::find(array, l)) {
49
564
    os << _(td->label_);
50
564
  } else {
51
114
    os << _("Unknown") << " (0x" << std::setw(2 * count) << std::setfill('0') << std::hex << l << std::dec << ")";
52
114
  }
53
54
678
  os.flags(f);
55
678
  return os;
56
1.39k
}
pentaxmn_int.cpp:_ZN5Exiv28InternalL13printCombiTagILm7ETnRAT__KNS0_10TagDetailsEL_ZNS0_L21pentaxImageProcessingEELi4ELi0ELi0EEERNSt3__113basic_ostreamIcNS6_11char_traitsIcEEEESB_RKNS_5ValueEPKNS_8ExifDataE
Line
Count
Source
32
1.98k
static std::ostream& printCombiTag(std::ostream& os, const Value& value, const ExifData* metadata) {
33
1.98k
  static_assert(N > 0, "Passed zero length printCombiTag");
34
1.98k
  std::ios::fmtflags f(os.flags());
35
1.98k
  if ((value.count() != count &&
36
140
       (value.count() < (count + ignoredcount) || value.count() > (count + ignoredcountmax))) ||
37
140
      count > 4) {
38
140
    return printValue(os, value, metadata);
39
140
  }
40
1.84k
  uint32_t l = 0;
41
6.91k
  for (int c = 0; c < count; ++c) {
42
5.89k
    if (value.toInt64(c) < 0 || value.toInt64(c) > 255) {
43
824
      return printValue(os, value, metadata);
44
824
    }
45
5.06k
    l += (value.toUint32(c) << ((count - c - 1) * 8));
46
5.06k
  }
47
48
1.02k
  if (auto td = Exiv2::find(array, l)) {
49
798
    os << _(td->label_);
50
798
  } else {
51
224
    os << _("Unknown") << " (0x" << std::setw(2 * count) << std::setfill('0') << std::hex << l << std::dec << ")";
52
224
  }
53
54
1.02k
  os.flags(f);
55
1.02k
  return os;
56
1.84k
}
pentaxmn_int.cpp:_ZN5Exiv28InternalL13printCombiTagILm71ETnRAT__KNS0_10TagDetailsEL_ZNS0_L17pentaxPictureModeEELi3ELi0ELi0EEERNSt3__113basic_ostreamIcNS6_11char_traitsIcEEEESB_RKNS_5ValueEPKNS_8ExifDataE
Line
Count
Source
32
5.44k
static std::ostream& printCombiTag(std::ostream& os, const Value& value, const ExifData* metadata) {
33
5.44k
  static_assert(N > 0, "Passed zero length printCombiTag");
34
5.44k
  std::ios::fmtflags f(os.flags());
35
5.44k
  if ((value.count() != count &&
36
210
       (value.count() < (count + ignoredcount) || value.count() > (count + ignoredcountmax))) ||
37
210
      count > 4) {
38
210
    return printValue(os, value, metadata);
39
210
  }
40
5.23k
  uint32_t l = 0;
41
19.7k
  for (int c = 0; c < count; ++c) {
42
15.0k
    if (value.toInt64(c) < 0 || value.toInt64(c) > 255) {
43
598
      return printValue(os, value, metadata);
44
598
    }
45
14.4k
    l += (value.toUint32(c) << ((count - c - 1) * 8));
46
14.4k
  }
47
48
4.64k
  if (auto td = Exiv2::find(array, l)) {
49
4.20k
    os << _(td->label_);
50
4.20k
  } else {
51
436
    os << _("Unknown") << " (0x" << std::setw(2 * count) << std::setfill('0') << std::hex << l << std::dec << ")";
52
436
  }
53
54
4.64k
  os.flags(f);
55
4.64k
  return os;
56
5.23k
}
pentaxmn_int.cpp:_ZN5Exiv28InternalL13printCombiTagILm20ETnRAT__KNS0_10TagDetailsEL_ZNS0_L15pentaxDriveModeEELi4ELi0ELi0EEERNSt3__113basic_ostreamIcNS6_11char_traitsIcEEEESB_RKNS_5ValueEPKNS_8ExifDataE
Line
Count
Source
32
5.06k
static std::ostream& printCombiTag(std::ostream& os, const Value& value, const ExifData* metadata) {
33
5.06k
  static_assert(N > 0, "Passed zero length printCombiTag");
34
5.06k
  std::ios::fmtflags f(os.flags());
35
5.06k
  if ((value.count() != count &&
36
256
       (value.count() < (count + ignoredcount) || value.count() > (count + ignoredcountmax))) ||
37
256
      count > 4) {
38
256
    return printValue(os, value, metadata);
39
256
  }
40
4.80k
  uint32_t l = 0;
41
18.7k
  for (int c = 0; c < count; ++c) {
42
16.0k
    if (value.toInt64(c) < 0 || value.toInt64(c) > 255) {
43
2.09k
      return printValue(os, value, metadata);
44
2.09k
    }
45
13.9k
    l += (value.toUint32(c) << ((count - c - 1) * 8));
46
13.9k
  }
47
48
2.71k
  if (auto td = Exiv2::find(array, l)) {
49
2.20k
    os << _(td->label_);
50
2.20k
  } else {
51
504
    os << _("Unknown") << " (0x" << std::setw(2 * count) << std::setfill('0') << std::hex << l << std::dec << ")";
52
504
  }
53
54
2.71k
  os.flags(f);
55
2.71k
  return os;
56
4.80k
}
pentaxmn_int.cpp:_ZN5Exiv28InternalL13printCombiTagILm2ETnRAT__KNS0_10TagDetailsEL_ZNS0_L27pentaxDynamicRangeExpansionEELi4ELi0ELi0EEERNSt3__113basic_ostreamIcNS6_11char_traitsIcEEEESB_RKNS_5ValueEPKNS_8ExifDataE
Line
Count
Source
32
1.33k
static std::ostream& printCombiTag(std::ostream& os, const Value& value, const ExifData* metadata) {
33
1.33k
  static_assert(N > 0, "Passed zero length printCombiTag");
34
1.33k
  std::ios::fmtflags f(os.flags());
35
1.33k
  if ((value.count() != count &&
36
150
       (value.count() < (count + ignoredcount) || value.count() > (count + ignoredcountmax))) ||
37
150
      count > 4) {
38
150
    return printValue(os, value, metadata);
39
150
  }
40
1.18k
  uint32_t l = 0;
41
3.35k
  for (int c = 0; c < count; ++c) {
42
3.11k
    if (value.toInt64(c) < 0 || value.toInt64(c) > 255) {
43
944
      return printValue(os, value, metadata);
44
944
    }
45
2.17k
    l += (value.toUint32(c) << ((count - c - 1) * 8));
46
2.17k
  }
47
48
238
  if (auto td = Exiv2::find(array, l)) {
49
98
    os << _(td->label_);
50
140
  } else {
51
140
    os << _("Unknown") << " (0x" << std::setw(2 * count) << std::setfill('0') << std::hex << l << std::dec << ")";
52
140
  }
53
54
238
  os.flags(f);
55
238
  return os;
56
1.18k
}
57
58
//! Shortcut for the printCombiTag template which requires typing the array name only once.
59
#define EXV_PRINT_COMBITAG(array, count, ignoredcount) \
60
  printCombiTag<std::size(array), array, count, ignoredcount, ignoredcount>
61
//! Shortcut for the printCombiTag template which requires typing the array name only once.
62
#define EXV_PRINT_COMBITAG_MULTI(array, count, ignoredcount, ignoredcountmax) \
63
1.51k
  printCombiTag<std::size(array), array, count, ignoredcount, ignoredcountmax>
64
65
//! ShootingMode, tag 0x0001
66
constexpr TagDetails pentaxShootingMode[] = {
67
    {0, N_("Auto")},
68
    {1, N_("Night-Scene")},
69
    {2, N_("Manual")},
70
};
71
72
//! CameraModel, tag 0x0005
73
constexpr TagDetails pentaxModel[] = {
74
    {0x0000d, "Optio 330/430"},
75
    {0x12926, "Optio 230"},
76
    {0x12958, "Optio 330GS"},
77
    {0x12962, "Optio 450/550"},
78
    {0x1296c, "Optio S"},
79
    {0x12971, "Optio S V1.01"},
80
    {0x12994, "*ist D"},
81
    {0x129b2, "Optio 33L"},
82
    {0x129bc, "Optio 33LF"},
83
    {0x129c6, "Optio 33WR/43WR/555"},
84
    {0x129d5, "Optio S4"},
85
    {0x12a02, "Optio MX"},
86
    {0x12a0c, "Optio S40"},
87
    {0x12a16, "Optio S4i"},
88
    {0x12a34, "Optio 30"},
89
    {0x12a52, "Optio S30"},
90
    {0x12a66, "Optio 750Z"},
91
    {0x12a70, "Optio SV"},
92
    {0x12a75, "Optio SVi"},
93
    {0x12a7a, "Optio X"},
94
    {0x12a8e, "Optio S5i"},
95
    {0x12a98, "Optio S50"},
96
    {0x12aa2, "*ist DS"},
97
    {0x12ab6, "Optio MX4"},
98
    {0x12ac0, "Optio S5n"},
99
    {0x12aca, "Optio WP"},
100
    {0x12afc, "Optio S55"},
101
    {0x12b10, "Optio S5z"},
102
    {0x12b1a, "*ist DL"},
103
    {0x12b24, "Optio S60"},
104
    {0x12b2e, "Optio S45"},
105
    {0x12b38, "Optio S6"},
106
    {0x12b4c, "Optio WPi"},
107
    {0x12b56, "BenQ DC X600"},
108
    {0x12b60, "*ist DS2"},
109
    {0x12b62, "Samsung GX-1S"},
110
    {0x12b6a, "Optio A10"},
111
    {0x12b7e, "*ist DL2"},
112
    {0x12b80, "Samsung GX-1L"},
113
    {0x12b9c, "K100D"},
114
    {0x12b9d, "K110D"},
115
    {0x12ba2, "K100D Super"},
116
    {0x12bb0, "Optio T10/T20"},
117
    {0x12be2, "Optio W10"},
118
    {0x12bf6, "Optio M10"},
119
    {0x12c1e, "K10D"},
120
    {0x12c20, "Samsung GX10"},
121
    {0x12c28, "Optio S7"},
122
    {0x12c2d, "Optio L20"},
123
    {0x12c32, "Optio M20"},
124
    {0x12c3c, "Optio W20"},
125
    {0x12c46, "Optio A20"},
126
    {0x12c78, "Optio E30"},
127
    {0x12c7d, "Optio E35"},
128
    {0x12c82, "Optio T30"},
129
    {0x12c8c, "Optio M30"},
130
    {0x12c91, "Optio L30"},
131
    {0x12c96, "Optio W30"},
132
    {0x12ca0, "Optio A30"},
133
    {0x12cb4, "Optio E40"},
134
    {0x12cbe, "Optio M40"},
135
    {0x12cc3, "Optio L40"},
136
    {0x12cc5, "Optio L36"},
137
    {0x12cc8, "Optio Z10"},
138
    {0x12cd2, "K20D"},
139
    {0x12cd4, "Samsung GX20"},
140
    {0x12cdc, "Optio S10"},
141
    {0x12ce6, "Optio A40"},
142
    {0x12cf0, "Optio V10"},
143
    {0x12cfa, "K200D"},
144
    {0x12d04, "Optio S12"},
145
    {0x12d0e, "Optio E50"},
146
    {0x12d18, "Optio M50"},
147
    {0x12d22, "Optio L50"},
148
    {0x12d2c, "Optio V20"},
149
    {0x12d40, "Optio W60"},
150
    {0x12d4a, "Optio M60"},
151
    {0x12d68, "Optio E60/M90"},
152
    {0x12d72, "K2000"},
153
    {0x12d73, "K-m"},
154
    {0x12d86, "Optio P70"},
155
    {0x12d90, "Optio L70"},
156
    {0x12d9a, "Optio E70"},
157
    {0x12dae, "X70"},
158
    {0x12db8, "K-7"},
159
    {0x12dcc, "Optio W80"},
160
    {0x12dea, "Optio P80"},
161
    {0x12df4, "Optio WS80"},
162
    {0x12dfe, "K-x"},
163
    {0x12e08, "645D"},
164
    {0x12e12, "Optio E80"},
165
    {0x12e30, "Optio W90"},
166
    {0x12e3a, "Optio I-10"},
167
    {0x12e44, "Optio H90"},
168
    {0x12e4e, "Optio E90"},
169
    {0x12e58, "X90"},
170
    {0x12e6c, "K-r"},
171
    {0x12e76, "K-5"},
172
    {0x12e8a, "Optio RS1000/RS1500"},
173
    {0x12e94, "Optio RZ10"},
174
    {0x12e9e, "Optio LS1000"},
175
    {0x12ebc, "Optio WG-1 GPS"},
176
    {0x12ed0, "Optio S1"},
177
    {0x12ee4, "Q"},
178
    {0x12ef8, "K-01"},
179
    {0x12f0c, "Optio RZ18"},
180
    {0x12f16, "Optio VS20"},
181
    {0x12f2a, "Optio WG-2 GPS"},
182
    {0x12f48, "Optio LS465"},
183
    {0x12f52, "K-30"},
184
    {0x12f5c, "X-5"},
185
    {0x12f66, "Q10"},
186
    {0x12f70, "K-5 II"},
187
    {0x12f71, "K-5 II s"},
188
    {0x12f7a, "Q7"},
189
    {0x12f84, "MX-1"},
190
    {0x12f8e, "WG-3 GPS"},
191
    {0x12f98, "WG-3"},
192
    {0x12fa2, "WG-10"},
193
    {0x12fb6, "K-50"},
194
    {0x12fc0, "K-3"},
195
    {0x12fca, "K-500"},
196
    {0x12fde, "WG-4 GPS"},
197
    {0x12fe8, "WG-4"},
198
    {0x13006, "WG-20"},
199
    {0x13010, "645Z"},
200
    {0x1301a, "K-S1"},
201
    {0x13024, "K-S2"},
202
    {0x1302e, "Q-S1"},
203
    {0x13056, "WG-30"},
204
    {0x1307e, "WG-30W"},
205
    {0x13088, "WG-5 GPS"},
206
    {0x13092, "K-1"},
207
    {0x1309c, "K-3 II"},
208
    {0x131f0, "WG-M2"},
209
    {0x1320e, "GR III"},
210
    {0x13222, "K-70"},
211
    {0x1322c, "KP"},
212
    {0x13240, "K-1 Mark II"},
213
    {0x13254, "K-3 Mark III"},
214
    {0x13290, "WG-70"},
215
    {0x1329a, "GR IIIx"},
216
    {0x132b8, "KF"},
217
    {0x132d6, "K-3 Mark III Monochrome"},
218
    {0x132e0, "GR IV"},
219
    {0x132e1, "GR IV HDF"},
220
    {0x13330, "GR IV Monochrome"},
221
};
222
223
//! Quality, tag 0x0008
224
constexpr TagDetails pentaxQuality[] = {
225
    {0, N_("Good")}, {1, N_("Better")},  {2, N_("Best")},    {3, N_("TIFF")},
226
    {4, N_("RAW")},  {5, N_("Premium")}, {65535, N_("n/a")},
227
};
228
229
//! Size, tag 0x0009
230
constexpr TagDetails pentaxSize[] = {
231
    {0, "640x480"},
232
    {1, N_("Full")},
233
    {2, "1024x768"},
234
    {3, "1280x960"},
235
    {4, "1600x1200"},
236
    {5, "2048x1536"},
237
    {8, N_("2560x1920 or 2304x1728")},
238
    {9, "3072x2304"},
239
    {10, "3264x2448"},
240
    {19, "320x240"},
241
    {20, "2288x1712"},
242
    {21, "2592x1944"},
243
    {22, N_("2304x1728 or 2592x1944")},
244
    {23, "3056x2296"},
245
    {25, N_("2816x2212 or 2816x2112")},
246
    {27, "3648x2736"},
247
    {29, "4000x3000"},
248
    {30, "4288x3216"},
249
    {31, "4608x3456"},
250
    {129, "1920x1080"},
251
    {135, "4608x2592"},
252
    {257, "3216x3216"},
253
    // not sure what to do with these values:
254
    //    '0 0' = 2304x1728
255
    //    '4 0' = 1600x1200
256
    //    '5 0' = 2048x1536
257
    //    '8 0' = 2560x1920
258
    //    '32 2' = 960x640
259
    //    '33 2' = 1152x768
260
    //    '34 2' = 1536x1024
261
    //    '35 1' = 2400x1600
262
    //    '36 0' = 3008x2008 or 3040x2024
263
    //    '37 0' = 3008x2000
264
};
265
266
//! Flash, tag 0x000c
267
constexpr TagDetails pentaxFlash[] = {
268
    {0x000, N_("Auto, Did not fire")},
269
    {0x001, N_("Off, Did not fire")},
270
    {0x002, N_("Off, Did not fire")},
271
    {0x003, N_("Auto, Did not fire, Red-eye reduction")},
272
    {0x005, N_("On. Did not fire. Wireless (Master)")},
273
    {0x100, N_("Auto, Fired")},
274
    {0x102, N_("On, Fired")},
275
    {0x103, N_("Auto, Fired, Red-eye reduction")},
276
    {0x104, N_("On, Red-eye reduction")},
277
    {0x105, N_("On, Wireless (Master)")},
278
    {0x106, N_("On, Wireless (Control)")},
279
    {0x108, N_("On, Soft")},
280
    {0x109, N_("On, Slow-sync")},
281
    {0x10a, N_("On, Slow-sync, Red-eye reduction")},
282
    {0x10b, N_("On, Trailing-curtain Sync")},
283
    // exiftool recognises 2 values, the values here correspond with Value 0
284
};
285
286
//! Focus, tag 0x000d
287
constexpr TagDetails pentaxFocus[] = {
288
    {0, N_("Normal")},
289
    {1, N_("Macro")},
290
    {2, N_("Infinity")},
291
    {3, N_("Manual")},
292
    {4, N_("Super Macro")},
293
    {5, N_("Pan Focus")},
294
    {16, N_("AF-S")},
295
    {17, N_("AF-C")},
296
    {18, N_("AF-A")},
297
    {32, N_("Contrast-detect")},
298
    {33, N_("Tracking Contrast-detect")},
299
    {288, N_("Face Detect")},
300
};
301
302
//! AFPoint, tag 0x000e
303
constexpr TagDetails pentaxAFPoint[] = {
304
    {0xffff, N_("Auto")},
305
    {0xfffe, N_("Fixed Center")},
306
    {0xfffd, N_("Automatic Tracking AF")},
307
    {0xfffc, N_("Face Recognition AF")},
308
    {0xfffb, N_("AF Select")},
309
    {0, N_("None")},
310
    {1, N_("Upper-left")},
311
    {2, N_("Top")},
312
    {3, N_("Upper-right")},
313
    {4, N_("Left")},
314
    {5, N_("Mid-left")},
315
    {6, N_("Center")},
316
    {7, N_("Mid-right")},
317
    {8, N_("Right")},
318
    {9, N_("Lower-left")},
319
    {10, N_("Bottom")},
320
    {11, N_("Lower-right")},
321
};
322
323
//! AFPointInFocus, tag 0x000f
324
constexpr TagDetails pentaxAFPointFocus[] = {
325
    {0xffff, N_("None")},    {0, N_("Fixed Center or multiple")},
326
    {1, N_("Top-left")},     {2, N_("Top-center")},
327
    {3, N_("Top-right")},    {4, N_("Left")},
328
    {5, N_("Center")},       {6, N_("Right")},
329
    {7, N_("Bottom-left")},  {8, N_("Bottom-center")},
330
    {9, N_("Bottom-right")},
331
};
332
333
//! ISO, tag 0x0014
334
constexpr TagDetails pentaxISO[] = {
335
    {3, "50"},
336
    {4, "64"},
337
    {5, "80"},
338
    {6, "100"},
339
    {7, "125"},
340
    {8, "160"},
341
    {9, "200"},
342
    {10, "250"},
343
    {11, "320"},
344
    {12, "400"},
345
    {13, "500"},
346
    {14, "640"},
347
    {15, "800"},
348
    {16, "1000"},
349
    {17, "1250"},
350
    {18, "1600"},
351
    {19, "2000"},
352
    {20, "2500"},
353
    {21, "3200"},
354
    {22, "4000"},
355
    {23, "5000"},
356
    {24, "6400"},
357
    {25, "8000"},
358
    {26, "10000"},
359
    {27, "12800"},
360
    {28, "16000"},
361
    {29, "20000"},
362
    {30, "25600"},
363
    {31, "32000"},
364
    {32, "40000"},
365
    {33, "51200"},
366
    {34, "64000"},
367
    {35, "80000"},
368
    {36, "102400"},
369
    {37, "128000"},
370
    {38, "160000"},
371
    {39, "204800"},
372
    {40, "256000"},
373
    {41, "320000"},
374
    {42, "409600"},
375
    {43, "512000"},
376
    {44, "640000"},
377
    {45, "819200"},
378
    {50, "50"},
379
    {100, "100"},
380
    {200, "200"},
381
    //        {    268, "200" },
382
    {400, "400"},
383
    {800, "800"},
384
    {1600, "1600"},
385
    {3200, "3200"},
386
    {258, "50"},
387
    {259, "70"},
388
    {260, "100"},
389
    {261, "140"},
390
    {262, "200"},
391
    {263, "280"},
392
    {264, "400"},
393
    {265, "560"},
394
    {266, "800"},
395
    {267, "1100"},
396
    {268, "1600"},
397
    {269, "2200"},
398
    {270, "3200"},
399
    {271, "4500"},
400
    {272, "6400"},
401
    {273, "9000"},
402
    {274, "12800"},
403
    {275, "18000"},
404
    {276, "25600"},
405
    {277, "36000"},
406
    {278, "51200"},
407
    {279, "72000"},
408
    {280, "102400"},
409
    {281, "144000"},
410
    {282, "204800"},
411
    {283, "288000"},
412
    {284, "409600"},
413
    {285, "576000"},
414
    {286, "819200"},
415
};
416
417
//! Generic for Off/On switches
418
constexpr TagDetails pentaxOffOn[] = {
419
    {0, N_("Off")},
420
    {1, N_("On")},
421
};
422
423
//! Generic for Yes/No switches
424
constexpr TagDetails pentaxYesNo[] = {
425
    {0, N_("No")},
426
    {1, N_("Yes")},
427
};
428
429
//! MeteringMode, tag 0x0017
430
constexpr TagDetails pentaxMeteringMode[] = {
431
    {0, N_("Multi Segment")},
432
    {1, N_("Center Weighted")},
433
    {2, N_("Spot")},
434
};
435
436
//! WhiteBalance, tag 0x0019
437
constexpr TagDetails pentaxWhiteBalance[] = {
438
    {0, N_("Auto")},
439
    {1, N_("Daylight")},
440
    {2, N_("Shade")},
441
    {3, N_("Fluorescent")},
442
    {4, N_("Tungsten")},
443
    {5, N_("Manual")},
444
    {6, N_("DaylightFluorescent")},
445
    {7, N_("DaywhiteFluorescent")},
446
    {8, N_("WhiteFluorescent")},
447
    {9, N_("Flash")},
448
    {10, N_("Cloudy")},
449
    {15, N_("Color Temperature Enhancement")},
450
    {17, N_("Kelvin")},
451
    {65534, N_("Unknown")},
452
    {65535, N_("User Selected")},
453
};
454
455
//! WhiteBalance, tag 0x001a
456
constexpr TagDetails pentaxWhiteBalanceMode[] = {
457
    {1, N_("Auto (Daylight)")},
458
    {2, N_("Auto (Shade)")},
459
    {3, N_("Auto (Flash)")},
460
    {4, N_("Auto (Tungsten)")},
461
    {6, N_("Auto (DaylightFluorescent)")},
462
    {7, N_("Auto (DaywhiteFluorescent)")},
463
    {8, N_("Auto (WhiteFluorescent)")},
464
    {10, N_("Auto (Cloudy)")},
465
    {0xffff, N_("User-Selected")},
466
    {0xfffe, N_("Preset (Fireworks?)")},
467
};
468
469
//! Saturation, tag 0x001f
470
constexpr TagDetails pentaxSaturation[] = {
471
    {0, N_("Low")},      {1, N_("Normal")},    {2, N_("High")}, {3, N_("Med Low")}, {4, N_("Med High")},
472
    {5, N_("Very Low")}, {6, N_("Very High")}, {7, N_("-4")},   {8, N_("+4")},      {65535, N_("None")},
473
};
474
475
//! Contrast, tag 0x0020
476
constexpr TagDetails pentaxContrast[] = {
477
    {0, N_("Low")},      {1, N_("Normal")},    {2, N_("High")}, {3, N_("Med Low")}, {4, N_("Med High")},
478
    {5, N_("Very Low")}, {6, N_("Very High")}, {7, N_("-4")},   {8, N_("+4")},
479
};
480
481
//! Sharpness, tag 0x0021
482
constexpr TagDetails pentaxSharpness[] = {
483
    {0, N_("Soft")},      {1, N_("Normal")},    {2, N_("Hard")}, {3, N_("Med Soft")}, {4, N_("Med Hard")},
484
    {5, N_("Very Soft")}, {6, N_("Very Hard")}, {7, N_("-4")},   {8, N_("+4")},
485
};
486
487
//! Location, tag 0x0022
488
constexpr TagDetails pentaxLocation[] = {
489
    {0, N_("Home town")},
490
    {1, N_("Destination")},
491
};
492
493
//! City names, tags 0x0023 and 0x0024
494
constexpr TagDetails pentaxCities[] = {
495
    {0, N_("Pago Pago")},     {1, N_("Honolulu")},      {2, N_("Anchorage")},       {3, N_("Vancouver")},
496
    {4, N_("San Fransisco")}, {5, N_("Los Angeles")},   {6, N_("Calgary")},         {7, N_("Denver")},
497
    {8, N_("Mexico City")},   {9, N_("Chicago")},       {10, N_("Miami")},          {11, N_("Toronto")},
498
    {12, N_("New York")},     {13, N_("Santiago")},     {14, N_("Caracus")},        {15, N_("Halifax")},
499
    {16, N_("Buenos Aires")}, {17, N_("Sao Paulo")},    {18, N_("Rio de Janeiro")}, {19, N_("Madrid")},
500
    {20, N_("London")},       {21, N_("Paris")},        {22, N_("Milan")},          {23, N_("Rome")},
501
    {24, N_("Berlin")},       {25, N_("Johannesburg")}, {26, N_("Istanbul")},       {27, N_("Cairo")},
502
    {28, N_("Jerusalem")},    {29, N_("Moscow")},       {30, N_("Jeddah")},         {31, N_("Tehran")},
503
    {32, N_("Dubai")},        {33, N_("Karachi")},      {34, N_("Kabul")},          {35, N_("Male")},
504
    {36, N_("Delhi")},        {37, N_("Colombo")},      {38, N_("Kathmandu")},      {39, N_("Dacca")},
505
    {40, N_("Yangon")},       {41, N_("Bangkok")},      {42, N_("Kuala Lumpur")},   {43, N_("Vientiane")},
506
    {44, N_("Singapore")},    {45, N_("Phnom Penh")},   {46, N_("Ho Chi Minh")},    {47, N_("Jakarta")},
507
    {48, N_("Hong Kong")},    {49, N_("Perth")},        {50, N_("Beijing")},        {51, N_("Shanghai")},
508
    {52, N_("Manila")},       {53, N_("Taipei")},       {54, N_("Seoul")},          {55, N_("Adelaide")},
509
    {56, N_("Tokyo")},        {57, N_("Guam")},         {58, N_("Sydney")},         {59, N_("Noumea")},
510
    {60, N_("Wellington")},   {61, N_("Auckland")},     {62, N_("Lima")},           {63, N_("Dakar")},
511
    {64, N_("Algiers")},      {65, N_("Helsinki")},     {66, N_("Athens")},         {67, N_("Nairobi")},
512
    {68, N_("Amsterdam")},    {69, N_("Stockholm")},    {70, N_("Lisbon")},         {71, N_("Copenhagen")},
513
    {72, N_("Warsaw")},       {73, N_("Prague")},       {74, N_("Budapest")},
514
};
515
516
//! ImageProcessing, combi-tag 0x0032 (4 bytes)
517
constexpr TagDetails pentaxImageProcessing[] = {
518
    {0x00000000, N_("Unprocessed")},      {0x00000004, N_("Digital Filter")}, {0x01000000, N_("Resized")},
519
    {0x02000000, N_("Cropped")},          {0x04000000, N_("Color Filter")},   {0x06000000, N_("Digital Filter 6")},
520
    {0x10000000, N_("Frame Synthesis?")},
521
};
522
523
//! PictureMode, combi-tag 0x0033 (3 bytes)
524
constexpr TagDetails pentaxPictureMode[] = {
525
    {0x000000, N_("Program")},
526
    {0x000100, N_("Hi-speed Program")},
527
    {0x000200, N_("DOF Program")},
528
    {0x000300, N_("MTF Program")},
529
    {0x000400, N_("Standard")},
530
    {0x000500, N_("Portrait")},
531
    {0x000600, N_("Landscape")},
532
    {0x000700, N_("Macro")},
533
    {0x000800, N_("Sport")},
534
    {0x000900, N_("Night Scene Portrait")},
535
    {0x000a00, N_("No Flash")},
536
    /* SCN modes (menu-selected) */
537
    {0x000b00, N_("Night Scene")},
538
    {0x000c00, N_("Surf & Snow")},
539
    {0x000d00, N_("Text")},
540
    {0x000e00, N_("Sunset")},
541
    {0x000f00, N_("Kids")},
542
    {0x001000, N_("Pet")},
543
    {0x001100, N_("Candlelight")},
544
    {0x001200, N_("Museum")},
545
    {0x001300, N_("Food")},
546
    {0x001400, N_("Stage Lighting")},
547
    {0x001500, N_("Night Snap")},
548
    {0x001700, N_("Blue Sky")},
549
    {0x001800, N_("Sunset")},
550
    {0x001a00, N_("Night Scene HDR")},
551
    {0x001b00, N_("HDR")},
552
    {0x001c00, N_("Quick Macro")},
553
    {0x001d00, N_("Forest")},
554
    {0x001e00, N_("Backlight Silhouette")},
555
    /* AUTO PICT modes (auto-selected) */
556
    {0x010400, N_("Auto PICT (Standard)")},
557
    {0x010500, N_("Auto PICT (Portrait)")},
558
    {0x010600, N_("Auto PICT (Landscape)")},
559
    {0x010700, N_("Auto PICT (Macro)")},
560
    {0x010800, N_("Auto PICT (Sport)")},
561
    /* Manual dial modes */
562
    {0x020000, N_("Program AE")},
563
    {0x030000, N_("Green Mode")},
564
    {0x040000, N_("Shutter Speed Priority")},
565
    {0x050000, N_("Aperture Priority")},
566
    {0x080000, N_("Manual")},
567
    {0x090000, N_("Bulb")},
568
    /* *istD modes */
569
    {0x020001, N_("Program AE")},
570
    {0x020101, N_("Hi-speed Program")},
571
    {0x020201, N_("DOF Program")},
572
    {0x020301, N_("MTF Program")},
573
    {0x021601, N_("Shallow DOF")},
574
    {0x030001, N_("Green Mode")},
575
    {0x040001, N_("Shutter Speed Priority")},
576
    {0x050001, N_("Aperture Priority")},
577
    {0x060001, N_("Program Tv Shift")},
578
    {0x070001, N_("Program Av Shift")},
579
    {0x080001, N_("Manual")},
580
    {0x090001, N_("Bulb")},
581
    {0x0a0001, N_("Aperture Priority (Off-Auto-Aperture)")},
582
    {0x0b0001, N_("Manual (Off-Auto-Aperture)")},
583
    {0x0c0001, N_("Bulb (Off-Auto-Aperture)")},
584
    /* K10D modes */
585
    {0x060000, N_("Shutter Priority")},
586
    {0x0d0000, N_("Shutter & Aperture Priority AE")},
587
    {0x0d0001, N_("Shutter & Aperture Priority AE (1)")},
588
    {0x0f0000, N_("Sensitivity Priority AE")},
589
    {0x0f0001, N_("Sensitivity Priority AE (1)")},
590
    {0x100000, N_("Flash X-Sync Speed AE")},
591
    {0x100001, N_("Flash X-Sync Speed AE (1)")},
592
    {0x120001, N_("Auto Program (Normal)")},
593
    {0x120101, N_("Auto Program (Hi-Speed)")},
594
    {0x120201, N_("Auto Program (DOF)")},
595
    {0x120301, N_("Auto Program (MTF)")},
596
    {0x121601, N_("Auto Program (Shallow DOF)")},
597
    {0x141601, N_("Blur control")},
598
    /* other modes */
599
    {0x000001, N_("Program")},
600
    {0xfe0000, N_("Video (30 fps)")},
601
    {0xff0004, N_("Video (24 fps)")},
602
};
603
604
//! DriveMode, combi-tag 0x0034 (4 bytes)
605
constexpr TagDetails pentaxDriveMode[] = {
606
    {0x00000000, N_("Single-frame")},
607
    {0x01000000, N_("Continuous")},
608
    {0x02000000, N_("Continuous (Hi)")},
609
    {0x03000000, N_("Burst")},
610
    {0xff000000, N_("Video")},
611
    {0x00100000, N_("Single-frame")}, /* on 645D */
612
    {0x00010000, N_("Self-timer (12 sec)")},
613
    {0x00020000, N_("Self-timer (2 sec)")},
614
    {0x000f0000, N_("Video")},
615
    {0x00100000, N_("Mirror Lock-up")},
616
    {0x00000100, N_("Remote Control (3 sec)")},
617
    {0x00000200, N_("Remote Control")},
618
    {0x00000400, N_("Remote Continuous Shooting")},
619
    {0x00000001, N_("Multiple Exposure")},
620
    {0x00000010, N_("HDR")},
621
    {0x00000020, N_("HDR Strong 1")},
622
    {0x00000030, N_("HDR Strong 2")},
623
    {0x00000040, N_("HDR Strong 3")},
624
    {0x000000e0, N_("HDR Auto")},
625
    {0x000000ff, N_("Video")},
626
};
627
628
//! ColorSpace, tag 0x0037
629
constexpr TagDetails pentaxColorSpace[] = {
630
    {0, N_("sRGB")},
631
    {1, N_("Adobe RGB")},
632
};
633
634
//! LensType, combi-tag 0x003f (2 unsigned long)
635
constexpr TagDetails pentaxLensType[] = {
636
    {0x0000, N_("M-42 or No Lens")},
637
    {0x0100, N_("K or M Lens")},
638
    {0x0200, N_("A Series Lens")},
639
    {0x0300, "Sigma Lens"},
640
    {0x0311, "smc PENTAX-FA SOFT 85mm F2.8"},
641
    {0x0312, "smc PENTAX-F 1.7X AF ADAPTER"},
642
    {0x0313, "smc PENTAX-F 24-50mm F4"},
643
    {0x0314, "smc PENTAX-F 35-80mm F4-5.6"},
644
    {0x0315, "smc PENTAX-F 80-200mm F4.7-5.6"},
645
    {0x0316, "smc PENTAX-F FISH-EYE 17-28mm F3.5-4.5"},
646
    {0x0317, "smc PENTAX-F 100-300mm F4.5-5.6"},         // 0
647
    {0x0317, "Sigma AF 28-300mm F3.5-6.3 DG IF Macro"},  // 1
648
    {0x0317, "Tokina 80-200mm F2.8 ATX-Pro"},            // 2
649
    {0x0318, "smc PENTAX-F 35-135mm F3.5-4.5"},
650
    {0x0319, "smc PENTAX-F 35-105mm F4-5.6"},            // 0
651
    {0x0319, "Sigma AF 28-300mm F3.5-5.6 DL IF"},        // 1
652
    {0x0319, "Sigma 55-200mm F4-5.6 DC"},                // 2
653
    {0x0319, "Sigma AF 28-300mm F3.5-5.6 DL IF"},        // 3
654
    {0x0319, "Sigma AF 28-300mm F3.5-6.3 DG IF Macro"},  // 4
655
    {0x0319, "Tokina 80-200mm F2.8 ATX-Pro"},            // 5
656
    {0x0319, "Sigma Zoom 70-210mm F4-5.6 UC-II"},        // 6
657
    {0x031a, "smc PENTAX-F* 250-600mm F5.6 ED[IF]"},
658
    {0x031b, "smc PENTAX-F 28-80mm F3.5-4.5"},        // 0
659
    {0x031b, "Tokina AT-X Pro AF 28-70mm F2.6-2.8"},  // 1
660
    {0x031c, "smc PENTAX-F 35-70mm F3.5-4.5"},        // 0
661
    {0x031c, "Tokina 19-35mm F3.5-4.5 AF"},           // 1
662
    {0x031c, "Tokina AT-X AF 400mm F5.6"},            // 2
663
    {0x031d, "PENTAX-F 28-80mm F3.5-4.5"},            // 0
664
    {0x031d, "Sigma AF 18-125mm F3.5-5.6 DC"},        // 1
665
    {0x031d, "Tokina AT-X PRO 28-70mm F2.6-2.8"},     // 2
666
    {0x031e, "PENTAX-F 70-200mm F4-5.6"},
667
    {0x031f, "smc PENTAX-F 70-210mm F4-5.6"},     // 0
668
    {0x031f, "Tokina AF 730 75-300mm F4.5-5.6"},  // 1
669
    {0x031f, "Takumar-F 70-210mm F4-5.6"},        // 2
670
    {0x0320, "smc PENTAX-F 50mm F1.4"},
671
    {0x0321, "smc PENTAX-F 50mm F1.7"},
672
    {0x0322, "smc PENTAX-F 135mm F2.8 [IF]"},
673
    {0x0323, "smc PENTAX-F 28mm F2.8"},
674
    {0x0324, "Sigma 20mm F1.8 EX DG Aspherical RF"},
675
    {0x0326, "smc PENTAX-F* 300mm F4.5 ED[IF]"},
676
    {0x0327, "smc PENTAX-F* 600mm F4 ED[IF]"},
677
    {0x0328, "smc PENTAX-F Macro 100mm F2.8"},
678
    {0x0329, "smc PENTAX-F Macro 50mm F2.8"},  // 0
679
    {0x0329, "Sigma 50mm F2.8 Macro"},         // 1
680
    {0x032a, "Sigma 300mm F2.8 EX DG APO IF"},
681
    {0x032c, "Tamron 35-90mm F4 AF"},                          // 0
682
    {0x032c, "Sigma AF 10-20mm F4-5.6 EX DC"},                 // 1
683
    {0x032c, "Sigma 12-24mm F4.5-5.6 EX DG"},                  // 2
684
    {0x032c, "Sigma 17-70mm F2.8-4.5 DC Macro"},               // 3
685
    {0x032c, "Sigma 18-50mm F3.5-5.6 DC"},                     // 4
686
    {0x032c, "Sigma 17-35mm F2.8-4 EX DG"},                    // 5
687
    {0x032c, "Sigma AF 18-35mm F3.5-4.5 Aspherical"},          // 6
688
    {0x032e, "Sigma or Samsung Lens"},                         // 0
689
    {0x032e, "Sigma APO 70-200mm F2.8 EX"},                    // 1
690
    {0x032e, "Sigma EX APO 100-300mm F4 IF"},                  // 2
691
    {0x032e, "Samsung/Schneider D-XENON 50-200mm F4-5.6 ED"},  // 3
692
    {0x032e, "Tokina AT-X AF SD 80-400mm f/4.5-5.6"},          // 4
693
    {0x0332, "smc PENTAX-FA 28-70mm F4 AL"},
694
    {0x0333, "Sigma 28mm F1.8 EX DG Aspherical Macro"},
695
    {0x0334, "smc PENTAX-FA 28-200mm F3.8-5.6 AL[IF]"},                 // 0
696
    {0x0334, "Tamron AF LD 28-200mm F3.8-5.6 [IF] Aspherical (171D)"},  // 1
697
    {0x0335, "smc PENTAX-FA 28-80mm F3.5-5.6 AL"},
698
    {0x03f7, "smc PENTAX-DA FISH-EYE 10-17mm F3.5-4.5 ED[IF]"},
699
    {0x03f8, "smc PENTAX-DA 12-24mm F4 ED AL[IF]"},
700
    {0x03fa, "smc PENTAX-DA 50-200mm F4-5.6 ED"},
701
    {0x03fb, "smc PENTAX-DA 40mm F2.8 Limited"},
702
    {0x03fc, "smc PENTAX-DA 18-55mm F3.5-5.6 AL"},
703
    {0x03fd, "smc PENTAX-DA 14mm F2.8 ED[IF]"},
704
    {0x03fe, "smc PENTAX-DA 16-45mm F4 ED AL"},
705
    {0x03ff, "Sigma Lens"},                             // 0
706
    {0x03ff, "Sigma 18-200mm F3.5-6.3 DC"},             // 1
707
    {0x03ff, "Sigma DL-II 35-80mm F4-5.6"},             // 2
708
    {0x03ff, "Sigma DL Zoom 75-300mm F4-5.6"},          // 3
709
    {0x03ff, "Sigma DF EX Aspherical 28-70mm F2.8"},    // 4
710
    {0x03ff, "Sigma AF Tele 400mm F5.6 Multi-coated"},  // 5
711
    {0x03ff, "Sigma 24-60mm F2.8 EX DG"},               // 6
712
    {0x03ff, "Sigma 70-300mm F4-5.6 Macro"},            // 7
713
    {0x03ff, "Sigma 55-200mm F4-5.6 DC"},               // 8
714
    {0x03ff, "Sigma 18-50mm F2.8 EX DC"},               // 9
715
    {0x03ff, "Sigma 18-50mm F2.8 EX DC Macro"},         // 10
716
    {0x0401, "smc PENTAX-FA SOFT 28mm F2.8"},
717
    {0x0402, "smc PENTAX-FA 80-320mm F4.5-5.6"},
718
    {0x0403, "smc PENTAX-FA 43mm F1.9 Limited"},
719
    {0x0406, "smc PENTAX-FA 35-80mm F4-5.6"},
720
    {0x0407, "Irix 45mm F/1.4"},
721
    {0x0408, "Irix 150mm F/2.8 Macro"},
722
    {0x0409, "Irix 11mm F/4"},
723
    {0x040a, "Irix 15mm F/2.4"},
724
    {0x040c, "smc PENTAX-FA 50mm F1.4"},
725
    {0x040f, "smc PENTAX-FA 28-105mm F4-5.6 [IF]"},
726
    {0x0410, "Tamron AF 80-210mm F4-5.6 (178D)"},
727
    {0x0413, "Tamron SP AF 90mm F2.8 (172E)"},
728
    {0x0414, "smc PENTAX-FA 28-80mm F3.5-5.6"},
729
    {0x0415, "Cosina AF 100-300mm F5.6-6.7"},
730
    {0x0416, "Tokina 28-80mm F3.5-5.6"},
731
    {0x0417, "smc PENTAX-FA 20-35mm F4 AL"},
732
    {0x0418, "smc PENTAX-FA 77mm F1.8 Limited"},
733
    {0x0419, "Tamron SP AF 14mm F2.8"},
734
    {0x041a, "smc PENTAX-FA Macro 100mm F3.5"},  // 0
735
    {0x041a, "Cosina 100mm F3.5 Macro"},         // 1
736
    {0x041b, "Tamron AF28-300mm F/3.5-6.3 LD Aspherical[IF] Macro (185D/285D)"},
737
    {0x041c, "smc PENTAX-FA 35mm F2 AL"},
738
    {0x041d, "Tamron AF 28-200mm F/3.8-5.6 LD Super II Macro (371D)"},
739
    {0x0422, "smc PENTAX-FA 24-90mm F3.5-4.5 AL[IF]"},
740
    {0x0423, "smc PENTAX-FA 100-300mm F4.7-5.8"},
741
    {0x0424, "Tamron AF 70-300mm F/4-5.6 LD Macro 1:2 (572D/A17)"},
742
    {0x0425, "Tamron SP AF 24-135mm F3.5-5.6 AD AL (190D)"},
743
    {0x0426, "smc PENTAX-FA 28-105mm F3.2-4.5 AL[IF]"},
744
    {0x0427, "smc PENTAX-FA 31mm F1.8AL Limited"},
745
    {0x0429, "Tamron AF 28-200mm Super Zoom F3.8-5.6 Aspherical XR [IF] Macro (A03)"},
746
    {0x042b, "smc PENTAX-FA 28-90mm F3.5-5.6"},
747
    {0x042c, "smc PENTAX-FA J 75-300mm F4.5-5.8 AL"},
748
    {0x042d, "Tamron Lens"},                                                 // 0
749
    {0x042d, "Tamron 28-300mm F3.5-6.3 Ultra zoom XR"},                      // 1
750
    {0x042d, "Tamron AF 28-300mm F3.5-6.3 XR Di LD Aspherical [IF] Macro"},  // 2
751
    {0x042e, "smc PENTAX-FA J 28-80mm F3.5-5.6 AL"},
752
    {0x042f, "smc PENTAX-FA J 18-35mm F4-5.6 AL"},
753
    {0x0431, "Tamron SP AF 28-75mm F2.8 XR Di LD Aspherical [IF] Macro (A09)"},
754
    {0x0433, "smc PENTAX-D FA 50mm F2.8 Macro"},
755
    {0x0434, "smc PENTAX-D FA 100mm F2.8 Macro"},
756
    {0x0437, "Samsung/Schneider D-XENOGON 35mm F2"},
757
    {0x0438, "Samsung/Schneider D-XENON 100mm F2.8 Macro"},
758
    {0x044b, "Tamron SP AF 70-200mm F2.8 Di LD [IF] Macro (A001)"},
759
    {0x04d6, "smc PENTAX-DA 35mm F2.4 AL"},
760
    {0x04e5, "smc PENTAX-DA 18-55mm F3.5-5.6 AL II"},
761
    {0x04e6, "Tamron SP AF 17-50mm F2.8 XR Di II"},
762
    {0x04e7, "smc PENTAX-DA 18-250mm F3.5-6.3 ED AL [IF]"},
763
    {0x04ed, "Samsung/Schneider D-XENOGON 10-17mm F3.5-4.5"},
764
    {0x04ef, "Samsung/Schneider D-XENON 12-24mm F4 ED AL [IF]"},
765
    {0x04f2, "smc PENTAX-DA* 16-50mm F2.8 ED AL [IF] SDM (SDM unused)"},
766
    {0x04f3, "smc PENTAX-DA 70mm F2.4 Limited"},
767
    {0x04f4, "smc PENTAX-DA 21mm F3.2 AL Limited"},
768
    {0x04f5, "Samsung/Schneider D-XENON 50-200mm F4-5.6"},
769
    {0x04f6, "Samsung/Schneider D-XENON 18-55mm F3.5-5.6"},
770
    {0x04f7, "smc PENTAX-DA FISH-EYE 10-17mm F3.5-4.5 ED [IF]"},
771
    {0x04f8, "smc PENTAX-DA 12-24mm F4 ED AL [IF]"},
772
    {0x04f9, "Tamron XR DiII 18-200mm F3.5-6.3 (A14)"},
773
    {0x04fa, "smc PENTAX-DA 50-200mm F4-5.6 ED"},
774
    {0x04fb, "smc PENTAX-DA 40mm F2.8 Limited"},
775
    {0x04fc, "smc PENTAX-DA 18-55mm F3.5-5.6 AL"},
776
    {0x04fd, "smc PENTAX-DA 14mm F2.8 ED[IF]"},
777
    {0x04fe, "smc PENTAX-DA 16-45mm F4 ED AL"},
778
    {0x0501, "smc PENTAX-FA* 24mm F2 AL[IF]"},
779
    {0x0502, "smc PENTAX-FA 28mm F2.8 AL"},
780
    {0x0503, "smc PENTAX-FA 50mm F1.7"},
781
    {0x0504, "smc PENTAX-FA 50mm F1.4"},
782
    {0x0505, "smc PENTAX-FA* 600mm F4 ED[IF]"},
783
    {0x0506, "smc PENTAX-FA* 300mm F4.5 ED[IF]"},
784
    {0x0507, "smc PENTAX-FA 135mm F2.8 [IF]"},
785
    {0x0508, "smc PENTAX-FA Macro 50mm F2.8"},
786
    {0x0509, "smc PENTAX-FA Macro 100mm F2.8"},
787
    {0x050a, "smc PENTAX-FA* 85mm F1.4 [IF]"},
788
    {0x050b, "smc PENTAX-FA* 200mm F2.8 ED[IF]"},
789
    {0x050c, "smc PENTAX-FA 28-80mm F3.5-4.7"},
790
    {0x050d, "smc PENTAX-FA 70-200mm F4-5.6"},
791
    {0x050e, "smc PENTAX-FA* 250-600mm F5.6 ED[IF]"},
792
    {0x050f, "smc PENTAX-FA 28-105mm F4-5.6"},
793
    {0x0510, "smc PENTAX-FA 100-300mm F4.5-5.6"},
794
    {0x0562, "smc PENTAX-FA 100-300mm F4.5-5.6"},
795
    {0x0601, "smc PENTAX-FA* 85mm F1.4[IF]"},
796
    {0x0602, "smc PENTAX-FA* 200mm F2.8 ED[IF]"},
797
    {0x0603, "smc PENTAX-FA* 300mm F2.8 ED[IF]"},
798
    {0x0604, "smc PENTAX-FA* 28-70mm F2.8 AL"},
799
    {0x0605, "smc PENTAX-FA* 80-200mm F2.8 ED[IF]"},
800
    {0x0606, "smc PENTAX-FA* 28-70mm F2.8 AL"},
801
    {0x0607, "smc PENTAX-FA* 80-200mm F2.8 ED[IF]"},
802
    {0x0608, "smc PENTAX-FA 28-70mm F4AL"},
803
    {0x0609, "smc PENTAX-FA 20mm F2.8"},
804
    {0x060a, "smc PENTAX-FA* 400mm F5.6 ED[IF]"},
805
    {0x060d, "smc PENTAX-FA* 400mm F5.6 ED[IF]"},
806
    {0x060e, "smc PENTAX-FA* Macro 200mm F4 ED[IF]"},
807
    {0x0700, "smc PENTAX-DA 21mm F3.2 AL Limited"},
808
    {0x073a, "smc PENTAX-D FA Macro 100mm F2.8 WR"},
809
    {0x074b, "Tamron SP AF 70-200mm F2.8 Di LD [IF] Macro (A001)"},
810
    {0x07c9, "smc Pentax-DA L 50-200mm F4-5.6 ED WR"},
811
    {0x07ca, "smc PENTAX-DA L 18-55mm F3.5-5.6 AL WR"},
812
    {0x07cb, "HD PENTAX-DA 55-300mm F4-5.8 ED WR"},
813
    {0x07cc, "HD PENTAX-DA 15mm F4 ED AL Limited"},
814
    {0x07cd, "HD PENTAX-DA 35mm F2.8 Macro Limited"},
815
    {0x07ce, "HD PENTAX-DA 70mm F2.4 Limited"},
816
    {0x07cf, "HD PENTAX-DA 21mm F3.2 ED AL Limited"},
817
    {0x07d0, "HD PENTAX-DA 40mm F2.8 Limited"},
818
    {0x07d4, "smc PENTAX-DA 50mm F1.8"},
819
    {0x07d5, "smc PENTAX-DA 40mm F2.8 XS"},
820
    {0x07d6, "smc PENTAX-DA 35mm F2.4 AL"},
821
    {0x07d8, "smc PENTAX-DA L 55-300mm F4-5.8 ED"},
822
    {0x07d9, "smc PENTAX-DA 50-200mm F4-5.6 ED WR"},
823
    {0x07da, "smc PENTAX-DA 18-55mm F3.5-5.6 AL WR"},
824
    {0x07dc, "Tamron SP AF 10-24mm F3.5-4.5 Di II LD Aspherical [IF]"},
825
    {0x07dd, "smc PENTAX-DA L 50-200mm F4-5.6 ED"},
826
    {0x07de, "smc PENTAX-DA L 18-55mm F3.5-5.6"},
827
    {0x07df, "Samsung/Schneider D-XENON 18-55mm F3.5-5.6 II"},
828
    {0x07e0, "smc PENTAX-DA 15mm F4 ED AL Limited"},
829
    {0x07e1, "Samsung/Schneider D-XENON 18-250mm F3.5-6.3"},
830
    {0x07e2, "smc PENTAX-DA* 55mm F1.4 SDM (SDM unused)"},
831
    {0x07e3, "smc PENTAX-DA* 60-250mm F4 [IF] SDM (SDM unused)"},
832
    {0x07e4, "Samsung 16-45mm F4 ED"},
833
    {0x07e5, "smc PENTAX-DA 18-55mm F3.5-5.6 AL II"},
834
    {0x07e6, "Tamron AF 17-50mm F2.8 XR Di-II LD (Model A16)"},
835
    {0x07e7, "smc PENTAX-DA 18-250mm F3.5-6.3ED AL [IF]"},
836
    {0x07e9, "smc PENTAX-DA 35mm F2.8 Macro Limited"},
837
    {0x07ea, "smc PENTAX-DA* 300 mm F4ED [IF] SDM (SDM not used)"},
838
    {0x07eb, "smc PENTAX-DA* 200mm F2.8 ED [IF] SDM (SDM not used)"},
839
    {0x07ec, "smc PENTAX-DA 55-300mm F4-5.8 ED"},
840
    {0x07ee, "Tamron AF 18-250mm F3.5-6.3 Di II LD Aspherical [IF] Macro"},
841
    {0x07f1, "smc PENTAX-DA* 50-135mm F2.8 ED [IF] SDM (SDM not used)"},
842
    {0x07f2, "smc PENTAX-DA* 16-50mm F2.8 ED AL [IF] SDM (SDM not used)"},
843
    {0x07f3, "smc PENTAX-DA 70mm F2.4 Limited"},
844
    {0x07f4, "smc PENTAX-DA 21mm F3.2 AL Limited"},
845
    {0x0800, "Sigma 50-150mm F2.8 II APO EX DC HSM"},
846
    {0x0803, "Sigma AF 18-125mm F3.5-5.6 DC"},
847
    {0x0804, "Sigma 50mm F1.4 EX DG HSM"},
848
    {0x0807, "Sigma 24-70mm F2.8 IF EX DG HSM"},
849
    {0x0808, "Sigma 18-250mm F3.5-6.3 DC OS HSM"},
850
    {0x080b, "Sigma 10-20mm F3.5 EX DC HSM"},
851
    {0x080c, "Sigma 70-300mm F4-5.6 DG OS"},
852
    {0x080d, "Sigma 120-400mm F4.5-5.6 APO DG OS HSM"},
853
    {0x080e, "Sigma 17-70mm F2.8-4.0 DC Macro OS HSM"},
854
    {0x080f, "Sigma 150-500mm F5-6.3 APO DG OS HSM"},
855
    {0x0810, "Sigma 70-200mm F2.8 EX DG Macro HSM II"},
856
    {0x0811, "Sigma 50-500mm F4.5-6.3 DG OS HSM"},
857
    {0x0812, "Sigma 8-16mm F4.5-5.6 DC HSM"},
858
    {0x0815, "Sigma 17-50mm F2.8 EX DC OS HSM"},
859
    {0x0816, "Sigma 85mm F1.4 EX DG HSM"},
860
    {0x0817, "Sigma 70-200mm F2.8 APO EX DG OS HSM"},
861
    {0x0819, "Sigma 17-50mm F2.8 EX DC HSM"},
862
    {0x081b, "Sigma 18-200mm F3.5-6.3 II DC HSM"},
863
    {0x081c, "Sigma 18-250mm F3.5-6.3 DC Macro HSM"},
864
    {0x081d, "Sigma 35mm F1.4 DG HSM"},
865
    {0x081e, "Sigma 17-70mm F2.8-4 DC Macro HSM | C"},
866
    {0x081f, "Sigma 18-35mm F1.8 DC HSM"},
867
    {0x0820, "Sigma 30mm F1.4 DC HSM | A"},
868
    {0x0822, "Sigma 18-300mm F3.5-6.3 DC Macro HSM"},
869
    {0x083b, "HD PENTAX-D FA 150-450mm F4.5-5.6 ED DC AW"},
870
    {0x083c, "HD PENTAX-D FA* 70-200mm F2.8 ED DC AW"},
871
    {0x083d, "HD PENTAX-D FA 28-105mm F3.5-5.6 ED DC WR"},
872
    {0x083e, "HD PENTAX-D FA 24-70mm F2.8 ED SDM WR"},
873
    {0x083f, "HD PENTAX-D FA 15-30mm F2.8 ED SDM WR"},
874
    {0x0840, "HD PENTAX-D FA* 50mm F1.4 SDM AW"},
875
    {0x0841, "HD PENTAX-D FA 70-210mm F4 ED SDM WR"},
876
    {0x0842, "HD PENTAX-D FA* 85mm F1.4 SDM AW"},
877
    {0x0843, "HD PENTAX-D FA 21mm F2.4 ED Limited DC WR"},
878
    {0x08c3, "HD PENTAX DA* 16-50mm F2.8 ED PLM AW"},
879
    {0x08c4, "HD PENTAX-DA* 11-18mm F2.8 ED DC AW"},
880
    {0x08c5, "HD PENTAX-DA 55-300mm F4.5-6.3 ED PLM WR RE"},
881
    {0x08c6, "smc PENTAX-DA L 18-50mm F4-5.6 DC WR RE"},
882
    {0x08c7, "HD PENTAX-DA 18-50mm F4-5.6 DC WR RE"},
883
    {0x08c8, "HD PENTAX-DA 16-85mm F3.5-5.6 ED DC WR"},
884
    {0x08d1, "HD PENTAX-DA 20-40mm F2.8-4 ED Limited DC WR"},
885
    {0x08d2, "smc PENTAX-DA 18-270mm F3.5-6.3 ED SDM"},
886
    {0x08d3, "HD PENTAX-DA 560mm F5.6 ED AW"},
887
    {0x08d7, "smc PENTAX-DA 18-135mm F3.5-5.6 ED AL [IF] DC WR"},
888
    {0x08e2, "smc PENTAX-DA* 55mm F1.4 SDM"},
889
    {0x08e3, "smc PENTAX DA* 60-250mm F4 [IF] SDM"},
890
    {0x08e8, "smc PENTAX-DA 17-70mm F4 AL [IF] SDM"},
891
    {0x08ea, "smc PENTAX-DA* 300mm F4 ED [IF] SDM"},
892
    {0x08eb, "smc PENTAX-DA* 200mm F2.8 ED [IF] SDM"},
893
    {0x08f1, "smc PENTAX-DA* 50-135mm F2.8 ED [IF] SDM"},
894
    {0x08f2, "smc PENTAX-DA* 16-50mm F2.8 ED AL [IF] SDM"},
895
    {0x08ff, "Sigma Lens"},                                   // 0
896
    {0x08ff, "Sigma 70-200mm F2.8 EX DG Macro HSM II"},       // 1
897
    {0x08ff, "Sigma 150-500mm F5-6.3 DG APO [OS] HSM"},       // 2
898
    {0x08ff, "Sigma 50-150mm F2.8 II APO EX DC HSM"},         // 3
899
    {0x08ff, "Sigma 4.5mm F2.8 EX DC HSM Circular Fisheye"},  // 4
900
    {0x08ff, "Sigma 50-200mm F4-5.6 DC OS"},                  // 5
901
    {0x08ff, "Sigma 24-70mm F2.8 EX DG HSM"},                 // 6
902
    {0x08ff, "Sigma 18-50mm F2.8-4.5 HSM OS"},                // 7
903
    {0x0900, "645 Manual Lens"},
904
    {0x0a00, "645 A Series Lens"},
905
    {0x0b01, "smc PENTAX-FA 645 75mm F2.8"},
906
    {0x0b02, "smc PENTAX-FA 645 45mm F2.8"},
907
    {0x0b03, "smc PENTAX-FA* 645 300mm F4 ED [IF]"},
908
    {0x0b04, "smc PENTAX-FA 645 45mm-85mm F4.5"},
909
    {0x0b05, "smc PENTAX-FA 645 400mm F5.6 ED [IF]"},
910
    {0x0b07, "smc PENTAX-FA 645 Macro 120mm F4"},
911
    {0x0b08, "smc PENTAX-FA 645 80-160mm F4.5"},
912
    {0x0b09, "smc PENTAX-FA 645 200mm F4 [IF]"},
913
    {0x0b0a, "smc PENTAX-FA 645 150mm F2.8 [IF]"},
914
    {0x0b0b, "smc PENTAX-FA 645 35mm F3.5 AL [IF]"},
915
    {0x0b0c, "smc PENTAX-FA 645 300mm F5.6 ED [IF]"},
916
    {0x0b0e, "smc PENTAX-FA 645 55-110mm F5.6"},
917
    {0x0b10, "smc PENTAX-FA 645 33-55mm F4.5 AL"},
918
    {0x0b11, "smc PENTAX-FA 645 150-300mm F5.6 ED [IF]"},
919
    {0x0b15, "HD PENTAX-D FA 645 35mm F3.5 AL [IF]"},
920
    {0x0d12, "smc PENTAX-D FA 645 55mm F2.8 AL [IF] SDM AW"},
921
    {0x0d13, "smc PENTAX-D FA 645 25mm F4 AL [IF] SDM AW"},
922
    {0x0d14, "HD PENTAX-D FA 645 90mm F2.8 ED AW SR"},
923
    {0x0dfd, "HD PENTAX-DA 645 28-45mm F4.5 ED AW SR"},
924
    {0x1500, "Pentax Q Manual Lens"},
925
    {0x1501, "01 Standard Prime 8.5mm F1.9"},
926
    {0x1502, "02 Standard Zoom 5-15mm F2.8-4.5"},
927
    {0x1603, "03 Fish-eye 3.2mm F5.6"},
928
    {0x1604, "04 Toy Lens Wide 6.3mm F7.1"},
929
    {0x1605, "05 Toy Lens Telephoto 18mm F8"},
930
    {0x1506, "06 Telephoto Zoom 15-45mm F2.8"},
931
    {0x1507, "07 Mount Shield 11.5mm F9"},
932
    {0x1508, "08 Wide Zoom 3.8-5.9mm F3.7-4"},
933
    {0x15e9, "Adapter Q for K-mount Lens"},
934
};
935
936
//! ImageTone, tag 0x004f
937
constexpr TagDetails pentaxImageTone[] = {
938
    {0, N_("Natural")},    {1, N_("Bright")}, {2, N_("Portrait")},      {3, N_("Landscape")},     {4, N_("Vibrant")},
939
    {5, N_("Monochrome")}, {6, N_("Muted")},  {7, N_("Reversal film")}, {8, N_("Bleach bypass")}, {9, N_("Radiant")},
940
};
941
942
//! DynamicRangeExpansion, tag 0x0069
943
constexpr TagDetails pentaxDynamicRangeExpansion[] = {
944
    {0, N_("Off")},
945
    {0x1000000, N_("On")},
946
};
947
948
//! HighISONoiseReduction, tag 0x0071
949
constexpr TagDetails pentaxHighISONoiseReduction[] = {
950
    {0, N_("Off")}, {1, N_("Weakest")}, {2, N_("Weak")}, {3, N_("Strong")}, {4, N_("Custom")},
951
};
952
953
5.09k
std::ostream& PentaxMakerNote::printVersion(std::ostream& os, const Value& value, const ExifData*) {
954
5.09k
  std::string val = value.toString();
955
5.09k
  std::replace(val.begin(), val.end(), ' ', '.');
956
5.09k
  os << val;
957
5.09k
  return os;
958
5.09k
}
959
960
1.38k
std::ostream& PentaxMakerNote::printResolution(std::ostream& os, const Value& value, const ExifData*) {
961
1.38k
  std::string val = value.toString();
962
1.38k
  std::replace(val.begin(), val.end(), ' ', 'x');
963
1.38k
  os << val;
964
1.38k
  return os;
965
1.38k
}
966
967
368
std::ostream& PentaxMakerNote::printDate(std::ostream& os, const Value& value, const ExifData*) {
968
  /* I choose same format as is used inside EXIF itself */
969
368
  return os << stringFormat("{}:{:02}:{:02}", ((static_cast<uint16_t>(value.toInt64(0)) << 8) + value.toInt64(1)),
970
368
                            value.toInt64(2), value.toInt64(3));
971
368
}
972
973
484
std::ostream& PentaxMakerNote::printTime(std::ostream& os, const Value& value, const ExifData*) {
974
484
  return os << stringFormat("{:02}:{:02}:{:02}", value.toInt64(0), value.toInt64(1), value.toInt64(2));
975
484
}
976
977
58
std::ostream& PentaxMakerNote::printExposure(std::ostream& os, const Value& value, const ExifData*) {
978
58
  return os << stringFormat("{:g} ms", static_cast<float>(value.toInt64()) / 100);
979
58
}
980
981
62
std::ostream& PentaxMakerNote::printFValue(std::ostream& os, const Value& value, const ExifData*) {
982
62
  return os << stringFormat("F{:.2g}", static_cast<float>(value.toInt64()) / 10);
983
62
}
984
985
54
std::ostream& PentaxMakerNote::printFocalLength(std::ostream& os, const Value& value, const ExifData*) {
986
54
  return os << stringFormat("{:.1f} mm", static_cast<float>(value.toInt64()) / 100);
987
54
}
988
989
146
std::ostream& PentaxMakerNote::printCompensation(std::ostream& os, const Value& value, const ExifData*) {
990
146
  return os << stringFormat("{:.2g} EV", (static_cast<float>(value.toInt64()) - 50) / 10);
991
146
}
992
993
70
std::ostream& PentaxMakerNote::printTemperature(std::ostream& os, const Value& value, const ExifData*) {
994
70
  return os << stringFormat("{} C", value.toInt64());
995
70
}
996
997
112
std::ostream& PentaxMakerNote::printFlashCompensation(std::ostream& os, const Value& value, const ExifData*) {
998
112
  return os << stringFormat("{:.2g} EV", static_cast<float>(value.toInt64()) / 256);
999
112
}
1000
1001
514
std::ostream& PentaxMakerNote::printBracketing(std::ostream& os, const Value& value, const ExifData*) {
1002
514
  std::ios::fmtflags f(os.flags());
1003
514
  if (auto l0 = value.toUint32(0); l0 < 10) {
1004
340
    os << std::setprecision(2) << static_cast<float>(l0) / 3 << " EV";
1005
340
  } else {
1006
174
    os << std::setprecision(2) << static_cast<float>(l0) - 9.5F << " EV";
1007
174
  }
1008
1009
514
  if (value.count() == 2) {
1010
438
    const auto l1 = value.toUint32(1);
1011
438
    os << " (";
1012
438
    if (l1 == 0) {
1013
82
      os << _("No extended bracketing");
1014
356
    } else {
1015
356
      auto type = l1 >> 8;
1016
356
      auto range = static_cast<byte>(l1);
1017
356
      switch (type) {
1018
66
        case 1:
1019
66
          os << _("WB-BA");
1020
66
          break;
1021
64
        case 2:
1022
64
          os << _("WB-GM");
1023
64
          break;
1024
64
        case 3:
1025
64
          os << _("Saturation");
1026
64
          break;
1027
8
        case 4:
1028
8
          os << _("Sharpness");
1029
8
          break;
1030
36
        case 5:
1031
36
          os << _("Contrast");
1032
36
          break;
1033
118
        default:
1034
118
          os << _("Unknown ") << type;
1035
118
          break;
1036
356
      }
1037
356
      os << " " << +range;
1038
356
    }
1039
438
    os << ")";
1040
438
  }
1041
514
  os.flags(f);
1042
514
  return os;
1043
514
}
1044
1045
648
std::ostream& PentaxMakerNote::printShutterCount(std::ostream& os, const Value& value, const ExifData* metadata) {
1046
648
  if (!metadata)
1047
324
    return os << "undefined";
1048
1049
324
  auto dateIt = metadata->findKey(ExifKey("Exif.PentaxDng.Date"));
1050
324
  if (dateIt == metadata->end()) {
1051
95
    dateIt = metadata->findKey(ExifKey("Exif.Pentax.Date"));
1052
95
  }
1053
1054
324
  auto timeIt = metadata->findKey(ExifKey("Exif.PentaxDng.Time"));
1055
324
  if (timeIt == metadata->end()) {
1056
155
    timeIt = metadata->findKey(ExifKey("Exif.Pentax.Time"));
1057
155
  }
1058
1059
324
  if (dateIt == metadata->end() || dateIt->size() != 4 || timeIt == metadata->end() || timeIt->size() != 3 ||
1060
272
      value.size() != 4) {
1061
272
    os << "undefined";
1062
272
    return os;
1063
272
  }
1064
52
  const uint32_t date = (dateIt->toUint32(0) << 24) + (dateIt->toUint32(1) << 16) + (dateIt->toUint32(2) << 8) +
1065
52
                        (dateIt->toUint32(3) << 0);
1066
52
  const uint32_t time = (timeIt->toUint32(0) << 24) + (timeIt->toUint32(1) << 16) + (timeIt->toUint32(2) << 8);
1067
52
  const uint32_t countEnc =
1068
52
      (value.toUint32(0) << 24) + (value.toUint32(1) << 16) + (value.toUint32(2) << 8) + (value.toUint32(3) << 0);
1069
  // The shutter count is encoded using date and time values stored
1070
  // in Pentax-specific tags.  The prototype for the encoding/decoding
1071
  // function is taken from Phil Harvey's ExifTool: Pentax.pm file,
1072
  // CryptShutterCount() routine.
1073
52
  const uint32_t count = countEnc ^ date ^ (~time);
1074
52
  os << count;
1075
52
  return os;
1076
324
}
1077
1078
// #1144 begin
1079
158
static std::string getKeyString(const std::string& key, const ExifData* metadata) {
1080
158
  std::string result;
1081
158
  if (metadata->findKey(ExifKey(key)) != metadata->end()) {
1082
117
    result = metadata->findKey(ExifKey(key))->toString();
1083
117
  }
1084
158
  return result;
1085
158
}
1086
1087
24
static long getKeyLong(const std::string& key, const ExifData* metadata) {
1088
24
  long result = -1;
1089
24
  if (metadata->findKey(ExifKey(key)) != metadata->end()) {
1090
0
    result = static_cast<long>(metadata->findKey(ExifKey(key))->toFloat(0));
1091
0
  }
1092
24
  return result;
1093
24
}
1094
1095
// Throws std::exception if the LensInfo can't be found.
1096
612
static ExifData::const_iterator findLensInfo(const ExifData* metadata) {
1097
612
  const auto dngLensInfo = metadata->findKey(ExifKey("Exif.PentaxDng.LensInfo"));
1098
612
  if (dngLensInfo != metadata->end()) {
1099
453
    return dngLensInfo;
1100
453
  }
1101
159
  const auto lensInfo = metadata->findKey(ExifKey("Exif.Pentax.LensInfo"));
1102
159
  if (lensInfo != metadata->end()) {
1103
29
    return lensInfo;
1104
29
  }
1105
130
  throw LensInfoNotFound();
1106
159
}
1107
1108
//! resolveLens0x32c print lens in human format
1109
24
static std::ostream& resolveLens0x32c(std::ostream& os, const Value& value, const ExifData* metadata) {
1110
24
  try {
1111
24
    unsigned long index = 0;
1112
1113
24
    long focalLength = getKeyLong("Exif.Photo.FocalLength", metadata);
1114
24
    bool bFL10_20 = 10 <= focalLength && focalLength <= 20;
1115
1116
    // std::cout << "model,focalLength = " << model << "," << focalLength << '\n';
1117
24
    if (bFL10_20) {
1118
0
      index = 1;
1119
0
    }
1120
1121
24
    if (index > 0) {
1122
0
      const unsigned long lensID = 0x32c;
1123
0
      auto td = Exiv2::find(pentaxLensType, lensID);
1124
0
      return os << _(td[index].label_);
1125
0
    }
1126
24
  } catch (...) {
1127
0
  }
1128
24
  return EXV_PRINT_COMBITAG_MULTI(pentaxLensType, 2, 1, 2)(os, value, metadata);
1129
24
}
1130
// #1144 end
1131
1132
// #816 begin
1133
//! resolveLens0x3ff print lens in human format
1134
static std::ostream& resolveLens0x3ff(std::ostream& os, const Value& value, const ExifData* metadata)
1135
// ----------------------------------------------------------------------
1136
344
{
1137
344
  try {
1138
344
    unsigned long index = 0;
1139
1140
    // http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Pentax.html#LensData
1141
344
    const auto lensInfo = findLensInfo(metadata);
1142
344
    if (lensInfo->count() < 5)
1143
34
      return EXV_PRINT_COMBITAG_MULTI(pentaxLensType, 2, 1, 2)(os, value, metadata);
1144
1145
310
    if (value.count() == 2) {
1146
      // http://dev.exiv2.org/attachments/download/326/IMGP4432.PEF
1147
      // exiv2 -pv --grep Lens ~/Downloads/IMGP4432.PEF
1148
      // 0x003f Pentax       LensType  Byte        2 3 255
1149
      // 0x0207 Pentax       LensInfo  Undefined  36 3 255 0 0 40 148 71 152 80 6 241 65 237 153 88 36 1 76
1150
      // 107 251 255 255 255 0 0 80 6 241 0 0 0 0 0 0 0 0
1151
144
      unsigned long base = 1;
1152
1153
144
      unsigned int autoAperture = lensInfo->toUint32(base + 1) & 0x01;
1154
144
      unsigned int minAperture = lensInfo->toUint32(base + 2) & 0x06;
1155
144
      unsigned int minFocusDistance = lensInfo->toUint32(base + 3) & 0xf8;
1156
1157
144
      if (autoAperture == 0x0 && minAperture == 0x0 && minFocusDistance == 0x28 && lensInfo->toUint32(base + 4) == 148)
1158
11
        index = 8;
1159
144
      if (autoAperture == 0x0 && minAperture == 0x0 && minFocusDistance == 0x28 && lensInfo->toUint32(base + 5) == 110)
1160
19
        index = 7;
1161
144
      if (autoAperture == 0x0 && minAperture == 0x0 && minFocusDistance == 0x28 && lensInfo->toUint32(base + 4) == 110)
1162
19
        index = 7;
1163
1164
166
    } else if (value.count() == 3) {
1165
      // http://dev.exiv2.org/attachments/download/858/_IGP9032.DNG
1166
      // $ exiv2 -pv --grep Lens ~/Downloads/_IGP9032.DNG
1167
      // 0x003f PentaxDng    LensType  Byte        3    3 255   0
1168
      // 0x0207 PentaxDng    LensInfo  Undefined  69  131   0   0 255 0  40 148  68 244 ...
1169
      //                                                0   1   2   3 4   5   6
1170
50
      if (lensInfo->toUint32(4) == 0 && lensInfo->toUint32(5) == 40 && lensInfo->toUint32(6) == 148)
1171
10
        index = 8;
1172
1173
116
    } else if (value.count() == 4) {
1174
      // http://dev.exiv2.org/attachments/download/868/IMGP2221.JPG
1175
      // 0x0207 PentaxDng    LensInfo  Undefined 128    0 131 128   0 0 255   1 184   0 0 0 0 0
1176
      //                                                0   1   2   3 4   5   6
1177
69
      if (lensInfo->count() == 128 && lensInfo->toUint32(1) == 131 && lensInfo->toUint32(2) == 128)
1178
10
        index = 8;
1179
      // #1155
1180
69
      if (lensInfo->toUint32(6) == 5)
1181
14
        index = 7;
1182
69
    }
1183
1184
310
    if (index > 0) {
1185
64
      const unsigned long lensID = 0x3ff;
1186
64
      auto td = Exiv2::find(pentaxLensType, lensID);
1187
64
      return os << _(td[index].label_);
1188
64
    }
1189
310
  } catch (...) {
1190
41
  }
1191
246
  return EXV_PRINT_COMBITAG_MULTI(pentaxLensType, 2, 1, 2)(os, value, metadata);
1192
344
}
1193
1194
// #1155
1195
//! resolveLens0x8ff print lens in human format
1196
static std::ostream& resolveLens0x8ff(std::ostream& os, const Value& value, const ExifData* metadata)
1197
// ----------------------------------------------------------------------
1198
131
{
1199
131
  try {
1200
131
    unsigned long index = 0;
1201
1202
131
    const auto lensInfo = findLensInfo(metadata);
1203
131
    if (value.count() == 4) {
1204
77
      std::string model = getKeyString("Exif.Image.Model", metadata);
1205
77
      if (model.starts_with("PENTAX K-3") && lensInfo->count() == 128 && lensInfo->toUint32(1) == 168 &&
1206
13
          lensInfo->toUint32(2) == 144)
1207
7
        index = 7;
1208
77
    }
1209
1210
131
    if (index > 0) {
1211
7
      const unsigned long lensID = 0x8ff;
1212
7
      auto td = Exiv2::find(pentaxLensType, lensID);
1213
7
      return os << _(td[index].label_);
1214
7
    }
1215
131
  } catch (...) {
1216
38
  }
1217
124
  return EXV_PRINT_COMBITAG_MULTI(pentaxLensType, 2, 1, 2)(os, value, metadata);
1218
131
}
1219
1220
// #1155
1221
//! resolveLens0x319 print lens in human format
1222
static std::ostream& resolveLens0x319(std::ostream& os, const Value& value, const ExifData* metadata)
1223
// ----------------------------------------------------------------------
1224
137
{
1225
137
  try {
1226
137
    unsigned long index = 0;
1227
1228
137
    const auto lensInfo = findLensInfo(metadata);
1229
137
    if (value.count() == 4) {
1230
28
      std::string model = getKeyString("Exif.Image.Model", metadata);
1231
28
      if (model.starts_with("PENTAX K-3") && lensInfo->count() == 128 && lensInfo->toUint32(1) == 131 &&
1232
0
          lensInfo->toUint32(2) == 128)
1233
0
        index = 6;
1234
28
    }
1235
137
    if (value.count() == 2) {
1236
53
      std::string model = getKeyString("Exif.Image.Model", metadata);
1237
53
      if (model.starts_with("PENTAX K100D") && lensInfo->count() == 44)
1238
0
        index = 6;
1239
53
      if (model.starts_with("PENTAX *ist DL") && lensInfo->count() == 36)
1240
0
        index = 6;
1241
53
    }
1242
1243
137
    if (index > 0) {
1244
0
      const unsigned long lensID = 0x319;
1245
0
      auto td = Exiv2::find(pentaxLensType, lensID);
1246
0
      return os << _(td[index].label_);
1247
0
    }
1248
137
  } catch (...) {
1249
55
  }
1250
137
  return EXV_PRINT_COMBITAG_MULTI(pentaxLensType, 2, 1, 2)(os, value, metadata);
1251
137
}
1252
1253
//! resolveLensType print lens in human format
1254
114
static std::ostream& resolveLensType(std::ostream& os, const Value& value, const ExifData* metadata) {
1255
114
  return EXV_PRINT_COMBITAG_MULTI(pentaxLensType, 2, 1, 2)(os, value, metadata);
1256
114
}
1257
1258
//! A lens id and a pretty-print function for special treatment of the id.
1259
2.56k
static std::ostream& printLensType(std::ostream& os, const Value& value, const ExifData* metadata) {
1260
  //! List of lens ids which require special treatment using resolveLensType
1261
2.56k
  static constexpr struct LensIdFct {
1262
2.56k
    uint32_t id_;   //!< Lens id
1263
2.56k
    PrintFct fct_;  //!< Pretty-print function
1264
    //! Comparison operator for find template
1265
25.4k
    bool operator==(uint32_t id) const {
1266
25.4k
      return id_ == id;
1267
25.4k
    }
1268
2.56k
  } lensIdFct[] = {
1269
2.56k
      {0x0317, resolveLensType}, {0x0319, resolveLens0x319}, {0x031b, resolveLensType},  {0x031c, resolveLensType},
1270
2.56k
      {0x031d, resolveLensType}, {0x031f, resolveLensType},  {0x0329, resolveLensType},  {0x032c, resolveLens0x32c},
1271
2.56k
      {0x032e, resolveLensType}, {0x0334, resolveLensType},  {0x03ff, resolveLens0x3ff}, {0x041a, resolveLensType},
1272
2.56k
      {0x042d, resolveLensType}, {0x08ff, resolveLens0x8ff},
1273
2.56k
  };
1274
  // #1034
1275
2.56k
  const std::string undefined("undefined");
1276
2.56k
  const std::string section("pentax");
1277
2.56k
  if (Internal::readExiv2Config(section, value.toString(), undefined) != undefined) {
1278
0
    return os << Internal::readExiv2Config(section, value.toString(), undefined);
1279
0
  }
1280
1281
2.56k
  const auto index = (value.toUint32(0) * 256) + value.toUint32(1);
1282
1283
  // std::cout << '\n' << "printLensType value =" << value.toLong() << " index = " << index << '\n';
1284
2.56k
  auto lif = Exiv2::find(lensIdFct, index);
1285
2.56k
  if (!lif)
1286
832
    return EXV_PRINT_COMBITAG_MULTI(pentaxLensType, 2, 1, 2)(os, value, metadata);
1287
1.73k
  if (metadata && lif->fct_)
1288
750
    return lif->fct_(os, value, metadata);
1289
980
  if (value.typeId() != unsignedShort || value.count() == 0)
1290
629
    return os << "(" << value << ")";
1291
351
  return os << value;
1292
980
}
1293
1294
// #816 end
1295
// ----------------------------------------------------------------------
1296
1297
// Pentax MakerNote Tag Info
1298
constexpr TagInfo PentaxMakerNote::tagInfo_[] = {
1299
    {0x0000, "Version", N_("Version"), N_("Pentax Makernote version"), IfdId::pentaxId, SectionId::makerTags, undefined,
1300
     -1, printVersion},
1301
    {0x0001, "Mode", N_("Shooting mode"), N_("Camera shooting mode"), IfdId::pentaxId, SectionId::makerTags,
1302
     unsignedShort, -1, EXV_PRINT_TAG(pentaxShootingMode)},
1303
    {0x0002, "PreviewResolution", N_("Resolution of a preview image"), N_("Resolution of a preview image"),
1304
     IfdId::pentaxId, SectionId::makerTags, undefined, -1, printResolution},
1305
    {0x0003, "PreviewLength", N_("Length of a preview image"), N_("Size of an IFD containing a preview image"),
1306
     IfdId::pentaxId, SectionId::makerTags, undefined, -1, printValue},
1307
    {0x0004, "PreviewOffset", N_("Pointer to a preview image"), N_("Offset to an IFD containing a preview image"),
1308
     IfdId::pentaxId, SectionId::makerTags, undefined, -1, printValue},
1309
    {0x0005, "ModelID", N_("Model identification"), N_("Pentax model identification"), IfdId::pentaxId,
1310
     SectionId::makerTags, unsignedShort, -1, EXV_PRINT_TAG(pentaxModel)},
1311
    {0x0006, "Date", N_("Date"), N_("Date"), IfdId::pentaxId, SectionId::makerTags, undefined, -1, printDate},
1312
    {0x0007, "Time", N_("Time"), N_("Time"), IfdId::pentaxId, SectionId::makerTags, undefined, -1, printTime},
1313
    {0x0008, "Quality", N_("Image quality"), N_("Image quality settings"), IfdId::pentaxId, SectionId::makerTags,
1314
     unsignedShort, -1, EXV_PRINT_TAG(pentaxQuality)},
1315
    {0x0009, "Size", N_("Image size"), N_("Image size settings"), IfdId::pentaxId, SectionId::makerTags, unsignedLong,
1316
     -1, EXV_PRINT_TAG(pentaxSize)},
1317
    /* Some missing ! */
1318
    {0x000c, "Flash", N_("Flash mode"), N_("Flash mode settings"), IfdId::pentaxId, SectionId::makerTags, unsignedLong,
1319
     -1, EXV_PRINT_TAG(pentaxFlash)},
1320
    {0x000d, "Focus", N_("Focus mode"), N_("Focus mode settings"), IfdId::pentaxId, SectionId::makerTags, unsignedLong,
1321
     -1, EXV_PRINT_TAG(pentaxFocus)},
1322
    {0x000e, "AFPoint", N_("AF point"), N_("Selected AF point"), IfdId::pentaxId, SectionId::makerTags, unsignedLong,
1323
     -1, EXV_PRINT_TAG(pentaxAFPoint)},
1324
    {0x000F, "AFPointInFocus", N_("AF point in focus"), N_("AF point in focus"), IfdId::pentaxId, SectionId::makerTags,
1325
     unsignedLong, -1, EXV_PRINT_TAG(pentaxAFPointFocus)},
1326
    /* Some missing ! */
1327
    {0x0012, "ExposureTime", N_("Exposure time"), N_("Exposure time"), IfdId::pentaxId, SectionId::makerTags,
1328
     unsignedLong, -1, printExposure},
1329
    {0x0013, "FNumber", N_("F-Number"), N_("F-Number"), IfdId::pentaxId, SectionId::makerTags, unsignedLong, -1,
1330
     printFValue},
1331
    {0x0014, "ISO", N_("ISO sensitivity"), N_("ISO sensitivity settings"), IfdId::pentaxId, SectionId::makerTags,
1332
     unsignedLong, -1, EXV_PRINT_TAG(pentaxISO)},
1333
    /* Some missing ! */
1334
    {0x0016, "ExposureCompensation", N_("Exposure compensation"), N_("Exposure compensation"), IfdId::pentaxId,
1335
     SectionId::makerTags, unsignedLong, -1, printCompensation},
1336
    /* Some missing ! */
1337
    {0x0017, "MeteringMode", N_("MeteringMode"), N_("MeteringMode"), IfdId::pentaxId, SectionId::makerTags, undefined,
1338
     -1, EXV_PRINT_TAG(pentaxMeteringMode)},
1339
    {0x0018, "AutoBracketing", N_("AutoBracketing"), N_("AutoBracketing"), IfdId::pentaxId, SectionId::makerTags,
1340
     undefined, -1, printBracketing},
1341
    {0x0019, "WhiteBalance", N_("White balance"), N_("White balance"), IfdId::pentaxId, SectionId::makerTags, undefined,
1342
     -1, EXV_PRINT_TAG(pentaxWhiteBalance)},
1343
    {0x001a, "WhiteBalanceMode", N_("White balance mode"), N_("White balance mode"), IfdId::pentaxId,
1344
     SectionId::makerTags, undefined, -1, EXV_PRINT_TAG(pentaxWhiteBalanceMode)},
1345
    {0x001b, "BlueBalance", N_("Blue balance"), N_("Blue color balance"), IfdId::pentaxId, SectionId::makerTags,
1346
     unsignedLong, -1, printValue},
1347
    {0x001c, "RedBalance", N_("Red balance"), N_("Red color balance"), IfdId::pentaxId, SectionId::makerTags,
1348
     unsignedLong, -1, printValue},
1349
    {0x001d, "FocalLength", N_("FocalLength"), N_("FocalLength"), IfdId::pentaxId, SectionId::makerTags, undefined, -1,
1350
     printFocalLength},
1351
    {0x001e, "DigitalZoom", N_("Digital zoom"), N_("Digital zoom"), IfdId::pentaxId, SectionId::makerTags, unsignedLong,
1352
     -1, printValue},
1353
    {0x001f, "Saturation", N_("Saturation"), N_("Saturation"), IfdId::pentaxId, SectionId::makerTags, undefined, -1,
1354
     EXV_PRINT_TAG(pentaxSaturation)},
1355
    {0x0020, "Contrast", N_("Contrast"), N_("Contrast"), IfdId::pentaxId, SectionId::makerTags, undefined, -1,
1356
     EXV_PRINT_TAG(pentaxContrast)},
1357
    {0x0021, "Sharpness", N_("Sharpness"), N_("Sharpness"), IfdId::pentaxId, SectionId::makerTags, undefined, -1,
1358
     EXV_PRINT_TAG(pentaxSharpness)},
1359
    {0x0022, "Location", N_("Location"), N_("Location"), IfdId::pentaxId, SectionId::makerTags, undefined, -1,
1360
     EXV_PRINT_TAG(pentaxLocation)},
1361
    {0x0023, "Hometown", N_("Hometown"), N_("Home town"), IfdId::pentaxId, SectionId::makerTags, undefined, -1,
1362
     EXV_PRINT_TAG(pentaxCities)},
1363
    {0x0024, "Destination", N_("Destination"), N_("Destination"), IfdId::pentaxId, SectionId::makerTags, undefined, -1,
1364
     EXV_PRINT_TAG(pentaxCities)},
1365
    {0x0025, "HometownDST", N_("Hometown DST"), N_("Whether day saving time is active in home town"), IfdId::pentaxId,
1366
     SectionId::makerTags, undefined, -1, EXV_PRINT_TAG(pentaxYesNo)},
1367
    {0x0026, "DestinationDST", N_("Destination DST"), N_("Whether day saving time is active in destination"),
1368
     IfdId::pentaxId, SectionId::makerTags, undefined, -1, EXV_PRINT_TAG(pentaxYesNo)},
1369
    {0x0027, "DSPFirmwareVersion", N_("DSPFirmwareVersion"), N_("DSPFirmwareVersion"), IfdId::pentaxId,
1370
     SectionId::makerTags, unsignedByte, -1, printValue}, /* TODO: Decoding missing */
1371
    {0x0028, "CPUFirmwareVersion", N_("CPUFirmwareVersion"), N_("CPUFirmwareVersion"), IfdId::pentaxId,
1372
     SectionId::makerTags, unsignedByte, -1, printValue}, /* TODO: Decoding missing */
1373
    {0x0029, "FrameNumber", N_("Frame number"), N_("Frame number"), IfdId::pentaxId, SectionId::makerTags, undefined,
1374
     -1, printValue},
1375
    /* Some missing ! */
1376
    {0x002d, "EffectiveLV", N_("Light value"), N_("Camera calculated light value, includes exposure compensation"),
1377
     IfdId::pentaxId, SectionId::makerTags, unsignedShort, -1, printValue},
1378
    /* Some missing ! */
1379
    {0x0032, "ImageProcessing", N_("Image processing"), N_("Image processing"), IfdId::pentaxId, SectionId::makerTags,
1380
     undefined, -1, EXV_PRINT_COMBITAG(pentaxImageProcessing, 4, 0)},
1381
    {0x0033, "PictureMode", N_("Picture mode"), N_("Picture mode"), IfdId::pentaxId, SectionId::makerTags, undefined,
1382
     -1, EXV_PRINT_COMBITAG(pentaxPictureMode, 3, 0)},
1383
    {0x0034, "DriveMode", N_("Drive mode"), N_("Drive mode"), IfdId::pentaxId, SectionId::makerTags, undefined, -1,
1384
     EXV_PRINT_COMBITAG(pentaxDriveMode, 4, 0)},
1385
    /* Some missing ! */
1386
    {0x0037, "ColorSpace", N_("Color space"), N_("Color space"), IfdId::pentaxId, SectionId::makerTags, unsignedShort,
1387
     -1, EXV_PRINT_TAG(pentaxColorSpace)},
1388
    {0x0038, "ImageAreaOffset", N_("Image area offset"), N_("Image area offset"), IfdId::pentaxId, SectionId::makerTags,
1389
     unsignedLong, -1, printValue},
1390
    {0x0039, "RawImageSize", N_("Raw image size"), N_("Raw image size"), IfdId::pentaxId, SectionId::makerTags,
1391
     unsignedLong, -1, printValue},
1392
    /* Some missing ! */
1393
    {0x003e, "PreviewImageBorders", N_("Preview image borders"), N_("Preview image borders"), IfdId::pentaxId,
1394
     SectionId::makerTags, unsignedByte, -1, printValue},
1395
    {0x003f, "LensType", N_("Lens type"), N_("Lens type"), IfdId::pentaxId, SectionId::makerTags, unsignedByte, -1,
1396
     printLensType},  // #816
1397
    {0x0040, "SensitivityAdjust", N_("Sensitivity adjust"), N_("Sensitivity adjust"), IfdId::pentaxId,
1398
     SectionId::makerTags, unsignedLong, -1, printValue},
1399
    {0x0041, "DigitalFilter", N_("Digital filter"), N_("Digital filter"), IfdId::pentaxId, SectionId::makerTags,
1400
     unsignedShort, -1, EXV_PRINT_TAG(pentaxOffOn)},
1401
    /* Some missing ! */
1402
    {0x0047, "Temperature", N_("Temperature"), N_("Camera temperature"), IfdId::pentaxId, SectionId::makerTags,
1403
     signedByte, -1, printTemperature},
1404
    {0x0048, "AELock", N_("AE lock"), N_("AE lock"), IfdId::pentaxId, SectionId::makerTags, unsignedShort, -1,
1405
     EXV_PRINT_TAG(pentaxOffOn)},
1406
    {0x0049, "NoiseReduction", N_("Noise reduction"), N_("Noise reduction"), IfdId::pentaxId, SectionId::makerTags,
1407
     unsignedShort, -1, EXV_PRINT_TAG(pentaxOffOn)},
1408
    /* Some missing ! */
1409
    {0x004d, "FlashExposureCompensation", N_("Flash exposure compensation"), N_("Flash exposure compensation"),
1410
     IfdId::pentaxId, SectionId::makerTags, signedLong, -1, printFlashCompensation},
1411
    /* Some missing ! */
1412
    {0x004f, "ImageTone", N_("Image tone"), N_("Image tone"), IfdId::pentaxId, SectionId::makerTags, unsignedShort, -1,
1413
     EXV_PRINT_TAG(pentaxImageTone)},
1414
    {0x0050, "ColorTemperature", N_("Color temperature"), N_("Color temperature"), IfdId::pentaxId,
1415
     SectionId::makerTags, unsignedShort, -1, printValue},
1416
    /* Some missing ! */
1417
    {0x005c, "ShakeReduction", N_("Shake reduction"), N_("Shake reduction information"), IfdId::pentaxId,
1418
     SectionId::makerTags, undefined, -1, printValue},
1419
    {0x005d, "ShutterCount", N_("Shutter count"), N_("Shutter count"), IfdId::pentaxId, SectionId::makerTags, undefined,
1420
     -1, printShutterCount},
1421
    {0x0069, "DynamicRangeExpansion", N_("Dynamic range expansion"), N_("Dynamic range expansion"), IfdId::pentaxId,
1422
     SectionId::makerTags, undefined, -1, EXV_PRINT_COMBITAG(pentaxDynamicRangeExpansion, 4, 0)},
1423
    {0x0071, "HighISONoiseReduction", N_("High ISO noise reduction"), N_("High ISO noise reduction"), IfdId::pentaxId,
1424
     SectionId::makerTags, unsignedByte, -1, EXV_PRINT_TAG(pentaxHighISONoiseReduction)},
1425
    {0x0072, "AFAdjustment", N_("AF Adjustment"), N_("AF Adjustment"), IfdId::pentaxId, SectionId::makerTags, undefined,
1426
     -1, printValue},
1427
    /* Many missing ! */
1428
    {0x009e, "HDF", N_("Highlight diffusion filter"), N_("Highlight diffusion filter"), IfdId::pentaxId,
1429
     SectionId::makerTags, unsignedShort, -1, EXV_PRINT_TAG(pentaxOffOn)},
1430
    {0x0200, "BlackPoint", N_("Black point"), N_("Black point"), IfdId::pentaxId, SectionId::makerTags, undefined, -1,
1431
     printValue},
1432
    {0x0201, "WhitePoint", N_("White point"), N_("White point"), IfdId::pentaxId, SectionId::makerTags, undefined, -1,
1433
     printValue},
1434
    /* Some missing ! */
1435
    {0x0205, "ShotInfo", N_("ShotInfo"), N_("ShotInfo"), IfdId::pentaxId, SectionId::makerTags, undefined, -1,
1436
     printValue}, /* TODO: Decoding missing */
1437
    {0x0206, "AEInfo", N_("AEInfo"), N_("AEInfo"), IfdId::pentaxId, SectionId::makerTags, undefined, -1,
1438
     printValue}, /* TODO: Decoding missing */
1439
    {0x0207, "LensInfo", N_("LensInfo"), N_("LensInfo"), IfdId::pentaxId, SectionId::makerTags, undefined, -1,
1440
     printValue}, /* TODO: Decoding missing */
1441
    {0x0208, "FlashInfo", N_("FlashInfo"), N_("FlashInfo"), IfdId::pentaxId, SectionId::makerTags, undefined, -1,
1442
     printValue}, /* TODO: Decoding missing */
1443
    {0x0209, "AEMeteringSegments", N_("AEMeteringSegments"), N_("AEMeteringSegments"), IfdId::pentaxId,
1444
     SectionId::makerTags, undefined, -1, printValue}, /* TODO: Decoding missing */
1445
    {0x020a, "FlashADump", N_("FlashADump"), N_("FlashADump"), IfdId::pentaxId, SectionId::makerTags, undefined, -1,
1446
     printValue}, /* TODO: Decoding missing */
1447
    {0x020b, "FlashBDump", N_("FlashBDump"), N_("FlashBDump"), IfdId::pentaxId, SectionId::makerTags, undefined, -1,
1448
     printValue}, /* TODO: Decoding missing */
1449
    /* Some missing ! */
1450
    {0x020d, "WB_RGGBLevelsDaylight", N_("WB_RGGBLevelsDaylight"), N_("WB_RGGBLevelsDaylight"), IfdId::pentaxId,
1451
     SectionId::makerTags, undefined, -1, printValue}, /* TODO: Decoding missing */
1452
    {0x020e, "WB_RGGBLevelsShade", N_("WB_RGGBLevelsShade"), N_("WB_RGGBLevelsShade"), IfdId::pentaxId,
1453
     SectionId::makerTags, undefined, -1, printValue}, /* TODO: Decoding missing */
1454
    {0x020f, "WB_RGGBLevelsCloudy", N_("WB_RGGBLevelsCloudy"), N_("WB_RGGBLevelsCloudy"), IfdId::pentaxId,
1455
     SectionId::makerTags, undefined, -1, printValue}, /* TODO: Decoding missing */
1456
    {0x0210, "WB_RGGBLevelsTungsten", N_("WB_RGGBLevelsTungsten"), N_("WB_RGGBLevelsTungsten"), IfdId::pentaxId,
1457
     SectionId::makerTags, undefined, -1, printValue}, /* TODO: Decoding missing */
1458
    {0x0211, "WB_RGGBLevelsFluorescentD", N_("WB_RGGBLevelsFluorescentD"), N_("WB_RGGBLevelsFluorescentD"),
1459
     IfdId::pentaxId, SectionId::makerTags, undefined, -1, printValue}, /* TODO: Decoding missing */
1460
    {0x0212, "WB_RGGBLevelsFluorescentN", N_("WB_RGGBLevelsFluorescentN"), N_("WB_RGGBLevelsFluorescentN"),
1461
     IfdId::pentaxId, SectionId::makerTags, undefined, -1, printValue}, /* TODO: Decoding missing */
1462
    {0x0213, "WB_RGGBLevelsFluorescentW", N_("WB_RGGBLevelsFluorescentW"), N_("WB_RGGBLevelsFluorescentW"),
1463
     IfdId::pentaxId, SectionId::makerTags, undefined, -1, printValue}, /* TODO: Decoding missing */
1464
    {0x0214, "WB_RGGBLevelsFlash", N_("WB_RGGBLevelsFlash"), N_("WB_RGGBLevelsFlash"), IfdId::pentaxId,
1465
     SectionId::makerTags, undefined, -1, printValue}, /* TODO: Decoding missing */
1466
    {0x0215, "CameraInfo", N_("CameraInfo"), N_("CameraInfo"), IfdId::pentaxId, SectionId::makerTags, undefined, -1,
1467
     printValue}, /* TODO: Decoding missing */
1468
    {0x0216, "BatteryInfo", N_("BatteryInfo"), N_("BatteryInfo"), IfdId::pentaxId, SectionId::makerTags, undefined, -1,
1469
     printValue}, /* TODO: Decoding missing */
1470
    {0x021f, "AFInfo", N_("AFInfo"), N_("AFInfo"), IfdId::pentaxId, SectionId::makerTags, undefined, -1,
1471
     printValue}, /* TODO: Decoding missing */
1472
    {0x0222, "ColorInfo", N_("ColorInfo"), N_("ColorInfo"), IfdId::pentaxId, SectionId::makerTags, undefined, -1,
1473
     printValue}, /* TODO: Decoding missing */
1474
    {0x0229, "SerialNumber", N_("Serial Number"), N_("Serial Number"), IfdId::pentaxId, SectionId::makerTags,
1475
     asciiString, -1, printValue},
1476
    // End of list marker
1477
    {0xffff, "(UnknownPentaxMakerNoteTag)", "(UnknownPentaxMakerNoteTag)", N_("Unknown PentaxMakerNote tag"),
1478
     IfdId::pentaxId, SectionId::makerTags, asciiString, -1, printValue},
1479
};
1480
1481
}  // namespace Exiv2::Internal