1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 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 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 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 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103
|
/*
* Copyright 2002-2012 Drew Noakes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* More information about this project is available at:
*
* http://drewnoakes.com/code/exif/
* http://code.google.com/p/metadata-extractor/
*/
package com.drew.metadata.exif;
import com.drew.lang.BufferBoundsException;
import com.drew.lang.BufferReader;
import com.drew.lang.ByteArrayReader;
import com.drew.lang.annotations.NotNull;
import com.drew.lang.annotations.Nullable;
import com.drew.metadata.Age;
import com.drew.metadata.Face;
import com.drew.metadata.TagDescriptor;
import java.io.UnsupportedEncodingException;
/**
* Provides human-readable string representations of tag values stored in a <code>PanasonicMakernoteDirectory</code>.
* <p/>
* Some information about this makernote taken from here:
* <ul>
* <li><a href="http://www.ozhiker.com/electronics/pjmt/jpeg_info/panasonic_mn.html">http://www.ozhiker.com/electronics/pjmt/jpeg_info/panasonic_mn.html</a></li>
* <li><a href="http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Panasonic.html">http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Panasonic.html</a></li>
* </ul>
*
* @author Drew Noakes http://drewnoakes.com, Philipp Sandhaus
*/
public class PanasonicMakernoteDescriptor extends TagDescriptor<PanasonicMakernoteDirectory>
{
public PanasonicMakernoteDescriptor(@NotNull PanasonicMakernoteDirectory directory)
{
super(directory);
}
@Nullable
public String getDescription(int tagType)
{
switch (tagType) {
case PanasonicMakernoteDirectory.TAG_QUALITY_MODE:
return getQualityModeDescription();
case PanasonicMakernoteDirectory.TAG_VERSION:
return getVersionDescription();
case PanasonicMakernoteDirectory.TAG_WHITE_BALANCE:
return getWhiteBalanceDescription();
case PanasonicMakernoteDirectory.TAG_FOCUS_MODE:
return getFocusModeDescription();
case PanasonicMakernoteDirectory.TAG_AF_AREA_MODE:
return getAfAreaModeDescription();
case PanasonicMakernoteDirectory.TAG_IMAGE_STABILIZATION:
return getImageStabilizationDescription();
case PanasonicMakernoteDirectory.TAG_MACRO_MODE:
return getMacroModeDescription();
case PanasonicMakernoteDirectory.TAG_RECORD_MODE:
return getRecordModeDescription();
case PanasonicMakernoteDirectory.TAG_AUDIO:
return getAudioDescription();
case PanasonicMakernoteDirectory.TAG_UNKNOWN_DATA_DUMP:
return getUnknownDataDumpDescription();
case PanasonicMakernoteDirectory.TAG_COLOR_EFFECT:
return getColorEffectDescription();
case PanasonicMakernoteDirectory.TAG_UPTIME:
return getUptimeDescription();
case PanasonicMakernoteDirectory.TAG_BURST_MODE:
return getBurstModeDescription();
case PanasonicMakernoteDirectory.TAG_CONTRAST_MODE:
return getContrastModeDescription();
case PanasonicMakernoteDirectory.TAG_NOISE_REDUCTION:
return getNoiseReductionDescription();
case PanasonicMakernoteDirectory.TAG_SELF_TIMER:
return getSelfTimerDescription();
case PanasonicMakernoteDirectory.TAG_ROTATION:
return getRotationDescription();
case PanasonicMakernoteDirectory.TAG_AF_ASSIST_LAMP:
return getAfAssistLampDescription();
case PanasonicMakernoteDirectory.TAG_COLOR_MODE:
return getColorModeDescription();
case PanasonicMakernoteDirectory.TAG_OPTICAL_ZOOM_MODE:
return getOpticalZoomModeDescription();
case PanasonicMakernoteDirectory.TAG_CONVERSION_LENS:
return getConversionLensDescription();
case PanasonicMakernoteDirectory.TAG_CONTRAST:
return getContrastDescription();
case PanasonicMakernoteDirectory.TAG_WORLD_TIME_LOCATION:
return getWorldTimeLocationDescription();
case PanasonicMakernoteDirectory.TAG_ADVANCED_SCENE_MODE:
return getAdvancedSceneModeDescription();
case PanasonicMakernoteDirectory.TAG_FACE_DETECTION_INFO:
return getDetectedFacesDescription();
case PanasonicMakernoteDirectory.TAG_TRANSFORM:
return getTransformDescription();
case PanasonicMakernoteDirectory.TAG_TRANSFORM_1:
return getTransform1Description();
case PanasonicMakernoteDirectory.TAG_INTELLIGENT_EXPOSURE:
return getIntelligentExposureDescription();
case PanasonicMakernoteDirectory.TAG_FLASH_WARNING:
return getFlashWarningDescription();
case PanasonicMakernoteDirectory.TAG_COUNTRY:
return getCountryDescription();
case PanasonicMakernoteDirectory.TAG_STATE:
return getStateDescription();
case PanasonicMakernoteDirectory.TAG_CITY:
return getCityDescription();
case PanasonicMakernoteDirectory.TAG_LANDMARK:
return getLandmarkDescription();
case PanasonicMakernoteDirectory.TAG_INTELLIGENT_RESOLUTION:
return getIntelligentResolutionDescription();
case PanasonicMakernoteDirectory.TAG_FACE_RECOGNITION_INFO:
return getRecognizedFacesDescription();
case PanasonicMakernoteDirectory.TAG_PRINT_IMAGE_MATCHING_INFO:
return getPrintImageMatchingInfoDescription();
case PanasonicMakernoteDirectory.TAG_SCENE_MODE:
return getSceneModeDescription();
case PanasonicMakernoteDirectory.TAG_FLASH_FIRED:
return getFlashFiredDescription();
case PanasonicMakernoteDirectory.TAG_TEXT_STAMP:
return getTextStampDescription();
case PanasonicMakernoteDirectory.TAG_TEXT_STAMP_1:
return getTextStamp1Description();
case PanasonicMakernoteDirectory.TAG_TEXT_STAMP_2:
return getTextStamp2Description();
case PanasonicMakernoteDirectory.TAG_TEXT_STAMP_3:
return getTextStamp3Description();
case PanasonicMakernoteDirectory.TAG_MAKERNOTE_VERSION:
return getMakernoteVersionDescription();
case PanasonicMakernoteDirectory.TAG_EXIF_VERSION:
return getExifVersionDescription();
case PanasonicMakernoteDirectory.TAG_INTERNAL_SERIAL_NUMBER:
return getInternalSerialNumberDescription();
case PanasonicMakernoteDirectory.TAG_TITLE:
return getTitleDescription();
case PanasonicMakernoteDirectory.TAG_BABY_NAME:
return getBabyNameDescription();
case PanasonicMakernoteDirectory.TAG_LOCATION:
return getLocationDescription();
case PanasonicMakernoteDirectory.TAG_BABY_AGE:
return getBabyAgeDescription();
case PanasonicMakernoteDirectory.TAG_BABY_AGE_1:
return getBabyAge1Description();
default:
return super.getDescription(tagType);
}
}
@Nullable
public String getPrintImageMatchingInfoDescription()
{
byte[] values = _directory.getByteArray(PanasonicMakernoteDirectory.TAG_PRINT_IMAGE_MATCHING_INFO);
if (values == null)
return null;
return "(" + values.length + " bytes)";
}
@Nullable
public String getTextStampDescription()
{
return getOnOffDescription(PanasonicMakernoteDirectory.TAG_TEXT_STAMP);
}
@Nullable
public String getTextStamp1Description()
{
return getOnOffDescription(PanasonicMakernoteDirectory.TAG_TEXT_STAMP_1);
}
@Nullable
public String getTextStamp2Description()
{
return getOnOffDescription(PanasonicMakernoteDirectory.TAG_TEXT_STAMP_2);
}
@Nullable
public String getTextStamp3Description()
{
return getOnOffDescription(PanasonicMakernoteDirectory.TAG_TEXT_STAMP_3);
}
@Nullable
public String getMacroModeDescription()
{
return getOnOffDescription(PanasonicMakernoteDirectory.TAG_MACRO_MODE);
}
@Nullable
public String getFlashFiredDescription()
{
return getOnOffDescription(PanasonicMakernoteDirectory.TAG_FLASH_FIRED);
}
@Nullable
public String getImageStabilizationDescription()
{
Integer value = _directory.getInteger(PanasonicMakernoteDirectory.TAG_IMAGE_STABILIZATION);
if (value == null)
return null;
switch (value) {
case 2:
return "On, Mode 1";
case 3:
return "Off";
case 4:
return "On, Mode 2";
default:
return "Unknown (" + value + ")";
}
}
@Nullable
public String getAudioDescription()
{
return getOnOffDescription(PanasonicMakernoteDirectory.TAG_AUDIO);
}
@Nullable
public String getTransformDescription()
{
return getTransformDescription(PanasonicMakernoteDirectory.TAG_TRANSFORM);
}
@Nullable
public String getTransform1Description()
{
return getTransformDescription(PanasonicMakernoteDirectory.TAG_TRANSFORM_1);
}
@Nullable
private String getTransformDescription(int tag)
{
byte[] values = _directory.getByteArray(tag);
if (values == null)
return null;
BufferReader reader = new ByteArrayReader(values);
try
{
int val1 = reader.getUInt16(0);
int val2 = reader.getUInt16(2);
if (val1 == -1 && val2 == 1)
return "Slim Low";
if (val1 == -3 && val2 == 2)
return "Slim High";
if (val1 == 0 && val2 == 0)
return "Off";
if (val1 == 1 && val2 == 1)
return "Stretch Low";
if (val1 == 3 && val2 == 2)
return "Stretch High";
return "Unknown (" + val1 + " " + val2 + ")";
} catch (BufferBoundsException e) {
return null ;
}
}
@Nullable
public String getIntelligentExposureDescription()
{
Integer value = _directory.getInteger(PanasonicMakernoteDirectory.TAG_INTELLIGENT_EXPOSURE);
if (value == null)
return null;
switch (value) {
case 0:
return "Off";
case 1:
return "Low";
case 2:
return "Standard";
case 3:
return "High";
default:
return "Unknown (" + value + ")";
}
}
@Nullable
public String getFlashWarningDescription()
{
Integer value = _directory.getInteger(PanasonicMakernoteDirectory.TAG_FLASH_WARNING);
if (value == null)
return null;
switch (value) {
case 0:
return "No";
case 1:
return "Yes (Flash required but disabled)";
default:
return "Unknown (" + value + ")";
}
}
@Nullable
public String getCountryDescription()
{
return getTextDescription(PanasonicMakernoteDirectory.TAG_COUNTRY);
}
@Nullable
public String getStateDescription()
{
return getTextDescription(PanasonicMakernoteDirectory.TAG_STATE);
}
@Nullable
public String getCityDescription()
{
return getTextDescription(PanasonicMakernoteDirectory.TAG_CITY);
}
@Nullable
public String getLandmarkDescription()
{
return getTextDescription(PanasonicMakernoteDirectory.TAG_LANDMARK);
}
@Nullable
public String getTitleDescription()
{
return getTextDescription(PanasonicMakernoteDirectory.TAG_TITLE);
}
@Nullable
public String getBabyNameDescription()
{
return getTextDescription(PanasonicMakernoteDirectory.TAG_BABY_NAME);
}
@Nullable
public String getLocationDescription()
{
return getTextDescription(PanasonicMakernoteDirectory.TAG_LOCATION);
}
@Nullable
public String getIntelligentResolutionDescription()
{
Integer value = _directory.getInteger(PanasonicMakernoteDirectory.TAG_INTELLIGENT_RESOLUTION);
if (value == null)
return null;
switch (value) {
case 0:
return "Off";
case 2:
return "Auto";
case 3:
return "On";
default:
return "Unknown (" + value + ")";
}
}
@Nullable
public String getContrastDescription()
{
Integer value = _directory.getInteger(PanasonicMakernoteDirectory.TAG_CONTRAST);
if (value == null)
return null;
switch (value) {
case 0:
return "Normal";
default:
return "Unknown (" + value + ")";
}
}
@Nullable
public String getWorldTimeLocationDescription()
{
Integer value = _directory.getInteger(PanasonicMakernoteDirectory.TAG_WORLD_TIME_LOCATION);
if (value == null)
return null;
switch (value) {
case 1:
return "Home";
case 2:
return "Destination";
default:
return "Unknown (" + value + ")";
}
}
@Nullable
public String getAdvancedSceneModeDescription()
{
Integer value = _directory.getInteger(PanasonicMakernoteDirectory.TAG_ADVANCED_SCENE_MODE);
if (value == null)
return null;
switch (value) {
case 1:
return "Normal";
case 2:
return "Outdoor/Illuminations/Flower/HDR Art";
case 3:
return "Indoor/Architecture/Objects/HDR B&W";
case 4:
return "Creative";
case 5:
return "Auto";
case 7:
return "Expressive";
case 8:
return "Retro";
case 9:
return "Pure";
case 10:
return "Elegant";
case 12:
return "Monochrome";
case 13:
return "Dynamic Art";
case 14:
return "Silhouette";
default:
return "Unknown (" + value + ")";
}
}
@Nullable
public String getUnknownDataDumpDescription()
{
byte[] value = _directory.getByteArray(PanasonicMakernoteDirectory.TAG_UNKNOWN_DATA_DUMP);
if (value == null)
return null;
return "[" + value.length + " bytes]";
}
@Nullable
public String getColorEffectDescription()
{
Integer value = _directory.getInteger(PanasonicMakernoteDirectory.TAG_COLOR_EFFECT);
if (value == null)
return null;
switch (value) {
case 1:
return "Off";
case 2:
return "Warm";
case 3:
return "Cool";
case 4:
return "Black & White";
case 5:
return "Sepia";
default:
return "Unknown (" + value + ")";
}
}
@Nullable
public String getUptimeDescription()
{
Integer value = _directory.getInteger(PanasonicMakernoteDirectory.TAG_UPTIME);
if (value == null)
return null;
return value / 100f + " s";
}
@Nullable
public String getBurstModeDescription()
{
Integer value = _directory.getInteger(PanasonicMakernoteDirectory.TAG_BURST_MODE);
if (value == null)
return null;
switch (value) {
case 0:
return "Off";
case 1:
return "On";
case 2:
return "Infinite";
case 4:
return "Unlimited";
default:
return "Unknown (" + value + ")";
}
}
@Nullable
public String getContrastModeDescription()
{
Integer value = _directory.getInteger(PanasonicMakernoteDirectory.TAG_CONTRAST_MODE);
if (value == null)
return null;
switch (value) {
case 0x0:
return "Normal";
case 0x1:
return "Low";
case 0x2:
return "High";
case 0x6:
return "Medium Low";
case 0x7:
return "Medium High";
case 0x100:
return "Low";
case 0x110:
return "Normal";
case 0x120:
return "High";
default:
return "Unknown (" + value + ")";
}
}
@Nullable
public String getNoiseReductionDescription()
{
Integer value = _directory.getInteger(PanasonicMakernoteDirectory.TAG_NOISE_REDUCTION);
if (value == null)
return null;
switch (value) {
case 0:
return "Standard (0)";
case 1:
return "Low (-1)";
case 2:
return "High (+1)";
case 3:
return "Lowest (-2)";
case 4:
return "Highest (+2)";
default:
return "Unknown (" + value + ")";
}
}
@Nullable
public String getSelfTimerDescription()
{
Integer value = _directory.getInteger(PanasonicMakernoteDirectory.TAG_SELF_TIMER);
if (value == null)
return null;
switch (value) {
case 1:
return "Off";
case 2:
return "10 s";
case 3:
return "2 s";
default:
return "Unknown (" + value + ")";
}
}
@Nullable
public String getRotationDescription()
{
Integer value = _directory.getInteger(PanasonicMakernoteDirectory.TAG_ROTATION);
if (value == null)
return null;
switch (value) {
case 1:
return "Horizontal";
case 3:
return "Rotate 180";
case 6:
return "Rotate 90 CW";
case 8:
return "Rotate 270 CW";
default:
return "Unknown (" + value + ")";
}
}
@Nullable
public String getAfAssistLampDescription()
{
Integer value = _directory.getInteger(PanasonicMakernoteDirectory.TAG_AF_ASSIST_LAMP);
if (value == null)
return null;
switch (value) {
case 1:
return "Fired";
case 2:
return "Enabled but not used";
case 3:
return "Disabled but required";
case 4:
return "Disabled and not required";
default:
return "Unknown (" + value + ")";
}
}
@Nullable
public String getColorModeDescription()
{
Integer value = _directory.getInteger(PanasonicMakernoteDirectory.TAG_COLOR_MODE);
if (value == null)
return null;
switch (value) {
case 0:
return "Normal";
case 1:
return "Natural";
case 2:
return "Vivid";
default:
return "Unknown (" + value + ")";
}
}
@Nullable
public String getOpticalZoomModeDescription()
{
Integer value = _directory.getInteger(PanasonicMakernoteDirectory.TAG_OPTICAL_ZOOM_MODE);
if (value == null)
return null;
switch (value) {
case 1:
return "Standard";
case 2:
return "Extended";
default:
return "Unknown (" + value + ")";
}
}
@Nullable
public String getConversionLensDescription()
{
Integer value = _directory.getInteger(PanasonicMakernoteDirectory.TAG_CONVERSION_LENS);
if (value == null)
return null;
switch (value) {
case 1:
return "Off";
case 2:
return "Wide";
case 3:
return "Telephoto";
case 4:
return "Macro";
default:
return "Unknown (" + value + ")";
}
}
@Nullable
public String getDetectedFacesDescription()
{
return buildFacesDescription(_directory.getDetectedFaces());
}
@Nullable
public String getRecognizedFacesDescription()
{
return buildFacesDescription(_directory.getRecognizedFaces());
}
@Nullable
private String buildFacesDescription(@Nullable Face[] faces)
{
if (faces == null)
return null;
StringBuilder result = new StringBuilder();
for (int i = 0; i < faces.length; i++)
result.append("Face ").append(i + 1).append(": ").append(faces[i].toString()).append("\n");
if (result.length() > 0)
return result.substring(0, result.length() - 1);
return null;
}
@Nullable
public String getRecordModeDescription()
{
Integer value = _directory.getInteger(PanasonicMakernoteDirectory.TAG_RECORD_MODE);
if (value == null)
return null;
switch (value) {
case 1:
return "Normal";
case 2:
return "Portrait";
case 3:
return "Scenery";
case 4:
return "Sports";
case 5:
return "Night Portrait";
case 6:
return "Program";
case 7:
return "Aperture Priority";
case 8:
return "Shutter Priority";
case 9:
return "Macro";
case 10:
return "Spot";
case 11:
return "Manual";
case 12:
return "Movie Preview";
case 13:
return "Panning";
case 14:
return "Simple";
case 15:
return "Color Effects";
case 16:
return "Self Portrait";
case 17:
return "Economy";
case 18:
return "Fireworks";
case 19:
return "Party";
case 20:
return "Snow";
case 21:
return "Night Scenery";
case 22:
return "Food";
case 23:
return "Baby";
case 24:
return "Soft Skin";
case 25:
return "Candlelight";
case 26:
return "Starry Night";
case 27:
return "High Sensitivity";
case 28:
return "Panorama Assist";
case 29:
return "Underwater";
case 30:
return "Beach";
case 31:
return "Aerial Photo";
case 32:
return "Sunset";
case 33:
return "Pet";
case 34:
return "Intelligent ISO";
case 35:
return "Clipboard";
case 36:
return "High Speed Continuous Shooting";
case 37:
return "Intelligent Auto";
case 39:
return "Multi-aspect";
case 41:
return "Transform";
case 42:
return "Flash Burst";
case 43:
return "Pin Hole";
case 44:
return "Film Grain";
case 45:
return "My Color";
case 46:
return "Photo Frame";
case 51:
return "HDR";
default:
return "Unknown (" + value + ")";
}
}
@Nullable
public String getSceneModeDescription()
{
Integer value = _directory.getInteger(PanasonicMakernoteDirectory.TAG_SCENE_MODE);
if (value == null)
return null;
switch (value) {
case 1:
return "Normal";
case 2:
return "Portrait";
case 3:
return "Scenery";
case 4:
return "Sports";
case 5:
return "Night Portrait";
case 6:
return "Program";
case 7:
return "Aperture Priority";
case 8:
return "Shutter Priority";
case 9:
return "Macro";
case 10:
return "Spot";
case 11:
return "Manual";
case 12:
return "Movie Preview";
case 13:
return "Panning";
case 14:
return "Simple";
case 15:
return "Color Effects";
case 16:
return "Self Portrait";
case 17:
return "Economy";
case 18:
return "Fireworks";
case 19:
return "Party";
case 20:
return "Snow";
case 21:
return "Night Scenery";
case 22:
return "Food";
case 23:
return "Baby";
case 24:
return "Soft Skin";
case 25:
return "Candlelight";
case 26:
return "Starry Night";
case 27:
return "High Sensitivity";
case 28:
return "Panorama Assist";
case 29:
return "Underwater";
case 30:
return "Beach";
case 31:
return "Aerial Photo";
case 32:
return "Sunset";
case 33:
return "Pet";
case 34:
return "Intelligent ISO";
case 35:
return "Clipboard";
case 36:
return "High Speed Continuous Shooting";
case 37:
return "Intelligent Auto";
case 39:
return "Multi-aspect";
case 41:
return "Transform";
case 42:
return "Flash Burst";
case 43:
return "Pin Hole";
case 44:
return "Film Grain";
case 45:
return "My Color";
case 46:
return "Photo Frame";
case 51:
return "HDR";
default:
return "Unknown (" + value + ")";
}
}
@Nullable
public String getFocusModeDescription()
{
Integer value = _directory.getInteger(PanasonicMakernoteDirectory.TAG_FOCUS_MODE);
if (value == null)
return null;
switch (value) {
case 1:
return "Auto";
case 2:
return "Manual";
case 4:
return "Auto, Focus Button";
case 5:
return "Auto, Continuous";
default:
return "Unknown (" + value + ")";
}
}
@Nullable
public String getAfAreaModeDescription()
{
int[] value = _directory.getIntArray(PanasonicMakernoteDirectory.TAG_AF_AREA_MODE);
if (value == null || value.length < 2)
return null;
switch (value[0]) {
case 0:
switch (value[1]) {
case 1:
return "Spot Mode On";
case 16:
return "Spot Mode Off";
default:
return "Unknown (" + value[0] + " " + value[1] + ")";
}
case 1:
switch (value[1]) {
case 0:
return "Spot Focusing";
case 1:
return "5-area";
default:
return "Unknown (" + value[0] + " " + value[1] + ")";
}
case 16:
switch (value[1]) {
case 0:
return "1-area";
case 16:
return "1-area (high speed)";
default:
return "Unknown (" + value[0] + " " + value[1] + ")";
}
case 32:
switch (value[1]) {
case 0:
return "Auto or Face Detect";
case 1:
return "3-area (left)";
case 2:
return "3-area (center)";
case 3:
return "3-area (right)";
default:
return "Unknown (" + value[0] + " " + value[1] + ")";
}
case 64:
return "Face Detect";
default:
return "Unknown (" + value[0] + " " + value[1] + ")";
}
}
@Nullable
public String getQualityModeDescription()
{
Integer value = _directory.getInteger(PanasonicMakernoteDirectory.TAG_QUALITY_MODE);
if (value == null)
return null;
switch (value) {
case 2:
return "High";
case 3:
return "Normal";
case 6:
return "Very High";
case 7:
return "Raw";
case 9:
return "Motion Picture";
default:
return "Unknown (" + value + ")";
}
}
@Nullable
public String getVersionDescription()
{
return convertBytesToVersionString(_directory.getIntArray(PanasonicMakernoteDirectory.TAG_VERSION), 2);
}
@Nullable
public String getMakernoteVersionDescription()
{
return convertBytesToVersionString(_directory.getIntArray(PanasonicMakernoteDirectory.TAG_MAKERNOTE_VERSION), 2);
}
@Nullable
public String getExifVersionDescription()
{
return convertBytesToVersionString(_directory.getIntArray(PanasonicMakernoteDirectory.TAG_EXIF_VERSION), 2);
}
@Nullable
public String getInternalSerialNumberDescription()
{
final byte[] bytes = _directory.getByteArray(PanasonicMakernoteDirectory.TAG_INTERNAL_SERIAL_NUMBER);
if (bytes==null)
return null;
int length = bytes.length;
for (int index = 0; index < bytes.length; index++) {
int i = bytes[index] & 0xFF;
if (i == 0 || i > 0x7F) {
length = index;
break;
}
}
return new String(bytes, 0, length);
}
@Nullable
public String getWhiteBalanceDescription()
{
Integer value = _directory.getInteger(PanasonicMakernoteDirectory.TAG_WHITE_BALANCE);
if (value == null)
return null;
switch (value) {
case 1:
return "Auto";
case 2:
return "Daylight";
case 3:
return "Cloudy";
case 4:
return "Incandescent";
case 5:
return "Manual";
case 8:
return "Flash";
case 10:
return "Black & White";
case 11:
return "Manual";
case 12:
return "Shade";
default:
return "Unknown (" + value + ")";
}
}
@Nullable
public String getBabyAgeDescription()
{
final Age age = _directory.getAge(PanasonicMakernoteDirectory.TAG_BABY_AGE);
if (age==null)
return null;
return age.toFriendlyString();
}
@Nullable
public String getBabyAge1Description()
{
final Age age = _directory.getAge(PanasonicMakernoteDirectory.TAG_BABY_AGE_1);
if (age==null)
return null;
return age.toFriendlyString();
}
@Nullable
private String getTextDescription(int tag)
{
byte[] values = _directory.getByteArray(tag);
if (values == null)
return null;
try {
return new String(values, "ASCII").trim();
} catch (UnsupportedEncodingException e) {
return null;
}
}
@Nullable
private String getOnOffDescription(int tag)
{
Integer value = _directory.getInteger(tag);
if (value == null)
return null;
switch (value) {
case 1:
return "Off";
case 2:
return "On";
default:
return "Unknown (" + value + ")";
}
}
}
|