@@ -744,8 +744,8 @@ constexpr TagDetails nikonAfAreaMode[] = {
744744 {3 , N_ (" Group Dynamic" )}, {4 , N_ (" Single Area (wide)" )}, {5 , N_ (" Dynamic Area (wide)" )},
745745};
746746
747- // ! AF2 Area Mode
748- constexpr TagDetails nikonAf2AreaMode [] = {
747+ // ! AF2 Area Mode when Contrast Detect AF is off
748+ constexpr TagDetails nikonAf2AreaModeContrastDetectAfOff [] = {
749749 {0 , N_ (" Single-point AF" )},
750750 {1 , N_ (" Dynamic-area AF" )},
751751 {2 , N_ (" Closest Subject" )},
@@ -766,6 +766,12 @@ constexpr TagDetails nikonAf2AreaMode[] = {
766766 {17 , N_ (" Group-area AF (VL)" )},
767767};
768768
769+ // ! AF2 Area Mode when Contrast Detect AF is on
770+ constexpr TagDetails nikonAf2AreaModeContrastDetectAfOn[] = {
771+ {0 , N_ (" Contrast AF" )}, {1 , N_ (" Normal-area AF" )}, {2 , N_ (" Wide-area AF" )},
772+ {3 , N_ (" Face-priority AF" )}, {4 , N_ (" Subject-tracking AF" )}, {5 , N_ (" Pinpoint AF" )},
773+ };
774+
769775// ! AfPoint
770776constexpr TagDetails nikonAfPoint[] = {
771777 {0 , N_ (" Center" )}, {1 , N_ (" Top" )}, {2 , N_ (" Bottom" )}, {3 , N_ (" Mid-left" )},
@@ -810,7 +816,7 @@ constexpr TagInfo Nikon3MakerNote::tagInfoAf21_[] = {
810816 {4 , " ContrastDetectAF" , N_ (" Contrast Detect AF" ), N_ (" Contrast detect AF" ), IfdId::nikonAf21Id,
811817 SectionId::makerTags, unsignedByte, 1 , EXV_PRINT_TAG (nikonOffOn)},
812818 {5 , " AFAreaMode" , N_ (" AF Area Mode" ), N_ (" AF area mode" ), IfdId::nikonAf21Id, SectionId::makerTags, unsignedByte, 1 ,
813- EXV_PRINT_TAG (nikonAf2AreaMode) },
819+ printAf2AreaMode },
814820 {6 , " PhaseDetectAF" , N_ (" Phase Detect AF" ), N_ (" Phase detect AF" ), IfdId::nikonAf21Id, SectionId::makerTags,
815821 unsignedByte, 1 , EXV_PRINT_TAG (nikonPhaseDetectAF)},
816822 {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,
17661772 return os;
17671773}
17681774
1775+ std::ostream& Nikon3MakerNote::printAf2AreaMode (std::ostream& os, const Value& value, const ExifData* metadata) {
1776+ int contrastDetectAF = 0 ;
1777+ if (metadata) {
1778+ auto pos = metadata->findKey (ExifKey (" Exif.NikonAf2.ContrastDetectAF" ));
1779+ if (pos != metadata->end () && pos->count () != 0 ) {
1780+ contrastDetectAF = pos->toUint32 ();
1781+ }
1782+ }
1783+
1784+ if (contrastDetectAF == 0 )
1785+ return EXV_PRINT_TAG (nikonAf2AreaModeContrastDetectAfOff)(os, value, nullptr );
1786+ else
1787+ return EXV_PRINT_TAG (nikonAf2AreaModeContrastDetectAfOn)(os, value, nullptr );
1788+ }
1789+
17691790std::ostream& Nikon3MakerNote::print0x0007 (std::ostream& os, const Value& value, const ExifData*) {
17701791 std::string focus = value.toString ();
17711792 if (focus == " AF-C " )
0 commit comments