Coverage Report

Created: 2026-08-31 06:55

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/exiv2/src/casiomn_int.cpp
Line
Count
Source
1
// SPDX-License-Identifier: GPL-2.0-or-later
2
/*
3
  File:      Casiomn.cpp
4
  History:   30-Oct-13, ahu: created
5
  Credits:   See header file
6
 */
7
// included header files
8
#include "casiomn_int.hpp"
9
#include "i18n.h"  // NLS support.
10
#include "image_int.hpp"
11
#include "tags.hpp"
12
#include "tags_int.hpp"
13
#include "types.hpp"
14
#include "value.hpp"
15
16
// + standard includes
17
#include <cstring>
18
#include <ostream>
19
#include <vector>
20
21
// *****************************************************************************
22
// class member definitions
23
namespace Exiv2::Internal {
24
//! RecordingMode, tag 0x0001
25
constexpr TagDetails casioRecordingMode[] = {
26
    {1, N_("Single Shutter")}, {2, N_("Panorama")},  {3, N_("Night Scene")},
27
    {4, N_("Portrait")},       {5, N_("Landscape")}, {7, N_("Panorama")},
28
    {10, N_("Night Scene")},   {15, N_("Portrait")}, {16, N_("Landscape")},
29
};
30
31
//! Quality, tag 0x0002
32
constexpr TagDetails casioQuality[] = {
33
    {1, N_("Economy")},
34
    {2, N_("Normal")},
35
    {3, N_("Fine")},
36
};
37
38
//! Focus Mode, tag 0x0003
39
constexpr TagDetails casioFocusMode[] = {
40
    {2, N_("Macro")}, {3, N_("Auto")}, {4, N_("Manual")}, {5, N_("Infinity")}, {7, N_("Sport AF")},
41
};
42
43
//! FlashMode, tag 0x0004
44
constexpr TagDetails casioFlashMode[] = {
45
    {1, N_("Auto")}, {2, N_("On")}, {3, N_("Off")}, {4, N_("Off")}, {5, N_("Red-eye Reduction")},
46
};
47
48
//! Flash intensity, tag 0x0005
49
constexpr TagDetails casioFlashIntensity[] = {
50
    {11, N_("Weak")}, {12, N_("Low")}, {13, N_("Normal")}, {14, N_("High")}, {15, N_("Strong")},
51
};
52
53
//! white balance, tag 0x0007
54
constexpr TagDetails casioWhiteBalance[] = {
55
    {1, N_("Auto")},        {2, N_("Tungsten")}, {3, N_("Daylight")},
56
    {4, N_("Fluorescent")}, {5, N_("Shade")},    {129, N_("Manual")},
57
};
58
59
//! Flash intensity, tag 0x0005
60
constexpr TagDetails casioDigitalZoom[] = {
61
    {0x10000, N_("Off")},  {0x10001, N_("2x")}, {0x13333, N_("1.2x")}, {0x13ae1, N_("1.23x")},
62
    {0x19999, N_("1.6x")}, {0x20000, N_("2x")}, {0x33333, N_("3.2x")}, {0x40000, N_("4x")},
63
};
64
65
//! Sharpness, tag 0x000b
66
constexpr TagDetails casioSharpness[] = {
67
    {0, N_("Normal")}, {1, N_("Soft")}, {2, N_("Hard")}, {16, N_("Normal")}, {17, N_("+1")}, {18, N_("-1")},
68
};
69
70
//! Contrast, tag 0x000c
71
constexpr TagDetails casioContrast[] = {
72
    {0, N_("Normal")}, {1, N_("Low")}, {2, N_("High")}, {16, N_("Normal")}, {17, N_("+1")}, {18, N_("-1")},
73
};
74
75
//! Saturation, tag 0x000d
76
constexpr TagDetails casioSaturation[] = {
77
    {0, N_("Normal")}, {1, N_("Low")}, {2, N_("High")}, {16, N_("Normal")}, {17, N_("+1")}, {18, N_("-1")},
78
};
79
80
//! Enhancement, tag 0x0016
81
constexpr TagDetails casioEnhancement[] = {
82
    {1, N_("Off")}, {2, N_("Red")}, {3, N_("Green")}, {4, N_("Blue")}, {5, N_("Flesh Tones")},
83
};
84
85
//! Color filter, tag 0x0017
86
constexpr TagDetails casioColorFilter[] = {
87
    {1, N_("Off")},  {2, N_("Black & White")}, {3, N_("Sepia")}, {4, N_("Red")},    {5, N_("Green")},
88
    {6, N_("Blue")}, {7, N_("Yellow")},        {8, N_("Pink")},  {9, N_("Purple")},
89
};
90
91
//! flash intensity 2, tag 0x0019
92
constexpr TagDetails casioFlashIntensity2[] = {
93
    {1, N_("Normal")},
94
    {2, N_("Weak")},
95
    {3, N_("Strong")},
96
};
97
98
//! CCD Sensitivity intensity, tag 0x0020
99
constexpr TagDetails casioCCDSensitivity[] = {
100
    {64, N_("Normal")}, {125, N_("+1.0")}, {250, N_("+2.0")}, {244, N_("+3.0")}, {80, N_("Normal (ISO 80 equivalent)")},
101
    {100, N_("High")},
102
};
103
104
// Casio MakerNote Tag Info
105
constexpr TagInfo CasioMakerNote::tagInfo_[] = {
106
    {0x0001, "RecordingMode", N_("Recording Mode"), N_("Recording Mode"), IfdId::casioId, SectionId::makerTags,
107
     unsignedShort, -1, EXV_PRINT_TAG(casioRecordingMode)},
108
    {0x0002, "Quality", N_("Quality"), N_("Quality"), IfdId::casioId, SectionId::makerTags, unsignedShort, -1,
109
     EXV_PRINT_TAG(casioQuality)},
110
    {0x0003, "FocusMode", N_("Focus Mode"), N_("Focus Mode"), IfdId::casioId, SectionId::makerTags, unsignedShort, -1,
111
     EXV_PRINT_TAG(casioFocusMode)},
112
    {0x0004, "FlashMode", N_("Flash Mode"), N_("Flash Mode"), IfdId::casioId, SectionId::makerTags, unsignedShort, -1,
113
     EXV_PRINT_TAG(casioFlashMode)},
114
    {0x0005, "FlashIntensity", N_("Flash Intensity"), N_("Flash Intensity"), IfdId::casioId, SectionId::makerTags,
115
     unsignedShort, -1, EXV_PRINT_TAG(casioFlashIntensity)},
116
    {0x0006, "ObjectDistance", N_("Object Distance"), N_("Distance to object"), IfdId::casioId, SectionId::makerTags,
117
     unsignedLong, -1, print0x0006},
118
    {0x0007, "WhiteBalance", N_("White Balance"), N_("White balance settings"), IfdId::casioId, SectionId::makerTags,
119
     unsignedShort, -1, EXV_PRINT_TAG(casioWhiteBalance)},
120
    {0x000a, "DigitalZoom", N_("Digital Zoom"), N_("Digital zoom"), IfdId::casioId, SectionId::makerTags, unsignedLong,
121
     -1, EXV_PRINT_TAG(casioDigitalZoom)},
122
    {0x000b, "Sharpness", N_("Sharpness"), N_("Sharpness"), IfdId::casioId, SectionId::makerTags, unsignedShort, -1,
123
     EXV_PRINT_TAG(casioSharpness)},
124
    {0x000c, "Contrast", N_("Contrast"), N_("Contrast"), IfdId::casioId, SectionId::makerTags, unsignedShort, -1,
125
     EXV_PRINT_TAG(casioContrast)},
126
    {0x000d, "Saturation", N_("Saturation"), N_("Saturation"), IfdId::casioId, SectionId::makerTags, unsignedShort, -1,
127
     EXV_PRINT_TAG(casioSaturation)},
128
    {0x0014, "ISO", N_("ISO"), N_("ISO"), IfdId::casioId, SectionId::makerTags, unsignedShort, -1, printValue},
129
    {0x0015, "FirmwareDate", N_("Firmware date"), N_("Firmware date"), IfdId::casioId, SectionId::makerTags,
130
     asciiString, -1, print0x0015},
131
    {0x0016, "Enhancement", N_("Enhancement"), N_("Enhancement"), IfdId::casioId, SectionId::makerTags, unsignedShort,
132
     -1, EXV_PRINT_TAG(casioEnhancement)},
133
    {0x0017, "ColorFilter", N_("Color Filter"), N_("Color Filter"), IfdId::casioId, SectionId::makerTags, unsignedShort,
134
     -1, EXV_PRINT_TAG(casioColorFilter)},
135
    {0x0018, "AFPoint", N_("AF Point"), N_("AF Point"), IfdId::casioId, SectionId::makerTags, unsignedShort, -1,
136
     printValue},
137
    {0x0019, "FlashIntensity2", N_("Flash Intensity"), N_("Flash Intensity"), IfdId::casioId, SectionId::makerTags,
138
     unsignedShort, -1, EXV_PRINT_TAG(casioFlashIntensity2)},
139
    {0x0020, "CCDSensitivity", N_("CCDSensitivity"), N_("CCDSensitivity"), IfdId::casioId, SectionId::makerTags,
140
     unsignedShort, -1, EXV_PRINT_TAG(casioCCDSensitivity)},
141
    {0x0e00, "PrintIM", N_("Print IM"), N_("PrintIM information"), IfdId::casioId, SectionId::makerTags, undefined, -1,
142
     printValue},
143
    {0xffff, "(UnknownCasioMakerNoteTag)", "(UnknownCasioMakerNoteTag)", N_("Unknown CasioMakerNote tag"),
144
     IfdId::casioId, SectionId::makerTags, asciiString, -1, printValue},
145
};
146
147
0
std::ostream& CasioMakerNote::print0x0006(std::ostream& os, const Value& value, const ExifData*) {
148
0
  return os << stringFormat("{:.2f} m", value.toInt64() / 1000.0);
149
0
}
150
151
0
std::ostream& CasioMakerNote::print0x0015(std::ostream& os, const Value& value, const ExifData*) {
152
  // format is:  "YYMM#00#00DDHH#00#00MM#00#00#00#00" or  "YYMM#00#00DDHH#00#00MMSS#00#00#00"
153
0
  std::vector<char> numbers;
154
0
  for (size_t i = 0; i < value.size(); i++) {
155
0
    const auto l = value.toInt64(i);
156
0
    if (l != 0) {
157
0
      numbers.push_back(l);
158
0
    }
159
0
  }
160
161
0
  if (numbers.size() >= 10) {
162
    // year
163
0
    long l = ((numbers[0] - 48) * 10) + (numbers[1] - 48);
164
0
    if (l < 70)
165
0
      l += 2000;
166
0
    else
167
0
      l += 1900;
168
0
    os << l << ":";
169
    // month, day, hour, minutes
170
0
    os << numbers[2] << numbers[3] << ":" << numbers[4] << numbers[5] << " " << numbers[6] << numbers[7] << ":"
171
0
       << numbers[8] << numbers[9];
172
    // optional seconds
173
0
    if (numbers.size() == 12) {
174
0
      os << ":" << numbers[10] << numbers[11];
175
0
    }
176
0
  } else
177
0
    os << value;
178
0
  return os;
179
0
}
180
181
// Casio Makernotes, Type 2
182
//! Quality Mode, tag 0x0004
183
constexpr TagDetails casio2QualityMode[] = {
184
    {0, N_("Economy")},
185
    {1, N_("Normal")},
186
    {2, N_("Fine")},
187
};
188
189
//! Image Size, tag 0x0009
190
constexpr TagDetails casio2ImageSize[] = {
191
    {0, "640x480"},    {4, "1600x1200"},  {5, "2048x1536"},  {20, "2288x1712"},
192
    {21, "2592x1944"}, {22, "2304x1728"}, {36, "3008x2008"},
193
};
194
195
//! Focus Mode, tag 0x000d
196
constexpr TagDetails casio2FocusMode[] = {
197
    {0, N_("Normal")},
198
    {1, N_("Macro")},
199
};
200
201
//! ISO Speed, tag 0x0014
202
constexpr TagDetails casio2IsoSpeed[] = {
203
    {3, "50"},
204
    {4, "64"},
205
    {6, "100"},
206
    {9, "200"},
207
};
208
209
//! White Balance, tag 0x0019
210
constexpr TagDetails casio2WhiteBalance[] = {
211
    {0, N_("Auto")},     {1, N_("Daylight")},    {2, N_("Shade")},
212
    {3, N_("Tungsten")}, {4, N_("Fluorescent")}, {5, N_("Manual")},
213
};
214
215
//! Saturation, tag 0x001f
216
constexpr TagDetails casio2Saturation[] = {
217
    {0, N_("Low")},
218
    {1, N_("Normal")},
219
    {2, N_("High")},
220
};
221
222
//! Contrast, tag 0x0020
223
constexpr TagDetails casio2Contrast[] = {
224
    {0, N_("Low")},
225
    {1, N_("Normal")},
226
    {2, N_("High")},
227
};
228
229
//! Sharpness, tag 0x0021
230
constexpr TagDetails casio2Sharpness[] = {
231
    {0, N_("Soft")},
232
    {1, N_("Normal")},
233
    {2, N_("Hard")},
234
};
235
236
//! White Balance2, tag 0x2012
237
constexpr TagDetails casio2WhiteBalance2[] = {
238
    {0, N_("Manual")},      {1, N_("Daylight")}, {2, N_("Cloudy")},    {3, N_("Shade")},  {4, N_("Flash")},
239
    {6, N_("Fluorescent")}, {9, N_("Tungsten")}, {10, N_("Tungsten")}, {12, N_("Flash")},
240
};
241
242
//! Release Mode, tag 0x3001
243
constexpr TagDetails casio2ReleaseMode[] = {
244
    {1, N_("Normal")},
245
    {3, N_("AE Bracketing")},
246
    {11, N_("WB Bracketing")},
247
    {13, N_("Contrast Bracketing")},
248
    {19, N_("High Speed Burst")},
249
};
250
251
//! Quality, tag 0x3002
252
constexpr TagDetails casio2Quality[] = {
253
    {1, N_("Economy")},
254
    {2, N_("Normal")},
255
    {3, N_("Fine")},
256
};
257
258
//! Focus Mode 2, tag 0x3003
259
constexpr TagDetails casio2FocusMode2[] = {
260
    {0, N_("Manual")},      {1, N_("Focus Lock")},
261
    {2, N_("Macro")},       {3, N_("Single-Area Auto Focus")},
262
    {5, N_("Infinity")},    {6, N_("Multi-Area Auto Focus")},
263
    {8, N_("Super Macro")},
264
};
265
266
//! AutoISO, tag 0x3008
267
constexpr TagDetails casio2AutoISO[] = {
268
    {1, N_("On")}, {2, N_("Off")}, {7, N_("On (high sensitivity)")}, {8, N_("On (anti-shake)")}, {10, N_("High Speed")},
269
};
270
271
//! AFMode, tag 0x3009
272
constexpr TagDetails casio2AFMode[] = {
273
    {0, N_("Off")},      {1, N_("Spot")},        {2, N_("Multi")}, {3, N_("Face Detection")},
274
    {4, N_("Tracking")}, {5, N_("Intelligent")},
275
};
276
277
//! ColorMode, tag 0x3015
278
constexpr TagDetails casio2ColorMode[] = {
279
    {0, N_("Off")},
280
    {2, N_("Black & White")},
281
    {3, N_("Sepia")},
282
};
283
284
//! Enhancement, tag 0x3016
285
constexpr TagDetails casio2Enhancement[] = {
286
    {0, N_("Off")}, {1, N_("Scenery")}, {3, N_("Green")}, {5, N_("Underwater")}, {9, N_("Flesh Tones")}
287
288
};
289
290
//! Color Filter, tag 0x3017
291
constexpr TagDetails casio2ColorFilter[] = {
292
    {0, N_("Off")}, {1, N_("Blue")},   {3, N_("Green")}, {4, N_("Yellow")},
293
    {5, N_("Red")}, {6, N_("Purple")}, {7, N_("Pink")},
294
};
295
296
//! Art Mode, tag 0x301b
297
constexpr TagDetails casio2ArtMode[] = {
298
    {0, N_("Normal")},        {8, N_("Silent Movie")}, {39, N_("HDR")},
299
    {45, N_("Premium Auto")}, {47, N_("Painting")},    {49, N_("Crayon Drawing")},
300
    {51, N_("Panorama")},     {52, N_("Art HDR")},     {62, N_("High Speed Night Shot")},
301
    {64, N_("Monochrome")},   {67, N_("Toy Camera")},  {68, N_("Pop Art")},
302
    {69, N_("Light Tone")},
303
};
304
305
//! Lighting Mode, tag 0x302a
306
constexpr TagDetails casio2LightingMode[] = {
307
    {0, N_("Off")},
308
    {1, N_("High Dynamic Range")},
309
    {5, N_("Shadow Enhance Low")},
310
    {6, N_("Shadow Enhance High")},
311
};
312
313
//! Portrait Refiner, tag 0x302b
314
constexpr TagDetails casio2PortraitRefiner[] = {
315
    {0, N_("Off")},
316
    {1, N_("+1")},
317
    {2, N_("+2")},
318
};
319
320
//! Special Effect Setting, tag 0x3031
321
constexpr TagDetails casio2SpecialEffectSetting[] = {
322
    {0, N_("Off")}, {1, N_("Makeup")}, {2, N_("Mist Removal")}, {3, N_("Vivid Landscape")}, {16, N_("Art Shot")},
323
};
324
325
//! Drive Mode, tag 0x3103
326
constexpr TagDetails casio2DriveMode[] = {
327
    {0, N_("Single Shot")},          {1, N_("Continuous Shooting")},
328
    {2, N_("Continuous (2 fps)")},   {3, N_("Continuous (3 fps)")},
329
    {4, N_("Continuous (4 fps)")},   {5, N_("Continuous (5 fps)")},
330
    {6, N_("Continuous (6 fps)")},   {7, N_("Continuous (7 fps)")},
331
    {10, N_("Continuous (10 fps)")}, {12, N_("Continuous (12 fps)")},
332
    {15, N_("Continuous (15 fps)")}, {20, N_("Continuous (20 fps)")},
333
    {30, N_("Continuous (30 fps)")}, {40, N_("Continuous (40 fps)")},
334
    {60, N_("Continuous (60 fps)")}, {240, N_("Auto-N")},
335
};
336
337
//! Video Quality, tag 0x4003
338
constexpr TagDetails casio2VideoQuality[] = {
339
    {1, N_("Standard")},
340
    {3, N_("HD (720p)")},
341
    {4, N_("Full HD (1080p)")},
342
    {5, N_("Low")},
343
};
344
345
// Casio2 MakerNote Tag Info
346
constexpr TagInfo Casio2MakerNote::tagInfo_[] = {
347
    {0x0002, "PreviewImageSize", N_("Preview Image Size"), N_("Preview Image Size"), IfdId::casio2Id,
348
     SectionId::makerTags, unsignedShort, -1, printValue},
349
    {0x0003, "PreviewImageLength", N_("Preview Image Length"), N_("Preview Image Length"), IfdId::casio2Id,
350
     SectionId::makerTags, unsignedLong, -1, printValue},
351
    {0x0004, "PreviewImageStart", N_("Preview Image Start"), N_("Preview Image Start"), IfdId::casio2Id,
352
     SectionId::makerTags, unsignedLong, -1, printValue},
353
    {0x0008, "QualityMode", N_("Quality Mode"), N_("Quality Mode"), IfdId::casio2Id, SectionId::makerTags,
354
     unsignedShort, -1, EXV_PRINT_TAG(casio2QualityMode)},
355
    {0x0009, "ImageSize", N_("Image Size"), N_("Image Size"), IfdId::casio2Id, SectionId::makerTags, unsignedShort, -1,
356
     EXV_PRINT_TAG(casio2ImageSize)},
357
    {0x000d, "FocusMode", N_("Focus Mode"), N_("Focus Mode"), IfdId::casio2Id, SectionId::makerTags, unsignedShort, -1,
358
     EXV_PRINT_TAG(casio2FocusMode)},
359
    {0x0014, "ISOSpeed", N_("ISO Speed"), N_("ISO Speed"), IfdId::casio2Id, SectionId::makerTags, unsignedShort, -1,
360
     EXV_PRINT_TAG(casio2IsoSpeed)},
361
    {0x0019, "WhiteBalance", N_("White Balance"), N_("White Balance Setting"), IfdId::casio2Id, SectionId::makerTags,
362
     unsignedShort, -1, EXV_PRINT_TAG(casio2WhiteBalance)},
363
    {0x001d, "FocalLength", N_("Focal Length"), N_("Focal Length"), IfdId::casio2Id, SectionId::makerTags,
364
     unsignedRational, -1, printValue},
365
    {0x001f, "Saturation", N_("Saturation"), N_("Saturation"), IfdId::casio2Id, SectionId::makerTags, unsignedShort, -1,
366
     EXV_PRINT_TAG(casio2Saturation)},
367
    {0x0020, "Contrast", N_("Contrast"), N_("Contrast"), IfdId::casio2Id, SectionId::makerTags, unsignedShort, -1,
368
     EXV_PRINT_TAG(casio2Contrast)},
369
    {0x0021, "Sharpness", N_("Sharpness"), N_("Sharpness"), IfdId::casio2Id, SectionId::makerTags, unsignedShort, -1,
370
     EXV_PRINT_TAG(casio2Sharpness)},
371
    {0x0e00, "PrintIM", N_("Print IM"), N_("PrintIM information"), IfdId::casio2Id, SectionId::makerTags, undefined, -1,
372
     printValue},
373
    {0x2000, "PreviewImage", N_("Preview Image"), N_("Preview Image"), IfdId::casio2Id, SectionId::makerTags, undefined,
374
     -1, printValue},
375
    {0x2001, "FirmwareDate", N_("Firmware Date"), N_("Firmware Date"), IfdId::casio2Id, SectionId::makerTags,
376
     asciiString, -1, print0x2001},
377
    {0x2011, "WhiteBalanceBias", N_("White Balance Bias"), N_("White Balance Bias"), IfdId::casio2Id,
378
     SectionId::makerTags, unsignedShort, -1, printValue},
379
    {0x2012, "WhiteBalance2", N_("White Balance"), N_("White Balance Setting"), IfdId::casio2Id, SectionId::makerTags,
380
     unsignedShort, -1, EXV_PRINT_TAG(casio2WhiteBalance2)},
381
    {0x2021, "AFPointPosition", N_("AF Point Position"), N_("AF Point Position"), IfdId::casio2Id, SectionId::makerTags,
382
     unsignedShort, -1, printValue},
383
    {0x2022, "ObjectDistance", N_("Object Distance"), N_("Object Distance"), IfdId::casio2Id, SectionId::makerTags,
384
     unsignedLong, -1, print0x2022},
385
    {0x2034, "FlashDistance", N_("Flash Distance"), N_("Flash Distance"), IfdId::casio2Id, SectionId::makerTags,
386
     unsignedShort, -1, printValue},
387
    {0x2076, "SpecialEffectMode", N_("Special Effect Mode"), N_("Special Effect Mode"), IfdId::casio2Id,
388
     SectionId::makerTags, unsignedByte, -1, printValue},
389
    {0x2089, "FaceInfo", N_("Face Info"), N_("Face Info"), IfdId::casio2Id, SectionId::makerTags, undefined, -1,
390
     printValue},
391
    {0x211c, "FacesDetected", N_("Faces detected"), N_("Faces detected"), IfdId::casio2Id, SectionId::makerTags,
392
     unsignedByte, -1, printValue},
393
    {0x3000, "RecordMode", N_("Record Mode"), N_("Record Mode"), IfdId::casio2Id, SectionId::makerTags, unsignedShort,
394
     -1, printValue},
395
    {0x3001, "ReleaseMode", N_("Release Mode"), N_("Release Mode"), IfdId::casio2Id, SectionId::makerTags,
396
     unsignedShort, -1, EXV_PRINT_TAG(casio2ReleaseMode)},
397
    {0x3002, "Quality", N_("Quality"), N_("Quality"), IfdId::casio2Id, SectionId::makerTags, unsignedShort, -1,
398
     EXV_PRINT_TAG(casio2Quality)},
399
    {0x3003, "FocusMode2", N_("Focus Mode2"), N_("Focus Mode2"), IfdId::casio2Id, SectionId::makerTags, unsignedShort,
400
     -1, EXV_PRINT_TAG(casio2FocusMode2)},
401
    {0x3006, "HometownCity", N_("Home town city"), N_("Home town city"), IfdId::casio2Id, SectionId::makerTags,
402
     asciiString, -1, printValue},
403
    {0x3007, "BestShotMode", N_("Best Shot Mode"), N_("Best Shot Mode"), IfdId::casio2Id, SectionId::makerTags,
404
     unsignedShort, -1, printValue},
405
    {0x3008, "AutoISO", N_("Auto ISO"), N_("Auto ISO"), IfdId::casio2Id, SectionId::makerTags, unsignedShort, -1,
406
     EXV_PRINT_TAG(casio2AutoISO)},
407
    {0x3009, "AFMode", N_("AF Mode"), N_("AF Mode"), IfdId::casio2Id, SectionId::makerTags, unsignedShort, -1,
408
     EXV_PRINT_TAG(casio2AFMode)},
409
    {0x3011, "Sharpness2", N_("Sharpness"), N_("Sharpness"), IfdId::casio2Id, SectionId::makerTags, undefined, -1,
410
     printValue},
411
    {0x3012, "Contrast2", N_("Contrast"), N_("Contrast"), IfdId::casio2Id, SectionId::makerTags, undefined, -1,
412
     printValue},
413
    {0x3013, "Saturation2", N_("Saturation"), N_("Saturation"), IfdId::casio2Id, SectionId::makerTags, undefined, -1,
414
     printValue},
415
    {0x3014, "ISO", N_("ISO"), N_("ISO"), IfdId::casio2Id, SectionId::makerTags, unsignedShort, -1, printValue},
416
    {0x3015, "ColorMode", N_("Color Mode"), N_("Color Mode"), IfdId::casio2Id, SectionId::makerTags, unsignedShort, -1,
417
     EXV_PRINT_TAG(casio2ColorMode)},
418
    {0x3016, "Enhancement", N_("Enhancement"), N_("Enhancement"), IfdId::casio2Id, SectionId::makerTags, unsignedShort,
419
     -1, EXV_PRINT_TAG(casio2Enhancement)},
420
    {0x3017, "ColorFilter", N_("Color Filter"), N_("Color Filter"), IfdId::casio2Id, SectionId::makerTags,
421
     unsignedShort, -1, EXV_PRINT_TAG(casio2ColorFilter)},
422
    {0x301b, "ArtMode", N_("Art Mode"), N_("Art Mode"), IfdId::casio2Id, SectionId::makerTags, unsignedShort, -1,
423
     EXV_PRINT_TAG(casio2ArtMode)},
424
    {0x301c, "SequenceNumber", N_("Sequence Number"), N_("Sequence Number"), IfdId::casio2Id, SectionId::makerTags,
425
     unsignedShort, -1, printValue},
426
    {0x3020, "ImageStabilization", N_("Image Stabilization"), N_("Image Stabilization"), IfdId::casio2Id,
427
     SectionId::makerTags, unsignedShort, -1, printValue},
428
    {0x302a, "LightingMode", N_("Lighting Mode"), N_("Lighting Mode"), IfdId::casio2Id, SectionId::makerTags,
429
     unsignedShort, -1, EXV_PRINT_TAG(casio2LightingMode)},
430
    {0x302b, "PortraitRefiner", N_("Portrait Refiner"), N_("Portrait Refiner settings"), IfdId::casio2Id,
431
     SectionId::makerTags, unsignedShort, -1, EXV_PRINT_TAG(casio2PortraitRefiner)},
432
    {0x3030, "SpecialEffectLevel", N_("Special Effect Level"), N_("Special Effect Level"), IfdId::casio2Id,
433
     SectionId::makerTags, unsignedShort, -1, printValue},
434
    {0x3031, "SpecialEffectSetting", N_("Special Effect Setting"), N_("Special Effect Setting"), IfdId::casio2Id,
435
     SectionId::makerTags, unsignedShort, -1, EXV_PRINT_TAG(casio2SpecialEffectSetting)},
436
    {0x3103, "DriveMode", N_("Drive Mode"), N_("Drive Mode"), IfdId::casio2Id, SectionId::makerTags, unsignedShort, -1,
437
     EXV_PRINT_TAG(casio2DriveMode)},
438
    {0x310b, "ArtModeParameters", N_("Art Mode Parameters"), N_("Art Mode Parameters"), IfdId::casio2Id,
439
     SectionId::makerTags, undefined, -1, printValue},
440
    {0x4001, "CaptureFrameRate", N_("Capture Frame Rate"), N_("Capture Frame Rate"), IfdId::casio2Id,
441
     SectionId::makerTags, unsignedShort, -1, printValue},
442
    {0x4003, "VideoQuality", N_("Video Quality"), N_("Video Quality"), IfdId::casio2Id, SectionId::makerTags,
443
     unsignedShort, -1, EXV_PRINT_TAG(casio2VideoQuality)},
444
    {0xffff, "(UnknownCasio2MakerNoteTag)", "(UnknownCasio2MakerNoteTag)", N_("Unknown Casio2MakerNote tag"),
445
     IfdId::casio2Id, SectionId::makerTags, asciiString, -1, printValue},
446
};
447
448
0
std::ostream& Casio2MakerNote::print0x2001(std::ostream& os, const Value& value, const ExifData*) {
449
  // format is:  "YYMM#00#00DDHH#00#00MM#00#00#00#00"
450
0
  std::vector<char> numbers;
451
0
  for (size_t i = 0; i < value.size(); i++) {
452
0
    const auto l = value.toInt64(i);
453
0
    if (l != 0) {
454
0
      numbers.push_back(l);
455
0
    }
456
0
  }
457
458
0
  if (numbers.size() >= 10) {
459
    // year
460
0
    long l = ((numbers[0] - 48) * 10) + (numbers[1] - 48);
461
0
    if (l < 70)
462
0
      l += 2000;
463
0
    else
464
0
      l += 1900;
465
0
    os << l << ":";
466
    // month, day, hour, minutes
467
0
    os << numbers[2] << numbers[3] << ":" << numbers[4] << numbers[5] << " " << numbers[6] << numbers[7] << ":"
468
0
       << numbers[8] << numbers[9];
469
0
  } else
470
0
    os << value;
471
0
  return os;
472
0
}
473
474
0
std::ostream& Casio2MakerNote::print0x2022(std::ostream& os, const Value& value, const ExifData*) {
475
0
  if (value.toInt64() >= 0x20000000) {
476
0
    return os << N_("Inf");
477
0
  }
478
0
  return os << stringFormat("{:.2f} m", value.toInt64() / 1000.0);
479
0
}
480
481
}  // namespace Exiv2::Internal