1 | /*
|
---|
2 | * Copyright 2002-2015 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 | */
|
---|
21 | package com.drew.metadata.exif.makernotes;
|
---|
22 |
|
---|
23 | import com.drew.lang.SequentialByteArrayReader;
|
---|
24 | import com.drew.lang.annotations.NotNull;
|
---|
25 | import com.drew.metadata.Directory;
|
---|
26 |
|
---|
27 | import java.io.IOException;
|
---|
28 | import java.util.HashMap;
|
---|
29 |
|
---|
30 | /**
|
---|
31 | * The Olympus makernote is used by many manufacturers (Epson, Konica, Minolta and Agfa...), and as such contains some tags
|
---|
32 | * that appear specific to those manufacturers.
|
---|
33 | *
|
---|
34 | * @author Drew Noakes https://drewnoakes.com
|
---|
35 | */
|
---|
36 | public class OlympusMakernoteDirectory extends Directory
|
---|
37 | {
|
---|
38 | /** Used by Konica / Minolta cameras. */
|
---|
39 | public static final int TAG_MAKERNOTE_VERSION = 0x0000;
|
---|
40 | /** Used by Konica / Minolta cameras. */
|
---|
41 | public static final int TAG_CAMERA_SETTINGS_1 = 0x0001;
|
---|
42 | /** Alternate Camera Settings Tag. Used by Konica / Minolta cameras. */
|
---|
43 | public static final int TAG_CAMERA_SETTINGS_2 = 0x0003;
|
---|
44 | /** Used by Konica / Minolta cameras. */
|
---|
45 | public static final int TAG_COMPRESSED_IMAGE_SIZE = 0x0040;
|
---|
46 | /** Used by Konica / Minolta cameras. */
|
---|
47 | public static final int TAG_MINOLTA_THUMBNAIL_OFFSET_1 = 0x0081;
|
---|
48 | /** Alternate Thumbnail Offset. Used by Konica / Minolta cameras. */
|
---|
49 | public static final int TAG_MINOLTA_THUMBNAIL_OFFSET_2 = 0x0088;
|
---|
50 | /** Length of thumbnail in bytes. Used by Konica / Minolta cameras. */
|
---|
51 | public static final int TAG_MINOLTA_THUMBNAIL_LENGTH = 0x0089;
|
---|
52 |
|
---|
53 | /**
|
---|
54 | * Used by Konica / Minolta cameras
|
---|
55 | * 0 = Natural Colour
|
---|
56 | * 1 = Black & White
|
---|
57 | * 2 = Vivid colour
|
---|
58 | * 3 = Solarization
|
---|
59 | * 4 = AdobeRGB
|
---|
60 | */
|
---|
61 | public static final int TAG_COLOUR_MODE = 0x0101;
|
---|
62 |
|
---|
63 | /**
|
---|
64 | * Used by Konica / Minolta cameras.
|
---|
65 | * 0 = Raw
|
---|
66 | * 1 = Super Fine
|
---|
67 | * 2 = Fine
|
---|
68 | * 3 = Standard
|
---|
69 | * 4 = Extra Fine
|
---|
70 | */
|
---|
71 | public static final int TAG_IMAGE_QUALITY_1 = 0x0102;
|
---|
72 |
|
---|
73 | /**
|
---|
74 | * Not 100% sure about this tag.
|
---|
75 | * <p>
|
---|
76 | * Used by Konica / Minolta cameras.
|
---|
77 | * 0 = Raw
|
---|
78 | * 1 = Super Fine
|
---|
79 | * 2 = Fine
|
---|
80 | * 3 = Standard
|
---|
81 | * 4 = Extra Fine
|
---|
82 | */
|
---|
83 | public static final int TAG_IMAGE_QUALITY_2 = 0x0103;
|
---|
84 |
|
---|
85 |
|
---|
86 | /**
|
---|
87 | * Three values:
|
---|
88 | * Value 1: 0=Normal, 2=Fast, 3=Panorama
|
---|
89 | * Value 2: Sequence Number Value 3:
|
---|
90 | * 1 = Panorama Direction: Left to Right
|
---|
91 | * 2 = Panorama Direction: Right to Left
|
---|
92 | * 3 = Panorama Direction: Bottom to Top
|
---|
93 | * 4 = Panorama Direction: Top to Bottom
|
---|
94 | */
|
---|
95 | public static final int TAG_SPECIAL_MODE = 0x0200;
|
---|
96 |
|
---|
97 | /**
|
---|
98 | * 1 = Standard Quality
|
---|
99 | * 2 = High Quality
|
---|
100 | * 3 = Super High Quality
|
---|
101 | */
|
---|
102 | public static final int TAG_JPEG_QUALITY = 0x0201;
|
---|
103 |
|
---|
104 | /**
|
---|
105 | * 0 = Normal (Not Macro)
|
---|
106 | * 1 = Macro
|
---|
107 | */
|
---|
108 | public static final int TAG_MACRO_MODE = 0x0202;
|
---|
109 |
|
---|
110 | /**
|
---|
111 | * 0 = Off, 1 = On
|
---|
112 | */
|
---|
113 | public static final int TAG_BW_MODE = 0x0203;
|
---|
114 |
|
---|
115 | /** Zoom Factor (0 or 1 = normal) */
|
---|
116 | public static final int TAG_DIGI_ZOOM_RATIO = 0x0204;
|
---|
117 | public static final int TAG_FOCAL_PLANE_DIAGONAL = 0x0205;
|
---|
118 | public static final int TAG_LENS_DISTORTION_PARAMETERS = 0x0206;
|
---|
119 | public static final int TAG_FIRMWARE_VERSION = 0x0207;
|
---|
120 | public static final int TAG_PICT_INFO = 0x0208;
|
---|
121 | public static final int TAG_CAMERA_ID = 0x0209;
|
---|
122 |
|
---|
123 | /**
|
---|
124 | * Used by Epson cameras
|
---|
125 | * Units = pixels
|
---|
126 | */
|
---|
127 | public static final int TAG_IMAGE_WIDTH = 0x020B;
|
---|
128 |
|
---|
129 | /**
|
---|
130 | * Used by Epson cameras
|
---|
131 | * Units = pixels
|
---|
132 | */
|
---|
133 | public static final int TAG_IMAGE_HEIGHT = 0x020C;
|
---|
134 |
|
---|
135 | /** A string. Used by Epson cameras. */
|
---|
136 | public static final int TAG_ORIGINAL_MANUFACTURER_MODEL = 0x020D;
|
---|
137 |
|
---|
138 | /**
|
---|
139 | * See the PIM specification here:
|
---|
140 | * http://www.ozhiker.com/electronics/pjmt/jpeg_info/pim.html
|
---|
141 | */
|
---|
142 | public static final int TAG_PRINT_IMAGE_MATCHING_INFO = 0x0E00;
|
---|
143 |
|
---|
144 | public static final int TAG_DATA_DUMP = 0x0F00;
|
---|
145 |
|
---|
146 | public static final int TAG_SHUTTER_SPEED_VALUE = 0x1000;
|
---|
147 | public static final int TAG_ISO_VALUE = 0x1001;
|
---|
148 | public static final int TAG_APERTURE_VALUE = 0x1002;
|
---|
149 | public static final int TAG_BRIGHTNESS_VALUE = 0x1003;
|
---|
150 | public static final int TAG_FLASH_MODE = 0x1004;
|
---|
151 | public static final int TAG_BRACKET = 0x1006;
|
---|
152 | public static final int TAG_FOCUS_RANGE = 0x100A;
|
---|
153 | public static final int TAG_FOCUS_MODE = 0x100B;
|
---|
154 | public static final int TAG_FOCUS_DISTANCE = 0x100C;
|
---|
155 | public static final int TAG_ZOOM = 0x100D;
|
---|
156 | public static final int TAG_MACRO_FOCUS = 0x100E;
|
---|
157 | public static final int TAG_SHARPNESS = 0x100F;
|
---|
158 | public static final int TAG_COLOUR_MATRIX = 0x1011;
|
---|
159 | public static final int TAG_BLACK_LEVEL = 0x1012;
|
---|
160 | public static final int TAG_WHITE_BALANCE = 0x1015;
|
---|
161 | public static final int TAG_RED_BIAS = 0x1017;
|
---|
162 | public static final int TAG_BLUE_BIAS = 0x1018;
|
---|
163 | public static final int TAG_SERIAL_NUMBER = 0x101A;
|
---|
164 | public static final int TAG_FLASH_BIAS = 0x1023;
|
---|
165 | public static final int TAG_CONTRAST = 0x1029;
|
---|
166 | public static final int TAG_SHARPNESS_FACTOR = 0x102A;
|
---|
167 | public static final int TAG_COLOUR_CONTROL = 0x102B;
|
---|
168 | public static final int TAG_VALID_BITS = 0x102C;
|
---|
169 | public static final int TAG_CORING_FILTER = 0x102D;
|
---|
170 | public static final int TAG_FINAL_WIDTH = 0x102E;
|
---|
171 | public static final int TAG_FINAL_HEIGHT = 0x102F;
|
---|
172 | public static final int TAG_COMPRESSION_RATIO = 0x1034;
|
---|
173 |
|
---|
174 | public final static class CameraSettings
|
---|
175 | {
|
---|
176 | // These 'sub'-tag values have been created for consistency -- they don't exist within the Makernote IFD
|
---|
177 | private static final int OFFSET = 0xF000;
|
---|
178 |
|
---|
179 | public static final int TAG_EXPOSURE_MODE = OFFSET + 2;
|
---|
180 | public static final int TAG_FLASH_MODE = OFFSET + 3;
|
---|
181 | public static final int TAG_WHITE_BALANCE = OFFSET + 4;
|
---|
182 | public static final int TAG_IMAGE_SIZE = OFFSET + 5;
|
---|
183 | public static final int TAG_IMAGE_QUALITY = OFFSET + 6;
|
---|
184 | public static final int TAG_SHOOTING_MODE = OFFSET + 7;
|
---|
185 | public static final int TAG_METERING_MODE = OFFSET + 8;
|
---|
186 | public static final int TAG_APEX_FILM_SPEED_VALUE = OFFSET + 9;
|
---|
187 | public static final int TAG_APEX_SHUTTER_SPEED_TIME_VALUE = OFFSET + 10;
|
---|
188 | public static final int TAG_APEX_APERTURE_VALUE = OFFSET + 11;
|
---|
189 | public static final int TAG_MACRO_MODE = OFFSET + 12;
|
---|
190 | public static final int TAG_DIGITAL_ZOOM = OFFSET + 13;
|
---|
191 | public static final int TAG_EXPOSURE_COMPENSATION = OFFSET + 14;
|
---|
192 | public static final int TAG_BRACKET_STEP = OFFSET + 15;
|
---|
193 |
|
---|
194 | public static final int TAG_INTERVAL_LENGTH = OFFSET + 17;
|
---|
195 | public static final int TAG_INTERVAL_NUMBER = OFFSET + 18;
|
---|
196 | public static final int TAG_FOCAL_LENGTH = OFFSET + 19;
|
---|
197 | public static final int TAG_FOCUS_DISTANCE = OFFSET + 20;
|
---|
198 | public static final int TAG_FLASH_FIRED = OFFSET + 21;
|
---|
199 | public static final int TAG_DATE = OFFSET + 22;
|
---|
200 | public static final int TAG_TIME = OFFSET + 23;
|
---|
201 | public static final int TAG_MAX_APERTURE_AT_FOCAL_LENGTH = OFFSET + 24;
|
---|
202 |
|
---|
203 | public static final int TAG_FILE_NUMBER_MEMORY = OFFSET + 27;
|
---|
204 | public static final int TAG_LAST_FILE_NUMBER = OFFSET + 28;
|
---|
205 | public static final int TAG_WHITE_BALANCE_RED = OFFSET + 29;
|
---|
206 | public static final int TAG_WHITE_BALANCE_GREEN = OFFSET + 30;
|
---|
207 | public static final int TAG_WHITE_BALANCE_BLUE = OFFSET + 31;
|
---|
208 | public static final int TAG_SATURATION = OFFSET + 32;
|
---|
209 | public static final int TAG_CONTRAST = OFFSET + 33;
|
---|
210 | public static final int TAG_SHARPNESS = OFFSET + 34;
|
---|
211 | public static final int TAG_SUBJECT_PROGRAM = OFFSET + 35;
|
---|
212 | public static final int TAG_FLASH_COMPENSATION = OFFSET + 36;
|
---|
213 | public static final int TAG_ISO_SETTING = OFFSET + 37;
|
---|
214 | public static final int TAG_CAMERA_MODEL = OFFSET + 38;
|
---|
215 | public static final int TAG_INTERVAL_MODE = OFFSET + 39;
|
---|
216 | public static final int TAG_FOLDER_NAME = OFFSET + 40;
|
---|
217 | public static final int TAG_COLOR_MODE = OFFSET + 41;
|
---|
218 | public static final int TAG_COLOR_FILTER = OFFSET + 42;
|
---|
219 | public static final int TAG_BLACK_AND_WHITE_FILTER = OFFSET + 43;
|
---|
220 | public static final int TAG_INTERNAL_FLASH = OFFSET + 44;
|
---|
221 | public static final int TAG_APEX_BRIGHTNESS_VALUE = OFFSET + 45;
|
---|
222 | public static final int TAG_SPOT_FOCUS_POINT_X_COORDINATE = OFFSET + 46;
|
---|
223 | public static final int TAG_SPOT_FOCUS_POINT_Y_COORDINATE = OFFSET + 47;
|
---|
224 | public static final int TAG_WIDE_FOCUS_ZONE = OFFSET + 48;
|
---|
225 | public static final int TAG_FOCUS_MODE = OFFSET + 49;
|
---|
226 | public static final int TAG_FOCUS_AREA = OFFSET + 50;
|
---|
227 | public static final int TAG_DEC_SWITCH_POSITION = OFFSET + 51;
|
---|
228 | }
|
---|
229 |
|
---|
230 | @NotNull
|
---|
231 | protected static final HashMap<Integer, String> _tagNameMap = new HashMap<Integer, String>();
|
---|
232 |
|
---|
233 | static {
|
---|
234 | _tagNameMap.put(TAG_SPECIAL_MODE, "Special Mode");
|
---|
235 | _tagNameMap.put(TAG_JPEG_QUALITY, "JPEG Quality");
|
---|
236 | _tagNameMap.put(TAG_MACRO_MODE, "Macro");
|
---|
237 | _tagNameMap.put(TAG_BW_MODE, "BW Mode");
|
---|
238 | _tagNameMap.put(TAG_DIGI_ZOOM_RATIO, "DigiZoom Ratio");
|
---|
239 | _tagNameMap.put(TAG_FOCAL_PLANE_DIAGONAL, "Focal Plane Diagonal");
|
---|
240 | _tagNameMap.put(TAG_LENS_DISTORTION_PARAMETERS, "Lens Distortion Parameters");
|
---|
241 | _tagNameMap.put(TAG_FIRMWARE_VERSION, "Firmware Version");
|
---|
242 | _tagNameMap.put(TAG_PICT_INFO, "Pict Info");
|
---|
243 | _tagNameMap.put(TAG_CAMERA_ID, "Camera Id");
|
---|
244 | _tagNameMap.put(TAG_DATA_DUMP, "Data Dump");
|
---|
245 | _tagNameMap.put(TAG_MAKERNOTE_VERSION, "Makernote Version");
|
---|
246 | _tagNameMap.put(TAG_CAMERA_SETTINGS_1, "Camera Settings");
|
---|
247 | _tagNameMap.put(TAG_CAMERA_SETTINGS_2, "Camera Settings");
|
---|
248 | _tagNameMap.put(TAG_COMPRESSED_IMAGE_SIZE, "Compressed Image Size");
|
---|
249 | _tagNameMap.put(TAG_MINOLTA_THUMBNAIL_OFFSET_1, "Thumbnail Offset");
|
---|
250 | _tagNameMap.put(TAG_MINOLTA_THUMBNAIL_OFFSET_2, "Thumbnail Offset");
|
---|
251 | _tagNameMap.put(TAG_MINOLTA_THUMBNAIL_LENGTH, "Thumbnail Length");
|
---|
252 | _tagNameMap.put(TAG_COLOUR_MODE, "Colour Mode");
|
---|
253 | _tagNameMap.put(TAG_IMAGE_QUALITY_1, "Image Quality");
|
---|
254 | _tagNameMap.put(TAG_IMAGE_QUALITY_2, "Image Quality");
|
---|
255 | _tagNameMap.put(TAG_IMAGE_HEIGHT, "Image Height");
|
---|
256 | _tagNameMap.put(TAG_IMAGE_WIDTH, "Image Width");
|
---|
257 | _tagNameMap.put(TAG_ORIGINAL_MANUFACTURER_MODEL, "Original Manufacturer Model");
|
---|
258 | _tagNameMap.put(TAG_PRINT_IMAGE_MATCHING_INFO, "Print Image Matching (PIM) Info");
|
---|
259 |
|
---|
260 | _tagNameMap.put(TAG_SHUTTER_SPEED_VALUE, "Shutter Speed Value");
|
---|
261 | _tagNameMap.put(TAG_ISO_VALUE, "ISO Value");
|
---|
262 | _tagNameMap.put(TAG_APERTURE_VALUE, "Aperture Value");
|
---|
263 | _tagNameMap.put(TAG_BRIGHTNESS_VALUE, "Brightness Value");
|
---|
264 | _tagNameMap.put(TAG_FLASH_MODE, "Flash Mode");
|
---|
265 | _tagNameMap.put(TAG_BRACKET, "Bracket");
|
---|
266 | _tagNameMap.put(TAG_FOCUS_RANGE, "Focus Range");
|
---|
267 | _tagNameMap.put(TAG_FOCUS_MODE, "Focus Mode");
|
---|
268 | _tagNameMap.put(TAG_FOCUS_DISTANCE, "Focus Distance");
|
---|
269 | _tagNameMap.put(TAG_ZOOM, "Zoom");
|
---|
270 | _tagNameMap.put(TAG_MACRO_FOCUS, "Macro Focus");
|
---|
271 | _tagNameMap.put(TAG_SHARPNESS, "Sharpness");
|
---|
272 | _tagNameMap.put(TAG_COLOUR_MATRIX, "Colour Matrix");
|
---|
273 | _tagNameMap.put(TAG_BLACK_LEVEL, "Black Level");
|
---|
274 | _tagNameMap.put(TAG_WHITE_BALANCE, "White Balance");
|
---|
275 | _tagNameMap.put(TAG_RED_BIAS, "Red Bias");
|
---|
276 | _tagNameMap.put(TAG_BLUE_BIAS, "Blue Bias");
|
---|
277 | _tagNameMap.put(TAG_SERIAL_NUMBER, "Serial Number");
|
---|
278 | _tagNameMap.put(TAG_FLASH_BIAS, "Flash Bias");
|
---|
279 | _tagNameMap.put(TAG_CONTRAST, "Contrast");
|
---|
280 | _tagNameMap.put(TAG_SHARPNESS_FACTOR, "Sharpness Factor");
|
---|
281 | _tagNameMap.put(TAG_COLOUR_CONTROL, "Colour Control");
|
---|
282 | _tagNameMap.put(TAG_VALID_BITS, "Valid Bits");
|
---|
283 | _tagNameMap.put(TAG_CORING_FILTER, "Coring Filter");
|
---|
284 | _tagNameMap.put(TAG_FINAL_WIDTH, "Final Width");
|
---|
285 | _tagNameMap.put(TAG_FINAL_HEIGHT, "Final Height");
|
---|
286 | _tagNameMap.put(TAG_COMPRESSION_RATIO, "Compression Ratio");
|
---|
287 |
|
---|
288 | _tagNameMap.put(CameraSettings.TAG_EXPOSURE_MODE, "Exposure Mode");
|
---|
289 | _tagNameMap.put(CameraSettings.TAG_FLASH_MODE, "Flash Mode");
|
---|
290 | _tagNameMap.put(CameraSettings.TAG_WHITE_BALANCE, "White Balance");
|
---|
291 | _tagNameMap.put(CameraSettings.TAG_IMAGE_SIZE, "Image Size");
|
---|
292 | _tagNameMap.put(CameraSettings.TAG_IMAGE_QUALITY, "Image Quality");
|
---|
293 | _tagNameMap.put(CameraSettings.TAG_SHOOTING_MODE, "Shooting Mode");
|
---|
294 | _tagNameMap.put(CameraSettings.TAG_METERING_MODE, "Metering Mode");
|
---|
295 | _tagNameMap.put(CameraSettings.TAG_APEX_FILM_SPEED_VALUE, "Apex Film Speed Value");
|
---|
296 | _tagNameMap.put(CameraSettings.TAG_APEX_SHUTTER_SPEED_TIME_VALUE, "Apex Shutter Speed Time Value");
|
---|
297 | _tagNameMap.put(CameraSettings.TAG_APEX_APERTURE_VALUE, "Apex Aperture Value");
|
---|
298 | _tagNameMap.put(CameraSettings.TAG_MACRO_MODE, "Macro Mode");
|
---|
299 | _tagNameMap.put(CameraSettings.TAG_DIGITAL_ZOOM, "Digital Zoom");
|
---|
300 | _tagNameMap.put(CameraSettings.TAG_EXPOSURE_COMPENSATION, "Exposure Compensation");
|
---|
301 | _tagNameMap.put(CameraSettings.TAG_BRACKET_STEP, "Bracket Step");
|
---|
302 |
|
---|
303 | _tagNameMap.put(CameraSettings.TAG_INTERVAL_LENGTH, "Interval Length");
|
---|
304 | _tagNameMap.put(CameraSettings.TAG_INTERVAL_NUMBER, "Interval Number");
|
---|
305 | _tagNameMap.put(CameraSettings.TAG_FOCAL_LENGTH, "Focal Length");
|
---|
306 | _tagNameMap.put(CameraSettings.TAG_FOCUS_DISTANCE, "Focus Distance");
|
---|
307 | _tagNameMap.put(CameraSettings.TAG_FLASH_FIRED, "Flash Fired");
|
---|
308 | _tagNameMap.put(CameraSettings.TAG_DATE, "Date");
|
---|
309 | _tagNameMap.put(CameraSettings.TAG_TIME, "Time");
|
---|
310 | _tagNameMap.put(CameraSettings.TAG_MAX_APERTURE_AT_FOCAL_LENGTH, "Max Aperture at Focal Length");
|
---|
311 |
|
---|
312 | _tagNameMap.put(CameraSettings.TAG_FILE_NUMBER_MEMORY, "File Number Memory");
|
---|
313 | _tagNameMap.put(CameraSettings.TAG_LAST_FILE_NUMBER, "Last File Number");
|
---|
314 | _tagNameMap.put(CameraSettings.TAG_WHITE_BALANCE_RED, "White Balance Red");
|
---|
315 | _tagNameMap.put(CameraSettings.TAG_WHITE_BALANCE_GREEN, "White Balance Green");
|
---|
316 | _tagNameMap.put(CameraSettings.TAG_WHITE_BALANCE_BLUE, "White Balance Blue");
|
---|
317 | _tagNameMap.put(CameraSettings.TAG_SATURATION, "Saturation");
|
---|
318 | _tagNameMap.put(CameraSettings.TAG_CONTRAST, "Contrast");
|
---|
319 | _tagNameMap.put(CameraSettings.TAG_SHARPNESS, "Sharpness");
|
---|
320 | _tagNameMap.put(CameraSettings.TAG_SUBJECT_PROGRAM, "Subject Program");
|
---|
321 | _tagNameMap.put(CameraSettings.TAG_FLASH_COMPENSATION, "Flash Compensation");
|
---|
322 | _tagNameMap.put(CameraSettings.TAG_ISO_SETTING, "ISO Setting");
|
---|
323 | _tagNameMap.put(CameraSettings.TAG_CAMERA_MODEL, "Camera Model");
|
---|
324 | _tagNameMap.put(CameraSettings.TAG_INTERVAL_MODE, "Interval Mode");
|
---|
325 | _tagNameMap.put(CameraSettings.TAG_FOLDER_NAME, "Folder Name");
|
---|
326 | _tagNameMap.put(CameraSettings.TAG_COLOR_MODE, "Color Mode");
|
---|
327 | _tagNameMap.put(CameraSettings.TAG_COLOR_FILTER, "Color Filter");
|
---|
328 | _tagNameMap.put(CameraSettings.TAG_BLACK_AND_WHITE_FILTER, "Black and White Filter");
|
---|
329 | _tagNameMap.put(CameraSettings.TAG_INTERNAL_FLASH, "Internal Flash");
|
---|
330 | _tagNameMap.put(CameraSettings.TAG_APEX_BRIGHTNESS_VALUE, "Apex Brightness Value");
|
---|
331 | _tagNameMap.put(CameraSettings.TAG_SPOT_FOCUS_POINT_X_COORDINATE, "Spot Focus Point X Coordinate");
|
---|
332 | _tagNameMap.put(CameraSettings.TAG_SPOT_FOCUS_POINT_Y_COORDINATE, "Spot Focus Point Y Coordinate");
|
---|
333 | _tagNameMap.put(CameraSettings.TAG_WIDE_FOCUS_ZONE, "Wide Focus Zone");
|
---|
334 | _tagNameMap.put(CameraSettings.TAG_FOCUS_MODE, "Focus Mode");
|
---|
335 | _tagNameMap.put(CameraSettings.TAG_FOCUS_AREA, "Focus Area");
|
---|
336 | _tagNameMap.put(CameraSettings.TAG_DEC_SWITCH_POSITION, "DEC Switch Position");
|
---|
337 | }
|
---|
338 |
|
---|
339 | public OlympusMakernoteDirectory()
|
---|
340 | {
|
---|
341 | this.setDescriptor(new OlympusMakernoteDescriptor(this));
|
---|
342 | }
|
---|
343 |
|
---|
344 | @Override
|
---|
345 | @NotNull
|
---|
346 | public String getName()
|
---|
347 | {
|
---|
348 | return "Olympus Makernote";
|
---|
349 | }
|
---|
350 |
|
---|
351 | @Override
|
---|
352 | public void setByteArray(int tagType, @NotNull byte[] bytes)
|
---|
353 | {
|
---|
354 | if (tagType == TAG_CAMERA_SETTINGS_1 || tagType == TAG_CAMERA_SETTINGS_2) {
|
---|
355 | processCameraSettings(bytes);
|
---|
356 | } else {
|
---|
357 | super.setByteArray(tagType, bytes);
|
---|
358 | }
|
---|
359 | }
|
---|
360 |
|
---|
361 | private void processCameraSettings(byte[] bytes)
|
---|
362 | {
|
---|
363 | SequentialByteArrayReader reader = new SequentialByteArrayReader(bytes);
|
---|
364 | reader.setMotorolaByteOrder(true);
|
---|
365 |
|
---|
366 | int count = bytes.length / 4;
|
---|
367 |
|
---|
368 | try {
|
---|
369 | for (int i = 0; i < count; i++) {
|
---|
370 | int value = reader.getInt32();
|
---|
371 | setInt(CameraSettings.OFFSET + i, value);
|
---|
372 | }
|
---|
373 | } catch (IOException e) {
|
---|
374 | // Should never happen, given that we check the length of the bytes beforehand.
|
---|
375 | e.printStackTrace();
|
---|
376 | }
|
---|
377 | }
|
---|
378 |
|
---|
379 | public boolean isIntervalMode()
|
---|
380 | {
|
---|
381 | Long value = getLongObject(CameraSettings.TAG_SHOOTING_MODE);
|
---|
382 | return value != null && value == 5;
|
---|
383 | }
|
---|
384 |
|
---|
385 | @Override
|
---|
386 | @NotNull
|
---|
387 | protected HashMap<Integer, String> getTagNameMap()
|
---|
388 | {
|
---|
389 | return _tagNameMap;
|
---|
390 | }
|
---|
391 | }
|
---|