| 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.LeicaMakernoteDirectory.*; |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
@SuppressWarnings("WeakerAccess") |
| 37 |
public class LeicaMakernoteDescriptor extends TagDescriptor<LeicaMakernoteDirectory> |
| 38 |
{ |
| 39 |
public LeicaMakernoteDescriptor(@NotNull LeicaMakernoteDirectory directory) |
| 40 |
{ |
| 41 |
super(directory); |
| 42 |
} |
| 43 |
|
| 44 |
@Override |
| 45 |
@Nullable |
| 46 |
public String getDescription(int tagType) |
| 47 |
{ |
| 48 |
switch (tagType) { |
| 49 |
case TAG_QUALITY: |
| 50 |
return getQualityDescription(); |
| 51 |
case TAG_USER_PROFILE: |
| 52 |
return getUserProfileDescription(); |
| 53 |
|
| 54 |
|
| 55 |
case TAG_WHITE_BALANCE: |
| 56 |
return getWhiteBalanceDescription(); |
| 57 |
case TAG_EXTERNAL_SENSOR_BRIGHTNESS_VALUE: |
| 58 |
return getExternalSensorBrightnessValueDescription(); |
| 59 |
case TAG_MEASURED_LV: |
| 60 |
return getMeasuredLvDescription(); |
| 61 |
case TAG_APPROXIMATE_F_NUMBER: |
| 62 |
return getApproximateFNumberDescription(); |
| 63 |
case TAG_CAMERA_TEMPERATURE: |
| 64 |
return getCameraTemperatureDescription(); |
| 65 |
case TAG_WB_RED_LEVEL: |
| 66 |
case TAG_WB_BLUE_LEVEL: |
| 67 |
case TAG_WB_GREEN_LEVEL: |
| 68 |
return getSimpleRational(tagType); |
| 69 |
default: |
| 70 |
return super.getDescription(tagType); |
| 71 |
} |
| 72 |
} |
| 73 |
|
| 74 |
@Nullable |
| 75 |
private String getCameraTemperatureDescription() |
| 76 |
{ |
| 77 |
return getFormattedInt(TAG_CAMERA_TEMPERATURE, "%d C"); |
| 78 |
} |
| 79 |
|
| 80 |
@Nullable |
| 81 |
private String getApproximateFNumberDescription() |
| 82 |
{ |
| 83 |
return getSimpleRational(TAG_APPROXIMATE_F_NUMBER); |
| 84 |
} |
| 85 |
|
| 86 |
@Nullable |
| 87 |
private String getMeasuredLvDescription() |
| 88 |
{ |
| 89 |
return getSimpleRational(TAG_MEASURED_LV); |
| 90 |
} |
| 91 |
|
| 92 |
@Nullable |
| 93 |
private String getExternalSensorBrightnessValueDescription() |
| 94 |
{ |
| 95 |
return getSimpleRational(TAG_EXTERNAL_SENSOR_BRIGHTNESS_VALUE); |
| 96 |
} |
| 97 |
|
| 98 |
@Nullable |
| 99 |
private String getWhiteBalanceDescription() |
| 100 |
{ |
| 101 |
return getIndexedDescription(TAG_WHITE_BALANCE, |
| 102 |
"Auto or Manual", |
| 103 |
"Daylight", |
| 104 |
"Fluorescent", |
| 105 |
"Tungsten", |
| 106 |
"Flash", |
| 107 |
"Cloudy", |
| 108 |
"Shadow" |
| 109 |
); |
| 110 |
} |
| 111 |
|
| 112 |
@Nullable |
| 113 |
private String getUserProfileDescription() |
| 114 |
{ |
| 115 |
return getIndexedDescription(TAG_QUALITY, 1, |
| 116 |
"User Profile 1", |
| 117 |
"User Profile 2", |
| 118 |
"User Profile 3", |
| 119 |
"User Profile 0 (Dynamic)" |
| 120 |
); |
| 121 |
} |
| 122 |
|
| 123 |
@Nullable |
| 124 |
private String getQualityDescription() |
| 125 |
{ |
| 126 |
return getIndexedDescription(TAG_QUALITY, 1, "Fine", "Basic"); |
| 127 |
} |
| 128 |
} |