From 5387705fa6193683e1c1c5fb2f59978efde45e1c Mon Sep 17 00:00:00 2001 From: HumanDynamo Date: Thu, 15 Apr 2010 09:36:39 +0000 Subject: [PATCH] implement shared Color mode decoding --- src/minoltamn.cpp | 3 +++ src/minoltasonyvalues.cpp | 26 +++++++++++++++++++++++++- src/minoltasonyvalues.hpp | 5 ++++- src/sonymn.cpp | 2 +- 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/minoltamn.cpp b/src/minoltamn.cpp index 82a1eb2f..11864ccc 100644 --- a/src/minoltamn.cpp +++ b/src/minoltamn.cpp @@ -120,9 +120,12 @@ namespace Exiv2 { TagInfo(0x0089, "ThumbnailLength", N_("Thumbnail Length"), N_("Size of the thumbnail"), minoltaIfdId, makerTags, unsignedLong, printValue), + + // TODO: for A100, use Sony table from minoltasonyvallue.cpp::printMinoltaSonyColorMode(). TagInfo(0x0101, "ColorMode", N_("Color Mode"), N_("Color mode"), minoltaIfdId, makerTags, unsignedLong, EXV_PRINT_TAG(minoltaColorMode)), + TagInfo(0x0102, "Quality", N_("Image Quality"), N_("Image quality"), minoltaIfdId, makerTags, unsignedLong, EXV_PRINT_TAG(minoltaImageQuality)), diff --git a/src/minoltasonyvalues.cpp b/src/minoltasonyvalues.cpp index 98dbceab..06cc00ee 100644 --- a/src/minoltasonyvalues.cpp +++ b/src/minoltasonyvalues.cpp @@ -325,6 +325,30 @@ namespace Exiv2 { return EXV_PRINT_TAG(minoltaSonyLensID)(os, value, metadata); } - // TODO: Added shared methods here. + // ---------------------------------------------------------------------------------------------------- + + //! Lookup table to translate Minolta A100 and all other Sony Alpha camera color mode values to readable labels + extern const TagDetails minoltaSonyColorMode[] = { + { 0, N_("Standard") }, + { 1, N_("Vivid Color") }, + { 2, N_("Portrait") }, + { 3, N_("Landscape") }, + { 4, N_("Sunset") }, + { 5, N_("Night View/Portrait") }, + { 6, N_("Black & White") }, + { 7, N_("AdobeRGB") }, + { 12, N_("Neutral") }, + { 100, N_("Neutral") }, + { 101, N_("Clear") }, + { 102, N_("Deep") }, + { 103, N_("Light") }, + { 104, N_("Night View") }, + { 105, N_("Autumn Leaves") } + }; + + std::ostream& printMinoltaSonyColorMode(std::ostream& os, const Value& value, const ExifData* metadata) + { + return EXV_PRINT_TAG(minoltaSonyColorMode)(os, value, metadata); + } } // namespace Exiv2 diff --git a/src/minoltasonyvalues.hpp b/src/minoltasonyvalues.hpp index b24e5097..29fcad3b 100644 --- a/src/minoltasonyvalues.hpp +++ b/src/minoltasonyvalues.hpp @@ -41,7 +41,10 @@ namespace Exiv2 { //! PrintMinolta/Sony Lens id values to readable labels - EXIV2API std::ostream& printMinoltaSonyLensID(std::ostream& os, const Value& value, const ExifData*); + EXIV2API std::ostream& printMinoltaSonyLensID(std::ostream&, const Value&, const ExifData*); + + //! PrintMinolta/Sony Color Mode values to readable labels + EXIV2API std::ostream& printMinoltaSonyColorMode(std::ostream&, const Value&, const ExifData*); // TODO: Added shared methods here. diff --git a/src/sonymn.cpp b/src/sonymn.cpp index ab4dc7b1..56e37040 100644 --- a/src/sonymn.cpp +++ b/src/sonymn.cpp @@ -253,7 +253,7 @@ namespace Exiv2 { TagInfo(0xb029, "ColorMode", N_("Color Mode"), N_("Color Mode"), - sonyIfdId, makerTags, unsignedLong, printValue), + sonyIfdId, makerTags, unsignedLong, printMinoltaSonyColorMode), TagInfo(0xb02b, "FullImageSize", N_("Full Image Size"), N_("Full Image Size"),