tiffimage.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 TIFFIMAGE_HPP_
#define TIFFIMAGE_HPP_
// *****************************************************************************
#include "exiv2lib_export.h"
// included header files
#include "image.hpp"
// *****************************************************************************
// namespace extensions
namespace Exiv2 {
// *****************************************************************************
// class definitions
// Add TIFF to the supported image formats
namespace ImageType {
const int tiff = 4;
const int dng = 4;
const int nef = 4;
const int pef = 4;
const int arw = 4;
const int sr2 = 4;
const int srw = 4;
}
class EXIV2API TiffImage : public Image {
public:
TiffImage(BasicIo::AutoPtr io, bool create);
void readMetadata();
void writeMetadata();
virtual void printStructure(std::ostream& out, PrintStructureOption option,int depth=0);
void setComment(const std::string& comment);
std::string mimeType() const;
int pixelWidth() const;
int pixelHeight() const;
private:
TiffImage(const TiffImage& rhs);
TiffImage& operator=(const TiffImage& rhs);
std::string primaryGroup() const;
private:
// DATA
mutable std::string primaryGroup_;
mutable std::string mimeType_;
mutable int pixelWidth_;
mutable int pixelHeight_;
}; // class TiffImage
class EXIV2API TiffParser {
public:
static ByteOrder decode(
ExifData& exifData,
IptcData& iptcData,
XmpData& xmpData,
const byte* pData,
uint32_t size
);
static WriteMethod encode(
BasicIo& io,
const byte* pData,
uint32_t size,
ByteOrder byteOrder,
const ExifData& exifData,
const IptcData& iptcData,
const XmpData& xmpData
);
}; // class TiffParser
// *****************************************************************************
// template, inline and free functions
// These could be static private functions on Image subclasses but then
// ImageFactory needs to be made a friend.
EXIV2API Image::AutoPtr newTiffInstance(BasicIo::AutoPtr io, bool create);
EXIV2API bool isTiffType(BasicIo& iIo, bool advance);
} // namespace Exiv2
#endif // #ifndef TIFFIMAGE_HPP_
Exiv2::BasicIo
An interface for simple binary IO.
Definition: basicio.hpp:55
Exiv2::BasicIo::AutoPtr
std::auto_ptr< BasicIo > AutoPtr
BasicIo auto_ptr type.
Definition: basicio.hpp:58
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::Image
Abstract base class defining the interface for an image. This is the top-level interface to the Exiv2...
Definition: image.hpp:78
Exiv2::Image::AutoPtr
std::auto_ptr< Image > AutoPtr
Image auto_ptr type.
Definition: image.hpp:81
Exiv2::IptcData
A container for IPTC data. This is a top-level class of the Exiv2 library.
Definition: iptc.hpp:170
Exiv2::TiffImage
Class to access TIFF images. Exif metadata is supported directly, IPTC is read from the Exif data,...
Definition: tiffimage.hpp:52
Exiv2::TiffParser
Stateless parser class for data in TIFF format. Images use this class to decode and encode TIFF data....
Definition: tiffimage.hpp:130
Exiv2::XmpData
A container for XMP data. This is a top-level class of the Exiv2 library.
Definition: xmp_exiv2.hpp:166
Exiv2::ImageType::pef
const int pef
PEF image type (see class TiffImage)
Definition: tiffimage.hpp:42
Exiv2::ImageType::nef
const int nef
NEF image type (see class TiffImage)
Definition: tiffimage.hpp:41
Exiv2::ImageType::dng
const int dng
DNG image type (see class TiffImage)
Definition: tiffimage.hpp:40
Exiv2::ImageType::sr2
const int sr2
SR2 image type (see class TiffImage)
Definition: tiffimage.hpp:44
Exiv2::ImageType::srw
const int srw
SRW image type (see class TiffImage)
Definition: tiffimage.hpp:45
Exiv2::ImageType::arw
const int arw
ARW image type (see class TiffImage)
Definition: tiffimage.hpp:43
Exiv2::ImageType::tiff
const int tiff
TIFF image type (see class TiffImage)
Definition: tiffimage.hpp:39
Exiv2
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition: asfvideo.hpp:36
Exiv2::PrintStructureOption
PrintStructureOption
Options for printStructure.
Definition: image.hpp:64
Exiv2::newTiffInstance
EXIV2API Image::AutoPtr newTiffInstance(BasicIo::AutoPtr io, bool create)
Create a new TiffImage instance and return an auto-pointer to it. Caller owns the returned object and...
Definition: tiffimage.cpp:317
Exiv2::comment
@ comment
Exiv2 type for the Exif user comment.
Definition: types.hpp:139
Exiv2::isTiffType
EXIV2API bool isTiffType(BasicIo &iIo, bool advance)
Check if the file iIo is a TIFF image.
Definition: tiffimage.cpp:326
Exiv2::ByteOrder
ByteOrder
Type to express the byte order (little or big endian)
Definition: types.hpp:102
Exiv2::WriteMethod
WriteMethod
Type to indicate write method used by TIFF parsers.
Definition: types.hpp:105