You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
126 lines
5.5 KiB
C++
126 lines
5.5 KiB
C++
18 years ago
|
// ***************************************************************** -*- C++ -*-
|
||
|
/*
|
||
15 years ago
|
* Copyright (C) 2004-2010 Andreas Huggel <ahuggel@gmx.net>
|
||
18 years ago
|
*
|
||
|
* 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.
|
||
|
*/
|
||
|
/*!
|
||
15 years ago
|
@file pentaxmn_int.hpp
|
||
18 years ago
|
@brief Pentax MakerNote implemented according to the specification
|
||
18 years ago
|
http://www.gvsoft.homedns.org/exif/makernote-pentax-type3.html and
|
||
18 years ago
|
based on ExifTool implementation and
|
||
18 years ago
|
<a href="http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Pentax.html">Pentax Makernote list</a> by Phil Harvey<br>
|
||
|
@version $Rev$
|
||
|
@author Michal Cihar
|
||
|
<a href="mailto:michal@cihar.com">michal@cihar.com</a>
|
||
|
@date 27-Sep-07
|
||
|
*/
|
||
15 years ago
|
#ifndef PENTAXMN_INT_HPP_
|
||
|
#define PENTAXMN_INT_HPP_
|
||
18 years ago
|
|
||
|
// *****************************************************************************
|
||
|
// included header files
|
||
|
#include "tags.hpp"
|
||
17 years ago
|
#include "types.hpp"
|
||
18 years ago
|
|
||
|
// + standard includes
|
||
|
#include <string>
|
||
18 years ago
|
#include <iostream>
|
||
|
#include <iomanip>
|
||
18 years ago
|
#include <memory>
|
||
|
|
||
|
// *****************************************************************************
|
||
|
// namespace extensions
|
||
|
namespace Exiv2 {
|
||
15 years ago
|
namespace Internal {
|
||
18 years ago
|
|
||
|
// *****************************************************************************
|
||
|
// class definitions
|
||
|
|
||
|
//! MakerNote for Pentaxfilm cameras
|
||
15 years ago
|
class PentaxMakerNote {
|
||
18 years ago
|
public:
|
||
|
//! Return read-only list of built-in Pentaxfilm tags
|
||
|
static const TagInfo* tagList();
|
||
|
|
||
18 years ago
|
//! Print Pentax version
|
||
17 years ago
|
static std::ostream& printPentaxVersion(std::ostream& os, const Value& value, const ExifData*);
|
||
18 years ago
|
//! Print Pentax resolution
|
||
17 years ago
|
static std::ostream& printPentaxResolution(std::ostream& os, const Value& value, const ExifData*);
|
||
18 years ago
|
//! Print Pentax date
|
||
17 years ago
|
static std::ostream& printPentaxDate(std::ostream& os, const Value& value, const ExifData*);
|
||
18 years ago
|
//! Print Pentax time
|
||
17 years ago
|
static std::ostream& printPentaxTime(std::ostream& os, const Value& value, const ExifData*);
|
||
18 years ago
|
//! Print Pentax exposure
|
||
17 years ago
|
static std::ostream& printPentaxExposure(std::ostream& os, const Value& value, const ExifData*);
|
||
18 years ago
|
//! Print Pentax F value
|
||
17 years ago
|
static std::ostream& printPentaxFValue(std::ostream& os, const Value& value, const ExifData*);
|
||
18 years ago
|
//! Print Pentax focal length
|
||
17 years ago
|
static std::ostream& printPentaxFocalLength(std::ostream& os, const Value& value, const ExifData*);
|
||
18 years ago
|
//! Print Pentax compensation
|
||
17 years ago
|
static std::ostream& printPentaxCompensation(std::ostream& os, const Value& value, const ExifData*);
|
||
18 years ago
|
//! Print Pentax temperature
|
||
17 years ago
|
static std::ostream& printPentaxTemperature(std::ostream& os, const Value& value, const ExifData*);
|
||
18 years ago
|
//! Print Pentax flash compensation
|
||
17 years ago
|
static std::ostream& printPentaxFlashCompensation(std::ostream& os, const Value& value, const ExifData*);
|
||
18 years ago
|
//! Print Pentax bracketing
|
||
17 years ago
|
static std::ostream& printPentaxBracketing(std::ostream& os, const Value& value, const ExifData*);
|
||
18 years ago
|
|
||
|
private:
|
||
|
//! Tag information
|
||
|
static const TagInfo tagInfo_[];
|
||
|
}; // class PentaxMakerNote
|
||
|
|
||
18 years ago
|
/*!
|
||
|
@brief Print function to translate Pentax "combi-values" to a description
|
||
|
by looking up a reference table.
|
||
|
*/
|
||
15 years ago
|
template <int N, const TagDetails (&array)[N], int count, int ignoredcount, int ignoredcountmax>
|
||
17 years ago
|
std::ostream& printCombiTag(std::ostream& os, const Value& value, const ExifData* metadata)
|
||
18 years ago
|
{
|
||
15 years ago
|
if ((value.count() != count && (value.count() < (count + ignoredcount) || value.count() > (count + ignoredcountmax))) || count > 4) {
|
||
17 years ago
|
return printValue(os, value, metadata);
|
||
18 years ago
|
}
|
||
|
unsigned long l = 0;
|
||
|
for (int c = 0; c < count; ++c) {
|
||
|
if (value.toLong(c) < 0 || value.toLong(c) > 255) {
|
||
17 years ago
|
return printValue(os, value, metadata);
|
||
18 years ago
|
}
|
||
|
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 << ")";
|
||
|
}
|
||
|
|
||
|
return os;
|
||
|
}
|
||
|
|
||
|
//! Shortcut for the printCombiTag template which requires typing the array name only once.
|
||
15 years ago
|
#define EXV_PRINT_COMBITAG(array, count, ignoredcount) printCombiTag<EXV_COUNTOF(array), array, count, ignoredcount, ignoredcount>
|
||
15 years ago
|
//! Shortcut for the printCombiTag template which requires typing the array name only once.
|
||
15 years ago
|
#define EXV_PRINT_COMBITAG_MULTI(array, count, ignoredcount, ignoredcountmax) printCombiTag<EXV_COUNTOF(array), array, count, ignoredcount, ignoredcountmax>
|
||
18 years ago
|
|
||
15 years ago
|
}} // namespace Internal, Exiv2
|
||
18 years ago
|
|
||
15 years ago
|
#endif // #ifndef PENTAXMN_INT_HPP_
|