source: josm/trunk/src/com/drew/metadata/exif/CanonMakernoteDescriptor.java@ 6127

Last change on this file since 6127 was 6127, checked in by bastiK, 12 years ago

applied #8895 - Upgrade metadata-extractor to v. 2.6.4 (patch by ebourg)

File size: 28.4 KB
Line 
1/*
2 * Copyright 2002-2012 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 * http://drewnoakes.com/code/exif/
19 * http://code.google.com/p/metadata-extractor/
20 */
21package com.drew.metadata.exif;
22
23import com.drew.lang.annotations.NotNull;
24import com.drew.lang.annotations.Nullable;
25import com.drew.metadata.TagDescriptor;
26
27/**
28 * Provides human-readable string representations of tag values stored in a <code>CanonMakernoteDirectory</code>.
29 *
30 * @author Drew Noakes http://drewnoakes.com
31 */
32public class CanonMakernoteDescriptor extends TagDescriptor<CanonMakernoteDirectory>
33{
34 public CanonMakernoteDescriptor(@NotNull CanonMakernoteDirectory directory)
35 {
36 super(directory);
37 }
38
39 @Nullable
40 public String getDescription(int tagType)
41 {
42 switch (tagType) {
43 case CanonMakernoteDirectory.TAG_CANON_SERIAL_NUMBER:
44 return getSerialNumberDescription();
45 case CanonMakernoteDirectory.CameraSettings.TAG_FLASH_ACTIVITY:
46 return getFlashActivityDescription();
47 case CanonMakernoteDirectory.CameraSettings.TAG_FOCUS_TYPE:
48 return getFocusTypeDescription();
49 case CanonMakernoteDirectory.CameraSettings.TAG_DIGITAL_ZOOM:
50 return getDigitalZoomDescription();
51 case CanonMakernoteDirectory.CameraSettings.TAG_QUALITY:
52 return getQualityDescription();
53 case CanonMakernoteDirectory.CameraSettings.TAG_MACRO_MODE:
54 return getMacroModeDescription();
55 case CanonMakernoteDirectory.CameraSettings.TAG_SELF_TIMER_DELAY:
56 return getSelfTimerDelayDescription();
57 case CanonMakernoteDirectory.CameraSettings.TAG_FLASH_MODE:
58 return getFlashModeDescription();
59 case CanonMakernoteDirectory.CameraSettings.TAG_CONTINUOUS_DRIVE_MODE:
60 return getContinuousDriveModeDescription();
61 case CanonMakernoteDirectory.CameraSettings.TAG_FOCUS_MODE_1:
62 return getFocusMode1Description();
63 case CanonMakernoteDirectory.CameraSettings.TAG_IMAGE_SIZE:
64 return getImageSizeDescription();
65 case CanonMakernoteDirectory.CameraSettings.TAG_EASY_SHOOTING_MODE:
66 return getEasyShootingModeDescription();
67 case CanonMakernoteDirectory.CameraSettings.TAG_CONTRAST:
68 return getContrastDescription();
69 case CanonMakernoteDirectory.CameraSettings.TAG_SATURATION:
70 return getSaturationDescription();
71 case CanonMakernoteDirectory.CameraSettings.TAG_SHARPNESS:
72 return getSharpnessDescription();
73 case CanonMakernoteDirectory.CameraSettings.TAG_ISO:
74 return getIsoDescription();
75 case CanonMakernoteDirectory.CameraSettings.TAG_METERING_MODE:
76 return getMeteringModeDescription();
77 case CanonMakernoteDirectory.CameraSettings.TAG_AF_POINT_SELECTED:
78 return getAfPointSelectedDescription();
79 case CanonMakernoteDirectory.CameraSettings.TAG_EXPOSURE_MODE:
80 return getExposureModeDescription();
81 case CanonMakernoteDirectory.CameraSettings.TAG_LONG_FOCAL_LENGTH:
82 return getLongFocalLengthDescription();
83 case CanonMakernoteDirectory.CameraSettings.TAG_SHORT_FOCAL_LENGTH:
84 return getShortFocalLengthDescription();
85 case CanonMakernoteDirectory.CameraSettings.TAG_FOCAL_UNITS_PER_MM:
86 return getFocalUnitsPerMillimetreDescription();
87 case CanonMakernoteDirectory.CameraSettings.TAG_FLASH_DETAILS:
88 return getFlashDetailsDescription();
89 case CanonMakernoteDirectory.CameraSettings.TAG_FOCUS_MODE_2:
90 return getFocusMode2Description();
91 case CanonMakernoteDirectory.FocalLength.TAG_WHITE_BALANCE:
92 return getWhiteBalanceDescription();
93 case CanonMakernoteDirectory.FocalLength.TAG_AF_POINT_USED:
94 return getAfPointUsedDescription();
95 case CanonMakernoteDirectory.FocalLength.TAG_FLASH_BIAS:
96 return getFlashBiasDescription();
97
98 // It turns out that these values are dependent upon the camera model and therefore the below code was
99 // incorrect for some Canon models. This needs to be revisited.
100
101// case CanonMakernoteDirectory.TAG_CANON_CUSTOM_FUNCTION_LONG_EXPOSURE_NOISE_REDUCTION:
102// return getLongExposureNoiseReductionDescription();
103// case CanonMakernoteDirectory.TAG_CANON_CUSTOM_FUNCTION_SHUTTER_AUTO_EXPOSURE_LOCK_BUTTONS:
104// return getShutterAutoExposureLockButtonDescription();
105// case CanonMakernoteDirectory.TAG_CANON_CUSTOM_FUNCTION_MIRROR_LOCKUP:
106// return getMirrorLockupDescription();
107// case CanonMakernoteDirectory.TAG_CANON_CUSTOM_FUNCTION_TV_AV_AND_EXPOSURE_LEVEL:
108// return getTvAndAvExposureLevelDescription();
109// case CanonMakernoteDirectory.TAG_CANON_CUSTOM_FUNCTION_AF_ASSIST_LIGHT:
110// return getAutoFocusAssistLightDescription();
111// case CanonMakernoteDirectory.TAG_CANON_CUSTOM_FUNCTION_SHUTTER_SPEED_IN_AV_MODE:
112// return getShutterSpeedInAvModeDescription();
113// case CanonMakernoteDirectory.TAG_CANON_CUSTOM_FUNCTION_BRACKETTING:
114// return getAutoExposureBrackettingSequenceAndAutoCancellationDescription();
115// case CanonMakernoteDirectory.TAG_CANON_CUSTOM_FUNCTION_SHUTTER_CURTAIN_SYNC:
116// return getShutterCurtainSyncDescription();
117// case CanonMakernoteDirectory.TAG_CANON_CUSTOM_FUNCTION_AF_STOP:
118// return getLensAutoFocusStopButtonDescription();
119// case CanonMakernoteDirectory.TAG_CANON_CUSTOM_FUNCTION_FILL_FLASH_REDUCTION:
120// return getFillFlashReductionDescription();
121// case CanonMakernoteDirectory.TAG_CANON_CUSTOM_FUNCTION_MENU_BUTTON_RETURN:
122// return getMenuButtonReturnPositionDescription();
123// case CanonMakernoteDirectory.TAG_CANON_CUSTOM_FUNCTION_SET_BUTTON_FUNCTION:
124// return getSetButtonFunctionWhenShootingDescription();
125// case CanonMakernoteDirectory.TAG_CANON_CUSTOM_FUNCTION_SENSOR_CLEANING:
126// return getSensorCleaningDescription();
127 default:
128 return super.getDescription(tagType);
129 }
130 }
131
132 @Nullable
133 public String getSerialNumberDescription()
134 {
135 Integer value = _directory.getInteger(CanonMakernoteDirectory.TAG_CANON_SERIAL_NUMBER);
136 if (value==null)
137 return null;
138 return String.format("%04X%05d", (value >> 8) & 0xFF, value & 0xFF);
139 }
140
141/*
142 @Nullable
143 public String getLongExposureNoiseReductionDescription()
144 {
145 Integer value = _directory.getInteger(CanonMakernoteDirectory.TAG_CANON_CUSTOM_FUNCTION_LONG_EXPOSURE_NOISE_REDUCTION);
146 if (value==null)
147 return null;
148 switch (value) {
149 case 0: return "Off";
150 case 1: return "On";
151 default: return "Unknown (" + value + ")";
152 }
153 }
154
155 @Nullable
156 public String getShutterAutoExposureLockButtonDescription()
157 {
158 Integer value = _directory.getInteger(CanonMakernoteDirectory.TAG_CANON_CUSTOM_FUNCTION_SHUTTER_AUTO_EXPOSURE_LOCK_BUTTONS);
159 if (value==null)
160 return null;
161 switch (value) {
162 case 0: return "AF/AE lock";
163 case 1: return "AE lock/AF";
164 case 2: return "AF/AF lock";
165 case 3: return "AE+release/AE+AF";
166 default: return "Unknown (" + value + ")";
167 }
168 }
169
170 @Nullable
171 public String getMirrorLockupDescription()
172 {
173 Integer value = _directory.getInteger(CanonMakernoteDirectory.TAG_CANON_CUSTOM_FUNCTION_MIRROR_LOCKUP);
174 if (value==null)
175 return null;
176 switch (value) {
177 case 0: return "Disabled";
178 case 1: return "Enabled";
179 default: return "Unknown (" + value + ")";
180 }
181 }
182
183 @Nullable
184 public String getTvAndAvExposureLevelDescription()
185 {
186 Integer value = _directory.getInteger(CanonMakernoteDirectory.TAG_CANON_CUSTOM_FUNCTION_TV_AV_AND_EXPOSURE_LEVEL);
187 if (value==null)
188 return null;
189 switch (value) {
190 case 0: return "1/2 stop";
191 case 1: return "1/3 stop";
192 default: return "Unknown (" + value + ")";
193 }
194 }
195
196 @Nullable
197 public String getAutoFocusAssistLightDescription()
198 {
199 Integer value = _directory.getInteger(CanonMakernoteDirectory.TAG_CANON_CUSTOM_FUNCTION_AF_ASSIST_LIGHT);
200 if (value==null)
201 return null;
202 switch (value) {
203 case 0: return "On (Auto)";
204 case 1: return "Off";
205 default: return "Unknown (" + value + ")";
206 }
207 }
208
209 @Nullable
210 public String getShutterSpeedInAvModeDescription()
211 {
212 Integer value = _directory.getInteger(CanonMakernoteDirectory.TAG_CANON_CUSTOM_FUNCTION_SHUTTER_SPEED_IN_AV_MODE);
213 if (value==null)
214 return null;
215 switch (value) {
216 case 0: return "Automatic";
217 case 1: return "1/200 (fixed)";
218 default: return "Unknown (" + value + ")";
219 }
220 }
221
222 @Nullable
223 public String getAutoExposureBrackettingSequenceAndAutoCancellationDescription()
224 {
225 Integer value = _directory.getInteger(CanonMakernoteDirectory.TAG_CANON_CUSTOM_FUNCTION_BRACKETTING);
226 if (value==null)
227 return null;
228 switch (value) {
229 case 0: return "0,-,+ / Enabled";
230 case 1: return "0,-,+ / Disabled";
231 case 2: return "-,0,+ / Enabled";
232 case 3: return "-,0,+ / Disabled";
233 default: return "Unknown (" + value + ")";
234 }
235 }
236
237 @Nullable
238 public String getShutterCurtainSyncDescription()
239 {
240 Integer value = _directory.getInteger(CanonMakernoteDirectory.TAG_CANON_CUSTOM_FUNCTION_SHUTTER_CURTAIN_SYNC);
241 if (value==null)
242 return null;
243 switch (value) {
244 case 0: return "1st Curtain Sync";
245 case 1: return "2nd Curtain Sync";
246 default: return "Unknown (" + value + ")";
247 }
248 }
249
250 @Nullable
251 public String getLensAutoFocusStopButtonDescription()
252 {
253 Integer value = _directory.getInteger(CanonMakernoteDirectory.TAG_CANON_CUSTOM_FUNCTION_AF_STOP);
254 if (value==null)
255 return null;
256 switch (value) {
257 case 0: return "AF stop";
258 case 1: return "Operate AF";
259 case 2: return "Lock AE and start timer";
260 default: return "Unknown (" + value + ")";
261 }
262 }
263
264 @Nullable
265 public String getFillFlashReductionDescription()
266 {
267 Integer value = _directory.getInteger(CanonMakernoteDirectory.TAG_CANON_CUSTOM_FUNCTION_FILL_FLASH_REDUCTION);
268 if (value==null)
269 return null;
270 switch (value) {
271 case 0: return "Enabled";
272 case 1: return "Disabled";
273 default: return "Unknown (" + value + ")";
274 }
275 }
276
277 @Nullable
278 public String getMenuButtonReturnPositionDescription()
279 {
280 Integer value = _directory.getInteger(CanonMakernoteDirectory.TAG_CANON_CUSTOM_FUNCTION_MENU_BUTTON_RETURN);
281 if (value==null)
282 return null;
283 switch (value) {
284 case 0: return "Top";
285 case 1: return "Previous (volatile)";
286 case 2: return "Previous";
287 default: return "Unknown (" + value + ")";
288 }
289 }
290
291 @Nullable
292 public String getSetButtonFunctionWhenShootingDescription()
293 {
294 Integer value = _directory.getInteger(CanonMakernoteDirectory.TAG_CANON_CUSTOM_FUNCTION_SET_BUTTON_FUNCTION);
295 if (value==null)
296 return null;
297 switch (value) {
298 case 0: return "Not Assigned";
299 case 1: return "Change Quality";
300 case 2: return "Change ISO Speed";
301 case 3: return "Select Parameters";
302 default: return "Unknown (" + value + ")";
303 }
304 }
305
306 @Nullable
307 public String getSensorCleaningDescription()
308 {
309 Integer value = _directory.getInteger(CanonMakernoteDirectory.TAG_CANON_CUSTOM_FUNCTION_SENSOR_CLEANING);
310 if (value==null)
311 return null;
312 switch (value) {
313 case 0: return "Disabled";
314 case 1: return "Enabled";
315 default: return "Unknown (" + value + ")";
316 }
317 }
318*/
319
320 @Nullable
321 public String getFlashBiasDescription()
322 {
323 Integer value = _directory.getInteger(CanonMakernoteDirectory.FocalLength.TAG_FLASH_BIAS);
324
325 if (value==null)
326 return null;
327
328 boolean isNegative = false;
329 if (value > 0xF000)
330 {
331 isNegative = true;
332 value = 0xFFFF - value;
333 value++;
334 }
335
336 // this tag is interesting in that the values returned are:
337 // 0, 0.375, 0.5, 0.626, 1
338 // not
339 // 0, 0.33, 0.5, 0.66, 1
340
341 return ((isNegative) ? "-" : "") + Float.toString(value / 32f) + " EV";
342 }
343
344 @Nullable
345 public String getAfPointUsedDescription()
346 {
347 Integer value = _directory.getInteger(CanonMakernoteDirectory.FocalLength.TAG_AF_POINT_USED);
348 if (value==null)
349 return null;
350 if ((value & 0x7) == 0) {
351 return "Right";
352 } else if ((value & 0x7) == 1) {
353 return "Centre";
354 } else if ((value & 0x7) == 2) {
355 return "Left";
356 } else {
357 return "Unknown (" + value + ")";
358 }
359 }
360
361 @Nullable
362 public String getWhiteBalanceDescription()
363 {
364 Integer value = _directory.getInteger(CanonMakernoteDirectory.FocalLength.TAG_WHITE_BALANCE);
365 if (value==null)
366 return null;
367 switch (value) {
368 case 0:
369 return "Auto";
370 case 1:
371 return "Sunny";
372 case 2:
373 return "Cloudy";
374 case 3:
375 return "Tungsten";
376 case 4:
377 return "Florescent";
378 case 5:
379 return "Flash";
380 case 6:
381 return "Custom";
382 default:
383 return "Unknown (" + value + ")";
384 }
385 }
386
387 @Nullable
388 public String getFocusMode2Description()
389 {
390 Integer value = _directory.getInteger(CanonMakernoteDirectory.CameraSettings.TAG_FOCUS_MODE_2);
391 if (value==null)
392 return null;
393 switch (value) {
394 case 0:
395 return "Single";
396 case 1:
397 return "Continuous";
398 default:
399 return "Unknown (" + value + ")";
400 }
401 }
402
403 @Nullable
404 public String getFlashDetailsDescription()
405 {
406 Integer value = _directory.getInteger(CanonMakernoteDirectory.CameraSettings.TAG_FLASH_DETAILS);
407 if (value==null)
408 return null;
409 if (((value >> 14) & 1) > 0) {
410 return "External E-TTL";
411 }
412 if (((value >> 13) & 1) > 0) {
413 return "Internal flash";
414 }
415 if (((value >> 11) & 1) > 0) {
416 return "FP sync used";
417 }
418 if (((value >> 4) & 1) > 0) {
419 return "FP sync enabled";
420 }
421 return "Unknown (" + value + ")";
422 }
423
424 @Nullable
425 public String getFocalUnitsPerMillimetreDescription()
426 {
427 Integer value = _directory.getInteger(CanonMakernoteDirectory.CameraSettings.TAG_FOCAL_UNITS_PER_MM);
428 if (value==null)
429 return null;
430 if (value != 0) {
431 return Integer.toString(value);
432 } else {
433 return "";
434 }
435 }
436
437 @Nullable
438 public String getShortFocalLengthDescription()
439 {
440 Integer value = _directory.getInteger(CanonMakernoteDirectory.CameraSettings.TAG_SHORT_FOCAL_LENGTH);
441 if (value==null)
442 return null;
443 String units = getFocalUnitsPerMillimetreDescription();
444 return Integer.toString(value) + " " + units;
445 }
446
447 @Nullable
448 public String getLongFocalLengthDescription()
449 {
450 Integer value = _directory.getInteger(CanonMakernoteDirectory.CameraSettings.TAG_LONG_FOCAL_LENGTH);
451 if (value==null)
452 return null;
453 String units = getFocalUnitsPerMillimetreDescription();
454 return Integer.toString(value) + " " + units;
455 }
456
457 @Nullable
458 public String getExposureModeDescription()
459 {
460 Integer value = _directory.getInteger(CanonMakernoteDirectory.CameraSettings.TAG_EXPOSURE_MODE);
461 if (value==null)
462 return null;
463 switch (value) {
464 case 0:
465 return "Easy shooting";
466 case 1:
467 return "Program";
468 case 2:
469 return "Tv-priority";
470 case 3:
471 return "Av-priority";
472 case 4:
473 return "Manual";
474 case 5:
475 return "A-DEP";
476 default:
477 return "Unknown (" + value + ")";
478 }
479 }
480
481 @Nullable
482 public String getAfPointSelectedDescription()
483 {
484 Integer value = _directory.getInteger(CanonMakernoteDirectory.CameraSettings.TAG_AF_POINT_SELECTED);
485 if (value==null)
486 return null;
487 switch (value) {
488 case 0x3000:
489 return "None (MF)";
490 case 0x3001:
491 return "Auto selected";
492 case 0x3002:
493 return "Right";
494 case 0x3003:
495 return "Centre";
496 case 0x3004:
497 return "Left";
498 default:
499 return "Unknown (" + value + ")";
500 }
501 }
502
503 @Nullable
504 public String getMeteringModeDescription()
505 {
506 Integer value = _directory.getInteger(CanonMakernoteDirectory.CameraSettings.TAG_METERING_MODE);
507 if (value==null)
508 return null;
509 switch (value) {
510 case 3:
511 return "Evaluative";
512 case 4:
513 return "Partial";
514 case 5:
515 return "Centre weighted";
516 default:
517 return "Unknown (" + value + ")";
518 }
519 }
520
521 @Nullable
522 public String getIsoDescription()
523 {
524 Integer value = _directory.getInteger(CanonMakernoteDirectory.CameraSettings.TAG_ISO);
525 if (value==null)
526 return null;
527
528 // Canon PowerShot S3 is special
529 int canonMask = 0x4000;
530 if ((value & canonMask) > 0)
531 return "" + (value & ~canonMask);
532
533 switch (value) {
534 case 0:
535 return "Not specified (see ISOSpeedRatings tag)";
536 case 15:
537 return "Auto";
538 case 16:
539 return "50";
540 case 17:
541 return "100";
542 case 18:
543 return "200";
544 case 19:
545 return "400";
546 default:
547 return "Unknown (" + value + ")";
548 }
549 }
550
551 @Nullable
552 public String getSharpnessDescription()
553 {
554 Integer value = _directory.getInteger(CanonMakernoteDirectory.CameraSettings.TAG_SHARPNESS);
555 if (value==null)
556 return null;
557 switch (value) {
558 case 0xFFFF:
559 return "Low";
560 case 0x000:
561 return "Normal";
562 case 0x001:
563 return "High";
564 default:
565 return "Unknown (" + value + ")";
566 }
567 }
568
569 @Nullable
570 public String getSaturationDescription()
571 {
572 Integer value = _directory.getInteger(CanonMakernoteDirectory.CameraSettings.TAG_SATURATION);
573 if (value==null)
574 return null;
575 switch (value) {
576 case 0xFFFF:
577 return "Low";
578 case 0x000:
579 return "Normal";
580 case 0x001:
581 return "High";
582 default:
583 return "Unknown (" + value + ")";
584 }
585 }
586
587 @Nullable
588 public String getContrastDescription()
589 {
590 Integer value = _directory.getInteger(CanonMakernoteDirectory.CameraSettings.TAG_CONTRAST);
591 if (value==null)
592 return null;
593 switch (value) {
594 case 0xFFFF:
595 return "Low";
596 case 0x000:
597 return "Normal";
598 case 0x001:
599 return "High";
600 default:
601 return "Unknown (" + value + ")";
602 }
603 }
604
605 @Nullable
606 public String getEasyShootingModeDescription()
607 {
608 Integer value = _directory.getInteger(CanonMakernoteDirectory.CameraSettings.TAG_EASY_SHOOTING_MODE);
609 if (value==null)
610 return null;
611 switch (value) {
612 case 0:
613 return "Full auto";
614 case 1:
615 return "Manual";
616 case 2:
617 return "Landscape";
618 case 3:
619 return "Fast shutter";
620 case 4:
621 return "Slow shutter";
622 case 5:
623 return "Night";
624 case 6:
625 return "B&W";
626 case 7:
627 return "Sepia";
628 case 8:
629 return "Portrait";
630 case 9:
631 return "Sports";
632 case 10:
633 return "Macro / Closeup";
634 case 11:
635 return "Pan focus";
636 default:
637 return "Unknown (" + value + ")";
638 }
639 }
640
641 @Nullable
642 public String getImageSizeDescription()
643 {
644 Integer value = _directory.getInteger(CanonMakernoteDirectory.CameraSettings.TAG_IMAGE_SIZE);
645 if (value==null)
646 return null;
647 switch (value) {
648 case 0:
649 return "Large";
650 case 1:
651 return "Medium";
652 case 2:
653 return "Small";
654 default:
655 return "Unknown (" + value + ")";
656 }
657 }
658
659 @Nullable
660 public String getFocusMode1Description()
661 {
662 Integer value = _directory.getInteger(CanonMakernoteDirectory.CameraSettings.TAG_FOCUS_MODE_1);
663 if (value==null)
664 return null;
665 switch (value) {
666 case 0:
667 return "One-shot";
668 case 1:
669 return "AI Servo";
670 case 2:
671 return "AI Focus";
672 case 3:
673 return "Manual Focus";
674 case 4:
675 // TODO should check field 32 here (FOCUS_MODE_2)
676 return "Single";
677 case 5:
678 return "Continuous";
679 case 6:
680 return "Manual Focus";
681 default:
682 return "Unknown (" + value + ")";
683 }
684 }
685
686 @Nullable
687 public String getContinuousDriveModeDescription()
688 {
689 Integer value = _directory.getInteger(CanonMakernoteDirectory.CameraSettings.TAG_CONTINUOUS_DRIVE_MODE);
690 if (value==null)
691 return null;
692 switch (value) {
693 case 0:
694 final Integer delay = _directory.getInteger(CanonMakernoteDirectory.CameraSettings.TAG_SELF_TIMER_DELAY);
695 if (delay!=null)
696 return delay == 0 ? "Single shot" : "Single shot with self-timer";
697 case 1:
698 return "Continuous";
699 }
700 return "Unknown (" + value + ")";
701 }
702
703 @Nullable
704 public String getFlashModeDescription()
705 {
706 Integer value = _directory.getInteger(CanonMakernoteDirectory.CameraSettings.TAG_FLASH_MODE);
707 if (value==null)
708 return null;
709 switch (value) {
710 case 0:
711 return "No flash fired";
712 case 1:
713 return "Auto";
714 case 2:
715 return "On";
716 case 3:
717 return "Red-eye reduction";
718 case 4:
719 return "Slow-synchro";
720 case 5:
721 return "Auto and red-eye reduction";
722 case 6:
723 return "On and red-eye reduction";
724 case 16:
725 // note: this value not set on Canon D30
726 return "External flash";
727 default:
728 return "Unknown (" + value + ")";
729 }
730 }
731
732 @Nullable
733 public String getSelfTimerDelayDescription()
734 {
735 Integer value = _directory.getInteger(CanonMakernoteDirectory.CameraSettings.TAG_SELF_TIMER_DELAY);
736 if (value==null)
737 return null;
738 if (value == 0) {
739 return "Self timer not used";
740 } else {
741 // TODO find an image that tests this calculation
742 return Double.toString((double)value * 0.1d) + " sec";
743 }
744 }
745
746 @Nullable
747 public String getMacroModeDescription()
748 {
749 Integer value = _directory.getInteger(CanonMakernoteDirectory.CameraSettings.TAG_MACRO_MODE);
750 if (value==null)
751 return null;
752 switch (value) {
753 case 1:
754 return "Macro";
755 case 2:
756 return "Normal";
757 default:
758 return "Unknown (" + value + ")";
759 }
760 }
761
762 @Nullable
763 public String getQualityDescription()
764 {
765 Integer value = _directory.getInteger(CanonMakernoteDirectory.CameraSettings.TAG_QUALITY);
766 if (value==null)
767 return null;
768 switch (value) {
769 case 2:
770 return "Normal";
771 case 3:
772 return "Fine";
773 case 5:
774 return "Superfine";
775 default:
776 return "Unknown (" + value + ")";
777 }
778 }
779
780 @Nullable
781 public String getDigitalZoomDescription()
782 {
783 Integer value = _directory.getInteger(CanonMakernoteDirectory.CameraSettings.TAG_DIGITAL_ZOOM);
784 if (value==null)
785 return null;
786 switch (value) {
787 case 0:
788 return "No digital zoom";
789 case 1:
790 return "2x";
791 case 2:
792 return "4x";
793 default:
794 return "Unknown (" + value + ")";
795 }
796 }
797
798 @Nullable
799 public String getFocusTypeDescription()
800 {
801 Integer value = _directory.getInteger(CanonMakernoteDirectory.CameraSettings.TAG_FOCUS_TYPE);
802 if (value==null)
803 return null;
804 switch (value) {
805 case 0:
806 return "Manual";
807 case 1:
808 return "Auto";
809 case 3:
810 return "Close-up (Macro)";
811 case 8:
812 return "Locked (Pan Mode)";
813 default:
814 return "Unknown (" + value + ")";
815 }
816 }
817
818 @Nullable
819 public String getFlashActivityDescription()
820 {
821 Integer value = _directory.getInteger(CanonMakernoteDirectory.CameraSettings.TAG_FLASH_ACTIVITY);
822 if (value==null)
823 return null;
824 switch (value) {
825 case 0:
826 return "Flash did not fire";
827 case 1:
828 return "Flash fired";
829 default:
830 return "Unknown (" + value + ")";
831 }
832 }
833}
Note: See TracBrowser for help on using the repository browser.