| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
package com.drew.metadata.exif.makernotes; |
| 22 |
|
| 23 |
import com.drew.lang.annotations.NotNull; |
| 24 |
import com.drew.lang.annotations.Nullable; |
| 25 |
import com.drew.metadata.TagDescriptor; |
| 26 |
|
| 27 |
import static com.drew.metadata.exif.makernotes.OlympusRawDevelopmentMakernoteDirectory.*; |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
@SuppressWarnings("WeakerAccess") |
| 40 |
public class OlympusRawDevelopmentMakernoteDescriptor extends TagDescriptor<OlympusRawDevelopmentMakernoteDirectory> |
| 41 |
{ |
| 42 |
public OlympusRawDevelopmentMakernoteDescriptor(@NotNull OlympusRawDevelopmentMakernoteDirectory directory) |
| 43 |
{ |
| 44 |
super(directory); |
| 45 |
} |
| 46 |
|
| 47 |
@Override |
| 48 |
@Nullable |
| 49 |
public String getDescription(int tagType) |
| 50 |
{ |
| 51 |
switch (tagType) { |
| 52 |
case TagRawDevVersion: |
| 53 |
return getRawDevVersionDescription(); |
| 54 |
case TagRawDevColorSpace: |
| 55 |
return getRawDevColorSpaceDescription(); |
| 56 |
case TagRawDevEngine: |
| 57 |
return getRawDevEngineDescription(); |
| 58 |
case TagRawDevNoiseReduction: |
| 59 |
return getRawDevNoiseReductionDescription(); |
| 60 |
case TagRawDevEditStatus: |
| 61 |
return getRawDevEditStatusDescription(); |
| 62 |
case TagRawDevSettings: |
| 63 |
return getRawDevSettingsDescription(); |
| 64 |
default: |
| 65 |
return super.getDescription(tagType); |
| 66 |
} |
| 67 |
} |
| 68 |
|
| 69 |
@Nullable |
| 70 |
public String getRawDevVersionDescription() |
| 71 |
{ |
| 72 |
return getVersionBytesDescription(TagRawDevVersion, 4); |
| 73 |
} |
| 74 |
|
| 75 |
@Nullable |
| 76 |
public String getRawDevColorSpaceDescription() |
| 77 |
{ |
| 78 |
return getIndexedDescription(TagRawDevColorSpace, |
| 79 |
"sRGB", "Adobe RGB", "Pro Photo RGB"); |
| 80 |
} |
| 81 |
|
| 82 |
@Nullable |
| 83 |
public String getRawDevEngineDescription() |
| 84 |
{ |
| 85 |
return getIndexedDescription(TagRawDevEngine, |
| 86 |
"High Speed", "High Function", "Advanced High Speed", "Advanced High Function"); |
| 87 |
} |
| 88 |
|
| 89 |
@Nullable |
| 90 |
public String getRawDevNoiseReductionDescription() |
| 91 |
{ |
| 92 |
Integer value = _directory.getInteger(TagRawDevNoiseReduction); |
| 93 |
if (value == null) |
| 94 |
return null; |
| 95 |
|
| 96 |
if (value == 0) |
| 97 |
return "(none)"; |
| 98 |
|
| 99 |
StringBuilder sb = new StringBuilder(); |
| 100 |
int v = value; |
| 101 |
|
| 102 |
if ((v & 1) != 0) sb.append("Noise Reduction, "); |
| 103 |
if (((v >> 1) & 1) != 0) sb.append("Noise Filter, "); |
| 104 |
if (((v >> 2) & 1) != 0) sb.append("Noise Filter (ISO Boost), "); |
| 105 |
|
| 106 |
return sb.substring(0, sb.length() - 2); |
| 107 |
} |
| 108 |
|
| 109 |
@Nullable |
| 110 |
public String getRawDevEditStatusDescription() |
| 111 |
{ |
| 112 |
Integer value = _directory.getInteger(TagRawDevEditStatus); |
| 113 |
if (value == null) |
| 114 |
return null; |
| 115 |
|
| 116 |
switch (value) |
| 117 |
{ |
| 118 |
case 0: |
| 119 |
return "Original"; |
| 120 |
case 1: |
| 121 |
return "Edited (Landscape)"; |
| 122 |
case 6: |
| 123 |
case 8: |
| 124 |
return "Edited (Portrait)"; |
| 125 |
default: |
| 126 |
return "Unknown (" + value + ")"; |
| 127 |
} |
| 128 |
} |
| 129 |
|
| 130 |
@Nullable |
| 131 |
public String getRawDevSettingsDescription() |
| 132 |
{ |
| 133 |
Integer value = _directory.getInteger(TagRawDevSettings); |
| 134 |
if (value == null) |
| 135 |
return null; |
| 136 |
|
| 137 |
if (value == 0) |
| 138 |
return "(none)"; |
| 139 |
|
| 140 |
StringBuilder sb = new StringBuilder(); |
| 141 |
int v = value; |
| 142 |
|
| 143 |
if ((v & 1) != 0) sb.append("WB Color Temp, "); |
| 144 |
if (((v >> 1) & 1) != 0) sb.append("WB Gray Point, "); |
| 145 |
if (((v >> 2) & 1) != 0) sb.append("Saturation, "); |
| 146 |
if (((v >> 3) & 1) != 0) sb.append("Contrast, "); |
| 147 |
if (((v >> 4) & 1) != 0) sb.append("Sharpness, "); |
| 148 |
if (((v >> 5) & 1) != 0) sb.append("Color Space, "); |
| 149 |
if (((v >> 6) & 1) != 0) sb.append("High Function, "); |
| 150 |
if (((v >> 7) & 1) != 0) sb.append("Noise Reduction, "); |
| 151 |
|
| 152 |
return sb.substring(0, sb.length() - 2); |
| 153 |
} |
| 154 |
|
| 155 |
} |