source: josm/trunk/src/com/drew/metadata/exif/makernotes/CanonMakernoteDirectory.java@ 10862

Last change on this file since 10862 was 10862, checked in by Don-vip, 8 years ago

update to metadata-extractor 2.9.1

File size: 34.0 KB
Line 
1/*
2 * Copyright 2002-2016 Drew Noakes
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 * More information about this project is available at:
17 *
18 * https://drewnoakes.com/code/exif/
19 * https://github.com/drewnoakes/metadata-extractor
20 */
21package com.drew.metadata.exif.makernotes;
22
23import com.drew.lang.annotations.NotNull;
24import com.drew.metadata.Directory;
25
26import java.util.HashMap;
27
28/**
29 * Describes tags specific to Canon cameras.
30 *
31 * Thanks to Bill Richards for his contribution to this makernote directory.
32 *
33 * Many tag definitions explained here: http://www.ozhiker.com/electronics/pjmt/jpeg_info/canon_mn.html
34 *
35 * @author Drew Noakes https://drewnoakes.com
36 */
37public class CanonMakernoteDirectory extends Directory
38{
39 // These TAG_*_ARRAY Exif tags map to arrays of int16 values which are split out into separate 'fake' tags.
40 // When an attempt is made to set one of these on the directory, it is split and the corresponding offset added to the tagType.
41 // So the resulting tag is the offset + the index into the array.
42
43 private static final int TAG_CAMERA_SETTINGS_ARRAY = 0x0001;
44 private static final int TAG_FOCAL_LENGTH_ARRAY = 0x0002;
45// private static final int TAG_FLASH_INFO = 0x0003;
46 private static final int TAG_SHOT_INFO_ARRAY = 0x0004;
47 private static final int TAG_PANORAMA_ARRAY = 0x0005;
48
49 public static final int TAG_CANON_IMAGE_TYPE = 0x0006;
50 public static final int TAG_CANON_FIRMWARE_VERSION = 0x0007;
51 public static final int TAG_CANON_IMAGE_NUMBER = 0x0008;
52 public static final int TAG_CANON_OWNER_NAME = 0x0009;
53 public static final int TAG_CANON_SERIAL_NUMBER = 0x000C;
54 public static final int TAG_CAMERA_INFO_ARRAY = 0x000D; // depends upon model, so leave for now
55 public static final int TAG_CANON_FILE_LENGTH = 0x000E;
56 public static final int TAG_CANON_CUSTOM_FUNCTIONS_ARRAY = 0x000F; // depends upon model, so leave for now
57 public static final int TAG_MODEL_ID = 0x0010;
58 public static final int TAG_MOVIE_INFO_ARRAY = 0x0011; // not currently decoded as not sure we see it in still images
59 private static final int TAG_AF_INFO_ARRAY = 0x0012; // not currently decoded
60 public static final int TAG_THUMBNAIL_IMAGE_VALID_AREA = 0x0013;
61 public static final int TAG_SERIAL_NUMBER_FORMAT = 0x0015;
62 public static final int TAG_SUPER_MACRO = 0x001A;
63 public static final int TAG_DATE_STAMP_MODE = 0x001C;
64 public static final int TAG_MY_COLORS = 0x001D;
65 public static final int TAG_FIRMWARE_REVISION = 0x001E;
66 public static final int TAG_CATEGORIES = 0x0023;
67 public static final int TAG_FACE_DETECT_ARRAY_1 = 0x0024;
68 public static final int TAG_FACE_DETECT_ARRAY_2 = 0x0025;
69 public static final int TAG_AF_INFO_ARRAY_2 = 0x0026;
70 public static final int TAG_IMAGE_UNIQUE_ID = 0x0028;
71
72 public static final int TAG_RAW_DATA_OFFSET = 0x0081;
73 public static final int TAG_ORIGINAL_DECISION_DATA_OFFSET = 0x0083;
74
75 public static final int TAG_CUSTOM_FUNCTIONS_1D_ARRAY = 0x0090; // not currently decoded
76 public static final int TAG_PERSONAL_FUNCTIONS_ARRAY = 0x0091; // not currently decoded
77 public static final int TAG_PERSONAL_FUNCTION_VALUES_ARRAY = 0x0092; // not currently decoded
78 public static final int TAG_FILE_INFO_ARRAY = 0x0093; // not currently decoded
79 public static final int TAG_AF_POINTS_IN_FOCUS_1D = 0x0094;
80 public static final int TAG_LENS_MODEL = 0x0095;
81 public static final int TAG_SERIAL_INFO_ARRAY = 0x0096; // not currently decoded
82 public static final int TAG_DUST_REMOVAL_DATA = 0x0097;
83 public static final int TAG_CROP_INFO = 0x0098; // not currently decoded
84 public static final int TAG_CUSTOM_FUNCTIONS_ARRAY_2 = 0x0099; // not currently decoded
85 public static final int TAG_ASPECT_INFO_ARRAY = 0x009A; // not currently decoded
86 public static final int TAG_PROCESSING_INFO_ARRAY = 0x00A0; // not currently decoded
87 public static final int TAG_TONE_CURVE_TABLE = 0x00A1;
88 public static final int TAG_SHARPNESS_TABLE = 0x00A2;
89 public static final int TAG_SHARPNESS_FREQ_TABLE = 0x00A3;
90 public static final int TAG_WHITE_BALANCE_TABLE = 0x00A4;
91 public static final int TAG_COLOR_BALANCE_ARRAY = 0x00A9; // not currently decoded
92 public static final int TAG_MEASURED_COLOR_ARRAY = 0x00AA; // not currently decoded
93 public static final int TAG_COLOR_TEMPERATURE = 0x00AE;
94 public static final int TAG_CANON_FLAGS_ARRAY = 0x00B0; // not currently decoded
95 public static final int TAG_MODIFIED_INFO_ARRAY = 0x00B1; // not currently decoded
96 public static final int TAG_TONE_CURVE_MATCHING = 0x00B2;
97 public static final int TAG_WHITE_BALANCE_MATCHING = 0x00B3;
98 public static final int TAG_COLOR_SPACE = 0x00B4;
99 public static final int TAG_PREVIEW_IMAGE_INFO_ARRAY = 0x00B6; // not currently decoded
100 public static final int TAG_VRD_OFFSET = 0x00D0;
101 public static final int TAG_SENSOR_INFO_ARRAY = 0x00E0; // not currently decoded
102
103 public static final int TAG_COLOR_DATA_ARRAY_2 = 0x4001; // depends upon camera model, not currently decoded
104 public static final int TAG_CRW_PARAM = 0x4002; // depends upon camera model, not currently decoded
105 public static final int TAG_COLOR_INFO_ARRAY_2 = 0x4003; // not currently decoded
106 public static final int TAG_BLACK_LEVEL = 0x4008; // not currently decoded
107 public static final int TAG_CUSTOM_PICTURE_STYLE_FILE_NAME = 0x4010;
108 public static final int TAG_COLOR_INFO_ARRAY = 0x4013; // not currently decoded
109 public static final int TAG_VIGNETTING_CORRECTION_ARRAY_1 = 0x4015; // not currently decoded
110 public static final int TAG_VIGNETTING_CORRECTION_ARRAY_2 = 0x4016; // not currently decoded
111 public static final int TAG_LIGHTING_OPTIMIZER_ARRAY = 0x4018; // not currently decoded
112 public static final int TAG_LENS_INFO_ARRAY = 0x4019; // not currently decoded
113 public static final int TAG_AMBIANCE_INFO_ARRAY = 0x4020; // not currently decoded
114 public static final int TAG_FILTER_INFO_ARRAY = 0x4024; // not currently decoded
115
116 public final static class CameraSettings
117 {
118 // These 'sub'-tag values have been created for consistency -- they don't exist within the exif segment
119 private static final int OFFSET = 0xC100;
120
121 /**
122 * 1 = Macro
123 * 2 = Normal
124 */
125 public static final int TAG_MACRO_MODE = OFFSET + 0x01;
126 public static final int TAG_SELF_TIMER_DELAY = OFFSET + 0x02;
127 /**
128 * 2 = Normal
129 * 3 = Fine
130 * 5 = Superfine
131 */
132 public static final int TAG_QUALITY = OFFSET + 0x03;
133 /**
134 * 0 = Flash Not Fired
135 * 1 = Auto
136 * 2 = On
137 * 3 = Red Eye Reduction
138 * 4 = Slow Synchro
139 * 5 = Auto + Red Eye Reduction
140 * 6 = On + Red Eye Reduction
141 * 16 = External Flash
142 */
143 public static final int TAG_FLASH_MODE = OFFSET + 0x04;
144 /**
145 * 0 = Single Frame or Timer Mode
146 * 1 = Continuous
147 */
148 public static final int TAG_CONTINUOUS_DRIVE_MODE = OFFSET + 0x05;
149 public static final int TAG_UNKNOWN_2 = OFFSET + 0x06;
150 /**
151 * 0 = One-Shot
152 * 1 = AI Servo
153 * 2 = AI Focus
154 * 3 = Manual Focus
155 * 4 = Single
156 * 5 = Continuous
157 * 6 = Manual Focus
158 */
159 public static final int TAG_FOCUS_MODE_1 = OFFSET + 0x07;
160 public static final int TAG_UNKNOWN_3 = OFFSET + 0x08;
161 public static final int TAG_UNKNOWN_4 = OFFSET + 0x09;
162 /**
163 * 0 = Large
164 * 1 = Medium
165 * 2 = Small
166 */
167 public static final int TAG_IMAGE_SIZE = OFFSET + 0x0A;
168 /**
169 * 0 = Full Auto
170 * 1 = Manual
171 * 2 = Landscape
172 * 3 = Fast Shutter
173 * 4 = Slow Shutter
174 * 5 = Night
175 * 6 = Black & White
176 * 7 = Sepia
177 * 8 = Portrait
178 * 9 = Sports
179 * 10 = Macro / Close-Up
180 * 11 = Pan Focus
181 */
182 public static final int TAG_EASY_SHOOTING_MODE = OFFSET + 0x0B;
183 /**
184 * 0 = No Digital Zoom
185 * 1 = 2x
186 * 2 = 4x
187 */
188 public static final int TAG_DIGITAL_ZOOM = OFFSET + 0x0C;
189 /**
190 * 0 = Normal
191 * 1 = High
192 * 65535 = Low
193 */
194 public static final int TAG_CONTRAST = OFFSET + 0x0D;
195 /**
196 * 0 = Normal
197 * 1 = High
198 * 65535 = Low
199 */
200 public static final int TAG_SATURATION = OFFSET + 0x0E;
201 /**
202 * 0 = Normal
203 * 1 = High
204 * 65535 = Low
205 */
206 public static final int TAG_SHARPNESS = OFFSET + 0x0F;
207 /**
208 * 0 = Check ISOSpeedRatings EXIF tag for ISO Speed
209 * 15 = Auto ISO
210 * 16 = ISO 50
211 * 17 = ISO 100
212 * 18 = ISO 200
213 * 19 = ISO 400
214 */
215 public static final int TAG_ISO = OFFSET + 0x10;
216 /**
217 * 3 = Evaluative
218 * 4 = Partial
219 * 5 = Centre Weighted
220 */
221 public static final int TAG_METERING_MODE = OFFSET + 0x11;
222 /**
223 * 0 = Manual
224 * 1 = Auto
225 * 3 = Close-up (Macro)
226 * 8 = Locked (Pan Mode)
227 */
228 public static final int TAG_FOCUS_TYPE = OFFSET + 0x12;
229 /**
230 * 12288 = None (Manual Focus)
231 * 12289 = Auto Selected
232 * 12290 = Right
233 * 12291 = Centre
234 * 12292 = Left
235 */
236 public static final int TAG_AF_POINT_SELECTED = OFFSET + 0x13;
237 /**
238 * 0 = Easy Shooting (See Easy Shooting Mode)
239 * 1 = Program
240 * 2 = Tv-Priority
241 * 3 = Av-Priority
242 * 4 = Manual
243 * 5 = A-DEP
244 */
245 public static final int TAG_EXPOSURE_MODE = OFFSET + 0x14;
246 public static final int TAG_UNKNOWN_7 = OFFSET + 0x15;
247 public static final int TAG_LENS_TYPE = OFFSET + 0x16;
248 public static final int TAG_LONG_FOCAL_LENGTH = OFFSET + 0x17;
249 public static final int TAG_SHORT_FOCAL_LENGTH = OFFSET + 0x18;
250 public static final int TAG_FOCAL_UNITS_PER_MM = OFFSET + 0x19;
251 public static final int TAG_UNKNOWN_9 = OFFSET + 0x1A;
252 public static final int TAG_UNKNOWN_10 = OFFSET + 0x1B;
253 /**
254 * 0 = Flash Did Not Fire
255 * 1 = Flash Fired
256 */
257 public static final int TAG_FLASH_ACTIVITY = OFFSET + 0x1C;
258 public static final int TAG_FLASH_DETAILS = OFFSET + 0x1D;
259 public static final int TAG_UNKNOWN_12 = OFFSET + 0x1E;
260 public static final int TAG_UNKNOWN_13 = OFFSET + 0x1F;
261 /**
262 * 0 = Focus Mode: Single
263 * 1 = Focus Mode: Continuous
264 */
265 public static final int TAG_FOCUS_MODE_2 = OFFSET + 0x20;
266 }
267
268 public final static class FocalLength
269 {
270 // These 'sub'-tag values have been created for consistency -- they don't exist within the exif segment
271
272 private static final int OFFSET = 0xC200;
273
274 /**
275 * 0 = Auto
276 * 1 = Sunny
277 * 2 = Cloudy
278 * 3 = Tungsten
279 * 4 = Florescent
280 * 5 = Flash
281 * 6 = Custom
282 */
283 public static final int TAG_WHITE_BALANCE = OFFSET + 0x07;
284 public static final int TAG_SEQUENCE_NUMBER = OFFSET + 0x09;
285 public static final int TAG_AF_POINT_USED = OFFSET + 0x0E;
286 /**
287 * The value of this tag may be translated into a flash bias value, in EV.
288 *
289 * 0xffc0 = -2 EV
290 * 0xffcc = -1.67 EV
291 * 0xffd0 = -1.5 EV
292 * 0xffd4 = -1.33 EV
293 * 0xffe0 = -1 EV
294 * 0xffec = -0.67 EV
295 * 0xfff0 = -0.5 EV
296 * 0xfff4 = -0.33 EV
297 * 0x0000 = 0 EV
298 * 0x000c = 0.33 EV
299 * 0x0010 = 0.5 EV
300 * 0x0014 = 0.67 EV
301 * 0x0020 = 1 EV
302 * 0x002c = 1.33 EV
303 * 0x0030 = 1.5 EV
304 * 0x0034 = 1.67 EV
305 * 0x0040 = 2 EV
306 */
307 public static final int TAG_FLASH_BIAS = OFFSET + 0x0F;
308 public static final int TAG_AUTO_EXPOSURE_BRACKETING = OFFSET + 0x10;
309 public static final int TAG_AEB_BRACKET_VALUE = OFFSET + 0x11;
310 public static final int TAG_SUBJECT_DISTANCE = OFFSET + 0x13;
311 }
312
313 public final static class ShotInfo
314 {
315 // These 'sub'-tag values have been created for consistency -- they don't exist within the exif segment
316
317 private static final int OFFSET = 0xC400;
318
319 public static final int TAG_AUTO_ISO = OFFSET + 1;
320 public static final int TAG_BASE_ISO = OFFSET + 2;
321 public static final int TAG_MEASURED_EV = OFFSET + 3;
322 public static final int TAG_TARGET_APERTURE = OFFSET + 4;
323 public static final int TAG_TARGET_EXPOSURE_TIME = OFFSET + 5;
324 public static final int TAG_EXPOSURE_COMPENSATION = OFFSET + 6;
325 public static final int TAG_WHITE_BALANCE = OFFSET + 7;
326 public static final int TAG_SLOW_SHUTTER = OFFSET + 8;
327 public static final int TAG_SEQUENCE_NUMBER = OFFSET + 9;
328 public static final int TAG_OPTICAL_ZOOM_CODE = OFFSET + 10;
329 public static final int TAG_CAMERA_TEMPERATURE = OFFSET + 12;
330 public static final int TAG_FLASH_GUIDE_NUMBER = OFFSET + 13;
331 public static final int TAG_AF_POINTS_IN_FOCUS = OFFSET + 14;
332 public static final int TAG_FLASH_EXPOSURE_BRACKETING = OFFSET + 15;
333 public static final int TAG_AUTO_EXPOSURE_BRACKETING = OFFSET + 16;
334 public static final int TAG_AEB_BRACKET_VALUE = OFFSET + 17;
335 public static final int TAG_CONTROL_MODE = OFFSET + 18;
336 public static final int TAG_FOCUS_DISTANCE_UPPER = OFFSET + 19;
337 public static final int TAG_FOCUS_DISTANCE_LOWER = OFFSET + 20;
338 public static final int TAG_F_NUMBER = OFFSET + 21;
339 public static final int TAG_EXPOSURE_TIME = OFFSET + 22;
340 public static final int TAG_MEASURED_EV_2 = OFFSET + 23;
341 public static final int TAG_BULB_DURATION = OFFSET + 24;
342 public static final int TAG_CAMERA_TYPE = OFFSET + 26;
343 public static final int TAG_AUTO_ROTATE = OFFSET + 27;
344 public static final int TAG_ND_FILTER = OFFSET + 28;
345 public static final int TAG_SELF_TIMER_2 = OFFSET + 29;
346 public static final int TAG_FLASH_OUTPUT = OFFSET + 33;
347 }
348
349 public final static class Panorama
350 {
351 // These 'sub'-tag values have been created for consistency -- they don't exist within the exif segment
352
353 private static final int OFFSET = 0xC500;
354
355 public static final int TAG_PANORAMA_FRAME_NUMBER = OFFSET + 2;
356 public static final int TAG_PANORAMA_DIRECTION = OFFSET + 5;
357 }
358
359 public final static class AFInfo
360 {
361 // These 'sub'-tag values have been created for consistency -- they don't exist within the exif segment
362
363 private static final int OFFSET = 0xD200;
364
365 public static final int TAG_NUM_AF_POINTS = OFFSET;
366 public static final int TAG_VALID_AF_POINTS = OFFSET + 1;
367 public static final int TAG_IMAGE_WIDTH = OFFSET + 2;
368 public static final int TAG_IMAGE_HEIGHT = OFFSET + 3;
369 public static final int TAG_AF_IMAGE_WIDTH = OFFSET + 4;
370 public static final int TAG_AF_IMAGE_HEIGHT = OFFSET + 5;
371 public static final int TAG_AF_AREA_WIDTH = OFFSET + 6;
372 public static final int TAG_AF_AREA_HEIGHT = OFFSET + 7;
373 public static final int TAG_AF_AREA_X_POSITIONS = OFFSET + 8;
374 public static final int TAG_AF_AREA_Y_POSITIONS = OFFSET + 9;
375 public static final int TAG_AF_POINTS_IN_FOCUS = OFFSET + 10;
376 public static final int TAG_PRIMARY_AF_POINT_1 = OFFSET + 11;
377 public static final int TAG_PRIMARY_AF_POINT_2 = OFFSET + 12; // not sure why there are two of these
378 }
379
380// /**
381// * Long Exposure Noise Reduction
382// * 0 = Off
383// * 1 = On
384// */
385// public static final int TAG_CANON_CUSTOM_FUNCTION_LONG_EXPOSURE_NOISE_REDUCTION = 0xC301;
386//
387// /**
388// * Shutter/Auto Exposure-lock buttons
389// * 0 = AF/AE lock
390// * 1 = AE lock/AF
391// * 2 = AF/AF lock
392// * 3 = AE+release/AE+AF
393// */
394// public static final int TAG_CANON_CUSTOM_FUNCTION_SHUTTER_AUTO_EXPOSURE_LOCK_BUTTONS = 0xC302;
395//
396// /**
397// * Mirror lockup
398// * 0 = Disable
399// * 1 = Enable
400// */
401// public static final int TAG_CANON_CUSTOM_FUNCTION_MIRROR_LOCKUP = 0xC303;
402//
403// /**
404// * Tv/Av and exposure level
405// * 0 = 1/2 stop
406// * 1 = 1/3 stop
407// */
408// public static final int TAG_CANON_CUSTOM_FUNCTION_TV_AV_AND_EXPOSURE_LEVEL = 0xC304;
409//
410// /**
411// * AF-assist light
412// * 0 = On (Auto)
413// * 1 = Off
414// */
415// public static final int TAG_CANON_CUSTOM_FUNCTION_AF_ASSIST_LIGHT = 0xC305;
416//
417// /**
418// * Shutter speed in Av mode
419// * 0 = Automatic
420// * 1 = 1/200 (fixed)
421// */
422// public static final int TAG_CANON_CUSTOM_FUNCTION_SHUTTER_SPEED_IN_AV_MODE = 0xC306;
423//
424// /**
425// * Auto-Exposure Bracketing sequence/auto cancellation
426// * 0 = 0,-,+ / Enabled
427// * 1 = 0,-,+ / Disabled
428// * 2 = -,0,+ / Enabled
429// * 3 = -,0,+ / Disabled
430// */
431// public static final int TAG_CANON_CUSTOM_FUNCTION_BRACKETING = 0xC307;
432//
433// /**
434// * Shutter Curtain Sync
435// * 0 = 1st Curtain Sync
436// * 1 = 2nd Curtain Sync
437// */
438// public static final int TAG_CANON_CUSTOM_FUNCTION_SHUTTER_CURTAIN_SYNC = 0xC308;
439//
440// /**
441// * Lens Auto-Focus stop button Function Switch
442// * 0 = AF stop
443// * 1 = Operate AF
444// * 2 = Lock AE and start timer
445// */
446// public static final int TAG_CANON_CUSTOM_FUNCTION_AF_STOP = 0xC309;
447//
448// /**
449// * Auto reduction of fill flash
450// * 0 = Enable
451// * 1 = Disable
452// */
453// public static final int TAG_CANON_CUSTOM_FUNCTION_FILL_FLASH_REDUCTION = 0xC30A;
454//
455// /**
456// * Menu button return position
457// * 0 = Top
458// * 1 = Previous (volatile)
459// * 2 = Previous
460// */
461// public static final int TAG_CANON_CUSTOM_FUNCTION_MENU_BUTTON_RETURN = 0xC30B;
462//
463// /**
464// * SET button function when shooting
465// * 0 = Not Assigned
466// * 1 = Change Quality
467// * 2 = Change ISO Speed
468// * 3 = Select Parameters
469// */
470// public static final int TAG_CANON_CUSTOM_FUNCTION_SET_BUTTON_FUNCTION = 0xC30C;
471//
472// /**
473// * Sensor cleaning
474// * 0 = Disable
475// * 1 = Enable
476// */
477// public static final int TAG_CANON_CUSTOM_FUNCTION_SENSOR_CLEANING = 0xC30D;
478
479 @NotNull
480 protected static final HashMap<Integer, String> _tagNameMap = new HashMap<Integer, String>();
481
482 static
483 {
484 _tagNameMap.put(TAG_CANON_FIRMWARE_VERSION, "Firmware Version");
485 _tagNameMap.put(TAG_CANON_IMAGE_NUMBER, "Image Number");
486 _tagNameMap.put(TAG_CANON_IMAGE_TYPE, "Image Type");
487 _tagNameMap.put(TAG_CANON_OWNER_NAME, "Owner Name");
488 _tagNameMap.put(TAG_CANON_SERIAL_NUMBER, "Camera Serial Number");
489 _tagNameMap.put(TAG_CAMERA_INFO_ARRAY, "Camera Info Array");
490 _tagNameMap.put(TAG_CANON_FILE_LENGTH, "File Length");
491 _tagNameMap.put(TAG_CANON_CUSTOM_FUNCTIONS_ARRAY, "Custom Functions");
492 _tagNameMap.put(TAG_MODEL_ID, "Canon Model ID");
493 _tagNameMap.put(TAG_MOVIE_INFO_ARRAY, "Movie Info Array");
494
495 _tagNameMap.put(CameraSettings.TAG_AF_POINT_SELECTED, "AF Point Selected");
496 _tagNameMap.put(CameraSettings.TAG_CONTINUOUS_DRIVE_MODE, "Continuous Drive Mode");
497 _tagNameMap.put(CameraSettings.TAG_CONTRAST, "Contrast");
498 _tagNameMap.put(CameraSettings.TAG_EASY_SHOOTING_MODE, "Easy Shooting Mode");
499 _tagNameMap.put(CameraSettings.TAG_EXPOSURE_MODE, "Exposure Mode");
500 _tagNameMap.put(CameraSettings.TAG_FLASH_DETAILS, "Flash Details");
501 _tagNameMap.put(CameraSettings.TAG_FLASH_MODE, "Flash Mode");
502 _tagNameMap.put(CameraSettings.TAG_FOCAL_UNITS_PER_MM, "Focal Units per mm");
503 _tagNameMap.put(CameraSettings.TAG_FOCUS_MODE_1, "Focus Mode");
504 _tagNameMap.put(CameraSettings.TAG_FOCUS_MODE_2, "Focus Mode");
505 _tagNameMap.put(CameraSettings.TAG_IMAGE_SIZE, "Image Size");
506 _tagNameMap.put(CameraSettings.TAG_ISO, "Iso");
507 _tagNameMap.put(CameraSettings.TAG_LONG_FOCAL_LENGTH, "Long Focal Length");
508 _tagNameMap.put(CameraSettings.TAG_MACRO_MODE, "Macro Mode");
509 _tagNameMap.put(CameraSettings.TAG_METERING_MODE, "Metering Mode");
510 _tagNameMap.put(CameraSettings.TAG_SATURATION, "Saturation");
511 _tagNameMap.put(CameraSettings.TAG_SELF_TIMER_DELAY, "Self Timer Delay");
512 _tagNameMap.put(CameraSettings.TAG_SHARPNESS, "Sharpness");
513 _tagNameMap.put(CameraSettings.TAG_SHORT_FOCAL_LENGTH, "Short Focal Length");
514 _tagNameMap.put(CameraSettings.TAG_QUALITY, "Quality");
515 _tagNameMap.put(CameraSettings.TAG_UNKNOWN_2, "Unknown Camera Setting 2");
516 _tagNameMap.put(CameraSettings.TAG_UNKNOWN_3, "Unknown Camera Setting 3");
517 _tagNameMap.put(CameraSettings.TAG_UNKNOWN_4, "Unknown Camera Setting 4");
518 _tagNameMap.put(CameraSettings.TAG_DIGITAL_ZOOM, "Digital Zoom");
519 _tagNameMap.put(CameraSettings.TAG_FOCUS_TYPE, "Focus Type");
520 _tagNameMap.put(CameraSettings.TAG_UNKNOWN_7, "Unknown Camera Setting 7");
521 _tagNameMap.put(CameraSettings.TAG_LENS_TYPE, "Lens Type");
522 _tagNameMap.put(CameraSettings.TAG_UNKNOWN_9, "Unknown Camera Setting 9");
523 _tagNameMap.put(CameraSettings.TAG_UNKNOWN_10, "Unknown Camera Setting 10");
524 _tagNameMap.put(CameraSettings.TAG_FLASH_ACTIVITY, "Flash Activity");
525 _tagNameMap.put(CameraSettings.TAG_UNKNOWN_12, "Unknown Camera Setting 12");
526 _tagNameMap.put(CameraSettings.TAG_UNKNOWN_13, "Unknown Camera Setting 13");
527
528 _tagNameMap.put(FocalLength.TAG_WHITE_BALANCE, "White Balance");
529 _tagNameMap.put(FocalLength.TAG_SEQUENCE_NUMBER, "Sequence Number");
530 _tagNameMap.put(FocalLength.TAG_AF_POINT_USED, "AF Point Used");
531 _tagNameMap.put(FocalLength.TAG_FLASH_BIAS, "Flash Bias");
532 _tagNameMap.put(FocalLength.TAG_AUTO_EXPOSURE_BRACKETING, "Auto Exposure Bracketing");
533 _tagNameMap.put(FocalLength.TAG_AEB_BRACKET_VALUE, "AEB Bracket Value");
534 _tagNameMap.put(FocalLength.TAG_SUBJECT_DISTANCE, "Subject Distance");
535
536 _tagNameMap.put(ShotInfo.TAG_AUTO_ISO, "Auto ISO");
537 _tagNameMap.put(ShotInfo.TAG_BASE_ISO, "Base ISO");
538 _tagNameMap.put(ShotInfo.TAG_MEASURED_EV, "Measured EV");
539 _tagNameMap.put(ShotInfo.TAG_TARGET_APERTURE, "Target Aperture");
540 _tagNameMap.put(ShotInfo.TAG_TARGET_EXPOSURE_TIME, "Target Exposure Time");
541 _tagNameMap.put(ShotInfo.TAG_EXPOSURE_COMPENSATION, "Exposure Compensation");
542 _tagNameMap.put(ShotInfo.TAG_WHITE_BALANCE, "White Balance");
543 _tagNameMap.put(ShotInfo.TAG_SLOW_SHUTTER, "Slow Shutter");
544 _tagNameMap.put(ShotInfo.TAG_SEQUENCE_NUMBER, "Sequence Number");
545 _tagNameMap.put(ShotInfo.TAG_OPTICAL_ZOOM_CODE, "Optical Zoom Code");
546 _tagNameMap.put(ShotInfo.TAG_CAMERA_TEMPERATURE, "Camera Temperature");
547 _tagNameMap.put(ShotInfo.TAG_FLASH_GUIDE_NUMBER, "Flash Guide Number");
548 _tagNameMap.put(ShotInfo.TAG_AF_POINTS_IN_FOCUS, "AF Points in Focus");
549 _tagNameMap.put(ShotInfo.TAG_FLASH_EXPOSURE_BRACKETING, "Flash Exposure Compensation");
550 _tagNameMap.put(ShotInfo.TAG_AUTO_EXPOSURE_BRACKETING, "Auto Exposure Bracketing");
551 _tagNameMap.put(ShotInfo.TAG_AEB_BRACKET_VALUE, "AEB Bracket Value");
552 _tagNameMap.put(ShotInfo.TAG_CONTROL_MODE, "Control Mode");
553 _tagNameMap.put(ShotInfo.TAG_FOCUS_DISTANCE_UPPER, "Focus Distance Upper");
554 _tagNameMap.put(ShotInfo.TAG_FOCUS_DISTANCE_LOWER, "Focus Distance Lower");
555 _tagNameMap.put(ShotInfo.TAG_F_NUMBER, "F Number");
556 _tagNameMap.put(ShotInfo.TAG_EXPOSURE_TIME, "Exposure Time");
557 _tagNameMap.put(ShotInfo.TAG_MEASURED_EV_2, "Measured EV 2");
558 _tagNameMap.put(ShotInfo.TAG_BULB_DURATION, "Bulb Duration");
559 _tagNameMap.put(ShotInfo.TAG_CAMERA_TYPE, "Camera Type");
560 _tagNameMap.put(ShotInfo.TAG_AUTO_ROTATE, "Auto Rotate");
561 _tagNameMap.put(ShotInfo.TAG_ND_FILTER, "ND Filter");
562 _tagNameMap.put(ShotInfo.TAG_SELF_TIMER_2, "Self Timer 2");
563 _tagNameMap.put(ShotInfo.TAG_FLASH_OUTPUT, "Flash Output");
564
565 _tagNameMap.put(Panorama.TAG_PANORAMA_FRAME_NUMBER, "Panorama Frame Number");
566 _tagNameMap.put(Panorama.TAG_PANORAMA_DIRECTION, "Panorama Direction");
567
568 _tagNameMap.put(AFInfo.TAG_NUM_AF_POINTS, "AF Point Count");
569 _tagNameMap.put(AFInfo.TAG_VALID_AF_POINTS, "Valid AF Point Count");
570 _tagNameMap.put(AFInfo.TAG_IMAGE_WIDTH, "Image Width");
571 _tagNameMap.put(AFInfo.TAG_IMAGE_HEIGHT, "Image Height");
572 _tagNameMap.put(AFInfo.TAG_AF_IMAGE_WIDTH, "AF Image Width");
573 _tagNameMap.put(AFInfo.TAG_AF_IMAGE_HEIGHT, "AF Image Height");
574 _tagNameMap.put(AFInfo.TAG_AF_AREA_WIDTH, "AF Area Width");
575 _tagNameMap.put(AFInfo.TAG_AF_AREA_HEIGHT, "AF Area Height");
576 _tagNameMap.put(AFInfo.TAG_AF_AREA_X_POSITIONS, "AF Area X Positions");
577 _tagNameMap.put(AFInfo.TAG_AF_AREA_Y_POSITIONS, "AF Area Y Positions");
578 _tagNameMap.put(AFInfo.TAG_AF_POINTS_IN_FOCUS, "AF Points in Focus Count");
579 _tagNameMap.put(AFInfo.TAG_PRIMARY_AF_POINT_1, "Primary AF Point 1");
580 _tagNameMap.put(AFInfo.TAG_PRIMARY_AF_POINT_2, "Primary AF Point 2");
581
582// _tagNameMap.put(TAG_CANON_CUSTOM_FUNCTION_LONG_EXPOSURE_NOISE_REDUCTION, "Long Exposure Noise Reduction");
583// _tagNameMap.put(TAG_CANON_CUSTOM_FUNCTION_SHUTTER_AUTO_EXPOSURE_LOCK_BUTTONS, "Shutter/Auto Exposure-lock Buttons");
584// _tagNameMap.put(TAG_CANON_CUSTOM_FUNCTION_MIRROR_LOCKUP, "Mirror Lockup");
585// _tagNameMap.put(TAG_CANON_CUSTOM_FUNCTION_TV_AV_AND_EXPOSURE_LEVEL, "Tv/Av And Exposure Level");
586// _tagNameMap.put(TAG_CANON_CUSTOM_FUNCTION_AF_ASSIST_LIGHT, "AF-Assist Light");
587// _tagNameMap.put(TAG_CANON_CUSTOM_FUNCTION_SHUTTER_SPEED_IN_AV_MODE, "Shutter Speed in Av Mode");
588// _tagNameMap.put(TAG_CANON_CUSTOM_FUNCTION_BRACKETING, "Auto-Exposure Bracketing Sequence/Auto Cancellation");
589// _tagNameMap.put(TAG_CANON_CUSTOM_FUNCTION_SHUTTER_CURTAIN_SYNC, "Shutter Curtain Sync");
590// _tagNameMap.put(TAG_CANON_CUSTOM_FUNCTION_AF_STOP, "Lens Auto-Focus Stop Button Function Switch");
591// _tagNameMap.put(TAG_CANON_CUSTOM_FUNCTION_FILL_FLASH_REDUCTION, "Auto Reduction of Fill Flash");
592// _tagNameMap.put(TAG_CANON_CUSTOM_FUNCTION_MENU_BUTTON_RETURN, "Menu Button Return Position");
593// _tagNameMap.put(TAG_CANON_CUSTOM_FUNCTION_SET_BUTTON_FUNCTION, "SET Button Function When Shooting");
594// _tagNameMap.put(TAG_CANON_CUSTOM_FUNCTION_SENSOR_CLEANING, "Sensor Cleaning");
595
596 _tagNameMap.put(TAG_THUMBNAIL_IMAGE_VALID_AREA, "Thumbnail Image Valid Area");
597 _tagNameMap.put(TAG_SERIAL_NUMBER_FORMAT, "Serial Number Format");
598 _tagNameMap.put(TAG_SUPER_MACRO, "Super Macro");
599 _tagNameMap.put(TAG_DATE_STAMP_MODE, "Date Stamp Mode");
600 _tagNameMap.put(TAG_MY_COLORS, "My Colors");
601 _tagNameMap.put(TAG_FIRMWARE_REVISION, "Firmware Revision");
602 _tagNameMap.put(TAG_CATEGORIES, "Categories");
603 _tagNameMap.put(TAG_FACE_DETECT_ARRAY_1, "Face Detect Array 1");
604 _tagNameMap.put(TAG_FACE_DETECT_ARRAY_2, "Face Detect Array 2");
605 _tagNameMap.put(TAG_AF_INFO_ARRAY_2, "AF Info Array 2");
606 _tagNameMap.put(TAG_IMAGE_UNIQUE_ID, "Image Unique ID");
607 _tagNameMap.put(TAG_RAW_DATA_OFFSET, "Raw Data Offset");
608 _tagNameMap.put(TAG_ORIGINAL_DECISION_DATA_OFFSET, "Original Decision Data Offset");
609 _tagNameMap.put(TAG_CUSTOM_FUNCTIONS_1D_ARRAY, "Custom Functions (1D) Array");
610 _tagNameMap.put(TAG_PERSONAL_FUNCTIONS_ARRAY, "Personal Functions Array");
611 _tagNameMap.put(TAG_PERSONAL_FUNCTION_VALUES_ARRAY, "Personal Function Values Array");
612 _tagNameMap.put(TAG_FILE_INFO_ARRAY, "File Info Array");
613 _tagNameMap.put(TAG_AF_POINTS_IN_FOCUS_1D, "AF Points in Focus (1D)");
614 _tagNameMap.put(TAG_LENS_MODEL, "Lens Model");
615 _tagNameMap.put(TAG_SERIAL_INFO_ARRAY, "Serial Info Array");
616 _tagNameMap.put(TAG_DUST_REMOVAL_DATA, "Dust Removal Data");
617 _tagNameMap.put(TAG_CROP_INFO, "Crop Info");
618 _tagNameMap.put(TAG_CUSTOM_FUNCTIONS_ARRAY_2, "Custom Functions Array 2");
619 _tagNameMap.put(TAG_ASPECT_INFO_ARRAY, "Aspect Information Array");
620 _tagNameMap.put(TAG_PROCESSING_INFO_ARRAY, "Processing Information Array");
621 _tagNameMap.put(TAG_TONE_CURVE_TABLE, "Tone Curve Table");
622 _tagNameMap.put(TAG_SHARPNESS_TABLE, "Sharpness Table");
623 _tagNameMap.put(TAG_SHARPNESS_FREQ_TABLE, "Sharpness Frequency Table");
624 _tagNameMap.put(TAG_WHITE_BALANCE_TABLE, "White Balance Table");
625 _tagNameMap.put(TAG_COLOR_BALANCE_ARRAY, "Color Balance Array");
626 _tagNameMap.put(TAG_MEASURED_COLOR_ARRAY, "Measured Color Array");
627 _tagNameMap.put(TAG_COLOR_TEMPERATURE, "Color Temperature");
628 _tagNameMap.put(TAG_CANON_FLAGS_ARRAY, "Canon Flags Array");
629 _tagNameMap.put(TAG_MODIFIED_INFO_ARRAY, "Modified Information Array");
630 _tagNameMap.put(TAG_TONE_CURVE_MATCHING, "Tone Curve Matching");
631 _tagNameMap.put(TAG_WHITE_BALANCE_MATCHING, "White Balance Matching");
632 _tagNameMap.put(TAG_COLOR_SPACE, "Color Space");
633 _tagNameMap.put(TAG_PREVIEW_IMAGE_INFO_ARRAY, "Preview Image Info Array");
634 _tagNameMap.put(TAG_VRD_OFFSET, "VRD Offset");
635 _tagNameMap.put(TAG_SENSOR_INFO_ARRAY, "Sensor Information Array");
636 _tagNameMap.put(TAG_COLOR_DATA_ARRAY_2, "Color Data Array 1");
637 _tagNameMap.put(TAG_CRW_PARAM, "CRW Parameters");
638 _tagNameMap.put(TAG_COLOR_INFO_ARRAY_2, "Color Data Array 2");
639 _tagNameMap.put(TAG_BLACK_LEVEL, "Black Level");
640 _tagNameMap.put(TAG_CUSTOM_PICTURE_STYLE_FILE_NAME, "Custom Picture Style File Name");
641 _tagNameMap.put(TAG_COLOR_INFO_ARRAY, "Color Info Array");
642 _tagNameMap.put(TAG_VIGNETTING_CORRECTION_ARRAY_1, "Vignetting Correction Array 1");
643 _tagNameMap.put(TAG_VIGNETTING_CORRECTION_ARRAY_2, "Vignetting Correction Array 2");
644 _tagNameMap.put(TAG_LIGHTING_OPTIMIZER_ARRAY, "Lighting Optimizer Array");
645 _tagNameMap.put(TAG_LENS_INFO_ARRAY, "Lens Info Array");
646 _tagNameMap.put(TAG_AMBIANCE_INFO_ARRAY, "Ambiance Info Array");
647 _tagNameMap.put(TAG_FILTER_INFO_ARRAY, "Filter Info Array");
648 }
649
650 public CanonMakernoteDirectory()
651 {
652 this.setDescriptor(new CanonMakernoteDescriptor(this));
653 }
654
655 @Override
656 @NotNull
657 public String getName()
658 {
659 return "Canon Makernote";
660 }
661
662 @Override
663 @NotNull
664 protected HashMap<Integer, String> getTagNameMap()
665 {
666 return _tagNameMap;
667 }
668
669 @Override
670 public void setObjectArray(int tagType, @NotNull Object array)
671 {
672 // TODO is there some way to drop out 'null' or 'zero' values that are present in the array to reduce the noise?
673
674 // Certain Canon tags contain arrays of values that we split into 'fake' tags as each
675 // index in the array has its own meaning and decoding.
676 // Pick those tags out here and throw away the original array.
677 // Otherwise just add as usual.
678 switch (tagType) {
679 case TAG_CAMERA_SETTINGS_ARRAY: {
680 int[] ints = (int[])array;
681 for (int i = 0; i < ints.length; i++)
682 setInt(CameraSettings.OFFSET + i, ints[i]);
683 break;
684 }
685 case TAG_FOCAL_LENGTH_ARRAY: {
686 int[] ints = (int[])array;
687 for (int i = 0; i < ints.length; i++)
688 setInt(FocalLength.OFFSET + i, ints[i]);
689 break;
690 }
691 case TAG_SHOT_INFO_ARRAY: {
692 int[] ints = (int[])array;
693 for (int i = 0; i < ints.length; i++)
694 setInt(ShotInfo.OFFSET + i, ints[i]);
695 break;
696 }
697 case TAG_PANORAMA_ARRAY: {
698 int[] ints = (int[])array;
699 for (int i = 0; i < ints.length; i++)
700 setInt(Panorama.OFFSET + i, ints[i]);
701 break;
702 }
703 // TODO the interpretation of the custom functions tag depends upon the camera model
704// case TAG_CANON_CUSTOM_FUNCTIONS_ARRAY:
705// int subTagTypeBase = 0xC300;
706// // we intentionally skip the first array member
707// for (int i = 1; i < ints.length; i++)
708// setInt(subTagTypeBase + i + 1, ints[i] & 0x0F);
709// break;
710 case TAG_AF_INFO_ARRAY: {
711 int[] ints = (int[])array;
712 for (int i = 0; i < ints.length; i++)
713 setInt(AFInfo.OFFSET + i, ints[i]);
714 break;
715 }
716 default: {
717 // no special handling...
718 super.setObjectArray(tagType, array);
719 break;
720 }
721 }
722 }
723}
Note: See TracBrowser for help on using the repository browser.