| 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.annotations.NotNull;
|
|---|
| 24 | import com.drew.lang.annotations.Nullable;
|
|---|
| 25 | import com.drew.metadata.TagDescriptor;
|
|---|
| 26 |
|
|---|
| 27 | import java.util.GregorianCalendar;
|
|---|
| 28 |
|
|---|
| 29 | import static com.drew.metadata.exif.makernotes.OlympusMakernoteDirectory.*;
|
|---|
| 30 |
|
|---|
| 31 | /**
|
|---|
| 32 | * Provides human-readable string representations of tag values stored in a {@link OlympusMakernoteDirectory}.
|
|---|
| 33 | *
|
|---|
| 34 | * @author Drew Noakes https://drewnoakes.com
|
|---|
| 35 | */
|
|---|
| 36 | public class OlympusMakernoteDescriptor extends TagDescriptor<OlympusMakernoteDirectory>
|
|---|
| 37 | {
|
|---|
| 38 | // TODO extend support for some offset-encoded byte[] tags: http://www.ozhiker.com/electronics/pjmt/jpeg_info/olympus_mn.html
|
|---|
| 39 |
|
|---|
| 40 | public OlympusMakernoteDescriptor(@NotNull OlympusMakernoteDirectory directory)
|
|---|
| 41 | {
|
|---|
| 42 | super(directory);
|
|---|
| 43 | }
|
|---|
| 44 |
|
|---|
| 45 | @Override
|
|---|
| 46 | @Nullable
|
|---|
| 47 | public String getDescription(int tagType)
|
|---|
| 48 | {
|
|---|
| 49 | switch (tagType) {
|
|---|
| 50 | case TAG_MAKERNOTE_VERSION:
|
|---|
| 51 | return getMakernoteVersionDescription();
|
|---|
| 52 | case TAG_COLOUR_MODE:
|
|---|
| 53 | return getColorModeDescription();
|
|---|
| 54 | case TAG_IMAGE_QUALITY_1:
|
|---|
| 55 | return getImageQuality1Description();
|
|---|
| 56 | case TAG_IMAGE_QUALITY_2:
|
|---|
| 57 | return getImageQuality2Description();
|
|---|
| 58 | case TAG_SPECIAL_MODE:
|
|---|
| 59 | return getSpecialModeDescription();
|
|---|
| 60 | case TAG_JPEG_QUALITY:
|
|---|
| 61 | return getJpegQualityDescription();
|
|---|
| 62 | case TAG_MACRO_MODE:
|
|---|
| 63 | return getMacroModeDescription();
|
|---|
| 64 | case TAG_BW_MODE:
|
|---|
| 65 | return getBWModeDescription();
|
|---|
| 66 | case TAG_DIGI_ZOOM_RATIO:
|
|---|
| 67 | return getDigiZoomRatioDescription();
|
|---|
| 68 | case TAG_CAMERA_ID:
|
|---|
| 69 | return getCameraIdDescription();
|
|---|
| 70 | case TAG_FLASH_MODE:
|
|---|
| 71 | return getFlashModeDescription();
|
|---|
| 72 | case TAG_FOCUS_RANGE:
|
|---|
| 73 | return getFocusRangeDescription();
|
|---|
| 74 | case TAG_FOCUS_MODE:
|
|---|
| 75 | return getFocusModeDescription();
|
|---|
| 76 | case TAG_SHARPNESS:
|
|---|
| 77 | return getSharpnessDescription();
|
|---|
| 78 |
|
|---|
| 79 | case CameraSettings.TAG_EXPOSURE_MODE:
|
|---|
| 80 | return getExposureModeDescription();
|
|---|
| 81 | case CameraSettings.TAG_FLASH_MODE:
|
|---|
| 82 | return getFlashModeCameraSettingDescription();
|
|---|
| 83 | case CameraSettings.TAG_WHITE_BALANCE:
|
|---|
| 84 | return getWhiteBalanceDescription();
|
|---|
| 85 | case CameraSettings.TAG_IMAGE_SIZE:
|
|---|
| 86 | return getImageSizeDescription();
|
|---|
| 87 | case CameraSettings.TAG_IMAGE_QUALITY:
|
|---|
| 88 | return getImageQualityDescription();
|
|---|
| 89 | case CameraSettings.TAG_SHOOTING_MODE:
|
|---|
| 90 | return getShootingModeDescription();
|
|---|
| 91 | case CameraSettings.TAG_METERING_MODE:
|
|---|
| 92 | return getMeteringModeDescription();
|
|---|
| 93 | case CameraSettings.TAG_APEX_FILM_SPEED_VALUE:
|
|---|
| 94 | return getApexFilmSpeedDescription();
|
|---|
| 95 | case CameraSettings.TAG_APEX_SHUTTER_SPEED_TIME_VALUE:
|
|---|
| 96 | return getApexShutterSpeedTimeDescription();
|
|---|
| 97 | case CameraSettings.TAG_APEX_APERTURE_VALUE:
|
|---|
| 98 | return getApexApertureDescription();
|
|---|
| 99 | case CameraSettings.TAG_MACRO_MODE:
|
|---|
| 100 | return getMacroModeCameraSettingDescription();
|
|---|
| 101 | case CameraSettings.TAG_DIGITAL_ZOOM:
|
|---|
| 102 | return getDigitalZoomDescription();
|
|---|
| 103 | case CameraSettings.TAG_EXPOSURE_COMPENSATION:
|
|---|
| 104 | return getExposureCompensationDescription();
|
|---|
| 105 | case CameraSettings.TAG_BRACKET_STEP:
|
|---|
| 106 | return getBracketStepDescription();
|
|---|
| 107 |
|
|---|
| 108 | case CameraSettings.TAG_INTERVAL_LENGTH:
|
|---|
| 109 | return getIntervalLengthDescription();
|
|---|
| 110 | case CameraSettings.TAG_INTERVAL_NUMBER:
|
|---|
| 111 | return getIntervalNumberDescription();
|
|---|
| 112 | case CameraSettings.TAG_FOCAL_LENGTH:
|
|---|
| 113 | return getFocalLengthDescription();
|
|---|
| 114 | case CameraSettings.TAG_FOCUS_DISTANCE:
|
|---|
| 115 | return getFocusDistanceDescription();
|
|---|
| 116 | case CameraSettings.TAG_FLASH_FIRED:
|
|---|
| 117 | return getFlastFiredDescription();
|
|---|
| 118 | case CameraSettings.TAG_DATE:
|
|---|
| 119 | return getDateDescription();
|
|---|
| 120 | case CameraSettings.TAG_TIME:
|
|---|
| 121 | return getTimeDescription();
|
|---|
| 122 | case CameraSettings.TAG_MAX_APERTURE_AT_FOCAL_LENGTH:
|
|---|
| 123 | return getMaxApertureAtFocalLengthDescription();
|
|---|
| 124 |
|
|---|
| 125 | case CameraSettings.TAG_FILE_NUMBER_MEMORY:
|
|---|
| 126 | return getFileNumberMemoryDescription();
|
|---|
| 127 | case CameraSettings.TAG_LAST_FILE_NUMBER:
|
|---|
| 128 | return getLastFileNumberDescription();
|
|---|
| 129 | case CameraSettings.TAG_WHITE_BALANCE_RED:
|
|---|
| 130 | return getWhiteBalanceRedDescription();
|
|---|
| 131 | case CameraSettings.TAG_WHITE_BALANCE_GREEN:
|
|---|
| 132 | return getWhiteBalanceGreenDescription();
|
|---|
| 133 | case CameraSettings.TAG_WHITE_BALANCE_BLUE:
|
|---|
| 134 | return getWhiteBalanceBlueDescription();
|
|---|
| 135 | case CameraSettings.TAG_SATURATION:
|
|---|
| 136 | return getSaturationDescription();
|
|---|
| 137 | case CameraSettings.TAG_CONTRAST:
|
|---|
| 138 | return getContrastDescription();
|
|---|
| 139 | case CameraSettings.TAG_SHARPNESS:
|
|---|
| 140 | return getSharpnessCameraSettingDescription();
|
|---|
| 141 | case CameraSettings.TAG_SUBJECT_PROGRAM:
|
|---|
| 142 | return getSubjectProgramDescription();
|
|---|
| 143 | case CameraSettings.TAG_FLASH_COMPENSATION:
|
|---|
| 144 | return getFlastCompensationDescription();
|
|---|
| 145 | case CameraSettings.TAG_ISO_SETTING:
|
|---|
| 146 | return getIsoSettingDescription();
|
|---|
| 147 | case CameraSettings.TAG_CAMERA_MODEL:
|
|---|
| 148 | return getCameraModelDescription();
|
|---|
| 149 | case CameraSettings.TAG_INTERVAL_MODE:
|
|---|
| 150 | return getIntervalModeDescription();
|
|---|
| 151 | case CameraSettings.TAG_FOLDER_NAME:
|
|---|
| 152 | return getFolderNameDescription();
|
|---|
| 153 | case CameraSettings.TAG_COLOR_MODE:
|
|---|
| 154 | return getColorModeCameraSettingDescription();
|
|---|
| 155 | case CameraSettings.TAG_COLOR_FILTER:
|
|---|
| 156 | return getColorFilterDescription();
|
|---|
| 157 | case CameraSettings.TAG_BLACK_AND_WHITE_FILTER:
|
|---|
| 158 | return getBlackAndWhiteFilterDescription();
|
|---|
| 159 | case CameraSettings.TAG_INTERNAL_FLASH:
|
|---|
| 160 | return getInternalFlashDescription();
|
|---|
| 161 | case CameraSettings.TAG_APEX_BRIGHTNESS_VALUE:
|
|---|
| 162 | return getApexBrightnessDescription();
|
|---|
| 163 | case CameraSettings.TAG_SPOT_FOCUS_POINT_X_COORDINATE:
|
|---|
| 164 | return getSpotFocusPointXCoordinateDescription();
|
|---|
| 165 | case CameraSettings.TAG_SPOT_FOCUS_POINT_Y_COORDINATE:
|
|---|
| 166 | return getSpotFocusPointYCoordinateDescription();
|
|---|
| 167 | case CameraSettings.TAG_WIDE_FOCUS_ZONE:
|
|---|
| 168 | return getWideFocusZoneDescription();
|
|---|
| 169 | case CameraSettings.TAG_FOCUS_MODE:
|
|---|
| 170 | return getFocusModeCameraSettingDescription();
|
|---|
| 171 | case CameraSettings.TAG_FOCUS_AREA:
|
|---|
| 172 | return getFocusAreaDescription();
|
|---|
| 173 | case CameraSettings.TAG_DEC_SWITCH_POSITION:
|
|---|
| 174 | return getDecSwitchPositionDescription();
|
|---|
| 175 |
|
|---|
| 176 | default:
|
|---|
| 177 | return super.getDescription(tagType);
|
|---|
| 178 | }
|
|---|
| 179 | }
|
|---|
| 180 |
|
|---|
| 181 | @Nullable
|
|---|
| 182 | public String getExposureModeDescription()
|
|---|
| 183 | {
|
|---|
| 184 | return getIndexedDescription(CameraSettings.TAG_EXPOSURE_MODE, "P", "A", "S", "M");
|
|---|
| 185 | }
|
|---|
| 186 |
|
|---|
| 187 | @Nullable
|
|---|
| 188 | public String getFlashModeCameraSettingDescription()
|
|---|
| 189 | {
|
|---|
| 190 | return getIndexedDescription(CameraSettings.TAG_FLASH_MODE,
|
|---|
| 191 | "Normal", "Red-eye reduction", "Rear flash sync", "Wireless");
|
|---|
| 192 | }
|
|---|
| 193 |
|
|---|
| 194 | @Nullable
|
|---|
| 195 | public String getWhiteBalanceDescription()
|
|---|
| 196 | {
|
|---|
| 197 | return getIndexedDescription(CameraSettings.TAG_WHITE_BALANCE,
|
|---|
| 198 | "Auto", // 0
|
|---|
| 199 | "Daylight",
|
|---|
| 200 | "Cloudy",
|
|---|
| 201 | "Tungsten",
|
|---|
| 202 | null,
|
|---|
| 203 | "Custom", // 5
|
|---|
| 204 | null,
|
|---|
| 205 | "Fluorescent",
|
|---|
| 206 | "Fluorescent 2",
|
|---|
| 207 | null,
|
|---|
| 208 | null, // 10
|
|---|
| 209 | "Custom 2",
|
|---|
| 210 | "Custom 3"
|
|---|
| 211 | );
|
|---|
| 212 | }
|
|---|
| 213 |
|
|---|
| 214 | @Nullable
|
|---|
| 215 | public String getImageSizeDescription()
|
|---|
| 216 | {
|
|---|
| 217 | // This is a pretty weird way to store this information!
|
|---|
| 218 | return getIndexedDescription(CameraSettings.TAG_IMAGE_SIZE, "2560 x 1920", "1600 x 1200", "1280 x 960", "640 x 480");
|
|---|
| 219 | }
|
|---|
| 220 |
|
|---|
| 221 | @Nullable
|
|---|
| 222 | public String getImageQualityDescription()
|
|---|
| 223 | {
|
|---|
| 224 | return getIndexedDescription(CameraSettings.TAG_IMAGE_QUALITY, "Raw", "Super Fine", "Fine", "Standard", "Economy", "Extra Fine");
|
|---|
| 225 | }
|
|---|
| 226 |
|
|---|
| 227 | @Nullable
|
|---|
| 228 | public String getShootingModeDescription()
|
|---|
| 229 | {
|
|---|
| 230 | return getIndexedDescription(CameraSettings.TAG_SHOOTING_MODE,
|
|---|
| 231 | "Single",
|
|---|
| 232 | "Continuous",
|
|---|
| 233 | "Self Timer",
|
|---|
| 234 | null,
|
|---|
| 235 | "Bracketing",
|
|---|
| 236 | "Interval",
|
|---|
| 237 | "UHS Continuous",
|
|---|
| 238 | "HS Continuous"
|
|---|
| 239 | );
|
|---|
| 240 | }
|
|---|
| 241 |
|
|---|
| 242 | @Nullable
|
|---|
| 243 | public String getMeteringModeDescription()
|
|---|
| 244 | {
|
|---|
| 245 | return getIndexedDescription(CameraSettings.TAG_METERING_MODE, "Multi-Segment", "Centre Weighted", "Spot");
|
|---|
| 246 | }
|
|---|
| 247 |
|
|---|
| 248 | @Nullable
|
|---|
| 249 | public String getApexFilmSpeedDescription()
|
|---|
| 250 | {
|
|---|
| 251 | // http://www.ozhiker.com/electronics/pjmt/jpeg_info/minolta_mn.html#Minolta_Camera_Settings
|
|---|
| 252 | // Apex Speed value = value/8-1 ,
|
|---|
| 253 | // ISO = (2^(value/8-1))*3.125
|
|---|
| 254 | Long value = _directory.getLongObject(CameraSettings.TAG_APEX_FILM_SPEED_VALUE);
|
|---|
| 255 |
|
|---|
| 256 | if (value == null)
|
|---|
| 257 | return null;
|
|---|
| 258 |
|
|---|
| 259 | double iso = Math.pow((value / 8d) - 1, 2) * 3.125;
|
|---|
| 260 | return Double.toString(iso);
|
|---|
| 261 | }
|
|---|
| 262 |
|
|---|
| 263 | @Nullable
|
|---|
| 264 | public String getApexShutterSpeedTimeDescription()
|
|---|
| 265 | {
|
|---|
| 266 | // http://www.ozhiker.com/electronics/pjmt/jpeg_info/minolta_mn.html#Minolta_Camera_Settings
|
|---|
| 267 | // Apex Time value = value/8-6 ,
|
|---|
| 268 | // ShutterSpeed = 2^( (48-value)/8 ),
|
|---|
| 269 | // Due to rounding error value=8 should be displayed as 30 sec.
|
|---|
| 270 | Long value = _directory.getLongObject(CameraSettings.TAG_APEX_SHUTTER_SPEED_TIME_VALUE);
|
|---|
| 271 |
|
|---|
| 272 | if (value == null)
|
|---|
| 273 | return null;
|
|---|
| 274 |
|
|---|
| 275 | double shutterSpeed = Math.pow((49-value) / 8d, 2);
|
|---|
| 276 | return Double.toString(shutterSpeed) + " sec";
|
|---|
| 277 | }
|
|---|
| 278 |
|
|---|
| 279 | @Nullable
|
|---|
| 280 | public String getApexApertureDescription()
|
|---|
| 281 | {
|
|---|
| 282 | // http://www.ozhiker.com/electronics/pjmt/jpeg_info/minolta_mn.html#Minolta_Camera_Settings
|
|---|
| 283 | // Apex Aperture Value = value/8-1 ,
|
|---|
| 284 | // Aperture F-stop = 2^( value/16-0.5 )
|
|---|
| 285 | Long value = _directory.getLongObject(CameraSettings.TAG_APEX_APERTURE_VALUE);
|
|---|
| 286 |
|
|---|
| 287 | if (value == null)
|
|---|
| 288 | return null;
|
|---|
| 289 |
|
|---|
| 290 | double fStop = Math.pow((value/16d) - 0.5, 2);
|
|---|
| 291 | return "F" + Double.toString(fStop);
|
|---|
| 292 | }
|
|---|
| 293 |
|
|---|
| 294 | @Nullable
|
|---|
| 295 | public String getMacroModeCameraSettingDescription()
|
|---|
| 296 | {
|
|---|
| 297 | return getIndexedDescription(CameraSettings.TAG_MACRO_MODE, "Off", "On");
|
|---|
| 298 | }
|
|---|
| 299 |
|
|---|
| 300 | @Nullable
|
|---|
| 301 | public String getDigitalZoomDescription()
|
|---|
| 302 | {
|
|---|
| 303 | return getIndexedDescription(CameraSettings.TAG_DIGITAL_ZOOM, "Off", "Electronic magnification", "Digital zoom 2x");
|
|---|
| 304 | }
|
|---|
| 305 |
|
|---|
| 306 | @Nullable
|
|---|
| 307 | public String getExposureCompensationDescription()
|
|---|
| 308 | {
|
|---|
| 309 | Long value = _directory.getLongObject(CameraSettings.TAG_EXPOSURE_COMPENSATION);
|
|---|
| 310 | return value == null ? null : ((value / 3d) - 2) + " EV";
|
|---|
| 311 | }
|
|---|
| 312 |
|
|---|
| 313 | @Nullable
|
|---|
| 314 | public String getBracketStepDescription()
|
|---|
| 315 | {
|
|---|
| 316 | return getIndexedDescription(CameraSettings.TAG_BRACKET_STEP, "1/3 EV", "2/3 EV", "1 EV");
|
|---|
| 317 | }
|
|---|
| 318 |
|
|---|
| 319 | @Nullable
|
|---|
| 320 | public String getIntervalLengthDescription()
|
|---|
| 321 | {
|
|---|
| 322 | if (!_directory.isIntervalMode())
|
|---|
| 323 | return "N/A";
|
|---|
| 324 |
|
|---|
| 325 | Long value = _directory.getLongObject(CameraSettings.TAG_INTERVAL_LENGTH);
|
|---|
| 326 | return value == null ? null : value + " min";
|
|---|
| 327 | }
|
|---|
| 328 |
|
|---|
| 329 | @Nullable
|
|---|
| 330 | public String getIntervalNumberDescription()
|
|---|
| 331 | {
|
|---|
| 332 | if (!_directory.isIntervalMode())
|
|---|
| 333 | return "N/A";
|
|---|
| 334 |
|
|---|
| 335 | Long value = _directory.getLongObject(CameraSettings.TAG_INTERVAL_NUMBER);
|
|---|
| 336 | return value == null ? null : Long.toString(value);
|
|---|
| 337 | }
|
|---|
| 338 |
|
|---|
| 339 | @Nullable
|
|---|
| 340 | public String getFocalLengthDescription()
|
|---|
| 341 | {
|
|---|
| 342 | Long value = _directory.getLongObject(CameraSettings.TAG_FOCAL_LENGTH);
|
|---|
| 343 | return value == null ? null : Double.toString(value/256d) + " mm";
|
|---|
| 344 | }
|
|---|
| 345 |
|
|---|
| 346 | @Nullable
|
|---|
| 347 | public String getFocusDistanceDescription()
|
|---|
| 348 | {
|
|---|
| 349 | Long value = _directory.getLongObject(CameraSettings.TAG_FOCUS_DISTANCE);
|
|---|
| 350 | return value == null
|
|---|
| 351 | ? null
|
|---|
| 352 | : value == 0
|
|---|
| 353 | ? "Infinity"
|
|---|
| 354 | : value + " mm";
|
|---|
| 355 | }
|
|---|
| 356 |
|
|---|
| 357 | @Nullable
|
|---|
| 358 | public String getFlastFiredDescription()
|
|---|
| 359 | {
|
|---|
| 360 | return getIndexedDescription(CameraSettings.TAG_FLASH_FIRED, "No", "Yes");
|
|---|
| 361 | }
|
|---|
| 362 |
|
|---|
| 363 | @Nullable
|
|---|
| 364 | public String getDateDescription()
|
|---|
| 365 | {
|
|---|
| 366 | // day = value%256,
|
|---|
| 367 | // month = floor( (value - floor( value/65536 )*65536 )/256 )
|
|---|
| 368 | // year = floor( value/65536)
|
|---|
| 369 | Long value = _directory.getLongObject(CameraSettings.TAG_DATE);
|
|---|
| 370 | if (value == null)
|
|---|
| 371 | return null;
|
|---|
| 372 | long day = value & 0xFF;
|
|---|
| 373 | long month = (value >> 16) & 0xFF;
|
|---|
| 374 | long year = (value >> 8) & 0xFF;
|
|---|
| 375 | return new GregorianCalendar((int)year + 1970, (int)month, (int)day).getTime().toString();
|
|---|
| 376 | }
|
|---|
| 377 |
|
|---|
| 378 | @Nullable
|
|---|
| 379 | public String getTimeDescription()
|
|---|
| 380 | {
|
|---|
| 381 | // hours = floor( value/65536 ),
|
|---|
| 382 | // minutes = floor( ( value - floor( value/65536 )*65536 )/256 ),
|
|---|
| 383 | // seconds = value%256
|
|---|
| 384 | Long value = _directory.getLongObject(CameraSettings.TAG_TIME);
|
|---|
| 385 | if (value == null)
|
|---|
| 386 | return null;
|
|---|
| 387 | long hours = (value >> 8) & 0xFF;
|
|---|
| 388 | long minutes = (value >> 16) & 0xFF;
|
|---|
| 389 | long seconds = value & 0xFF;
|
|---|
| 390 |
|
|---|
| 391 | return String.format("%02d:%02d:%02d", hours, minutes, seconds);
|
|---|
| 392 | }
|
|---|
| 393 |
|
|---|
| 394 | @Nullable
|
|---|
| 395 | public String getMaxApertureAtFocalLengthDescription()
|
|---|
| 396 | {
|
|---|
| 397 | // Aperture F-Stop = 2^(value/16-0.5)
|
|---|
| 398 | Long value = _directory.getLongObject(CameraSettings.TAG_TIME);
|
|---|
| 399 | if (value == null)
|
|---|
| 400 | return null;
|
|---|
| 401 | double fStop = Math.pow((value/16d) - 0.5, 2);
|
|---|
| 402 | return "F" + fStop;
|
|---|
| 403 | }
|
|---|
| 404 |
|
|---|
| 405 | @Nullable
|
|---|
| 406 | public String getFileNumberMemoryDescription()
|
|---|
| 407 | {
|
|---|
| 408 | return getIndexedDescription(CameraSettings.TAG_FILE_NUMBER_MEMORY, "Off", "On");
|
|---|
| 409 | }
|
|---|
| 410 |
|
|---|
| 411 | @Nullable
|
|---|
| 412 | public String getLastFileNumberDescription()
|
|---|
| 413 | {
|
|---|
| 414 | Long value = _directory.getLongObject(CameraSettings.TAG_LAST_FILE_NUMBER);
|
|---|
| 415 | return value == null
|
|---|
| 416 | ? null
|
|---|
| 417 | : value == 0
|
|---|
| 418 | ? "File Number Memory Off"
|
|---|
| 419 | : Long.toString(value);
|
|---|
| 420 | }
|
|---|
| 421 |
|
|---|
| 422 | @Nullable
|
|---|
| 423 | public String getWhiteBalanceRedDescription()
|
|---|
| 424 | {
|
|---|
| 425 | Long value = _directory.getLongObject(CameraSettings.TAG_WHITE_BALANCE_RED);
|
|---|
| 426 | return value == null ? null : Double.toString(value/256d);
|
|---|
| 427 | }
|
|---|
| 428 |
|
|---|
| 429 | @Nullable
|
|---|
| 430 | public String getWhiteBalanceGreenDescription()
|
|---|
| 431 | {
|
|---|
| 432 | Long value = _directory.getLongObject(CameraSettings.TAG_WHITE_BALANCE_GREEN);
|
|---|
| 433 | return value == null ? null : Double.toString(value/256d);
|
|---|
| 434 | }
|
|---|
| 435 |
|
|---|
| 436 | @Nullable
|
|---|
| 437 | public String getWhiteBalanceBlueDescription()
|
|---|
| 438 | {
|
|---|
| 439 | Long value = _directory.getLongObject(CameraSettings.TAG_WHITE_BALANCE_BLUE);
|
|---|
| 440 | return value == null ? null : Double.toString(value/256d);
|
|---|
| 441 | }
|
|---|
| 442 |
|
|---|
| 443 | @Nullable
|
|---|
| 444 | public String getSaturationDescription()
|
|---|
| 445 | {
|
|---|
| 446 | Long value = _directory.getLongObject(CameraSettings.TAG_SATURATION);
|
|---|
| 447 | return value == null ? null : Long.toString(value-3);
|
|---|
| 448 | }
|
|---|
| 449 |
|
|---|
| 450 | @Nullable
|
|---|
| 451 | public String getContrastDescription()
|
|---|
| 452 | {
|
|---|
| 453 | Long value = _directory.getLongObject(CameraSettings.TAG_CONTRAST);
|
|---|
| 454 | return value == null ? null : Long.toString(value-3);
|
|---|
| 455 | }
|
|---|
| 456 |
|
|---|
| 457 | @Nullable
|
|---|
| 458 | public String getSharpnessCameraSettingDescription()
|
|---|
| 459 | {
|
|---|
| 460 | return getIndexedDescription(CameraSettings.TAG_SHARPNESS, "Hard", "Normal", "Soft");
|
|---|
| 461 | }
|
|---|
| 462 |
|
|---|
| 463 | @Nullable
|
|---|
| 464 | public String getSubjectProgramDescription()
|
|---|
| 465 | {
|
|---|
| 466 | return getIndexedDescription(CameraSettings.TAG_SUBJECT_PROGRAM, "None", "Portrait", "Text", "Night Portrait", "Sunset", "Sports Action");
|
|---|
| 467 | }
|
|---|
| 468 |
|
|---|
| 469 | @Nullable
|
|---|
| 470 | public String getFlastCompensationDescription()
|
|---|
| 471 | {
|
|---|
| 472 | Long value = _directory.getLongObject(CameraSettings.TAG_FLASH_COMPENSATION);
|
|---|
| 473 | return value == null ? null : ((value-6)/3d) + " EV";
|
|---|
| 474 | }
|
|---|
| 475 |
|
|---|
| 476 | @Nullable
|
|---|
| 477 | public String getIsoSettingDescription()
|
|---|
| 478 | {
|
|---|
| 479 | return getIndexedDescription(CameraSettings.TAG_ISO_SETTING, "100", "200", "400", "800", "Auto", "64");
|
|---|
| 480 | }
|
|---|
| 481 |
|
|---|
| 482 | @Nullable
|
|---|
| 483 | public String getCameraModelDescription()
|
|---|
| 484 | {
|
|---|
| 485 | return getIndexedDescription(CameraSettings.TAG_CAMERA_MODEL,
|
|---|
| 486 | "DiMAGE 7",
|
|---|
| 487 | "DiMAGE 5",
|
|---|
| 488 | "DiMAGE S304",
|
|---|
| 489 | "DiMAGE S404",
|
|---|
| 490 | "DiMAGE 7i",
|
|---|
| 491 | "DiMAGE 7Hi",
|
|---|
| 492 | "DiMAGE A1",
|
|---|
| 493 | "DiMAGE S414");
|
|---|
| 494 | }
|
|---|
| 495 |
|
|---|
| 496 | @Nullable
|
|---|
| 497 | public String getIntervalModeDescription()
|
|---|
| 498 | {
|
|---|
| 499 | return getIndexedDescription(CameraSettings.TAG_INTERVAL_MODE, "Still Image", "Time Lapse Movie");
|
|---|
| 500 | }
|
|---|
| 501 |
|
|---|
| 502 | @Nullable
|
|---|
| 503 | public String getFolderNameDescription()
|
|---|
| 504 | {
|
|---|
| 505 | return getIndexedDescription(CameraSettings.TAG_FOLDER_NAME, "Standard Form", "Data Form");
|
|---|
| 506 | }
|
|---|
| 507 |
|
|---|
| 508 | @Nullable
|
|---|
| 509 | public String getColorModeCameraSettingDescription()
|
|---|
| 510 | {
|
|---|
| 511 | return getIndexedDescription(CameraSettings.TAG_COLOR_MODE, "Natural Color", "Black & White", "Vivid Color", "Solarization", "AdobeRGB");
|
|---|
| 512 | }
|
|---|
| 513 |
|
|---|
| 514 | @Nullable
|
|---|
| 515 | public String getColorFilterDescription()
|
|---|
| 516 | {
|
|---|
| 517 | Long value = _directory.getLongObject(CameraSettings.TAG_COLOR_FILTER);
|
|---|
| 518 | return value == null ? null : Long.toString(value-3);
|
|---|
| 519 | }
|
|---|
| 520 |
|
|---|
| 521 | @Nullable
|
|---|
| 522 | public String getBlackAndWhiteFilterDescription()
|
|---|
| 523 | {
|
|---|
| 524 | return super.getDescription(CameraSettings.TAG_BLACK_AND_WHITE_FILTER);
|
|---|
| 525 | }
|
|---|
| 526 |
|
|---|
| 527 | @Nullable
|
|---|
| 528 | public String getInternalFlashDescription()
|
|---|
| 529 | {
|
|---|
| 530 | return getIndexedDescription(CameraSettings.TAG_INTERNAL_FLASH, "Did Not Fire", "Fired");
|
|---|
| 531 | }
|
|---|
| 532 |
|
|---|
| 533 | @Nullable
|
|---|
| 534 | public String getApexBrightnessDescription()
|
|---|
| 535 | {
|
|---|
| 536 | Long value = _directory.getLongObject(CameraSettings.TAG_APEX_BRIGHTNESS_VALUE);
|
|---|
| 537 | return value == null ? null : Double.toString((value/8d)-6);
|
|---|
| 538 | }
|
|---|
| 539 |
|
|---|
| 540 | @Nullable
|
|---|
| 541 | public String getSpotFocusPointXCoordinateDescription()
|
|---|
| 542 | {
|
|---|
| 543 | return super.getDescription(CameraSettings.TAG_SPOT_FOCUS_POINT_X_COORDINATE);
|
|---|
| 544 | }
|
|---|
| 545 |
|
|---|
| 546 | @Nullable
|
|---|
| 547 | public String getSpotFocusPointYCoordinateDescription()
|
|---|
| 548 | {
|
|---|
| 549 | return super.getDescription(CameraSettings.TAG_SPOT_FOCUS_POINT_Y_COORDINATE);
|
|---|
| 550 | }
|
|---|
| 551 |
|
|---|
| 552 | @Nullable
|
|---|
| 553 | public String getWideFocusZoneDescription()
|
|---|
| 554 | {
|
|---|
| 555 | return getIndexedDescription(CameraSettings.TAG_WIDE_FOCUS_ZONE,
|
|---|
| 556 | "No Zone or AF Failed",
|
|---|
| 557 | "Center Zone (Horizontal Orientation)",
|
|---|
| 558 | "Center Zone (Vertical Orientation)",
|
|---|
| 559 | "Left Zone",
|
|---|
| 560 | "Right Zone"
|
|---|
| 561 | );
|
|---|
| 562 | }
|
|---|
| 563 |
|
|---|
| 564 | @Nullable
|
|---|
| 565 | public String getFocusModeCameraSettingDescription()
|
|---|
| 566 | {
|
|---|
| 567 | return getIndexedDescription(CameraSettings.TAG_FOCUS_MODE, "Auto Focus", "Manual Focus");
|
|---|
| 568 | }
|
|---|
| 569 |
|
|---|
| 570 | @Nullable
|
|---|
| 571 | public String getFocusAreaDescription()
|
|---|
| 572 | {
|
|---|
| 573 | return getIndexedDescription(CameraSettings.TAG_FOCUS_AREA, "Wide Focus (Normal)", "Spot Focus");
|
|---|
| 574 | }
|
|---|
| 575 |
|
|---|
| 576 | @Nullable
|
|---|
| 577 | public String getDecSwitchPositionDescription()
|
|---|
| 578 | {
|
|---|
| 579 | return getIndexedDescription(CameraSettings.TAG_DEC_SWITCH_POSITION, "Exposure", "Contrast", "Saturation", "Filter");
|
|---|
| 580 | }
|
|---|
| 581 |
|
|---|
| 582 | @Nullable
|
|---|
| 583 | public String getMakernoteVersionDescription()
|
|---|
| 584 | {
|
|---|
| 585 | return getVersionBytesDescription(TAG_MAKERNOTE_VERSION, 2);
|
|---|
| 586 | }
|
|---|
| 587 |
|
|---|
| 588 | @Nullable
|
|---|
| 589 | public String getImageQuality2Description()
|
|---|
| 590 | {
|
|---|
| 591 | return getIndexedDescription(TAG_IMAGE_QUALITY_2,
|
|---|
| 592 | "Raw",
|
|---|
| 593 | "Super Fine",
|
|---|
| 594 | "Fine",
|
|---|
| 595 | "Standard",
|
|---|
| 596 | "Extra Fine");
|
|---|
| 597 | }
|
|---|
| 598 |
|
|---|
| 599 | @Nullable
|
|---|
| 600 | public String getImageQuality1Description()
|
|---|
| 601 | {
|
|---|
| 602 | return getIndexedDescription(TAG_IMAGE_QUALITY_1,
|
|---|
| 603 | "Raw",
|
|---|
| 604 | "Super Fine",
|
|---|
| 605 | "Fine",
|
|---|
| 606 | "Standard",
|
|---|
| 607 | "Extra Fine");
|
|---|
| 608 | }
|
|---|
| 609 |
|
|---|
| 610 | @Nullable
|
|---|
| 611 | public String getColorModeDescription()
|
|---|
| 612 | {
|
|---|
| 613 | return getIndexedDescription(TAG_COLOUR_MODE,
|
|---|
| 614 | "Natural Colour",
|
|---|
| 615 | "Black & White",
|
|---|
| 616 | "Vivid Colour",
|
|---|
| 617 | "Solarization",
|
|---|
| 618 | "AdobeRGB");
|
|---|
| 619 | }
|
|---|
| 620 |
|
|---|
| 621 | @Nullable
|
|---|
| 622 | public String getSharpnessDescription()
|
|---|
| 623 | {
|
|---|
| 624 | return getIndexedDescription(TAG_SHARPNESS, "Normal", "Hard", "Soft");
|
|---|
| 625 | }
|
|---|
| 626 |
|
|---|
| 627 | @Nullable
|
|---|
| 628 | public String getFocusModeDescription()
|
|---|
| 629 | {
|
|---|
| 630 | return getIndexedDescription(TAG_FOCUS_MODE, "Auto", "Manual");
|
|---|
| 631 | }
|
|---|
| 632 |
|
|---|
| 633 | @Nullable
|
|---|
| 634 | public String getFocusRangeDescription()
|
|---|
| 635 | {
|
|---|
| 636 | return getIndexedDescription(TAG_FOCUS_RANGE, "Normal", "Macro");
|
|---|
| 637 | }
|
|---|
| 638 |
|
|---|
| 639 | @Nullable
|
|---|
| 640 | public String getFlashModeDescription()
|
|---|
| 641 | {
|
|---|
| 642 | return getIndexedDescription(TAG_FLASH_MODE, null, null, "On", "Off");
|
|---|
| 643 | }
|
|---|
| 644 |
|
|---|
| 645 | @Nullable
|
|---|
| 646 | public String getDigiZoomRatioDescription()
|
|---|
| 647 | {
|
|---|
| 648 | return getIndexedDescription(TAG_DIGI_ZOOM_RATIO, "Normal", null, "Digital 2x Zoom");
|
|---|
| 649 | }
|
|---|
| 650 |
|
|---|
| 651 | @Nullable
|
|---|
| 652 | public String getCameraIdDescription()
|
|---|
| 653 | {
|
|---|
| 654 | byte[] bytes = _directory.getByteArray(TAG_CAMERA_ID);
|
|---|
| 655 | if (bytes == null)
|
|---|
| 656 | return null;
|
|---|
| 657 | return new String(bytes);
|
|---|
| 658 | }
|
|---|
| 659 |
|
|---|
| 660 | @Nullable
|
|---|
| 661 | public String getMacroModeDescription()
|
|---|
| 662 | {
|
|---|
| 663 | return getIndexedDescription(TAG_MACRO_MODE, "Normal (no macro)", "Macro");
|
|---|
| 664 | }
|
|---|
| 665 |
|
|---|
| 666 | @Nullable
|
|---|
| 667 | public String getBWModeDescription()
|
|---|
| 668 | {
|
|---|
| 669 | return getIndexedDescription(TAG_BW_MODE, "Off", "On");
|
|---|
| 670 | }
|
|---|
| 671 |
|
|---|
| 672 | @Nullable
|
|---|
| 673 | public String getJpegQualityDescription()
|
|---|
| 674 | {
|
|---|
| 675 | return getIndexedDescription(TAG_JPEG_QUALITY,
|
|---|
| 676 | 1,
|
|---|
| 677 | "Standard Quality",
|
|---|
| 678 | "High Quality",
|
|---|
| 679 | "Super High Quality");
|
|---|
| 680 | }
|
|---|
| 681 |
|
|---|
| 682 | @Nullable
|
|---|
| 683 | public String getSpecialModeDescription()
|
|---|
| 684 | {
|
|---|
| 685 | long[] values = (long[])_directory.getObject(TAG_SPECIAL_MODE);
|
|---|
| 686 | if (values==null)
|
|---|
| 687 | return null;
|
|---|
| 688 | if (values.length < 1)
|
|---|
| 689 | return "";
|
|---|
| 690 | StringBuilder desc = new StringBuilder();
|
|---|
| 691 |
|
|---|
| 692 | switch ((int)values[0]) {
|
|---|
| 693 | case 0:
|
|---|
| 694 | desc.append("Normal picture taking mode");
|
|---|
| 695 | break;
|
|---|
| 696 | case 1:
|
|---|
| 697 | desc.append("Unknown picture taking mode");
|
|---|
| 698 | break;
|
|---|
| 699 | case 2:
|
|---|
| 700 | desc.append("Fast picture taking mode");
|
|---|
| 701 | break;
|
|---|
| 702 | case 3:
|
|---|
| 703 | desc.append("Panorama picture taking mode");
|
|---|
| 704 | break;
|
|---|
| 705 | default:
|
|---|
| 706 | desc.append("Unknown picture taking mode");
|
|---|
| 707 | break;
|
|---|
| 708 | }
|
|---|
| 709 |
|
|---|
| 710 | if (values.length >= 2) {
|
|---|
| 711 | switch ((int)values[1]) {
|
|---|
| 712 | case 0:
|
|---|
| 713 | break;
|
|---|
| 714 | case 1:
|
|---|
| 715 | desc.append(" / 1st in a sequence");
|
|---|
| 716 | break;
|
|---|
| 717 | case 2:
|
|---|
| 718 | desc.append(" / 2nd in a sequence");
|
|---|
| 719 | break;
|
|---|
| 720 | case 3:
|
|---|
| 721 | desc.append(" / 3rd in a sequence");
|
|---|
| 722 | break;
|
|---|
| 723 | default:
|
|---|
| 724 | desc.append(" / ");
|
|---|
| 725 | desc.append(values[1]);
|
|---|
| 726 | desc.append("th in a sequence");
|
|---|
| 727 | break;
|
|---|
| 728 | }
|
|---|
| 729 | }
|
|---|
| 730 | if (values.length >= 3) {
|
|---|
| 731 | switch ((int)values[2]) {
|
|---|
| 732 | case 1:
|
|---|
| 733 | desc.append(" / Left to right panorama direction");
|
|---|
| 734 | break;
|
|---|
| 735 | case 2:
|
|---|
| 736 | desc.append(" / Right to left panorama direction");
|
|---|
| 737 | break;
|
|---|
| 738 | case 3:
|
|---|
| 739 | desc.append(" / Bottom to top panorama direction");
|
|---|
| 740 | break;
|
|---|
| 741 | case 4:
|
|---|
| 742 | desc.append(" / Top to bottom panorama direction");
|
|---|
| 743 | break;
|
|---|
| 744 | }
|
|---|
| 745 | }
|
|---|
| 746 |
|
|---|
| 747 | return desc.toString();
|
|---|
| 748 | }
|
|---|
| 749 | }
|
|---|