@@ -3438,7 +3438,7 @@ std::ostream& Nikon3MakerNote::printExternalFlashData1Fl6(std::ostream& os, cons
34383438
34393439 if (v0 & 0x01 ) {
34403440 std::ostringstream ossTemp;
3441- printTagBitmask< std::size (nikonFlashAdaptors), nikonFlashAdaptors> (ossTemp, value, metadata);
3441+ EXV_PRINT_TAG_BITMASK (nikonFlashAdaptors)(ossTemp, value, metadata);
34423442 std::string tempStr = ossTemp.str ();
34433443 if (!tempStr.empty ()) {
34443444 os << " , " << tempStr;
@@ -3464,7 +3464,7 @@ std::ostream& Nikon3MakerNote::printExternalFlashData2Fl6(std::ostream& os, cons
34643464
34653465 if (v0 & 0x80 ) {
34663466 os << " , " ;
3467- printTag< std::size (nikonFlashControlMode), nikonFlashControlMode> (os, (value.toUint32 () & 0x0F ), metadata);
3467+ EXV_PRINT_TAG (nikonFlashControlMode)(os, (value.toUint32 () & 0x0F ), metadata);
34683468 }
34693469 os.copyfmt (oss);
34703470 os.flags (f);
@@ -3489,7 +3489,7 @@ std::ostream& Nikon3MakerNote::printExternalFlashData1Fl7(std::ostream& os, cons
34893489 os << (v0 & 0x80 ? _ (" External flash zoom override" ) : _ (" No external flash zoom override" ));
34903490
34913491 std::ostringstream ossTemp;
3492- printTagBitmask< std::size (nikonFlashAdaptors), nikonFlashAdaptors> (ossTemp, value, metadata);
3492+ EXV_PRINT_TAG_BITMASK (nikonFlashAdaptors)(ossTemp, value, metadata);
34933493 std::string tempStr = ossTemp.str ();
34943494 if (!tempStr.empty ()) {
34953495 os << " , " << tempStr;
@@ -3501,17 +3501,9 @@ std::ostream& Nikon3MakerNote::printExternalFlashData1Fl7(std::ostream& os, cons
35013501}
35023502
35033503std::ostream& Nikon3MakerNote::printExternalFlashData2 (std::ostream& os, const Value& value, const ExifData* metadata) {
3504- std::ios::fmtflags f (os.flags ());
3505- if (value.count () != 1 || value.typeId () != unsignedByte) {
3506- os << " (" << value << " )" ;
3507- os.flags (f);
3508- return os;
3509- }
3510-
3511- printTag<std::size (nikonFlashControlMode), nikonFlashControlMode>(os, (value.toUint32 () & 0x0F ), metadata);
3512-
3513- os.flags (f);
3514- return os;
3504+ if (value.count () != 1 || value.typeId () != unsignedByte)
3505+ return os << " (" << value << " )" ;
3506+ return EXV_PRINT_TAG (nikonFlashControlMode)(os, (value.toUint32 () & 0x0F ), metadata);
35153507}
35163508
35173509std::ostream& Nikon3MakerNote::printFlashMasterDataFl6 (std::ostream& os, const Value& value, const ExifData* metadata) {
@@ -3573,20 +3565,9 @@ std::ostream& Nikon3MakerNote::printFlashMasterDataFl7(std::ostream& os, const V
35733565}
35743566
35753567std::ostream& Nikon3MakerNote::printFlashGroupAControlData (std::ostream& os, const Value& value, const ExifData* data) {
3576- std::ios::fmtflags f (os.flags ());
3577- if (value.count () != 1 || value.typeId () != unsignedByte) {
3578- os << " (" << value << " )" ;
3579- os.flags (f);
3580- return os;
3581- }
3582- std::ostringstream oss;
3583- oss.copyfmt (os);
3584-
3585- printTag<std::size (nikonFlashControlMode), nikonFlashControlMode>(os, (value.toUint32 () & 0x0F ), data);
3586-
3587- os.copyfmt (oss);
3588- os.flags (f);
3589- return os;
3568+ if (value.count () != 1 || value.typeId () != unsignedByte)
3569+ return os << " (" << value << " )" ;
3570+ return EXV_PRINT_TAG (nikonFlashControlMode)(os, (value.toUint32 () & 0x0F ), data);
35903571}
35913572
35923573std::ostream& Nikon3MakerNote::printFlashGroupBCControlData (std::ostream& os, const Value& value,
@@ -3601,9 +3582,9 @@ std::ostream& Nikon3MakerNote::printFlashGroupBCControlData(std::ostream& os, co
36013582 oss.copyfmt (os);
36023583 const auto temp = value.toUint32 ();
36033584
3604- printTag< std::size (nikonFlashControlMode), nikonFlashControlMode> (os, (temp >> 4 ), data);
3585+ EXV_PRINT_TAG (nikonFlashControlMode)(os, (temp >> 4 ), data);
36053586 os << " , " ;
3606- printTag< std::size (nikonFlashControlMode), nikonFlashControlMode> (os, (temp & 0x0f ), data);
3587+ EXV_PRINT_TAG (nikonFlashControlMode)(os, (temp & 0x0f ), data);
36073588
36083589 os.copyfmt (oss);
36093590 os.flags (f);
@@ -3785,17 +3766,9 @@ std::ostream& Nikon3MakerNote::printFlashGroupCDataFl7(std::ostream& os, const V
37853766}
37863767
37873768std::ostream& Nikon3MakerNote::printExternalFlashData3 (std::ostream& os, const Value& value, const ExifData* data) {
3788- std::ios::fmtflags f (os.flags ());
3789- if (value.count () != 1 || value.typeId () != unsignedByte) {
3790- os << " (" << value << " )" ;
3791- os.flags (f);
3792- return os;
3793- }
3794-
3795- printTag<std::size (nikonFlashExposureComp), nikonFlashExposureComp>(os, (value.toUint32 (0 ) & 0x04 ), data);
3796-
3797- os.flags (f);
3798- return os;
3769+ if (value.count () != 1 || value.typeId () != unsignedByte)
3770+ return os << " (" << value << " )" ;
3771+ return EXV_PRINT_TAG (nikonFlashExposureComp)(os, (value.toUint32 (0 ) & 0x04 ), data);
37993772}
38003773
38013774std::ostream& Nikon3MakerNote::printCameraExposureCompensation (std::ostream& os, const Value& value, const ExifData*) {
@@ -3811,30 +3784,17 @@ std::ostream& Nikon3MakerNote::printCameraExposureCompensation(std::ostream& os,
38113784}
38123785
38133786std::ostream& Nikon3MakerNote::printExternalFlashData4 (std::ostream& os, const Value& value, const ExifData* metadata) {
3814- std::ios::fmtflags f (os.flags ());
3815- if (value.count () != 1 || value.typeId () != unsignedByte) {
3816- os << " (" << value << " )" ;
3817- os.flags (f);
3818- return os;
3819- }
3820-
3821- printTag<std::size (nikonFlashIlluminationPat), nikonFlashIlluminationPat>(os, value.toUint32 (0 ), metadata);
3822-
3823- os.flags (f);
3824- return os;
3787+ if (value.count () != 1 || value.typeId () != unsignedByte)
3788+ return os << " (" << value << " )" ;
3789+ return EXV_PRINT_TAG (nikonFlashIlluminationPat)(os, value.toUint32 (0 ), metadata);
38253790}
38263791
38273792std::ostream& Nikon3MakerNote::printFlashZoomHeadPosition (std::ostream& os, const Value& value, const ExifData*) {
3828- if (value.count () != 1 || value.typeId () != unsignedByte) {
3793+ if (value.count () != 1 || value.typeId () != unsignedByte)
38293794 return os << " (" << value << " )" ;
3830- }
3831-
3832- auto v0 = value.toUint32 (0 );
3833- if (v0 == 0 ) {
3834- return os << _ (" n/a" );
3835- }
3836-
3837- return os << stringFormat (" {} mm" , v0);
3795+ if (auto v0 = value.toUint32 (0 ))
3796+ return os << stringFormat (" {} mm" , v0);
3797+ return os << _ (" n/a" );
38383798}
38393799
38403800std::ostream& Nikon3MakerNote::printTimeZone (std::ostream& os, const Value& value, const ExifData*) {
0 commit comments