Loading...
Searching...
No Matches
pentaxmn_int.hpp
// ***************************************************************** -*- C++ -*-
/*
* Copyright (C) 2004-2021 Exiv2 authors
* This program is part of the Exiv2 distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
*/
#ifndef PENTAXMN_INT_HPP_
#define PENTAXMN_INT_HPP_
// *****************************************************************************
// included header files
#include "tags.hpp"
#include "tags_int.hpp"
#include "types.hpp"
// + standard includes
#include <iostream>
#include <iomanip>
// *****************************************************************************
// namespace extensions
namespace Exiv2 {
namespace 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);
}
unsigned long l = 0;
for (int c = 0; c < count; ++c) {
if (value.toLong(c) < 0 || value.toLong(c) > 255) {
return printValue(os, value, metadata);
}
l += (value.toLong(c) << ((count - c - 1) * 8));
}
const TagDetails* td = find(array, l);
if (td) {
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<EXV_COUNTOF(array), array, count, ignoredcount, ignoredcount>
#define EXV_PRINT_COMBITAG_MULTI(array, count, ignoredcount, ignoredcountmax) printCombiTag<EXV_COUNTOF(array), array, count, ignoredcount, ignoredcountmax>
} // namespace Internal
} // namespace Exiv2
#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:434
Exiv2::Internal::PentaxMakerNote
MakerNote for Pentaxfilm cameras.
Definition pentaxmn_int.hpp:42
Exiv2::Internal::PentaxMakerNote::printVersion
static std::ostream & printVersion(std::ostream &os, const Value &value, const ExifData *)
Print Pentax version.
Definition pentaxmn_int.cpp:1014
Exiv2::Internal::PentaxMakerNote::printResolution
static std::ostream & printResolution(std::ostream &os, const Value &value, const ExifData *)
Print Pentax resolution.
Definition pentaxmn_int.cpp:1025
Exiv2::Internal::PentaxMakerNote::printFocalLength
static std::ostream & printFocalLength(std::ostream &os, const Value &value, const ExifData *)
Print Pentax focal length.
Definition pentaxmn_int.cpp:1074
Exiv2::Internal::PentaxMakerNote::printShutterCount
static std::ostream & printShutterCount(std::ostream &os, const Value &value, const ExifData *)
Print Pentax shutter count.
Definition pentaxmn_int.cpp:1159
Exiv2::Internal::PentaxMakerNote::printDate
static std::ostream & printDate(std::ostream &os, const Value &value, const ExifData *)
Print Pentax date.
Definition pentaxmn_int.cpp:1036
Exiv2::Internal::PentaxMakerNote::printExposure
static std::ostream & printExposure(std::ostream &os, const Value &value, const ExifData *)
Print Pentax exposure.
Definition pentaxmn_int.cpp:1059
Exiv2::Internal::PentaxMakerNote::printFValue
static std::ostream & printFValue(std::ostream &os, const Value &value, const ExifData *)
Print Pentax F value.
Definition pentaxmn_int.cpp:1065
Exiv2::Internal::PentaxMakerNote::printTemperature
static std::ostream & printTemperature(std::ostream &os, const Value &value, const ExifData *)
Print Pentax temperature.
Definition pentaxmn_int.cpp:1094
Exiv2::Internal::PentaxMakerNote::printCompensation
static std::ostream & printCompensation(std::ostream &os, const Value &value, const ExifData *)
Print Pentax compensation.
Definition pentaxmn_int.cpp:1084
Exiv2::Internal::PentaxMakerNote::printBracketing
static std::ostream & printBracketing(std::ostream &os, const Value &value, const ExifData *)
Print Pentax bracketing.
Definition pentaxmn_int.cpp:1110
Exiv2::Internal::PentaxMakerNote::printFlashCompensation
static std::ostream & printFlashCompensation(std::ostream &os, const Value &value, const ExifData *)
Print Pentax flash compensation.
Definition pentaxmn_int.cpp:1100
Exiv2::Internal::PentaxMakerNote::tagList
static const TagInfo * tagList()
Return read-only list of built-in Pentaxfilm tags.
Definition pentaxmn_int.cpp:1703
Exiv2::Internal::PentaxMakerNote::printTime
static std::ostream & printTime(std::ostream &os, const Value &value, const ExifData *)
Print Pentax time.
Definition pentaxmn_int.cpp:1047
Exiv2::Value
Common interface for all types of values used with metadata.
Definition value.hpp:51
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::Value::count
virtual long count() const =0
Return the number of components of the value.
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:82
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:2576
Exiv2
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition asfvideo.hpp:36
Exiv2::find
const T * find(T(&src)[N], const K &key)
Find an element that matches key in the array src.
Definition types.hpp:497
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:571
Exiv2::Internal::TagDetails
Helper structure for lookup tables for translations of numeric tag values to human readable labels.
Definition tags_int.hpp:225
Exiv2::Internal::TagDetails::label_
const char * label_
Translation of the tag value.
Definition tags_int.hpp:227
Exiv2::TagInfo
Tag information.
Definition tags.hpp:74