1 // ***************************************************************** -*- C++ -*-
2 /*
3  * Copyright (C) 2004-2021 Exiv2 authors
4  * This program is part of the Exiv2 distribution.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
19  */
20 // *****************************************************************************
21 // included header files
22 #include "types.hpp"
23 #include "panasonicmn_int.hpp"
24 #include "tags_int.hpp"
25 #include "value.hpp"
26 #include "i18n.h"                // NLS support.
27 
28 // + standard includes
29 #include <string>
30 #include <sstream>
31 #include <iomanip>
32 #include <cassert>
33 #include <cstring>
34 
35 // *****************************************************************************
36 // class member definitions
37 namespace Exiv2 {
38     namespace Internal {
39 
40     //! Quality, tag 0x0001
41     extern const TagDetails panasonicQuality[] = {
42         {  1, N_("TIFF")           },
43         {  2, N_("High")           },
44         {  3, N_("Normal")         },
45         {  6, N_("Very High")      },
46         {  7, N_("Raw")            },
47         {  9, N_("Motion Picture") },
48         { 11, N_("Full HD Movie")  },
49         { 12, N_("4k Movie")       }
50     };
51 
52     //! WhiteBalance, tag 0x0003
53     extern const TagDetails panasonicWhiteBalance[] = {
54         {  1, N_("Auto")            },
55         {  2, N_("Daylight")        },
56         {  3, N_("Cloudy")          },
57         {  4, N_("Halogen")         },
58         {  5, N_("Manual")          },
59         {  8, N_("Flash")           },
60         { 10, N_("Black and white") },
61         { 11, N_("Manual")          },
62         { 12, N_("Shade")           },
63         { 13, N_("Kelvin")          }
64     };
65 
66     //! FocusMode, tag 0x0007
67     extern const TagDetails panasonicFocusMode[] = {
68         {  1, N_("Auto")               },
69         {  2, N_("Manual")             },
70         {  4, N_("Auto, focus button") },
71         {  5, N_("Auto, continuous")   },
72         {  6, N_("AF-S")               },
73         {  7, N_("AF-C")               },
74         {  8, N_("AF-F")               }
75     };
76 
77     //! ImageStabilizer, tag 0x001a
78     extern const TagDetails panasonicImageStabilizer[] = {
79         {  2, N_("On, Mode 1") },
80         {  3, N_("Off")        },
81         {  4, N_("On, Mode 2") },
82         {  5, N_("Panning")    },
83         {  6, N_("On, Mode 3") },
84     };
85 
86     //! Macro, tag 0x001c
87     extern const TagDetails panasonicMacro[] = {
88         {   1, N_("On")         },
89         {   2, N_("Off")        },
90         { 257, N_("Tele-macro") },
91         { 513, N_("Macro-zoom") }
92     };
93 
94     //! ShootingMode, tag 0x001f and SceneMode, tag 0x8001
95     extern const TagDetails panasonicShootingMode[] = {
96         {  0, N_("Off")                            }, // only SceneMode
97         {  1, N_("Normal")                         },
98         {  2, N_("Portrait")                       },
99         {  3, N_("Scenery")                        },
100         {  4, N_("Sports")                         },
101         {  5, N_("Night portrait")                 },
102         {  6, N_("Program")                        },
103         {  7, N_("Aperture priority")              },
104         {  8, N_("Shutter-speed priority")         },
105         {  9, N_("Macro")                          },
106         { 10, N_("Spot")                           },
107         { 11, N_("Manual")                         },
108         { 12, N_("Movie preview")                  },
109         { 13, N_("Panning")                        },
110         { 14, N_("Simple")                         },
111         { 15, N_("Color effects")                  },
112         { 16, N_("Self Portrait")                  },
113         { 17, N_("Economy")                        },
114         { 18, N_("Fireworks")                      },
115         { 19, N_("Party")                          },
116         { 20, N_("Snow")                           },
117         { 21, N_("Night scenery")                  },
118         { 22, N_("Food")                           },
119         { 23, N_("Baby")                           },
120         { 24, N_("Soft skin")                      },
121         { 25, N_("Candlelight")                    },
122         { 26, N_("Starry night")                   },
123         { 27, N_("High sensitivity")               },
124         { 28, N_("Panorama assist")                },
125         { 29, N_("Underwater")                     },
126         { 30, N_("Beach")                          },
127         { 31, N_("Aerial photo")                   },
128         { 32, N_("Sunset")                         },
129         { 33, N_("Pet")                            },
130         { 34, N_("Intelligent ISO")                },
131         { 35, N_("Clipboard")                      },
132         { 36, N_("High speed continuous shooting") },
133         { 37, N_("Intelligent auto")               },
134         { 39, N_("Multi-aspect")                   },
135         { 41, N_("Transform")                      },
136         { 42, N_("Flash Burst")                    },
137         { 43, N_("Pin Hole")                       },
138         { 44, N_("Film Grain")                     },
139         { 45, N_("My Color")                       },
140         { 46, N_("Photo Frame")                    },
141         { 51, N_("HDR")                            },
142         { 55, N_("Handheld Night Shot")            },
143         { 57, N_("3D")                             },
144         { 59, N_("Creative Control")               },
145         { 62, N_("Panorama")                       },
146         { 63, N_("Glass Through")                  },
147         { 64, N_("HDR")                            },
148         { 66, N_("Digital Filter")                 },
149         { 67, N_("Clear Portrait")                 },
150         { 68, N_("Silky Skin")                     },
151         { 69, N_("Backlit Softness")               },
152         { 70, N_("Clear in Backlight")             },
153         { 71, N_("Relaxing Tone")                  },
154         { 72, N_("Sweet Child's Face")             },
155         { 73, N_("Distinct Scenery")               },
156         { 74, N_("Bright Blue Sky")                },
157         { 75, N_("Romantic Sunset Glow")           },
158         { 76, N_("Vivid Sunset Glow")              },
159         { 77, N_("Glistening Water")               },
160         { 78, N_("Clear Nightscape")               },
161         { 79, N_("Cool Night Sky")                 },
162         { 80, N_("Warm Glowing Nightscape")        },
163         { 81, N_("Artistic Nightscape")            },
164         { 82, N_("Glittering Illuminations")       },
165         { 83, N_("Clear Night Portrait")           },
166         { 84, N_("Soft Image of a Flower")         },
167         { 85, N_("Appetizing Food")                },
168         { 86, N_("Cute Desert")                    },
169         { 87, N_("Freeze Animal Motion")           },
170         { 88, N_("Clear Sports Shot")              },
171         { 89, N_("Monochrome")                     },
172         { 90, N_("Creative Control")               }
173     };
174 
175     //! Audio, tag 0x0020
176     extern const TagDetails panasonicAudio[] = {
177         { 1, N_("Yes")    },
178         { 2, N_("No")     },
179         { 3, N_("Stereo") }
180     };
181 
182     //! ColorEffect, tag 0x0028
183     extern const TagDetails panasonicColorEffect[] = {
184         { 1, N_("Off")             },
185         { 2, N_("Warm")            },
186         { 3, N_("Cool")            },
187         { 4, N_("Black and white") },
188         { 5, N_("Sepia")           },
189         { 6, N_("Happy")           }
190     };
191 
192     //! BustMode, tag 0x002a
193     extern const TagDetails panasonicBurstMode[] = {
194         { 0, N_("Off")              },
195         { 1, N_("Low/High quality") },
196         { 2, N_("Infinite")         }
197     };
198 
199     //! Contrast, tag 0x002c
200     extern const TagDetails panasonicContrast[] = {
201         {   0, N_("Normal")      },
202         {   1, N_("Low")         },
203         {   2, N_("High")        },
204         {   6, N_("Medium low")  },
205         {   7, N_("Medium high") },
206         { 256, N_("Low")         },
207         { 272, N_("Standard")    },
208         { 288, N_("High")        },
209         { 288, N_("High")        }              // To silence compiler warning
210     };
211 
212     //! NoiseReduction, tag 0x002d
213     extern const TagDetails panasonicNoiseReduction[] = {
214         { 0, N_("Standard") },
215         { 1, N_("Low (-1)")     },
216         { 2, N_("High (+1)")    },
217         { 3, N_("Lowest (-2)")  },
218         { 4, N_("Highest (+2)") }
219     };
220 
221     //! SelfTimer, tag 0x002e
222     extern const TagDetails panasonicSelfTimer[] = {
223         { 1, N_("Off")                },
224         { 2, "10 s"               },
225         { 3, "2 s"                },
226         { 4, "10 s / 3 pictures"  }
227     };
228 
229     //! Rotation, tag 0x0030
230     extern const TagDetails panasonicRotation[] = {
231         { 1, N_("Horizontal (normal)") },
232         { 3, N_("Rotate 180")          },
233         { 6, N_("Rotate 90 CW")        },
234         { 8, N_("Rotate 270 CW")       }
235     };
236 
237     //! AFAssistLamp, tag 0x0031
238     extern const TagDetails panasonicAFAssistLamp[] = {
239         { 1, N_("Fired")                     },
240         { 2, N_("Enabled but Not Used")      },
241         { 3, N_("Disabled but Required")     },
242         { 4, N_("Disabled and Not Required") }
243     };
244 
245     //! ColorMode, tag 0x0032
246     extern const TagDetails panasonicColorMode[] = {
247         { 0, N_("Normal")  },
248         { 1, N_("Natural") },
249         { 2, N_("Vivid")   }
250     };
251 
252     //! OpticalZoomMode, tag 0x0034
253     extern const TagDetails panasonicOpticalZoomMode[] = {
254         { 1, N_("Standard")  },
255         { 2, N_("EX optics") }
256     };
257 
258     //! ConversionLens, tag 0x0035
259     extern const TagDetails panasonicConversionLens[] = {
260         { 1, N_("Off")       },
261         { 2, N_("Wide")      },
262         { 3, N_("Telephoto") },
263         { 4, N_("Macro")     },
264         { 4, N_("Macro")     }                  // To silence compiler warning
265     };
266 
267     //! WorldTimeLocation, tag 0x003a
268     extern const TagDetails panasonicWorldTimeLocation[] = {
269         { 1, N_("Home")        },
270         { 2, N_("Destination") }
271     };
272 
273     //! TextStamp, tag 0x003b, 0x003e, 000x8008 and 0x8009
274     extern const TagDetails panasonicTextStamp[] = {
275         { 1, N_("Off") },
276         { 2, N_("On")  }
277     };
278 
279     //! FilmMode, tag 0x0042
280     extern const TagDetails panasonicFilmMode[] = {
281         {  1, N_("Standard (color)") },
282         {  2, N_("Dynamic (color)")  },
283         {  3, N_("Nature (color)")   },
284         {  4, N_("Smooth (color)")   },
285         {  5, N_("Standard (B&W)")   },
286         {  6, N_("Dynamic (B&W)")    },
287         {  7, N_("Smooth (B&W)")     },
288         { 10, N_("Nostalgic")        },
289         { 11, N_("Vibrant")          }
290     };
291 
292     //! Bracket Settings, tag 0x0045
293     extern const TagDetails panasonicBracketSettings[] = {
294         { 0, N_("No Bracket")               },
295         { 1, N_("3 images, Sequence 0/-/+") },
296         { 2, N_("3 images, Sequence -/0/+") },
297         { 3, N_("5 images, Sequence 0/-/+") },
298         { 4, N_("5 images, Sequence -/0/+") },
299         { 5, N_("7 images, Sequence 0/-/+") },
300         { 6, N_("7 images, Sequence -/0/+") }
301     };
302 
303     //! Flash curtain, tag 0x0048
304     extern const TagDetails panasonicFlashCurtain[] = {
305         { 0, N_("n/a") },
306         { 1, N_("1st") },
307         { 2, N_("2nd") }
308     };
309 
310     //! Long Shutter Noise Reduction, tag 0x0049
311     extern const TagDetails panasonicLongShutterNoiseReduction[] = {
312         { 1, N_("Off") },
313         { 2, N_("On") }
314     };
315 
316     //! Intelligent exposure, tag 0x005d
317     extern const TagDetails panasonicIntelligentExposure[] = {
318         { 0, N_("Off")      },
319         { 1, N_("Low")      },
320         { 2, N_("Standard") },
321         { 3, N_("High")     }
322     };
323 
324     //! Flash warning, tag 0x0062
325     extern const TagDetails panasonicFlashWarning[] = {
326         { 0, N_("No")                               },
327         { 1, N_("Yes (flash required but disabled") }
328     };
329 
330     //! Intelligent resolution, tag 0x0070
331     extern const TagDetails panasonicIntelligentResolution[] = {
332         { 0, N_("Off")      },
333         { 1, N_("Low")      },
334         { 2, N_("Standard") },
335         { 3, N_("High")     },
336         { 4, N_("Extended") }
337     };
338 
339     //! Intelligent D-Range, tag 0x0079
340     extern const TagDetails panasonicIntelligentDRange[] = {
341         { 0, N_("Off")      },
342         { 1, N_("Low")      },
343         { 2, N_("Standard") },
344         { 3, N_("High")     }
345     };
346 
347     //! Clear Retouch, tag 0x007c
348     extern const TagDetails panasonicClearRetouch[] = {
349         { 0, N_("Off") },
350         { 1, N_("On") }
351     };
352 
353     //! Photo Style, tag 0x0089
354     extern const TagDetails panasonicPhotoStyle[] = {
355         { 0, N_("NoAuto")             },
356         { 1, N_("Standard or Custom") },
357         { 2, N_("Vivid")              },
358         { 3, N_("Natural")            },
359         { 4, N_("Monochrome")         },
360         { 5, N_("Scenery")            },
361         { 6, N_("Portrait")           }
362     };
363 
364     //! Shading compensation, tag 0x008a
365     extern const TagDetails panasonicShadingCompensation[] = {
366         { 0, N_("Off") },
367         { 1, N_("On") }
368     };
369 
370     //! Camera orientation, tag 0x008f
371     extern const TagDetails panasonicCameraOrientation[] = {
372         { 0, N_("Normal")         },
373         { 1, N_("Rotate CW")      },
374         { 2, N_("Rotate 180")     },
375         { 3, N_("Rotate CCW")     },
376         { 4, N_("Tilt upwards")   },
377         { 5, N_("Tilt downwards") }
378     };
379 
380     //! Sweep panorama direction, tag 0x0093
381     extern const TagDetails panasonicSweepPanoramaDirection[] = {
382         { 0, N_("Off")           },
383         { 1, N_("Left to Right") },
384         { 2, N_("Right to Left") },
385         { 3, N_("Top to Bottom") },
386         { 4, N_("Bottom to Top") }
387     };
388 
389     //! Timer recording, tag 0x0096
390     extern const TagDetails panasonicTimerRecording[] = {
391         { 0, N_("Off")                   },
392         { 1, N_("Time Lapse")            },
393         { 2, N_("Stop-Motion Animation") }
394     };
395 
396     //! HDR, tag 0x009e
397     extern const TagDetails panasonicHDR[] = {
398         {     0, N_("Off")         },
399         {   100, N_("1 EV")        },
400         {   200, N_("2 EV")        },
401         {   300, N_("3 EV")        },
402         { 32868, N_("1 EV (Auto)") },
403         { 32968, N_("2 EV (Auto)") },
404         { 33068, N_("3 EV (Auto)") }
405     };
406 
407     //! Shutter Type, tag 0x009f
408     extern const TagDetails panasonicShutterType[] = {
409         { 0, N_("Mechanical") },
410         { 1, N_("Electronic") },
411         { 2, N_("Hybrid")     }
412     };
413 
414     //! Touch AE, tag 0x00ab
415     extern const TagDetails panasonicTouchAE[] = {
416         { 0, N_("Off") },
417         { 1, N_("On")  }
418     };
419 
420     //! Flash Fired, tag 0x8007
421     extern const TagDetails panasonicFlashFired[] = {
422         { 1, N_("No")  },
423         { 2, N_("Yes") }
424     };
425 
426     // Panasonic MakerNote Tag Info
427     const TagInfo PanasonicMakerNote::tagInfo_[] = {
428         TagInfo(0x0001, "Quality", N_("Quality"), N_("Image Quality"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicQuality)),
429         TagInfo(0x0002, "FirmwareVersion", N_("Firmware Version"), N_("Firmware version"), panasonicId, makerTags, undefined, -1, printValue),
430         TagInfo(0x0003, "WhiteBalance", N_("White Balance"), N_("White balance setting"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicWhiteBalance)),
431         TagInfo(0x0004, "0x0004", "0x0004", N_("Unknown"), panasonicId, makerTags, unsignedShort, -1, printValue),
432         TagInfo(0x0007, "FocusMode", N_("Focus Mode"), N_("Focus mode"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicFocusMode)),
433         TagInfo(0x000f, "AFMode", N_("AF Mode"), N_("AF mode"), panasonicId, makerTags, unsignedByte, -1, print0x000f),
434         TagInfo(0x001a, "ImageStabilization", N_("Image Stabilization"), N_("Image stabilization"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicImageStabilizer)),
435         TagInfo(0x001c, "Macro", N_("Macro"), N_("Macro mode"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicMacro)),
436         TagInfo(0x001f, "ShootingMode", N_("Shooting Mode"), N_("Shooting mode"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicShootingMode)),
437         TagInfo(0x0020, "Audio", N_("Audio"), N_("Audio"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicAudio)),
438         TagInfo(0x0021, "DataDump", N_("Data Dump"), N_("Data dump"), panasonicId, makerTags, undefined, -1, printValue),
439         TagInfo(0x0022, "0x0022", "0x0022", N_("Unknown"), panasonicId, makerTags, unsignedShort, -1, printValue),
440         TagInfo(0x0023, "WhiteBalanceBias", N_("White Balance Bias"), N_("White balance adjustment"), panasonicId, makerTags, signedShort, -1, print0x0023),
441         TagInfo(0x0024, "FlashBias", N_("FlashBias"), N_("Flash bias"), panasonicId, makerTags, signedShort, -1, printValue),
442         TagInfo(0x0025, "InternalSerialNumber", N_("Internal Serial Number"), N_("This number is unique, and contains the date of manufacture, but is not the same as the number printed on the camera body."), panasonicId, makerTags, undefined, -1, printPanasonicText),
443         TagInfo(0x0026, "ExifVersion", "Exif Version", N_("Exif version"), panasonicId, makerTags, undefined, -1, printExifVersion),
444         TagInfo(0x0027, "0x0027", "0x0027", N_("Unknown"), panasonicId, makerTags, unsignedShort, -1, printValue),
445         TagInfo(0x0028, "ColorEffect", N_("Color Effect"), N_("Color effect"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicColorEffect)),
446         TagInfo(0x0029, "TimeSincePowerOn", "Time since Power On", N_("Time in 1/100 s from when the camera was powered on to when the image is written to memory card"), panasonicId, makerTags, unsignedLong, -1, print0x0029),
447         TagInfo(0x002a, "BurstMode", N_("Burst Mode"), N_("Burst mode"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicBurstMode)),
448         TagInfo(0x002b, "SequenceNumber", N_("Sequence Number"), N_("Sequence number"), panasonicId, makerTags, unsignedLong, -1, printValue),
449         TagInfo(0x002c, "Contrast", N_("Contrast"), N_("Contrast setting"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicContrast)),
450         TagInfo(0x002d, "NoiseReduction", N_("NoiseReduction"), N_("Noise reduction"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicNoiseReduction)),
451         TagInfo(0x002e, "SelfTimer", N_("Self Timer"), N_("Self timer"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicSelfTimer)),
452         TagInfo(0x002f, "0x002f", "0x002f", N_("Unknown"), panasonicId, makerTags, unsignedShort, -1, printValue),
453         TagInfo(0x0030, "Rotation", N_("Rotation"), N_("Rotation"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicRotation)),
454         TagInfo(0x0031, "AFAssistLamp", N_("AF Assist Lamp"), N_("AF Assist Lamp"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicAFAssistLamp)),
455         TagInfo(0x0032, "ColorMode", N_("Color Mode"), N_("Color mode"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicColorMode)),
456         TagInfo(0x0033, "BabyAge1", N_("Baby Age 1"), N_("Baby (or pet) age 1"), panasonicId, makerTags, asciiString, -1, print0x0033),
457         TagInfo(0x0034, "OpticalZoomMode", N_("Optical Zoom Mode"), N_("Optical zoom mode"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicOpticalZoomMode)),
458         TagInfo(0x0035, "ConversionLens", N_("Conversion Lens"), N_("Conversion lens"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicConversionLens)),
459         TagInfo(0x0036, "TravelDay", N_("Travel Day"), N_("Travel day"), panasonicId, makerTags, unsignedShort, -1, print0x0036),
460         TagInfo(0x0039, "Contrast", N_("Contrast"), N_("Contrast"), panasonicId, makerTags, unsignedShort, -1, printValue),
461         TagInfo(0x003a, "WorldTimeLocation", N_("World Time Location"), N_("World time location"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicWorldTimeLocation)),
462         TagInfo(0x003b, "TextStamp1", N_("Text Stamp 1"), N_("Text Stamp 1"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicTextStamp)),
463         TagInfo(0x003c, "ProgramISO", N_("Program ISO"), N_("Program ISO"), panasonicId, makerTags, unsignedShort, -1, print0x003c),
464         TagInfo(0x003d, "AdvancedSceneType", N_("Advanced Scene Type"), N_("Advanced Scene Type"), panasonicId, makerTags, unsignedShort, -1, printValue),
465         TagInfo(0x003e, "TextStamp2", N_("Text Stamp 2"), N_("Text Stamp 2"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicTextStamp)),
466         TagInfo(0x003f, "FacesDetected", N_("Faces detected"), N_("Faces detected"), panasonicId, makerTags, unsignedShort, -1, printValue),
467         TagInfo(0x0040, "Saturation", N_("Saturation"), N_("Saturation"), panasonicId, makerTags, unsignedShort, -1, printValue),
468         TagInfo(0x0041, "Sharpness", N_("Sharpness"), N_("Sharpness"), panasonicId, makerTags, unsignedShort, -1, printValue),
469         TagInfo(0x0042, "FilmMode", N_("Film Mode"), N_("Film mode"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicFilmMode)),
470         TagInfo(0x0044, "ColorTempKelvin", N_("Color Temp Kelvin"), N_("Color Temperatur in Kelvin"), panasonicId, makerTags, unsignedShort, -1, printValue),
471         TagInfo(0x0045, "BracketSettings", N_("Bracket Settings"), N_("Bracket Settings"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicBracketSettings)),
472         TagInfo(0x0046, "WBAdjustAB", N_("WB Adjust AB"), N_("WB adjust AB. Positive is a shift toward blue."), panasonicId, makerTags, unsignedShort, -1, printValue),
473         TagInfo(0x0047, "WBAdjustGM", N_("WB Adjust GM"), N_("WBAdjustGM. Positive is a shift toward green."), panasonicId, makerTags, unsignedShort, -1, printValue),
474         TagInfo(0x0048, "FlashCurtain", N_("Flash Curtain"), N_("Flash Curtain"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicFlashCurtain)),
475         TagInfo(0x0049, "LongShutterNoiseReduction", N_("Long Shutter Noise Reduction"), N_("Long Shutter Noise Reduction"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicLongShutterNoiseReduction)),
476         TagInfo(0x004b, "ImageWidth", N_("Image width"), N_("Image width"), panasonicId, makerTags, unsignedLong, -1, printValue),
477         TagInfo(0x004c, "ImageHeight", N_("Image height"), N_("Image height"), panasonicId, makerTags, unsignedLong, -1, printValue),
478         TagInfo(0x004d, "AFPointPosition", N_("AF Point Position"), N_("AF Point Position"), panasonicId, makerTags, unsignedRational, -1, printValue),
479         TagInfo(0x004e, "FaceDetInfo", N_("Face detection info"), N_("Face detection info"), panasonicId, makerTags, undefined, -1, printValue),
480         TagInfo(0x0051, "LensType", N_("Lens Type"), N_("Lens type"), panasonicId, makerTags, asciiString, -1, printValue),
481         TagInfo(0x0052, "LensSerialNumber", N_("Lens Serial Number"), N_("Lens serial number"), panasonicId, makerTags, asciiString, -1, printValue),
482         TagInfo(0x0053, "AccessoryType", N_("Accessory Type"), N_("Accessory type"), panasonicId, makerTags, asciiString, -1, printValue),
483         TagInfo(0x0054, "AccessorySerialNumber", N_("Accessory Serial Number"), N_("Accessory Serial Number"), panasonicId, makerTags, asciiString, -1, printValue),
484         TagInfo(0x0059, "Transform1", N_("Transform 1"), N_("Transform 1"), panasonicId, makerTags, undefined, -1, printValue),
485         TagInfo(0x005d, "IntelligentExposure", N_("Intelligent Exposure"), N_("Intelligent Exposure"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicIntelligentExposure)),
486         TagInfo(0x0060, "LensFirmwareVersion", N_("Firmware Version of the Lens"), N_("Firmware Version of the Lens"), panasonicId, makerTags, undefined, -1, printValue),
487         TagInfo(0x0061, "FaceRecInfo", N_("Face recognition info"), N_("Face recognition info"), panasonicId, makerTags, undefined, -1, printValue),
488         TagInfo(0x0062, "FlashWarning", N_("Flash Warning"), N_("Flash warning"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicFlashWarning)),
489         TagInfo(0x0065, "Title", N_("Title"), N_("Title"), panasonicId, makerTags, undefined, -1, printPanasonicText),
490         TagInfo(0x0066, "BabyName", N_("Baby Name"), N_("Baby name (or pet name)"), panasonicId, makerTags, undefined, -1, printPanasonicText),
491         TagInfo(0x0067, "Location", N_("Location"), N_("Location"), panasonicId, makerTags, undefined, -1, printPanasonicText),
492         TagInfo(0x0069, "Country", N_("Country"), N_("Country"), panasonicId, makerTags, undefined, -1, printPanasonicText),
493         TagInfo(0x006b, "State", N_("State"), N_("State"), panasonicId, makerTags, undefined, -1, printPanasonicText),
494         TagInfo(0x006d, "City", N_("City"), N_("City"), panasonicId, makerTags, undefined, -1, printPanasonicText),
495         TagInfo(0x006f, "Landmark", N_("Landmark"), N_("Landmark"), panasonicId, makerTags, undefined, -1, printPanasonicText),
496         TagInfo(0x0070, "IntelligentResolution", N_("Intelligent resolution"), N_("Intelligent resolution"), panasonicId, makerTags, unsignedByte, -1, EXV_PRINT_TAG(panasonicIntelligentResolution)),
497         TagInfo(0x0077, "BurstSpeed", N_("Burst Speed"), N_("Burst Speed in pictures per second"), panasonicId, makerTags, unsignedShort, -1, printValue),
498         TagInfo(0x0079, "IntelligentDRange", N_("Intelligent Dynamic Range"), N_("Intelligent Dynamic Range"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicIntelligentDRange)),
499         TagInfo(0x007c, "ClearRetouch", N_("Clear Retouch"), N_("Clear Retouch"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicClearRetouch)),
500         TagInfo(0x0080, "City2", N_("City2"), N_("City2"), panasonicId, makerTags, undefined, -1, printPanasonicText),
501         TagInfo(0x0086, "ManometerPressure", N_("Manometer Pressure"), N_("Manometer pressure"), panasonicId, makerTags, unsignedShort, -1, printPressure),
502         TagInfo(0x0089, "PhotoStyle", N_("Photo style"), N_("Photo style"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicPhotoStyle)),
503         TagInfo(0x008a, "ShadingCompensation", N_("Shading Compensation"), N_("Shading Compensation"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicShadingCompensation)),
504         TagInfo(0x008c, "AccelerometerZ", N_("Accelerometer Z"), N_("positive is acceleration upwards"), panasonicId, makerTags, unsignedShort, -1, printAccelerometer),
505         TagInfo(0x008d, "AccelerometerX", N_("Accelerometer X"), N_("positive is acceleration to the left"), panasonicId, makerTags, unsignedShort, -1, printAccelerometer),
506         TagInfo(0x008e, "AccelerometerY", N_("Accelerometer Y"), N_("positive is acceleration backwards"), panasonicId, makerTags, unsignedShort, -1, printAccelerometer),
507         TagInfo(0x008f, "CameraOrientation", N_("Camera Orientation"), N_("Camera Orientation"), panasonicId, makerTags, unsignedByte, -1, EXV_PRINT_TAG(panasonicCameraOrientation)),
508         TagInfo(0x0090, "RollAngle", N_("Roll Angle"), N_("degress of clockwise camera rotation"), panasonicId, makerTags, unsignedShort, -1, printRollAngle),
509         TagInfo(0x0091, "PitchAngle", N_("Pitch Angle"), N_("degress of upwards camera tilt"), panasonicId, makerTags, unsignedShort, -1, printPitchAngle),
510         TagInfo(0x0093, "SweepPanoramaDirection", N_("Sweep Panorama Direction"), N_("Sweep Panorama Direction"), panasonicId, makerTags, unsignedByte, -1, EXV_PRINT_TAG(panasonicSweepPanoramaDirection)),
511         TagInfo(0x0094, "PanoramaFieldOfView", N_("Field of View of Panorama"), N_("Field of View of Panorama"), panasonicId, makerTags, unsignedShort, -1, printValue),
512         TagInfo(0x0096, "TimerRecording", N_("Timer Recording"), N_("Timer Recording"), panasonicId, makerTags, unsignedByte, -1, EXV_PRINT_TAG(panasonicTimerRecording)),
513         TagInfo(0x009d, "InternalNDFilter", N_("Internal ND Filter"), N_("Internal ND Filter"), panasonicId, makerTags, unsignedRational, -1, printValue),
514         TagInfo(0x009e, "HDR", N_("HDR"), N_("HDR"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicHDR)),
515         TagInfo(0x009f, "ShutterType", N_("Shutter Type"), N_("Shutter Type"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicShutterType)),
516         TagInfo(0x00a3, "ClearRetouchValue", N_("Clear Retouch Value"), N_("Clear Retouch Value"), panasonicId, makerTags, unsignedRational, -1, printValue),
517         TagInfo(0x00ab, "TouchAE", N_("TouchAE"), N_("TouchAE"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicTouchAE)),
518         TagInfo(0x0e00, "PrintIM", N_("Print IM"), N_("PrintIM information"), panasonicId, makerTags, undefined, -1, printValue),
519         TagInfo(0x4449, "0x4449", "0x4449", N_("Unknown"), panasonicId, makerTags, undefined, -1, printValue),
520         TagInfo(0x8000, "MakerNoteVersion", N_("MakerNote Version"), N_("MakerNote version"), panasonicId, makerTags, undefined, -1, printExifVersion),
521         TagInfo(0x8001, "SceneMode", N_("Scene Mode"), N_("Scene mode"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicShootingMode)),
522         TagInfo(0x8004, "WBRedLevel", N_("WB Red Level"), N_("WB red level"), panasonicId, makerTags, unsignedShort, -1, printValue),
523         TagInfo(0x8005, "WBGreenLevel", N_("WB Green Level"), N_("WB green level"), panasonicId, makerTags, unsignedShort, -1, printValue),
524         TagInfo(0x8006, "WBBlueLevel", N_("WB Blue Level"), N_("WB blue level"), panasonicId, makerTags, unsignedShort, -1, printValue),
525         TagInfo(0x8007, "FlashFired", N_("Flash Fired"), N_("Flash Fired"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicFlashFired)),
526         TagInfo(0x8008, "TextStamp3", N_("Text Stamp 3"), N_("Text Stamp 3"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicTextStamp)),
527         TagInfo(0x8009, "TextStamp4", N_("Text Stamp 4"), N_("Text Stamp 4"), panasonicId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(panasonicTextStamp)),
528         TagInfo(0x8010, "BabyAge2", N_("Baby Age 2"), N_("Baby (or pet) age 2"), panasonicId, makerTags, asciiString, -1, print0x0033),
529         TagInfo(0x8012, "Transform2", N_("Transform 2"), N_("Transform 2"), panasonicId, makerTags, undefined, -1, printValue),
530         // End of list marker
531         TagInfo(0xffff, "(UnknownPanasonicMakerNoteTag)", "(UnknownPanasonicMakerNoteTag)", N_("Unknown PanasonicMakerNote tag"), panasonicId, makerTags, asciiString, -1, printValue)
532     };
533 
tagList()534     const TagInfo* PanasonicMakerNote::tagList()
535     {
536         return tagInfo_;
537     }
538 
539     // tag Focus Mode
print0x000f(std::ostream & os,const Value & value,const ExifData *)540     std::ostream& PanasonicMakerNote::print0x000f(std::ostream& os,
541                                                   const Value& value,
542                                                   const ExifData*)
543     {
544         if (value.count() < 2 || value.typeId() != unsignedByte) {
545             return os << value;
546         }
547         long l0 = value.toLong(0);
548         long l1 = value.toLong(1);
549         if      (l0 ==   0 && l1 ==  1) os << _("Spot mode on or 9 area");
550         else if (l0 ==   0 && l1 == 16) os << _("Spot mode off or 3-area (high speed)");
551         else if (l0 ==   0 && l1 == 23) os << _("23-area");
552         else if (l0 ==   0 && l1 == 49) os << _("49-area");
553         else if (l0 ==   0 && l1 ==225) os << _("225-area");
554         else if (l0 ==   1 && l1 ==  0) os << _("Spot focussing");
555         else if (l0 ==   1 && l1 ==  1) os << _("5-area");
556         else if (l0 ==  16 && l1 ==  0) os << _("1-area");
557         else if (l0 ==  16 && l1 == 16) os << _("1-area (high speed)");
558         else if (l0 ==  32 && l1 ==  0) os << _("3-area (auto)");
559         else if (l0 ==  32 && l1 ==  1) os << _("3-area (left)");
560         else if (l0 ==  32 && l1 ==  2) os << _("3-area (center)");
561         else if (l0 ==  32 && l1 ==  3) os << _("3-area (right)");
562         else if (l0 ==  64 && l1 ==  0) os << _("Face Detect");
563         else if (l0 == 128 && l1 ==  0) os << _("Spot Focusing 2");
564         else if (l0 == 240 && l1 ==  0) os << _("Tracking");
565         else os << value;
566         return os;
567     } // PanasonicMakerNote::print0x000f
568 
569     // tag White balance bias
print0x0023(std::ostream & os,const Value & value,const ExifData *)570     std::ostream& PanasonicMakerNote::print0x0023(std::ostream& os,
571                                                   const Value& value,
572                                                   const ExifData*)
573     {
574         std::ios::fmtflags f( os.flags() );
575         std::ostringstream oss;
576         oss.copyfmt(os);
577         os << std::fixed << std::setprecision(1)
578            << value.toLong() / 3 << _(" EV");
579         os.copyfmt(oss);
580 
581         os.flags(f);
582         return os;
583 
584     } // PanasonicMakerNote::print0x0023
585 
586     // Time since power on
print0x0029(std::ostream & os,const Value & value,const ExifData *)587     std::ostream& PanasonicMakerNote::print0x0029(std::ostream& os,
588                                                   const Value& value,
589                                                   const ExifData*)
590     {
591         std::ostringstream oss;
592         oss.copyfmt(os);
593         long time=value.toLong();
594         os << std::setw(2) << std::setfill('0') << time / 360000 << ":"
595            << std::setw(2) << std::setfill('0') << (time % 360000) / 6000 << ":"
596            << std::setw(2) << std::setfill('0') << (time % 6000) / 100 << "."
597            << std::setw(2) << std::setfill('0') << time % 100;
598         os.copyfmt(oss);
599 
600         return os;
601 
602     } // PanasonicMakerNote::print0x0029
603 
604     // bage age
print0x0033(std::ostream & os,const Value & value,const ExifData *)605     std::ostream& PanasonicMakerNote::print0x0033(std::ostream& os,
606                                                   const Value& value,
607                                                   const ExifData*)
608     {
609         if(value.toString()=="9999:99:99 00:00:00")
610         {
611             os << N_("not set");
612         }
613         else
614         {
615             os << value;
616         };
617         return os;
618     } // PanasonicMakerNote::print0x0033
619 
620     // Travel days
print0x0036(std::ostream & os,const Value & value,const ExifData *)621     std::ostream& PanasonicMakerNote::print0x0036(std::ostream& os,
622                                                   const Value& value,
623                                                   const ExifData*)
624     {
625         if(value.toLong()==65535)
626         {
627             os << N_("not set");
628         }
629         else
630         {
631             os << value;
632         };
633         return os;
634     } // PanasonicMakerNote::print0x0036
635 
636     // Program ISO
print0x003c(std::ostream & os,const Value & value,const ExifData *)637     std::ostream& PanasonicMakerNote::print0x003c(std::ostream& os,
638                                                   const Value& value,
639                                                   const ExifData*)
640     {
641         switch(value.toLong())
642         {
643             case 65534:
644                 os << N_("Intelligent ISO");
645                 break;
646             case 65535:
647                 os << N_("n/a");
648                 break;
649             default:
650                 os << value;
651                 break;
652         };
653         return os;
654     } // PanasonicMakerNote::print0x003c
655 
printPanasonicText(std::ostream & os,const Value & value,const ExifData *)656     std::ostream& PanasonicMakerNote::printPanasonicText(std::ostream& os,
657                                                   const Value& value,
658                                                   const ExifData*)
659     {
660         if(value.size()>0 && value.typeId() == undefined)
661         {
662             for(long i=0; i< value.size(); i++)
663             {
664                 if(value.toLong(i)==0)
665                 {
666                     break;
667                 };
668                 os << static_cast<char>(value.toLong(i));
669             };
670             return os;
671         }
672         else
673         {
674             return os << value;
675         };
676     } // PanasonicMakerNote::printPanasonicText
677 
678     // Manometer Pressure
printPressure(std::ostream & os,const Value & value,const ExifData *)679     std::ostream& PanasonicMakerNote::printPressure(std::ostream& os, const Value& value, const ExifData*)
680     {
681         switch(value.toLong())
682         {
683             case 65535:
684                 os << N_("infinite");
685                 break;
686             default:
687                 os << value << N_(" hPa");
688                 break;
689           };
690           return os;
691     } // PanasonicMakerNote::printPressure
692 
printAccelerometer(std::ostream & os,const Value & value,const ExifData *)693     std::ostream& PanasonicMakerNote::printAccelerometer(std::ostream& os, const Value& value, const ExifData*)
694     {
695         // value is stored as unsigned int, but should be readed as signed int, so manually convert it
696         int i = value.toLong();
697         i = i - ((i & 0x8000) >> 15) * 0xffff;
698         return os << i;
699     }  // PanasonicMakerNote::printAccelerometer
700 
printRollAngle(std::ostream & os,const Value & value,const ExifData *)701     std::ostream& PanasonicMakerNote::printRollAngle(std::ostream& os, const Value& value, const ExifData*)
702     {
703         // roll angle is stored as signed int, but tag states to be unsigned int
704         int i = value.toLong();
705         i = i - ((i & 0x8000) >> 15) * 0xffff;
706         std::ostringstream oss;
707         oss.copyfmt(os);
708         os << std::fixed << std::setprecision(1) << i / 10.0;
709         os.copyfmt(oss);
710 
711         return os;
712     }  // PanasonicMakerNote::printRollAngle
713 
printPitchAngle(std::ostream & os,const Value & value,const ExifData *)714     std::ostream& PanasonicMakerNote::printPitchAngle(std::ostream& os, const Value& value, const ExifData*)
715     {
716         // pitch angle is stored as signed int, but tag states to be unsigned int
717         // change sign to be compatible with ExifTool: positive is upwards
718         int i = value.toLong();
719         i = i - ((i & 0x8000) >> 15) * 0xffff;
720         std::ostringstream oss;
721         oss.copyfmt(os);
722         os << std::fixed << std::setprecision(1) << -i / 10.0;
723         os.copyfmt(oss);
724 
725         return os;
726     }  // PanasonicMakerNote::printPitchAngle
727 
728     // Panasonic MakerNote Tag Info
729     const TagInfo PanasonicMakerNote::tagInfoRaw_[] = {
730         TagInfo(0x0001, "Version", N_("Version"), N_("Panasonic raw version"), panaRawId, panaRaw, undefined, -1, printExifVersion),
731         TagInfo(0x0002, "SensorWidth", N_("Sensor Width"), N_("Sensor width"), panaRawId, panaRaw, unsignedShort, -1, printValue),
732         TagInfo(0x0003, "SensorHeight", N_("Sensor Height"), N_("Sensor height"), panaRawId, panaRaw, unsignedShort, -1, printValue),
733         TagInfo(0x0004, "SensorTopBorder", N_("Sensor Top Border"), N_("Sensor top border"), panaRawId, panaRaw, unsignedShort, -1, printValue),
734         TagInfo(0x0005, "SensorLeftBorder", N_("Sensor Left Border"), N_("Sensor left border"), panaRawId, panaRaw, unsignedShort, -1, printValue),
735         TagInfo(0x0006, "ImageHeight", N_("Image Height"), N_("Image height"), panaRawId, panaRaw, unsignedShort, -1, printValue),
736         TagInfo(0x0007, "ImageWidth", N_("Image Width"), N_("Image width"), panaRawId, panaRaw, unsignedShort, -1, printValue),
737         TagInfo(0x0011, "RedBalance", N_("Red Balance"), N_("Red balance (found in Digilux 2 RAW images)"), panaRawId, panaRaw, unsignedShort, -1, printValue),
738         TagInfo(0x0012, "BlueBalance", N_("Blue Balance"), N_("Blue balance"), panaRawId, panaRaw, unsignedShort, -1, printValue),
739         TagInfo(0x0017, "ISOSpeed", N_("ISO Speed"), N_("ISO speed setting"), panaRawId, panaRaw, unsignedShort, -1, printValue),
740         TagInfo(0x0024, "WBRedLevel", N_("WB Red Level"), N_("WB red level"), panaRawId, panaRaw, unsignedShort, -1, printValue),
741         TagInfo(0x0025, "WBGreenLevel", N_("WB Green Level"), N_("WB green level"), panaRawId, panaRaw, unsignedShort, -1, printValue),
742         TagInfo(0x0026, "WBBlueLevel", N_("WB Blue Level"), N_("WB blue level"), panaRawId, panaRaw, unsignedShort, -1, printValue),
743         TagInfo(0x002e, "PreviewImage", N_("Preview Image"), N_("Preview image"), panaRawId, panaRaw, undefined, -1, printValue),
744         TagInfo(0x010f, "Make", N_("Manufacturer"), N_("The manufacturer of the recording equipment"), panaRawId, panaRaw, asciiString, -1, printValue),
745         TagInfo(0x0110, "Model", N_("Model"), N_("The model name or model number of the equipment"), panaRawId, panaRaw, asciiString, -1, printValue),
746         TagInfo(0x0111, "StripOffsets", N_("Strip Offsets"), N_("Strip offsets"), panaRawId, panaRaw, unsignedLong, -1, printValue),
747         TagInfo(0x0112, "Orientation", N_("Orientation"), N_("Orientation"), panaRawId, panaRaw, unsignedShort, -1, print0x0112),
748         TagInfo(0x0116, "RowsPerStrip", N_("Rows Per Strip"), N_("The number of rows per strip"), panaRawId, panaRaw, unsignedShort, -1, printValue),
749         TagInfo(0x0117, "StripByteCounts", N_("Strip Byte Counts"), N_("Strip byte counts"), panaRawId, panaRaw, unsignedLong, -1, printValue),
750         TagInfo(0x0118, "RawDataOffset", N_("Raw Data Offset"), N_("Raw data offset"), panaRawId, panaRaw, unsignedLong, -1, printValue),
751         TagInfo(0x8769, "ExifTag", N_("Exif IFD Pointer"), N_("A pointer to the Exif IFD"), panaRawId, panaRaw, unsignedLong, -1, printValue),
752         TagInfo(0x8825, "GPSTag", N_("GPS Info IFD Pointer"), N_("A pointer to the GPS Info IFD"), panaRawId, panaRaw, unsignedLong, -1, printValue),
753         // End of list marker
754         TagInfo(0xffff, "(UnknownPanasonicRawTag)", "(UnknownPanasonicRawTag)", N_("Unknown PanasonicRaw tag"), panaRawId, panaRaw, asciiString, -1, printValue)
755     };
756 
tagListRaw()757     const TagInfo* PanasonicMakerNote::tagListRaw()
758     {
759         return tagInfoRaw_;
760     }
761 
762 }}                                      // namespace Internal, Exiv2
763