@ -25,6 +25,7 @@
# include "tags_int.hpp"
# include "tiffcomposite_int.hpp"
# include "value.hpp"
# include "exif.hpp"
# include "i18n.h" // NLS support.
// + standard includes
@ -791,14 +792,29 @@ namespace Exiv2 {
return tagInfoCs2_ ;
}
//! Lookup table to translate Sony2Fp AF Area Mode values to readable labels
constexpr TagDetails sony2FpAFAreaMode [ ] = {
{ 0 , N_ ( " Multi " ) } ,
{ 1 , N_ ( " Center " ) } ,
{ 2 , N_ ( " Spot " ) } ,
{ 3 , N_ ( " Flexible Spot " ) } ,
{ 10 , N_ ( " Selective (for Miniature effect) " ) } ,
{ 11 , N_ ( " Zone " ) } ,
{ 12 , N_ ( " Expanded Flexible Spot " ) } ,
{ 14 , N_ ( " Tracking " ) } ,
{ 15 , N_ ( " Face Tracking " ) } ,
{ 20 , N_ ( " Animal Eye Tracking " ) } ,
{ 255 , N_ ( " Manual " ) }
} ;
//! Sony Tag 9402 Sony2Fp (FocusPosition)
constexpr TagInfo SonyMakerNote : : tagInfoFp_ [ ] = {
{ 0x04 , " AmbientTemperature " , N_ ( " Ambient Temperature " ) , N_ ( " Ambient Temperature " ) , sony2FpId , makerTags , signedByte , 1 , printValue } ,
{ 0x16 , " FocusMode " , N_ ( " Focus Mode " ) , N_ ( " Focus Mode " ) , sony2FpId , makerTags , unsignedByte , 1 , printValue } ,
{ 0x17 , " AFAreaMode " , N_ ( " AF Area Mode " ) , N_ ( " AF Area Mode " ) , sony2FpId , makerTags , unsignedByte , 1 , printValue } ,
{ 0x2d , " FocusPosition2 " , N_ ( " Focus Position 2 " ) , N_ ( " Focus Position 2 " ) , sony2FpId , makerTags , unsignedByte , 1 , printValue } ,
{ 0x04 , " AmbientTemperature " , N_ ( " Ambient t emperature" ) , N_ ( " Temperature of the surroundings (in degrees Celsius) " ) , sony2FpId , makerTags , signedByte , 1 , print TemperatureInDegC } ,
{ 0x16 , " FocusMode " , N_ ( " Focus mode" ) , N_ ( " Focus mode " ) , sony2FpId , makerTags , unsignedByte , 1 , print Sony2FpFocusMod e} ,
{ 0x17 , " AFAreaMode " , N_ ( " AF area mode" ) , N_ ( " Auto focus area mode " ) , sony2FpId , makerTags , unsignedByte , 1 , EXV_PRINT_TAG( sony2FpAFAreaMode ) } ,
{ 0x2d , " FocusPosition2 " , N_ ( " Focus position 2" ) , N_ ( " Focus position 2 " ) , sony2FpId , makerTags , unsignedByte , 1 , print Sony2FpFocusPosition2 } ,
// End of list marker
{ 0xffff , " (Unknownsony2FpTag) " , " (Unknownsony2FpTag) " , " (Unknownsony2FpTag) " , sony2FpId , makerTags , unsignedByte , 1 , printValue } ,
{ 0xffff , " (Unknown Sony2FpTag)" , " (UnknownSony2FpTag) " , " (UnknownSony2FpTag) " , sony2FpId , makerTags , unsignedByte , 1 , printValue } ,
} ;
const TagInfo * SonyMakerNote : : tagListFp ( )
@ -806,6 +822,57 @@ namespace Exiv2 {
return tagInfoFp_ ;
}
std : : ostream & SonyMakerNote : : printSony2FpFocusMode ( std : : ostream & os , const Value & value , const ExifData * )
{
if ( value . count ( ) ! = 1 )
os < < value ;
else {
long val = ( value . toLong ( ) & 0x7F ) ;
if ( val = = 0 )
os < < N_ ( " Manual " ) ;
else if ( val = = 2 )
os < < N_ ( " AF-S " ) ;
else if ( val = = 3 )
os < < N_ ( " AF-C " ) ;
else if ( val = = 4 )
os < < N_ ( " AF-A " ) ;
else if ( val = = 6 )
os < < N_ ( " DMF " ) ;
else
os < < " ( " < < val < < " ) " ;
}
return os ;
}
std : : ostream & SonyMakerNote : : printSony2FpFocusPosition2 ( std : : ostream & os , const Value & value , const ExifData * metadata )
{
if ( value . count ( ) ! = 1 )
os < < " ( " < < value < < " ) " ;
else {
auto pos = metadata - > findKey ( ExifKey ( " Exif.Image.Model " ) ) ;
if ( pos = = metadata - > end ( ) )
return os < < " ( " < < value < < " ) " ;
// Ranges of models that do not support this tag
const char * models [ ] = { " DSC- " , " Stellar " } ;
std : : string model = pos - > toString ( ) ;
for ( auto & & m : models ) {
if ( model . find ( m ) = = 0 ) {
os < < N_ ( " n/a " ) ;
return os ;
}
}
long val = value . toLong ( ) ;
if ( val = = 255 )
os < < N_ ( " Infinity " ) ;
else
os < < val ;
}
return os ;
}
//! Sony Tag 9403 SonyMisc1
constexpr TagInfo SonyMakerNote : : tagInfoSonyMisc1_ [ ] = {
{ 0x05 , " CameraTemperature " , N_ ( " Camera temperature " ) ,