| 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.ByteArrayReader; |
| 24 |
import com.drew.lang.RandomAccessReader; |
| 25 |
import com.drew.lang.annotations.NotNull; |
| 26 |
import com.drew.lang.annotations.Nullable; |
| 27 |
import com.drew.metadata.Age; |
| 28 |
import com.drew.metadata.Directory; |
| 29 |
import com.drew.metadata.Face; |
| 30 |
|
| 31 |
import java.io.IOException; |
| 32 |
import java.util.HashMap; |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
@SuppressWarnings("WeakerAccess") |
| 41 |
public class PanasonicMakernoteDirectory extends Directory |
| 42 |
{ |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
public static final int TAG_QUALITY_MODE = 0x0001; |
| 53 |
public static final int TAG_FIRMWARE_VERSION = 0x0002; |
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
public static final int TAG_WHITE_BALANCE = 0x0003; |
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
public static final int TAG_FOCUS_MODE = 0x0007; |
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
public static final int TAG_AF_AREA_MODE = 0x000f; |
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
public static final int TAG_IMAGE_STABILIZATION = 0x001a; |
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
public static final int TAG_MACRO_MODE = 0x001C; |
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
|
| 164 |
public static final int TAG_RECORD_MODE = 0x001F; |
| 165 |
|
| 166 |
|
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
public static final int TAG_AUDIO = 0x0020; |
| 171 |
|
| 172 |
|
| 173 |
|
| 174 |
|
| 175 |
public static final int TAG_UNKNOWN_DATA_DUMP = 0x0021; |
| 176 |
|
| 177 |
public static final int TAG_EASY_MODE = 0x0022; |
| 178 |
public static final int TAG_WHITE_BALANCE_BIAS = 0x0023; |
| 179 |
public static final int TAG_FLASH_BIAS = 0x0024; |
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
public static final int TAG_INTERNAL_SERIAL_NUMBER = 0x0025; |
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
|
| 190 |
public static final int TAG_EXIF_VERSION = 0x0026; |
| 191 |
|
| 192 |
|
| 193 |
|
| 194 |
|
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
public static final int TAG_COLOR_EFFECT = 0x0028; |
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
|
| 207 |
public static final int TAG_UPTIME = 0x0029; |
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
public static final int TAG_BURST_MODE = 0x002a; |
| 217 |
|
| 218 |
public static final int TAG_SEQUENCE_NUMBER = 0x002b; |
| 219 |
|
| 220 |
|
| 221 |
|
| 222 |
|
| 223 |
|
| 224 |
|
| 225 |
|
| 226 |
|
| 227 |
|
| 228 |
|
| 229 |
|
| 230 |
|
| 231 |
|
| 232 |
|
| 233 |
|
| 234 |
|
| 235 |
|
| 236 |
|
| 237 |
|
| 238 |
|
| 239 |
|
| 240 |
|
| 241 |
|
| 242 |
|
| 243 |
|
| 244 |
|
| 245 |
|
| 246 |
|
| 247 |
public static final int TAG_CONTRAST_MODE = 0x002c; |
| 248 |
|
| 249 |
|
| 250 |
|
| 251 |
|
| 252 |
|
| 253 |
|
| 254 |
|
| 255 |
|
| 256 |
|
| 257 |
public static final int TAG_NOISE_REDUCTION = 0x002d; |
| 258 |
|
| 259 |
|
| 260 |
|
| 261 |
|
| 262 |
|
| 263 |
|
| 264 |
public static final int TAG_SELF_TIMER = 0x002e; |
| 265 |
|
| 266 |
|
| 267 |
|
| 268 |
|
| 269 |
|
| 270 |
|
| 271 |
|
| 272 |
public static final int TAG_ROTATION = 0x0030; |
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
|
| 277 |
|
| 278 |
|
| 279 |
|
| 280 |
public static final int TAG_AF_ASSIST_LAMP = 0x0031; |
| 281 |
|
| 282 |
|
| 283 |
|
| 284 |
|
| 285 |
|
| 286 |
|
| 287 |
|
| 288 |
public static final int TAG_COLOR_MODE = 0x0032; |
| 289 |
|
| 290 |
public static final int TAG_BABY_AGE = 0x0033; |
| 291 |
|
| 292 |
|
| 293 |
|
| 294 |
|
| 295 |
|
| 296 |
public static final int TAG_OPTICAL_ZOOM_MODE = 0x0034; |
| 297 |
|
| 298 |
|
| 299 |
|
| 300 |
|
| 301 |
|
| 302 |
|
| 303 |
|
| 304 |
public static final int TAG_CONVERSION_LENS = 0x0035; |
| 305 |
|
| 306 |
public static final int TAG_TRAVEL_DAY = 0x0036; |
| 307 |
|
| 308 |
|
| 309 |
|
| 310 |
|
| 311 |
public static final int TAG_CONTRAST = 0x0039; |
| 312 |
|
| 313 |
|
| 314 |
|
| 315 |
|
| 316 |
|
| 317 |
|
| 318 |
public static final int TAG_WORLD_TIME_LOCATION = 0x003a; |
| 319 |
|
| 320 |
|
| 321 |
|
| 322 |
|
| 323 |
|
| 324 |
public static final int TAG_TEXT_STAMP = 0x003b; |
| 325 |
|
| 326 |
public static final int TAG_PROGRAM_ISO = 0x003c; |
| 327 |
|
| 328 |
|
| 329 |
|
| 330 |
|
| 331 |
|
| 332 |
|
| 333 |
|
| 334 |
|
| 335 |
|
| 336 |
|
| 337 |
|
| 338 |
|
| 339 |
|
| 340 |
|
| 341 |
|
| 342 |
|
| 343 |
public static final int TAG_ADVANCED_SCENE_MODE = 0x003d; |
| 344 |
|
| 345 |
|
| 346 |
|
| 347 |
|
| 348 |
|
| 349 |
public static final int TAG_TEXT_STAMP_1 = 0x003e; |
| 350 |
|
| 351 |
public static final int TAG_FACES_DETECTED = 0x003f; |
| 352 |
|
| 353 |
public static final int TAG_SATURATION = 0x0040; |
| 354 |
public static final int TAG_SHARPNESS = 0x0041; |
| 355 |
public static final int TAG_FILM_MODE = 0x0042; |
| 356 |
|
| 357 |
public static final int TAG_COLOR_TEMP_KELVIN = 0x0044; |
| 358 |
public static final int TAG_BRACKET_SETTINGS = 0x0045; |
| 359 |
|
| 360 |
|
| 361 |
|
| 362 |
|
| 363 |
public static final int TAG_WB_ADJUST_AB = 0x0046; |
| 364 |
|
| 365 |
|
| 366 |
|
| 367 |
public static final int TAG_WB_ADJUST_GM = 0x0047; |
| 368 |
|
| 369 |
public static final int TAG_FLASH_CURTAIN = 0x0048; |
| 370 |
public static final int TAG_LONG_EXPOSURE_NOISE_REDUCTION = 0x0049; |
| 371 |
|
| 372 |
public static final int TAG_PANASONIC_IMAGE_WIDTH = 0x004b; |
| 373 |
public static final int TAG_PANASONIC_IMAGE_HEIGHT = 0x004c; |
| 374 |
public static final int TAG_AF_POINT_POSITION = 0x004d; |
| 375 |
|
| 376 |
|
| 377 |
|
| 378 |
|
| 379 |
|
| 380 |
|
| 381 |
|
| 382 |
|
| 383 |
|
| 384 |
|
| 385 |
|
| 386 |
|
| 387 |
|
| 388 |
|
| 389 |
|
| 390 |
public static final int TAG_FACE_DETECTION_INFO = 0x004e; |
| 391 |
public static final int TAG_LENS_TYPE = 0x0051; |
| 392 |
public static final int TAG_LENS_SERIAL_NUMBER = 0x0052; |
| 393 |
public static final int TAG_ACCESSORY_TYPE = 0x0053; |
| 394 |
public static final int TAG_ACCESSORY_SERIAL_NUMBER = 0x0054; |
| 395 |
|
| 396 |
|
| 397 |
|
| 398 |
|
| 399 |
|
| 400 |
|
| 401 |
|
| 402 |
|
| 403 |
|
| 404 |
public static final int TAG_TRANSFORM = 0x0059; |
| 405 |
|
| 406 |
|
| 407 |
|
| 408 |
|
| 409 |
|
| 410 |
|
| 411 |
|
| 412 |
public static final int TAG_INTELLIGENT_EXPOSURE = 0x005d; |
| 413 |
|
| 414 |
public static final int TAG_LENS_FIRMWARE_VERSION = 0x0060; |
| 415 |
public static final int TAG_BURST_SPEED = 0x0077; |
| 416 |
public static final int TAG_INTELLIGENT_D_RANGE = 0x0079; |
| 417 |
public static final int TAG_CLEAR_RETOUCH = 0x007c; |
| 418 |
public static final int TAG_CITY2 = 0x0080; |
| 419 |
public static final int TAG_PHOTO_STYLE = 0x0089; |
| 420 |
public static final int TAG_SHADING_COMPENSATION = 0x008a; |
| 421 |
|
| 422 |
public static final int TAG_ACCELEROMETER_Z = 0x008c; |
| 423 |
public static final int TAG_ACCELEROMETER_X = 0x008d; |
| 424 |
public static final int TAG_ACCELEROMETER_Y = 0x008e; |
| 425 |
public static final int TAG_CAMERA_ORIENTATION = 0x008f; |
| 426 |
public static final int TAG_ROLL_ANGLE = 0x0090; |
| 427 |
public static final int TAG_PITCH_ANGLE = 0x0091; |
| 428 |
public static final int TAG_SWEEP_PANORAMA_DIRECTION = 0x0093; |
| 429 |
public static final int TAG_SWEEP_PANORAMA_FIELD_OF_VIEW = 0x0094; |
| 430 |
public static final int TAG_TIMER_RECORDING = 0x0096; |
| 431 |
|
| 432 |
public static final int TAG_INTERNAL_ND_FILTER = 0x009d; |
| 433 |
public static final int TAG_HDR = 0x009e; |
| 434 |
public static final int TAG_SHUTTER_TYPE = 0x009f; |
| 435 |
|
| 436 |
public static final int TAG_CLEAR_RETOUCH_VALUE = 0x00a3; |
| 437 |
public static final int TAG_TOUCH_AE = 0x00ab; |
| 438 |
|
| 439 |
|
| 440 |
|
| 441 |
|
| 442 |
public static final int TAG_PRINT_IMAGE_MATCHING_INFO = 0x0E00; |
| 443 |
|
| 444 |
|
| 445 |
|
| 446 |
|
| 447 |
|
| 448 |
|
| 449 |
|
| 450 |
|
| 451 |
|
| 452 |
|
| 453 |
|
| 454 |
|
| 455 |
|
| 456 |
|
| 457 |
|
| 458 |
|
| 459 |
|
| 460 |
|
| 461 |
public static final int TAG_FACE_RECOGNITION_INFO = 0x0061; |
| 462 |
|
| 463 |
|
| 464 |
|
| 465 |
|
| 466 |
|
| 467 |
public static final int TAG_FLASH_WARNING = 0x0062; |
| 468 |
public static final int TAG_RECOGNIZED_FACE_FLAGS = 0x0063; |
| 469 |
public static final int TAG_TITLE = 0x0065; |
| 470 |
public static final int TAG_BABY_NAME = 0x0066; |
| 471 |
public static final int TAG_LOCATION = 0x0067; |
| 472 |
public static final int TAG_COUNTRY = 0x0069; |
| 473 |
public static final int TAG_STATE = 0x006b; |
| 474 |
public static final int TAG_CITY = 0x006d; |
| 475 |
public static final int TAG_LANDMARK = 0x006f; |
| 476 |
|
| 477 |
|
| 478 |
|
| 479 |
|
| 480 |
|
| 481 |
|
| 482 |
public static final int TAG_INTELLIGENT_RESOLUTION = 0x0070; |
| 483 |
|
| 484 |
public static final int TAG_MAKERNOTE_VERSION = 0x8000; |
| 485 |
public static final int TAG_SCENE_MODE = 0x8001; |
| 486 |
public static final int TAG_WB_RED_LEVEL = 0x8004; |
| 487 |
public static final int TAG_WB_GREEN_LEVEL = 0x8005; |
| 488 |
public static final int TAG_WB_BLUE_LEVEL = 0x8006; |
| 489 |
public static final int TAG_FLASH_FIRED = 0x8007; |
| 490 |
public static final int TAG_TEXT_STAMP_2 = 0x8008; |
| 491 |
public static final int TAG_TEXT_STAMP_3 = 0x8009; |
| 492 |
public static final int TAG_BABY_AGE_1 = 0x8010; |
| 493 |
|
| 494 |
|
| 495 |
|
| 496 |
|
| 497 |
|
| 498 |
|
| 499 |
|
| 500 |
|
| 501 |
|
| 502 |
public static final int TAG_TRANSFORM_1 = 0x8012; |
| 503 |
|
| 504 |
@NotNull |
| 505 |
private static final HashMap<Integer, String> _tagNameMap = new HashMap<Integer, String>(); |
| 506 |
|
| 507 |
static |
| 508 |
{ |
| 509 |
_tagNameMap.put(TAG_QUALITY_MODE, "Quality Mode"); |
| 510 |
_tagNameMap.put(TAG_FIRMWARE_VERSION, "Version"); |
| 511 |
_tagNameMap.put(TAG_WHITE_BALANCE, "White Balance"); |
| 512 |
_tagNameMap.put(TAG_FOCUS_MODE, "Focus Mode"); |
| 513 |
_tagNameMap.put(TAG_AF_AREA_MODE, "AF Area Mode"); |
| 514 |
_tagNameMap.put(TAG_IMAGE_STABILIZATION, "Image Stabilization"); |
| 515 |
_tagNameMap.put(TAG_MACRO_MODE, "Macro Mode"); |
| 516 |
_tagNameMap.put(TAG_RECORD_MODE, "Record Mode"); |
| 517 |
_tagNameMap.put(TAG_AUDIO, "Audio"); |
| 518 |
_tagNameMap.put(TAG_INTERNAL_SERIAL_NUMBER, "Internal Serial Number"); |
| 519 |
_tagNameMap.put(TAG_UNKNOWN_DATA_DUMP, "Unknown Data Dump"); |
| 520 |
_tagNameMap.put(TAG_EASY_MODE, "Easy Mode"); |
| 521 |
_tagNameMap.put(TAG_WHITE_BALANCE_BIAS, "White Balance Bias"); |
| 522 |
_tagNameMap.put(TAG_FLASH_BIAS, "Flash Bias"); |
| 523 |
_tagNameMap.put(TAG_EXIF_VERSION, "Exif Version"); |
| 524 |
_tagNameMap.put(TAG_COLOR_EFFECT, "Color Effect"); |
| 525 |
_tagNameMap.put(TAG_UPTIME, "Camera Uptime"); |
| 526 |
_tagNameMap.put(TAG_BURST_MODE, "Burst Mode"); |
| 527 |
_tagNameMap.put(TAG_SEQUENCE_NUMBER, "Sequence Number"); |
| 528 |
_tagNameMap.put(TAG_CONTRAST_MODE, "Contrast Mode"); |
| 529 |
_tagNameMap.put(TAG_NOISE_REDUCTION, "Noise Reduction"); |
| 530 |
_tagNameMap.put(TAG_SELF_TIMER, "Self Timer"); |
| 531 |
_tagNameMap.put(TAG_ROTATION, "Rotation"); |
| 532 |
_tagNameMap.put(TAG_AF_ASSIST_LAMP, "AF Assist Lamp"); |
| 533 |
_tagNameMap.put(TAG_COLOR_MODE, "Color Mode"); |
| 534 |
_tagNameMap.put(TAG_BABY_AGE, "Baby Age"); |
| 535 |
_tagNameMap.put(TAG_OPTICAL_ZOOM_MODE, "Optical Zoom Mode"); |
| 536 |
_tagNameMap.put(TAG_CONVERSION_LENS, "Conversion Lens"); |
| 537 |
_tagNameMap.put(TAG_TRAVEL_DAY, "Travel Day"); |
| 538 |
_tagNameMap.put(TAG_CONTRAST, "Contrast"); |
| 539 |
_tagNameMap.put(TAG_WORLD_TIME_LOCATION, "World Time Location"); |
| 540 |
_tagNameMap.put(TAG_TEXT_STAMP, "Text Stamp"); |
| 541 |
_tagNameMap.put(TAG_PROGRAM_ISO, "Program ISO"); |
| 542 |
_tagNameMap.put(TAG_ADVANCED_SCENE_MODE, "Advanced Scene Mode"); |
| 543 |
_tagNameMap.put(TAG_PRINT_IMAGE_MATCHING_INFO, "Print Image Matching (PIM) Info"); |
| 544 |
_tagNameMap.put(TAG_FACES_DETECTED, "Number of Detected Faces"); |
| 545 |
_tagNameMap.put(TAG_SATURATION, "Saturation"); |
| 546 |
_tagNameMap.put(TAG_SHARPNESS, "Sharpness"); |
| 547 |
_tagNameMap.put(TAG_FILM_MODE, "Film Mode"); |
| 548 |
_tagNameMap.put(TAG_COLOR_TEMP_KELVIN, "Color Temp Kelvin"); |
| 549 |
_tagNameMap.put(TAG_BRACKET_SETTINGS, "Bracket Settings"); |
| 550 |
_tagNameMap.put(TAG_WB_ADJUST_AB, "White Balance Adjust (AB)"); |
| 551 |
_tagNameMap.put(TAG_WB_ADJUST_GM, "White Balance Adjust (GM)"); |
| 552 |
|
| 553 |
_tagNameMap.put(TAG_FLASH_CURTAIN, "Flash Curtain"); |
| 554 |
_tagNameMap.put(TAG_LONG_EXPOSURE_NOISE_REDUCTION, "Long Exposure Noise Reduction"); |
| 555 |
_tagNameMap.put(TAG_PANASONIC_IMAGE_WIDTH, "Panasonic Image Width"); |
| 556 |
_tagNameMap.put(TAG_PANASONIC_IMAGE_HEIGHT, "Panasonic Image Height"); |
| 557 |
|
| 558 |
_tagNameMap.put(TAG_AF_POINT_POSITION, "Af Point Position"); |
| 559 |
_tagNameMap.put(TAG_FACE_DETECTION_INFO, "Face Detection Info"); |
| 560 |
_tagNameMap.put(TAG_LENS_TYPE, "Lens Type"); |
| 561 |
_tagNameMap.put(TAG_LENS_SERIAL_NUMBER, "Lens Serial Number"); |
| 562 |
_tagNameMap.put(TAG_ACCESSORY_TYPE, "Accessory Type"); |
| 563 |
_tagNameMap.put(TAG_ACCESSORY_SERIAL_NUMBER, "Accessory Serial Number"); |
| 564 |
_tagNameMap.put(TAG_TRANSFORM, "Transform"); |
| 565 |
_tagNameMap.put(TAG_INTELLIGENT_EXPOSURE, "Intelligent Exposure"); |
| 566 |
_tagNameMap.put(TAG_LENS_FIRMWARE_VERSION, "Lens Firmware Version"); |
| 567 |
_tagNameMap.put(TAG_FACE_RECOGNITION_INFO, "Face Recognition Info"); |
| 568 |
_tagNameMap.put(TAG_FLASH_WARNING, "Flash Warning"); |
| 569 |
_tagNameMap.put(TAG_RECOGNIZED_FACE_FLAGS, "Recognized Face Flags"); |
| 570 |
_tagNameMap.put(TAG_TITLE, "Title"); |
| 571 |
_tagNameMap.put(TAG_BABY_NAME, "Baby Name"); |
| 572 |
_tagNameMap.put(TAG_LOCATION, "Location"); |
| 573 |
_tagNameMap.put(TAG_COUNTRY, "Country"); |
| 574 |
_tagNameMap.put(TAG_STATE, "State"); |
| 575 |
_tagNameMap.put(TAG_CITY, "City"); |
| 576 |
_tagNameMap.put(TAG_LANDMARK, "Landmark"); |
| 577 |
_tagNameMap.put(TAG_INTELLIGENT_RESOLUTION, "Intelligent Resolution"); |
| 578 |
_tagNameMap.put(TAG_BURST_SPEED, "Burst Speed"); |
| 579 |
_tagNameMap.put(TAG_INTELLIGENT_D_RANGE, "Intelligent D-Range"); |
| 580 |
_tagNameMap.put(TAG_CLEAR_RETOUCH, "Clear Retouch"); |
| 581 |
_tagNameMap.put(TAG_CITY2, "City 2"); |
| 582 |
_tagNameMap.put(TAG_PHOTO_STYLE, "Photo Style"); |
| 583 |
_tagNameMap.put(TAG_SHADING_COMPENSATION, "Shading Compensation"); |
| 584 |
|
| 585 |
_tagNameMap.put(TAG_ACCELEROMETER_Z, "Accelerometer Z"); |
| 586 |
_tagNameMap.put(TAG_ACCELEROMETER_X, "Accelerometer X"); |
| 587 |
_tagNameMap.put(TAG_ACCELEROMETER_Y, "Accelerometer Y"); |
| 588 |
_tagNameMap.put(TAG_CAMERA_ORIENTATION, "Camera Orientation"); |
| 589 |
_tagNameMap.put(TAG_ROLL_ANGLE, "Roll Angle"); |
| 590 |
_tagNameMap.put(TAG_PITCH_ANGLE, "Pitch Angle"); |
| 591 |
_tagNameMap.put(TAG_SWEEP_PANORAMA_DIRECTION, "Sweep Panorama Direction"); |
| 592 |
_tagNameMap.put(TAG_SWEEP_PANORAMA_FIELD_OF_VIEW, "Sweep Panorama Field Of View"); |
| 593 |
_tagNameMap.put(TAG_TIMER_RECORDING, "Timer Recording"); |
| 594 |
|
| 595 |
_tagNameMap.put(TAG_INTERNAL_ND_FILTER, "Internal ND Filter"); |
| 596 |
_tagNameMap.put(TAG_HDR, "HDR"); |
| 597 |
_tagNameMap.put(TAG_SHUTTER_TYPE, "Shutter Type"); |
| 598 |
_tagNameMap.put(TAG_CLEAR_RETOUCH_VALUE, "Clear Retouch Value"); |
| 599 |
_tagNameMap.put(TAG_TOUCH_AE, "Touch AE"); |
| 600 |
|
| 601 |
_tagNameMap.put(TAG_MAKERNOTE_VERSION, "Makernote Version"); |
| 602 |
_tagNameMap.put(TAG_SCENE_MODE, "Scene Mode"); |
| 603 |
_tagNameMap.put(TAG_WB_RED_LEVEL, "White Balance (Red)"); |
| 604 |
_tagNameMap.put(TAG_WB_GREEN_LEVEL, "White Balance (Green)"); |
| 605 |
_tagNameMap.put(TAG_WB_BLUE_LEVEL, "White Balance (Blue)"); |
| 606 |
_tagNameMap.put(TAG_FLASH_FIRED, "Flash Fired"); |
| 607 |
_tagNameMap.put(TAG_TEXT_STAMP_1, "Text Stamp 1"); |
| 608 |
_tagNameMap.put(TAG_TEXT_STAMP_2, "Text Stamp 2"); |
| 609 |
_tagNameMap.put(TAG_TEXT_STAMP_3, "Text Stamp 3"); |
| 610 |
_tagNameMap.put(TAG_BABY_AGE_1, "Baby Age 1"); |
| 611 |
_tagNameMap.put(TAG_TRANSFORM_1, "Transform 1"); |
| 612 |
} |
| 613 |
|
| 614 |
public PanasonicMakernoteDirectory() |
| 615 |
{ |
| 616 |
this.setDescriptor(new PanasonicMakernoteDescriptor(this)); |
| 617 |
} |
| 618 |
|
| 619 |
@Override |
| 620 |
@NotNull |
| 621 |
public String getName() |
| 622 |
{ |
| 623 |
return "Panasonic Makernote"; |
| 624 |
} |
| 625 |
|
| 626 |
@Override |
| 627 |
@NotNull |
| 628 |
protected HashMap<Integer, String> getTagNameMap() |
| 629 |
{ |
| 630 |
return _tagNameMap; |
| 631 |
} |
| 632 |
|
| 633 |
@Nullable |
| 634 |
public Face[] getDetectedFaces() |
| 635 |
{ |
| 636 |
byte[] bytes = getByteArray(TAG_FACE_DETECTION_INFO); |
| 637 |
if (bytes==null) |
| 638 |
return null; |
| 639 |
|
| 640 |
RandomAccessReader reader = new ByteArrayReader(bytes); |
| 641 |
reader.setMotorolaByteOrder(false); |
| 642 |
|
| 643 |
try { |
| 644 |
int faceCount = reader.getUInt16(0); |
| 645 |
if (faceCount==0) |
| 646 |
return null; |
| 647 |
Face[] faces = new Face[faceCount]; |
| 648 |
|
| 649 |
for (int i = 0; i < faceCount; i++) { |
| 650 |
int offset = 2 + i * 8; |
| 651 |
faces[i] = new Face( |
| 652 |
reader.getUInt16(offset), |
| 653 |
reader.getUInt16(offset + 2), |
| 654 |
reader.getUInt16(offset + 4), |
| 655 |
reader.getUInt16(offset + 6) |
| 656 |
, null, null); |
| 657 |
} |
| 658 |
return faces; |
| 659 |
} catch (IOException e) { |
| 660 |
return null; |
| 661 |
} |
| 662 |
} |
| 663 |
|
| 664 |
@Nullable |
| 665 |
public Face[] getRecognizedFaces() |
| 666 |
{ |
| 667 |
byte[] bytes = getByteArray(TAG_FACE_RECOGNITION_INFO); |
| 668 |
if (bytes == null) |
| 669 |
return null; |
| 670 |
|
| 671 |
RandomAccessReader reader = new ByteArrayReader(bytes); |
| 672 |
reader.setMotorolaByteOrder(false); |
| 673 |
|
| 674 |
try { |
| 675 |
int faceCount = reader.getUInt16(0); |
| 676 |
if (faceCount==0) |
| 677 |
return null; |
| 678 |
Face[] faces = new Face[faceCount]; |
| 679 |
|
| 680 |
for (int i = 0; i < faceCount; i++) { |
| 681 |
int offset = 4 + i * 44; |
| 682 |
String name = reader.getString(offset, 20, "ASCII").trim(); |
| 683 |
String age = reader.getString(offset + 28, 20, "ASCII").trim(); |
| 684 |
faces[i] = new Face( |
| 685 |
reader.getUInt16(offset + 20), |
| 686 |
reader.getUInt16(offset + 22), |
| 687 |
reader.getUInt16(offset + 24), |
| 688 |
reader.getUInt16(offset + 26), |
| 689 |
name, |
| 690 |
Age.fromPanasonicString(age)); |
| 691 |
} |
| 692 |
return faces; |
| 693 |
} catch (IOException e) { |
| 694 |
return null; |
| 695 |
} |
| 696 |
} |
| 697 |
|
| 698 |
|
| 699 |
|
| 700 |
|
| 701 |
|
| 702 |
|
| 703 |
@Nullable |
| 704 |
public Age getAge(int tag) |
| 705 |
{ |
| 706 |
final String ageString = getString(tag); |
| 707 |
if (ageString==null) |
| 708 |
return null; |
| 709 |
return Age.fromPanasonicString(ageString); |
| 710 |
} |
| 711 |
} |