Merge pull request #2838 from norbertwg/translate-Exif.NikonAf2.AFAreaMode-

Translate exif.nikon af2.af area mode - enhanced
main
Miloš Komarčević 2 years ago committed by GitHub
commit 9fe6ded530
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -744,8 +744,8 @@ constexpr TagDetails nikonAfAreaMode[] = {
{3, N_("Group Dynamic")}, {4, N_("Single Area (wide)")}, {5, N_("Dynamic Area (wide)")}, {3, N_("Group Dynamic")}, {4, N_("Single Area (wide)")}, {5, N_("Dynamic Area (wide)")},
}; };
//! AF2 Area Mode //! AF2 Area Mode when Contrast Detect AF is off
constexpr TagDetails nikonAf2AreaMode[] = { constexpr TagDetails nikonAf2AreaModeContrastDetectAfOff[] = {
{0, N_("Single-point AF")}, {0, N_("Single-point AF")},
{1, N_("Dynamic-area AF")}, {1, N_("Dynamic-area AF")},
{2, N_("Closest Subject")}, {2, N_("Closest Subject")},
@ -766,6 +766,12 @@ constexpr TagDetails nikonAf2AreaMode[] = {
{17, N_("Group-area AF (VL)")}, {17, N_("Group-area AF (VL)")},
}; };
//! AF2 Area Mode when Contrast Detect AF is on
constexpr TagDetails nikonAf2AreaModeContrastDetectAfOn[] = {
{0, N_("Contrast AF")}, {1, N_("Normal-area AF")}, {2, N_("Wide-area AF")},
{3, N_("Face-priority AF")}, {4, N_("Subject-tracking AF")}, {5, N_("Pinpoint AF")},
};
//! AfPoint //! AfPoint
constexpr TagDetails nikonAfPoint[] = { constexpr TagDetails nikonAfPoint[] = {
{0, N_("Center")}, {1, N_("Top")}, {2, N_("Bottom")}, {3, N_("Mid-left")}, {0, N_("Center")}, {1, N_("Top")}, {2, N_("Bottom")}, {3, N_("Mid-left")},
@ -810,7 +816,7 @@ constexpr TagInfo Nikon3MakerNote::tagInfoAf21_[] = {
{4, "ContrastDetectAF", N_("Contrast Detect AF"), N_("Contrast detect AF"), IfdId::nikonAf21Id, {4, "ContrastDetectAF", N_("Contrast Detect AF"), N_("Contrast detect AF"), IfdId::nikonAf21Id,
SectionId::makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonOffOn)}, SectionId::makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonOffOn)},
{5, "AFAreaMode", N_("AF Area Mode"), N_("AF area mode"), IfdId::nikonAf21Id, SectionId::makerTags, unsignedByte, 1, {5, "AFAreaMode", N_("AF Area Mode"), N_("AF area mode"), IfdId::nikonAf21Id, SectionId::makerTags, unsignedByte, 1,
EXV_PRINT_TAG(nikonAf2AreaMode)}, printAf2AreaMode},
{6, "PhaseDetectAF", N_("Phase Detect AF"), N_("Phase detect AF"), IfdId::nikonAf21Id, SectionId::makerTags, {6, "PhaseDetectAF", N_("Phase Detect AF"), N_("Phase detect AF"), IfdId::nikonAf21Id, SectionId::makerTags,
unsignedByte, 1, EXV_PRINT_TAG(nikonPhaseDetectAF)}, unsignedByte, 1, EXV_PRINT_TAG(nikonPhaseDetectAF)},
{7, "PrimaryAFPoint", N_("Primary AF Point"), N_("Primary AF point"), IfdId::nikonAf21Id, SectionId::makerTags, {7, "PrimaryAFPoint", N_("Primary AF Point"), N_("Primary AF point"), IfdId::nikonAf21Id, SectionId::makerTags,
@ -1766,6 +1772,21 @@ std::ostream& Nikon3MakerNote::print0x0002(std::ostream& os, const Value& value,
return os; return os;
} }
std::ostream& Nikon3MakerNote::printAf2AreaMode(std::ostream& os, const Value& value, const ExifData* metadata) {
int contrastDetectAF = 0;
if (metadata) {
auto pos = metadata->findKey(ExifKey("Exif.NikonAf2.ContrastDetectAF"));
if (pos != metadata->end() && pos->count() != 0) {
contrastDetectAF = pos->toUint32();
}
}
if (contrastDetectAF == 0)
return EXV_PRINT_TAG(nikonAf2AreaModeContrastDetectAfOff)(os, value, nullptr);
else
return EXV_PRINT_TAG(nikonAf2AreaModeContrastDetectAfOn)(os, value, nullptr);
}
std::ostream& Nikon3MakerNote::print0x0007(std::ostream& os, const Value& value, const ExifData*) { std::ostream& Nikon3MakerNote::print0x0007(std::ostream& os, const Value& value, const ExifData*) {
std::string focus = value.toString(); std::string focus = value.toString();
if (focus == "AF-C ") if (focus == "AF-C ")

@ -144,6 +144,8 @@ class Nikon3MakerNote {
//@{ //@{
//! Print ISO setting //! Print ISO setting
static std::ostream& print0x0002(std::ostream& os, const Value& value, const ExifData*); static std::ostream& print0x0002(std::ostream& os, const Value& value, const ExifData*);
//! Print AF2 Area Mode
static std::ostream& printAf2AreaMode(std::ostream& os, const Value& value, const ExifData* metadata);
//! Print autofocus mode //! Print autofocus mode
static std::ostream& print0x0007(std::ostream& os, const Value& value, const ExifData*); static std::ostream& print0x0007(std::ostream& os, const Value& value, const ExifData*);
//! Print lens type //! Print lens type

@ -149,7 +149,7 @@ Exif.NikonMe.MultiExposureAutoGain Long 1 0 Off
Exif.Nikon3.HighISONoiseReduction Short 1 0 Off Exif.Nikon3.HighISONoiseReduction Short 1 0 Off
Exif.NikonAf2.Version Undefined 4 48 49 48 48 1.00 Exif.NikonAf2.Version Undefined 4 48 49 48 48 1.00
Exif.NikonAf2.ContrastDetectAF Byte 1 1 On Exif.NikonAf2.ContrastDetectAF Byte 1 1 On
Exif.NikonAf2.AFAreaMode Byte 1 2 Closest Subject Exif.NikonAf2.AFAreaMode Byte 1 2 Wide-area AF
Exif.NikonAf2.PhaseDetectAF Byte 1 0 Off Exif.NikonAf2.PhaseDetectAF Byte 1 0 Off
Exif.NikonAf2.PrimaryAFPoint Byte 1 0 0 Exif.NikonAf2.PrimaryAFPoint Byte 1 0 0
Exif.NikonAf2.AFPointsUsed Byte 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Exif.NikonAf2.AFPointsUsed Byte 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Loading…
Cancel
Save