| 1 | package com.drew.metadata.exif.makernotes; |
| 2 | |
| 3 | import com.drew.metadata.TagDescriptor; |
| 4 | |
| 5 | import static com.drew.metadata.exif.makernotes.NikonPictureControl1Directory.TAG_FILTER_EFFECT; |
| 6 | import static com.drew.metadata.exif.makernotes.NikonPictureControl1Directory.TAG_PICTURE_CONTROL_ADJUST; |
| 7 | import static com.drew.metadata.exif.makernotes.NikonPictureControl1Directory.TAG_TONING_EFFECT; |
| 8 | |
| 9 | public final class NikonPictureControl1Descriptor extends TagDescriptor<NikonPictureControl1Directory> |
| 10 | { |
| 11 | public NikonPictureControl1Descriptor(NikonPictureControl1Directory directory) |
| 12 | { |
| 13 | super(directory); |
| 14 | } |
| 15 | |
| 16 | @Override |
| 17 | public String getDescription(int tagType) |
| 18 | { |
| 19 | switch (tagType) { |
| 20 | case TAG_PICTURE_CONTROL_ADJUST: |
| 21 | return getPictureControlAdjustDescription(); |
| 22 | case TAG_FILTER_EFFECT: |
| 23 | return getFilterEffectDescription(); |
| 24 | case TAG_TONING_EFFECT: |
| 25 | return getToningEffectDescription(); |
| 26 | default: |
| 27 | return super.getDescription(tagType); |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | public String getPictureControlAdjustDescription() |
| 32 | { |
| 33 | return getIndexedDescription( |
| 34 | TAG_PICTURE_CONTROL_ADJUST, |
| 35 | "Default Settings", |
| 36 | "Quick Adjust", |
| 37 | "Full Control" |
| 38 | ); |
| 39 | } |
| 40 | |
| 41 | public String getFilterEffectDescription() |
| 42 | { |
| 43 | Integer value = _directory.getInteger(TAG_FILTER_EFFECT); |
| 44 | if (value == null) { |
| 45 | return null; |
| 46 | } |
| 47 | |
| 48 | switch (value) { |
| 49 | case 0x80: |
| 50 | return "Off"; |
| 51 | case 0x81: |
| 52 | return "Yellow"; |
| 53 | case 0x82: |
| 54 | return "Orange"; |
| 55 | case 0x83: |
| 56 | return "Red"; |
| 57 | case 0x84: |
| 58 | return "Green"; |
| 59 | case 0xFF: |
| 60 | return "N/A"; |
| 61 | default: |
| 62 | return super.getDescription(TAG_FILTER_EFFECT); |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | public String getToningEffectDescription() |
| 67 | { |
| 68 | Integer value = _directory.getInteger(TAG_TONING_EFFECT); |
| 69 | if (value == null) { |
| 70 | return null; |
| 71 | } |
| 72 | |
| 73 | switch (value) { |
| 74 | case 0x80: |
| 75 | return "B&W"; |
| 76 | case 0x81: |
| 77 | return "Sepia"; |
| 78 | case 0x82: |
| 79 | return "Cyanotype"; |
| 80 | case 0x83: |
| 81 | return "Red"; |
| 82 | case 0x84: |
| 83 | return "Yellow"; |
| 84 | case 0x85: |
| 85 | return "Green"; |
| 86 | case 0x86: |
| 87 | return "Blue-green"; |
| 88 | case 0x87: |
| 89 | return "Blue"; |
| 90 | case 0x88: |
| 91 | return "Purple-blue"; |
| 92 | case 0x89: |
| 93 | return "Red-purple"; |
| 94 | case 0xFF: |
| 95 | return "N/A"; |
| 96 | default: |
| 97 | return super.getDescription(TAG_TONING_EFFECT); |
| 98 | } |
| 99 | } |
| 100 | } |