Loading...
Searching...
No Matches
pentaxmn_int.hpp
// SPDX-License-Identifier: GPL-2.0-or-later
#ifndef PENTAXMN_INT_HPP_
#define PENTAXMN_INT_HPP_
// *****************************************************************************
// included header files
#include "tags.hpp"
#include "tags_int.hpp"
#include "types.hpp"
// *****************************************************************************
// namespace extensions
namespace Exiv2::Internal {
// *****************************************************************************
// class definitions
class PentaxMakerNote {
public:
static const TagInfo* tagList();
static std::ostream& printVersion(std::ostream& os, const Value& value, const ExifData*);
static std::ostream& printResolution(std::ostream& os, const Value& value, const ExifData*);
static std::ostream& printDate(std::ostream& os, const Value& value, const ExifData*);
static std::ostream& printTime(std::ostream& os, const Value& value, const ExifData*);
static std::ostream& printExposure(std::ostream& os, const Value& value, const ExifData*);
static std::ostream& printFValue(std::ostream& os, const Value& value, const ExifData*);
static std::ostream& printFocalLength(std::ostream& os, const Value& value, const ExifData*);
static std::ostream& printCompensation(std::ostream& os, const Value& value, const ExifData*);
static std::ostream& printTemperature(std::ostream& os, const Value& value, const ExifData*);
static std::ostream& printFlashCompensation(std::ostream& os, const Value& value, const ExifData*);
static std::ostream& printBracketing(std::ostream& os, const Value& value, const ExifData*);
static std::ostream& printShutterCount(std::ostream& os, const Value& value, const ExifData*);
private:
static const TagInfo tagInfo_[];
}; // class PentaxMakerNote
template <int N, const TagDetails (&array)[N], int count, int ignoredcount, int ignoredcountmax>
std::ostream& printCombiTag(std::ostream& os, const Value& value, const ExifData* metadata) {
std::ios::fmtflags f(os.flags());
if ((value.count() != count &&
(value.count() < (count + ignoredcount) || value.count() > (count + ignoredcountmax))) ||
count > 4) {
return printValue(os, value, metadata);
}
uint32_t l = 0;
for (int c = 0; c < count; ++c) {
if (value.toInt64(c) < 0 || value.toInt64(c) > 255) {
return printValue(os, value, metadata);
}
l += (value.toUint32(c) << ((count - c - 1) * 8));
}
if (auto td = Exiv2::find(array, l)) {
os << exvGettext(td->label_);
} else {
os << exvGettext("Unknown") << " (0x" << std::setw(2 * count) << std::setfill('0') << std::hex << l << std::dec
<< ")";
}
os.flags(f);
return os;
}
#define EXV_PRINT_COMBITAG(array, count, ignoredcount) \
printCombiTag<std::size(array), array, count, ignoredcount, ignoredcount>
#define EXV_PRINT_COMBITAG_MULTI(array, count, ignoredcount, ignoredcountmax) \
printCombiTag<std::size(array), array, count, ignoredcount, ignoredcountmax>
} // namespace Exiv2::Internal
#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:901
Exiv2::Internal::PentaxMakerNote::printResolution
static std::ostream & printResolution(std::ostream &os, const Value &value, const ExifData *)
Print Pentax resolution.
Definition pentaxmn_int.cpp:908
Exiv2::Internal::PentaxMakerNote::printFocalLength
static std::ostream & printFocalLength(std::ostream &os, const Value &value, const ExifData *)
Print Pentax focal length.
Definition pentaxmn_int.cpp:948
Exiv2::Internal::PentaxMakerNote::printShutterCount
static std::ostream & printShutterCount(std::ostream &os, const Value &value, const ExifData *)
Print Pentax shutter count.
Definition pentaxmn_int.cpp:1016
Exiv2::Internal::PentaxMakerNote::printDate
static std::ostream & printDate(std::ostream &os, const Value &value, const ExifData *)
Print Pentax date.
Definition pentaxmn_int.cpp:915
Exiv2::Internal::PentaxMakerNote::printExposure
static std::ostream & printExposure(std::ostream &os, const Value &value, const ExifData *)
Print Pentax exposure.
Definition pentaxmn_int.cpp:936
Exiv2::Internal::PentaxMakerNote::printFValue
static std::ostream & printFValue(std::ostream &os, const Value &value, const ExifData *)
Print Pentax F value.
Definition pentaxmn_int.cpp:941
Exiv2::Internal::PentaxMakerNote::printTemperature
static std::ostream & printTemperature(std::ostream &os, const Value &value, const ExifData *)
Print Pentax temperature.
Definition pentaxmn_int.cpp:962
Exiv2::Internal::PentaxMakerNote::printCompensation
static std::ostream & printCompensation(std::ostream &os, const Value &value, const ExifData *)
Print Pentax compensation.
Definition pentaxmn_int.cpp:955
Exiv2::Internal::PentaxMakerNote::printBracketing
static std::ostream & printBracketing(std::ostream &os, const Value &value, const ExifData *)
Print Pentax bracketing.
Definition pentaxmn_int.cpp:974
Exiv2::Internal::PentaxMakerNote::printFlashCompensation
static std::ostream & printFlashCompensation(std::ostream &os, const Value &value, const ExifData *)
Print Pentax flash compensation.
Definition pentaxmn_int.cpp:967
Exiv2::Internal::PentaxMakerNote::tagList
static const TagInfo * tagList()
Return read-only list of built-in Pentaxfilm tags.
Definition pentaxmn_int.cpp:1459
Exiv2::Internal::PentaxMakerNote::printTime
static std::ostream & printTime(std::ostream &os, const Value &value, const ExifData *)
Print Pentax time.
Definition pentaxmn_int.cpp:925
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:2483
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:504
Exiv2::TagInfo
Tag information.
Definition tags.hpp:224