| Exiv2

Loading...
Searching...
No Matches
pentaxmn_int.hpp
1// SPDX-License-Identifier: GPL-2.0-or-later
2
3#ifndef PENTAXMN_INT_HPP_
4#define PENTAXMN_INT_HPP_
5
6// *****************************************************************************
7// included header files
8#include "tags.hpp"
9#include "tags_int.hpp"
10#include "types.hpp"
11
12// *****************************************************************************
13// namespace extensions
14 namespace Exiv2::Internal {
15// *****************************************************************************
16// class definitions
17
19 class PentaxMakerNote {
20 public:
22 static const TagInfo* tagList();
23
25 static std::ostream& printVersion(std::ostream& os, const Value& value, const ExifData*);
27 static std::ostream& printResolution(std::ostream& os, const Value& value, const ExifData*);
29 static std::ostream& printDate(std::ostream& os, const Value& value, const ExifData*);
31 static std::ostream& printTime(std::ostream& os, const Value& value, const ExifData*);
33 static std::ostream& printExposure(std::ostream& os, const Value& value, const ExifData*);
35 static std::ostream& printFValue(std::ostream& os, const Value& value, const ExifData*);
37 static std::ostream& printFocalLength(std::ostream& os, const Value& value, const ExifData*);
39 static std::ostream& printCompensation(std::ostream& os, const Value& value, const ExifData*);
41 static std::ostream& printTemperature(std::ostream& os, const Value& value, const ExifData*);
43 static std::ostream& printFlashCompensation(std::ostream& os, const Value& value, const ExifData*);
45 static std::ostream& printBracketing(std::ostream& os, const Value& value, const ExifData*);
47 static std::ostream& printShutterCount(std::ostream& os, const Value& value, const ExifData*);
48
49 private:
51 static const TagInfo tagInfo_[];
52}; // class PentaxMakerNote
53
58 template <int N, const TagDetails (&array)[N], int count, int ignoredcount, int ignoredcountmax>
59std::ostream& printCombiTag(std::ostream& os, const Value& value, const ExifData* metadata) {
60 std::ios::fmtflags f(os.flags());
61 if ((value.count() != count &&
62 (value.count() < (count + ignoredcount) || value.count() > (count + ignoredcountmax))) ||
63 count > 4) {
64 return printValue(os, value, metadata);
65 }
66 uint32_t l = 0;
67 for (int c = 0; c < count; ++c) {
68 if (value.toInt64(c) < 0 || value.toInt64(c) > 255) {
69 return printValue(os, value, metadata);
70 }
71 l += (value.toUint32(c) << ((count - c - 1) * 8));
72 }
73 if (auto td = Exiv2::find(array, l)) {
74 os << exvGettext(td->label_);
75 } else {
76 os << exvGettext("Unknown") << " (0x" << std::setw(2 * count) << std::setfill('0') << std::hex << l << std::dec
77 << ")";
78 }
79
80 os.flags(f);
81 return os;
82}
83
85#define EXV_PRINT_COMBITAG(array, count, ignoredcount) \
86 printCombiTag<std::size(array), array, count, ignoredcount, ignoredcount>
88#define EXV_PRINT_COMBITAG_MULTI(array, count, ignoredcount, ignoredcountmax) \
89 printCombiTag<std::size(array), array, count, ignoredcount, ignoredcountmax>
90
91} // namespace Exiv2::Internal
92
93#endif // #ifndef PENTAXMN_INT_HPP_
Exiv2::ExifData
A container for Exif data. This is a top-level class of the Exiv2 library. The container holds Exifda...
Definition exif.hpp:379
Exiv2::Internal::PentaxMakerNote
MakerNote for Pentaxfilm cameras.
Definition pentaxmn_int.hpp:19
Exiv2::Internal::PentaxMakerNote::printVersion
static std::ostream & printVersion(std::ostream &os, const Value &value, const ExifData *)
Print Pentax version.
Definition pentaxmn_int.cpp:905
Exiv2::Internal::PentaxMakerNote::printResolution
static std::ostream & printResolution(std::ostream &os, const Value &value, const ExifData *)
Print Pentax resolution.
Definition pentaxmn_int.cpp:912
Exiv2::Internal::PentaxMakerNote::printFocalLength
static std::ostream & printFocalLength(std::ostream &os, const Value &value, const ExifData *)
Print Pentax focal length.
Definition pentaxmn_int.cpp:952
Exiv2::Internal::PentaxMakerNote::printShutterCount
static std::ostream & printShutterCount(std::ostream &os, const Value &value, const ExifData *)
Print Pentax shutter count.
Definition pentaxmn_int.cpp:1020
Exiv2::Internal::PentaxMakerNote::printDate
static std::ostream & printDate(std::ostream &os, const Value &value, const ExifData *)
Print Pentax date.
Definition pentaxmn_int.cpp:919
Exiv2::Internal::PentaxMakerNote::printExposure
static std::ostream & printExposure(std::ostream &os, const Value &value, const ExifData *)
Print Pentax exposure.
Definition pentaxmn_int.cpp:940
Exiv2::Internal::PentaxMakerNote::printFValue
static std::ostream & printFValue(std::ostream &os, const Value &value, const ExifData *)
Print Pentax F value.
Definition pentaxmn_int.cpp:945
Exiv2::Internal::PentaxMakerNote::printTemperature
static std::ostream & printTemperature(std::ostream &os, const Value &value, const ExifData *)
Print Pentax temperature.
Definition pentaxmn_int.cpp:966
Exiv2::Internal::PentaxMakerNote::printCompensation
static std::ostream & printCompensation(std::ostream &os, const Value &value, const ExifData *)
Print Pentax compensation.
Definition pentaxmn_int.cpp:959
Exiv2::Internal::PentaxMakerNote::printBracketing
static std::ostream & printBracketing(std::ostream &os, const Value &value, const ExifData *)
Print Pentax bracketing.
Definition pentaxmn_int.cpp:978
Exiv2::Internal::PentaxMakerNote::printFlashCompensation
static std::ostream & printFlashCompensation(std::ostream &os, const Value &value, const ExifData *)
Print Pentax flash compensation.
Definition pentaxmn_int.cpp:971
Exiv2::Internal::PentaxMakerNote::tagList
static const TagInfo * tagList()
Return read-only list of built-in Pentaxfilm tags.
Definition pentaxmn_int.cpp:1463
Exiv2::Internal::PentaxMakerNote::printTime
static std::ostream & printTime(std::ostream &os, const Value &value, const ExifData *)
Print Pentax time.
Definition pentaxmn_int.cpp:929
Exiv2::Value
Common interface for all types of values used with metadata.
Definition value.hpp:33
Exiv2::Value::count
virtual size_t count() const =0
Return the number of components of the value.
Exiv2::Value::toUint32
virtual uint32_t toUint32(size_t n=0) const =0
Convert the n-th component of the value to a float. The behaviour of this method may be undefined if ...
Exiv2::Value::toInt64
virtual int64_t toInt64(size_t n=0) const =0
Convert the n-th component of the value to an int64_t. The behaviour of this method may be undefined ...
Exiv2::Internal
Helper structure for the Matroska tags lookup table.
Definition matroskavideo.hpp:39
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:59
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:2485
Exiv2::find
const T * find(T(&src)[N], const K &key)
Find an element that matches key in the array src.
Definition types.hpp:449
Exiv2::exvGettext
EXIV2API const char * exvGettext(const char *str)
Translate a string using the gettext framework. This wrapper hides all the implementation details fro...
Definition types.cpp:508
Exiv2::TagInfo
Tag information.
Definition tags.hpp:224