@ -1465,6 +1465,37 @@ namespace Exiv2 {
return tagInfoLd3_ ;
}
// Nikon3 Lens Data 4 Tag Info
// based on https://exiftool.org/TagNames/Nikon.html#LensData0800
const TagInfo Nikon3MakerNote : : tagInfoLd4_ [ ] = {
TagInfo ( 0 , " Version " , N_ ( " Version " ) , N_ ( " Version " ) , nikonLd4Id , makerTags , undefined , 4 , printExifVersion ) ,
TagInfo ( 4 , " ExitPupilPosition " , N_ ( " Exit Pupil Position " ) , N_ ( " Exit pupil position " ) , nikonLd4Id , makerTags , unsignedByte , 1 , printExitPupilPosition ) ,
TagInfo ( 5 , " AFAperture " , N_ ( " AF Aperture " ) , N_ ( " AF aperture " ) , nikonLd4Id , makerTags , unsignedByte , 1 , printAperture ) ,
TagInfo ( 9 , " FocusPosition " , N_ ( " Focus Position " ) , N_ ( " Focus position " ) , nikonLd4Id , makerTags , unsignedByte , 1 , printValue ) ,
TagInfo ( 11 , " FocusDistance " , N_ ( " Focus Distance " ) , N_ ( " Focus distance " ) , nikonLd4Id , makerTags , unsignedByte , 1 , printFocusDistance ) ,
TagInfo ( 12 , " FocalLength " , N_ ( " Focal Length " ) , N_ ( " Focal length " ) , nikonLd4Id , makerTags , unsignedByte , 1 , printFocal ) ,
TagInfo ( 13 , " LensIDNumber " , N_ ( " Lens ID Number " ) , N_ ( " Lens ID number " ) , nikonLd4Id , makerTags , unsignedByte , 1 , printLensId4 ) ,
TagInfo ( 14 , " LensFStops " , N_ ( " Lens F-Stops " ) , N_ ( " Lens F-stops " ) , nikonLd4Id , makerTags , unsignedByte , 1 , printFStops ) ,
TagInfo ( 15 , " MinFocalLength " , N_ ( " Min Focal Length " ) , N_ ( " Min focal length " ) , nikonLd4Id , makerTags , unsignedByte , 1 , printFocal ) ,
TagInfo ( 16 , " MaxFocalLength " , N_ ( " Max Focal Length " ) , N_ ( " Max focal length " ) , nikonLd4Id , makerTags , unsignedByte , 1 , printFocal ) ,
TagInfo ( 17 , " MaxApertureAtMinFocal " , N_ ( " Max Aperture At Min Focal " ) , N_ ( " Max aperture at min focal length " ) , nikonLd4Id , makerTags , unsignedByte , 1 , printAperture ) ,
TagInfo ( 18 , " MaxApertureAtMaxFocal " , N_ ( " Max Aperture At Max Focal " ) , N_ ( " Max aperture at max focal length " ) , nikonLd4Id , makerTags , unsignedByte , 1 , printAperture ) ,
TagInfo ( 19 , " MCUVersion " , N_ ( " MCU Version " ) , N_ ( " MCU version " ) , nikonLd4Id , makerTags , unsignedByte , 1 , printValue ) ,
TagInfo ( 20 , " EffectiveMaxAperture " , N_ ( " Effective Max Aperture " ) , N_ ( " Effective max aperture " ) , nikonLd4Id , makerTags , unsignedByte , 1 , printAperture ) ,
TagInfo ( 48 , " LensID " , N_ ( " LensID " ) , N_ ( " Lens ID " ) , nikonLd4Id , makerTags , unsignedShort , 1 , printLensId4ZMount ) ,
TagInfo ( 54 , " MaxAperture " , N_ ( " Max Aperture " ) , N_ ( " Max aperture " ) , nikonLd4Id , makerTags , unsignedShort , 1 , printApertureLd4 ) ,
TagInfo ( 56 , " FNumber " , N_ ( " F-Number " ) , N_ ( " F-Number " ) , nikonLd4Id , makerTags , unsignedShort , 1 , printApertureLd4 ) ,
TagInfo ( 60 , " FocalLength " , N_ ( " Focal Length " ) , N_ ( " Focal length " ) , nikonLd4Id , makerTags , unsignedShort , 1 , printFocalLd4 ) ,
TagInfo ( 79 , " FocusDistance " , N_ ( " Focus Distance " ) , N_ ( " Focus distance " ) , nikonLd4Id , makerTags , unsignedByte , 1 , printFocusDistance ) ,
// End of list marker
TagInfo ( 0xffff , " (UnknownNikonLd4Tag) " , " (UnknownNikonLd4Tag) " , N_ ( " Unknown Nikon Lens Data 3 Tag " ) , nikonLd4Id , makerTags , unsignedByte , 1 , printValue )
} ;
const TagInfo * Nikon3MakerNote : : tagListLd4 ( )
{
return tagInfoLd4_ ;
}
std : : ostream & Nikon3MakerNote : : printIiIso ( std : : ostream & os ,
const Value & value ,
const ExifData * )
@ -1790,6 +1821,13 @@ namespace Exiv2 {
return testConfigFile ( os , value ) ? os : printLensId ( os , value , metadata , " NikonLd3 " ) ;
}
std : : ostream & Nikon3MakerNote : : printLensId4 ( std : : ostream & os ,
const Value & value ,
const ExifData * metadata )
{
return testConfigFile ( os , value ) ? os : printLensId ( os , value , metadata , " NikonLd4 " ) ;
}
std : : ostream & Nikon3MakerNote : : printLensId ( std : : ostream & os ,
const Value & value ,
const ExifData * metadata ,
@ -2876,4 +2914,71 @@ fmountlens[] = {
return os < < s ;
}
std : : ostream & Nikon3MakerNote : : printLensId4ZMount ( std : : ostream & os ,
const Value & value ,
const ExifData * )
{
if ( value . count ( ) ! = 1 | | value . typeId ( ) ! = unsignedShort ) {
return os < < " ( " < < value < < " ) " ;
}
// from https://github.com/exiftool/exiftool/blob/12.12/lib/Image/ExifTool/Nikon.pm#L4646
static const struct ZMntLens { uint16_t lid ; const char * manuf , * lensname ; }
zmountlens [ ] = {
{ 1 , " Nikon " , " Nikkor Z 24-70mm f/4 S " } ,
{ 2 , " Nikon " , " Nikkor Z 14-30mm f/4 S " } ,
{ 4 , " Nikon " , " Nikkor Z 35mm f/1.8 S " } ,
{ 8 , " Nikon " , " Nikkor Z 58mm f/0.95 S Noct " } , //IB
{ 9 , " Nikon " , " Nikkor Z 50mm f/1.8 S " } ,
{ 11 , " Nikon " , " Nikkor Z DX 16-50mm f/3.5-6.3 VR " } ,
{ 12 , " Nikon " , " Nikkor Z DX 50-250mm f/4.5-6.3 VR " } ,
{ 13 , " Nikon " , " Nikkor Z 24-70mm f/2.8 S " } ,
{ 14 , " Nikon " , " Nikkor Z 85mm f/1.8 S " } ,
{ 15 , " Nikon " , " Nikkor Z 24mm f/1.8 S " } , //IB
{ 16 , " Nikon " , " Nikkor Z 70-200mm f/2.8 VR S " } , //IB
{ 17 , " Nikon " , " Nikkor Z 20mm f/1.8 S " } , //IB
{ 18 , " Nikon " , " Nikkor Z 24-200mm f/4-6.3 VR " } , //IB
{ 21 , " Nikon " , " Nikkor Z 50mm f/1.2 S " } , //IB
{ 22 , " Nikon " , " Nikkor Z 24-50mm f/4-6.3 " } , //IB
{ 23 , " Nikon " , " Nikkor Z 14-24mm f/2.8 S " } , //IB
{ 0 , " " , " " } //end of array
} ;
uint16_t lid = static_cast < uint16_t > ( value . toLong ( ) ) ;
for ( int i = 0 ; zmountlens [ i ] . lid ! = 0 ; + + i ) {
if ( zmountlens [ i ] . lid = = lid ) return os < < zmountlens [ i ] . manuf < < " " < < zmountlens [ i ] . lensname ;
}
return os < < lid ;
}
std : : ostream & Nikon3MakerNote : : printApertureLd4 ( std : : ostream & os ,
const Value & value ,
const ExifData * )
{
if ( value . count ( ) ! = 1 | | value . typeId ( ) ! = unsignedShort ) {
return os < < " ( " < < value < < " ) " ;
}
double aperture = pow ( 2.0 , value . toLong ( ) / 384.0 - 1.0 ) ;
std : : ostringstream oss ;
oss . copyfmt ( os ) ;
os < < std : : fixed < < std : : setprecision ( 1 ) < < " F " < < aperture ;
os . copyfmt ( oss ) ;
return os ;
}
std : : ostream & Nikon3MakerNote : : printFocalLd4 ( std : : ostream & os ,
const Value & value ,
const ExifData * )
{
if ( value . count ( ) ! = 1 | | value . typeId ( ) ! = unsignedShort ) {
return os < < " ( " < < value < < " ) " ;
}
std : : ostringstream oss ;
oss . copyfmt ( os ) ;
os < < std : : fixed < < std : : setprecision ( 1 ) < < value . toLong ( ) < < " mm " ;
os . copyfmt ( oss ) ;
return os ;
}
} } // namespace Internal, Exiv2