Exiv2
pentaxmn_int.hpp
Go to the documentation of this file.
1 // ***************************************************************** -*- C++ -*-
2 /*
3  * Copyright (C) 2004-2018 Exiv2 authors
4  * This program is part of the Exiv2 distribution.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
19  */
27 #ifndef PENTAXMN_INT_HPP_
28 #define PENTAXMN_INT_HPP_
29 
30 // *****************************************************************************
31 // included header files
32 #include "tags.hpp"
33 #include "tags_int.hpp"
34 #include "types.hpp"
35 
36 // + standard includes
37 #include <iostream>
38 #include <iomanip>
39 
40 // *****************************************************************************
41 // namespace extensions
42 namespace Exiv2 {
43  namespace Internal {
44 
45 // *****************************************************************************
46 // class definitions
47 
50  public:
52  static const TagInfo* tagList();
53 
55  static std::ostream& printVersion(std::ostream& os, const Value& value, const ExifData*);
57  static std::ostream& printResolution(std::ostream& os, const Value& value, const ExifData*);
59  static std::ostream& printDate(std::ostream& os, const Value& value, const ExifData*);
61  static std::ostream& printTime(std::ostream& os, const Value& value, const ExifData*);
63  static std::ostream& printExposure(std::ostream& os, const Value& value, const ExifData*);
65  static std::ostream& printFValue(std::ostream& os, const Value& value, const ExifData*);
67  static std::ostream& printFocalLength(std::ostream& os, const Value& value, const ExifData*);
69  static std::ostream& printCompensation(std::ostream& os, const Value& value, const ExifData*);
71  static std::ostream& printTemperature(std::ostream& os, const Value& value, const ExifData*);
73  static std::ostream& printFlashCompensation(std::ostream& os, const Value& value, const ExifData*);
75  static std::ostream& printBracketing(std::ostream& os, const Value& value, const ExifData*);
77  static std::ostream& printShutterCount(std::ostream& os, const Value& value, const ExifData*);
78 
79  private:
81  static const TagInfo tagInfo_[];
82  }; // class PentaxMakerNote
83 
88  template <int N, const TagDetails (&array)[N], int count, int ignoredcount, int ignoredcountmax>
89  std::ostream& printCombiTag(std::ostream& os, const Value& value, const ExifData* metadata)
90  {
91  std::ios::fmtflags f( os.flags() );
92  if ((value.count() != count && (value.count() < (count + ignoredcount) || value.count() > (count + ignoredcountmax))) || count > 4) {
93  return printValue(os, value, metadata);
94  }
95  unsigned long l = 0;
96  for (int c = 0; c < count; ++c) {
97  if (value.toLong(c) < 0 || value.toLong(c) > 255) {
98  return printValue(os, value, metadata);
99  }
100  l += (value.toLong(c) << ((count - c - 1) * 8));
101  }
102  const TagDetails* td = find(array, l);
103  if (td) {
104  os << exvGettext(td->label_);
105  }
106  else {
107  os << exvGettext("Unknown") << " (0x"
108  << std::setw(2 * count) << std::setfill('0')
109  << std::hex << l << std::dec << ")";
110  }
111 
112  os.flags(f);
113  return os;
114  }
115 
117 #define EXV_PRINT_COMBITAG(array, count, ignoredcount) printCombiTag<EXV_COUNTOF(array), array, count, ignoredcount, ignoredcount>
118 #define EXV_PRINT_COMBITAG_MULTI(array, count, ignoredcount, ignoredcountmax) printCombiTag<EXV_COUNTOF(array), array, count, ignoredcount, ignoredcountmax>
120 
121  } // namespace Internal
122 } // namespace Exiv2
123 
124 
125 #endif // #ifndef PENTAXMN_INT_HPP_
pentaxmn_int.hpp
Pentax MakerNote implemented according to the specification http://www.gvsoft.homedns....
Exiv2::Internal::pentaxFlash
const TagDetails pentaxFlash[]
Flash, tag 0x000c.
Exiv2::Internal::TagDetails
Helper structure for lookup tables for translations of numeric tag values to human readable labels.
Definition: tags_int.hpp:188
Exiv2::Internal::PentaxMakerNote::tagList
static const TagInfo * tagList()
Return read-only list of built-in Pentaxfilm tags.
Definition: pentaxmn_int.cpp:1695
Exiv2::Internal::PentaxMakerNote::printBracketing
static std::ostream & printBracketing(std::ostream &os, const Value &value, const ExifData *)
Print Pentax bracketing.
Definition: pentaxmn_int.cpp:1111
Exiv2::Internal::pentaxFocus
const TagDetails pentaxFocus[]
Focus, tag 0x000d.
Exiv2::Internal::pentaxDynamicRangeExpansion
const TagDetails pentaxDynamicRangeExpansion[]
DynamicRangeExpansion, tag 0x0069.
exif.hpp
Encoding and decoding of Exif data.
Exiv2::Value::size
virtual long size() const =0
Return the size of the value in bytes.
Exiv2::ExifData::findKey
iterator findKey(const ExifKey &key)
Find the first Exifdatum with the given key, return an iterator to it.
Definition: exif.cpp:581
Exiv2::Value
Common interface for all types of values used with metadata.
Definition: value.hpp:60
Exiv2::Internal::printLensType
std::ostream & printLensType(std::ostream &os, const Value &value, const ExifData *metadata)
A lens id and a pretty-print function for special treatment of the id.
Definition: pentaxmn_int.cpp:1399
metadatum.hpp
Provides abstract base classes Metadatum and Key.
types.hpp
Type definitions for Exiv2 and related functionality.
Exiv2::ExifData::const_iterator
ExifMetadata::const_iterator const_iterator
ExifMetadata const iterator type.
Definition: exif.hpp:439
Exiv2::undefined
Exif UNDEFINED type, an 8-bit byte that may contain anything.
Definition: types.hpp:137
Exiv2::Value::typeId
TypeId typeId() const
Return the type identifier (Exif data format type).
Definition: value.hpp:113
Exiv2::Internal::PentaxMakerNote::printTemperature
static std::ostream & printTemperature(std::ostream &os, const Value &value, const ExifData *)
Print Pentax temperature.
Definition: pentaxmn_int.cpp:1095
Exiv2::Internal::pentaxContrast
const TagDetails pentaxContrast[]
Contrast, tag 0x0020.
Exiv2::exvGettext
const EXIV2API char * exvGettext(const char *str)
Translate a string using the gettext framework. This wrapper hides all the implementation details fro...
Definition: types.cpp:576
Exiv2::focalLength
EXIV2API ExifData::const_iterator focalLength(const ExifData &ed)
Return the focal length setting.
Definition: easyaccess.cpp:499
Exiv2::asciiString
Exif ASCII type, 8-bit byte.
Definition: types.hpp:132
Exiv2::Internal::pentaxSize
const TagDetails pentaxSize[]
Size, tag 0x0009.
Exiv2::Internal::pentaxWhiteBalanceMode
const TagDetails pentaxWhiteBalanceMode[]
WhiteBalance, tag 0x001a.
Exiv2::Internal::pentaxHighISONoiseReduction
const TagDetails pentaxHighISONoiseReduction[]
HighISONoiseReduction, tag 0x0071.
Exiv2::Internal::pentaxDriveMode
const TagDetails pentaxDriveMode[]
DriveMode, combi-tag 0x0034 (4 bytes)
Exiv2::Internal::pentaxSaturation
const TagDetails pentaxSaturation[]
Saturation, tag 0x001f.
Exiv2::Value::count
virtual long count() const =0
Return the number of components of the value.
Exiv2::ExifData::end
iterator end()
End of the metadata.
Definition: exif.hpp:492
Exiv2::Internal::pentaxLensType
const TagDetails pentaxLensType[]
LensType, combi-tag 0x003f (2 unsigned long)
Exiv2::unsignedLong
Exif LONG type, 32-bit (4-byte) unsigned integer.
Definition: types.hpp:134
Exiv2::Internal::PentaxMakerNote::printFlashCompensation
static std::ostream & printFlashCompensation(std::ostream &os, const Value &value, const ExifData *)
Print Pentax flash compensation.
Definition: pentaxmn_int.cpp:1101
Exiv2::Internal::pentaxImageProcessing
const TagDetails pentaxImageProcessing[]
ImageProcessing, combi-tag 0x0032 (4 bytes)
Exiv2::Internal::pentaxYesNo
const TagDetails pentaxYesNo[]
Generic for Yes/No switches.
Exiv2::Internal::pentaxAFPoint
const TagDetails pentaxAFPoint[]
AFPoint, tag 0x000e.
Exiv2::Internal::lensIdFct
const LensIdFct lensIdFct[]
List of lens ids which require special treatment with the medicine.
Definition: canonmn_int.cpp:1086
Exiv2::PrintFct
std::ostream &(* PrintFct)(std::ostream &, const Value &, const ExifData *pExifData)
Type for a function pointer for functions interpreting the tag value.
Definition: tags.hpp:57
Exiv2::Internal::pentaxCities
const TagDetails pentaxCities[]
City names, tags 0x0023 and 0x0024.
Exiv2::Internal::printCombiTag
std::ostream & printCombiTag(std::ostream &os, const Value &value, const ExifData *metadata)
Print function to translate Pentax "combi-values" to a description by looking up a reference table.
Definition: pentaxmn_int.hpp:89
Exiv2::Internal::PentaxMakerNote::printResolution
static std::ostream & printResolution(std::ostream &os, const Value &value, const ExifData *)
Print Pentax resolution.
Definition: pentaxmn_int.cpp:1026
Exiv2::Internal::pentaxModel
const TagDetails pentaxModel[]
CameraModel, tag 0x0005.
EXV_PRINT_TAG
#define EXV_PRINT_TAG(array)
Shortcut for the printTag template which requires typing the array name only once.
Definition: tags_int.hpp:241
Exiv2::Internal::pentaxQuality
const TagDetails pentaxQuality[]
Quality, tag 0x0008.
Exiv2::Internal::pentaxAFPointFocus
const TagDetails pentaxAFPointFocus[]
AFPointInFocus, tag 0x000f.
Exiv2::Internal::LensIdFct::id_
long id_
Lens id.
Definition: canonmn_int.cpp:1079
Exiv2::Internal::LensIdFct::fct_
PrintFct fct_
Pretty-print function Comparison operator for find template.
Definition: canonmn_int.cpp:1080
Exiv2::unsignedByte
Exif BYTE type, 8-bit unsigned integer.
Definition: types.hpp:131
Exiv2::Internal::PentaxMakerNote::printDate
static std::ostream & printDate(std::ostream &os, const Value &value, const ExifData *)
Print Pentax date.
Definition: pentaxmn_int.cpp:1037
Exiv2::Internal::pentaxImageTone
const TagDetails pentaxImageTone[]
ImageTone, tag 0x004f.
Exiv2::Internal::resolveLens0x8ff
std::ostream & resolveLens0x8ff(std::ostream &os, const Value &value, const ExifData *metadata)
resolveLens0x8ff print lens in human format
Definition: pentaxmn_int.cpp:1304
Exiv2::Internal::printValue
std::ostream & printValue(std::ostream &os, const Value &value, const ExifData *)
Default print function, using the Value output operator.
Definition: tags_int.cpp:2162
Exiv2::signedByte
Exif SBYTE type, an 8-bit signed (twos-complement) integer.
Definition: types.hpp:136
Exiv2::ExifKey
Concrete keys for Exif metadata and access to Exif tag reference data.
Definition: tags.hpp:148
Exiv2::Value::toString
std::string toString() const
Return the value as a string. Implemented in terms of write(std::ostream& os) const of the concrete c...
Definition: value.cpp:175
Exiv2::Internal::pentaxWhiteBalance
const TagDetails pentaxWhiteBalance[]
WhiteBalance, tag 0x0019.
Exiv2::Internal::PentaxMakerNote
MakerNote for Pentaxfilm cameras.
Definition: pentaxmn_int.hpp:49
Exiv2::Internal::TagDetails::label_
const char * label_
Translation of the tag value.
Definition: tags_int.hpp:190
Exiv2::Internal::pentaxPictureMode
const TagDetails pentaxPictureMode[]
PictureMode, combi-tag 0x0033 (3 bytes)
Exiv2::find
const T * find(T(&src)[N], const K &key)
Find an element that matches key in the array src.
Definition: types.hpp:508
Exiv2::Internal::LensIdFct
A lens id and a pretty-print function for special treatment of the id.
Definition: canonmn_int.cpp:1078
Exiv2::Value::toLong
virtual long toLong(long n=0) const =0
Convert the n-th component of the value to a long. The behaviour of this method may be undefined if t...
Exiv2::unsignedShort
Exif SHORT type, 16-bit (2-byte) unsigned integer.
Definition: types.hpp:133
Exiv2::Internal::resolveLens0x32c
std::ostream & resolveLens0x32c(std::ostream &os, const Value &value, const ExifData *metadata)
resolveLens0x32c print lens in human format
Definition: pentaxmn_int.cpp:1218
Exiv2::Internal::pentaxLocation
const TagDetails pentaxLocation[]
Location, tag 0x0022.
Exiv2::Internal::pentaxISO
const TagDetails pentaxISO[]
ISO, tag 0x0014.
Exiv2::Internal::pentaxMeteringMode
const TagDetails pentaxMeteringMode[]
MeteringMode, tag 0x0017.
makernote_int.hpp
Makernote factory and registry, IFD makernote header, and camera vendor specific makernote implementa...
Exiv2
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition: asfvideo.hpp:36
Exiv2::Internal::PentaxMakerNote::printFocalLength
static std::ostream & printFocalLength(std::ostream &os, const Value &value, const ExifData *)
Print Pentax focal length.
Definition: pentaxmn_int.cpp:1075
value.hpp
Value interface and concrete subclasses.
Exiv2::Internal::resolveLensType
std::ostream & resolveLensType(std::ostream &os, const Value &value, const ExifData *metadata)
resolveLensType print lens in human format
Definition: pentaxmn_int.cpp:1367
Exiv2::Internal::PentaxMakerNote::printFValue
static std::ostream & printFValue(std::ostream &os, const Value &value, const ExifData *)
Print Pentax F value.
Definition: pentaxmn_int.cpp:1066
Exiv2::signedLong
Exif SLONG type, a 32-bit (4-byte) signed (twos-complement) integer.
Definition: types.hpp:139
Exiv2::Internal::pentaxSharpness
const TagDetails pentaxSharpness[]
Sharpness, tag 0x0021.
Exiv2::TagInfo
Tag information.
Definition: tags.hpp:82
Exiv2::Internal::PentaxMakerNote::printTime
static std::ostream & printTime(std::ostream &os, const Value &value, const ExifData *)
Print Pentax time.
Definition: pentaxmn_int.cpp:1048
Exiv2::Internal::PentaxMakerNote::printVersion
static std::ostream & printVersion(std::ostream &os, const Value &value, const ExifData *)
Print Pentax version.
Definition: pentaxmn_int.cpp:1015
EXV_PRINT_COMBITAG
#define EXV_PRINT_COMBITAG(array, count, ignoredcount)
Shortcut for the printCombiTag template which requires typing the array name only once.
Definition: pentaxmn_int.hpp:117
Exiv2::time
IPTC time type.
Definition: types.hpp:149
Exiv2::date
IPTC date type.
Definition: types.hpp:148
EXV_PRINT_COMBITAG_MULTI
#define EXV_PRINT_COMBITAG_MULTI(array, count, ignoredcount, ignoredcountmax)
Shortcut for the printCombiTag template which requires typing the array name only once.
Definition: pentaxmn_int.hpp:119
Exiv2::Internal::readExiv2Config
std::string readExiv2Config(const std::string &section, const std::string &value, const std::string &def)
Read value from Exiv2 configuration file.
Definition: makernote_int.cpp:113
Exiv2::Internal::pentaxColorSpace
const TagDetails pentaxColorSpace[]
ColorSpace, tag 0x0037.
tags_int.hpp
Internal Exif tag and type information.
Exiv2::Internal::resolveLens0x3ff
std::ostream & resolveLens0x3ff(std::ostream &os, const Value &value, const ExifData *metadata)
resolveLens0x3ff print lens in human format
Definition: pentaxmn_int.cpp:1245
tags.hpp
Exif tag and type information.
Exiv2::model
EXIV2API ExifData::const_iterator model(const ExifData &ed)
Return the camera model.
Definition: easyaccess.cpp:436
Exiv2::string
IPTC string type.
Definition: types.hpp:147
Exiv2::Internal::resolveLens0x319
std::ostream & resolveLens0x319(std::ostream &os, const Value &value, const ExifData *metadata)
resolveLens0x319 print lens in human format
Definition: pentaxmn_int.cpp:1332
Exiv2::Internal::PentaxMakerNote::printCompensation
static std::ostream & printCompensation(std::ostream &os, const Value &value, const ExifData *)
Print Pentax compensation.
Definition: pentaxmn_int.cpp:1085
Exiv2::Internal::pentaxShootingMode
const TagDetails pentaxShootingMode[]
ShootingMode, tag 0x0001.
Exiv2::Internal::PentaxMakerNote::printShutterCount
static std::ostream & printShutterCount(std::ostream &os, const Value &value, const ExifData *)
Print Pentax shutter count.
Definition: pentaxmn_int.cpp:1160
Exiv2::Internal::pentaxOffOn
const TagDetails pentaxOffOn[]
Generic for Off/On switches.
Exiv2::Internal::PentaxMakerNote::printExposure
static std::ostream & printExposure(std::ostream &os, const Value &value, const ExifData *)
Print Pentax exposure.
Definition: pentaxmn_int.cpp:1060
Exiv2::ExifData
A container for Exif data. This is a top-level class of the Exiv2 library. The container holds Exifda...
Definition: exif.hpp:434