3#ifndef TIFFIMAGE_INT_HPP_
4#define TIFFIMAGE_INT_HPP_
8#include <unordered_map>
10#include "tiffcomposite_int.hpp"
11#include "tifffwd_int.hpp"
51 virtual bool read(
const byte* pData,
size_t size);
73 virtual void print(std::ostream& os,
const std::string& prefix =
"")
const;
77 [[nodiscard]]
virtual uint32_t
offset()
const;
79 [[nodiscard]]
virtual uint32_t
size()
const;
81 [[nodiscard]]
virtual uint16_t
tag()
const;
136 std::size_t operator()(
const TiffGroupKey& pair)
const noexcept {
137 return std::hash<uint64_t>{}(
static_cast<uint64_t
>(pair.first) << 32 |
static_cast<uint64_t
>(pair.second));
145using TiffGroupTable = std::unordered_map<TiffGroupKey, NewTiffCompFct, TiffGroupKey_hash>;
153using TiffTreeTable = std::unordered_map<TiffGroupKey, TiffTreeParent, TiffGroupKey_hash>;
166 static std::unique_ptr<TiffComponent>
create(uint32_t extendedTag,
IfdId group);
175 static const TiffTreeTable tiffTreeTable_;
237 static std::unique_ptr<TiffComponent> parse(
const byte* pData,
size_t size, uint32_t root,
TiffHeaderBase* pHeader);
331 using OffsetList = std::map<OffsetId, OffsetData>;
334 OffsetList offsetList_;
347 return ifdId_ == md.
ifdId();
An interface for simple binary IO.
Definition basicio.hpp:35
A container for Exif data. This is a top-level class of the Exiv2 library. The container holds Exifda...
Definition exif.hpp:379
An Exif metadatum, consisting of an ExifKey and a Value and methods to manipulate these.
Definition exif.hpp:41
IfdId ifdId() const
Return the IFD id as an integer. (Do not use, this is meant for library internal use....
Definition exif.cpp:300
Unary predicate that matches an Exifdatum with a given IfdId.
Definition tiffimage_int.hpp:340
FindExifdatum(Exiv2::IfdId ifdId)
Constructor, initializes the object with the IfdId to look for.
Definition tiffimage_int.hpp:343
bool operator()(const Exiv2::Exifdatum &md) const
Returns true if IFD id matches.
Definition tiffimage_int.hpp:346
Class to insert pointers or offsets to computed addresses at specific locations in an image....
Definition tiffimage_int.hpp:295
void setTarget(OffsetId id, uint32_t target)
Set the target for offset id, i.e., the address to which the offset points.
Definition tiffimage_int.cpp:2358
OffsetId
Identifiers for supported offsets.
Definition tiffimage_int.hpp:298
@ cr2RawIfdOffset
CR2 RAW IFD offset, a pointer in the CR2 header to the 4th IFD in a CR2 image.
Definition tiffimage_int.hpp:299
void writeOffsets(BasicIo &io) const
Write the offsets to the IO instance io.
Definition tiffimage_int.cpp:2364
void setOrigin(OffsetId id, uint32_t origin, ByteOrder byteOrder)
Set the origin of the offset for id, i.e., the location in the image where the offset is,...
Definition tiffimage_int.cpp:2354
Interface class for components of a TIFF directory hierarchy (Composite pattern). Both TIFF directori...
Definition tiffcomposite_int.hpp:152
TIFF component factory.
Definition tiffimage_int.hpp:158
static TiffPath getPath(uint32_t extendedTag, IfdId group, uint32_t root)
Get the path, i.e., a list of extended tag and group pairs, from the root TIFF element to the TIFF en...
Definition tiffimage_int.cpp:2013
static std::unique_ptr< TiffComponent > create(uint32_t extendedTag, IfdId group)
Create the TiffComponent for TIFF entry extendedTag and group. The embedded lookup table is used to f...
Definition tiffimage_int.cpp:1992
Table of TIFF decoding and encoding functions and find functions. This class is separated from the me...
Definition tiffimage_int.hpp:255
static DecoderFct findDecoder(const std::string &make, uint32_t extendedTag, IfdId group)
Find the decoder function for a key.
Definition tiffimage_int.cpp:1974
static EncoderFct findEncoder(const std::string &make, uint32_t extendedTag, IfdId group)
Find special encoder function for a key.
Definition tiffimage_int.cpp:1983
Stateless parser class for data in TIFF format. Images use this class to decode and encode TIFF-based...
Definition tiffimage_int.hpp:183
static WriteMethod encode(BasicIo &io, const byte *pData, size_t size, ExifData &exifData, IptcData &iptcData, XmpData &xmpData, uint32_t root, FindEncoderFct findEncoderFct, TiffHeaderBase *pHeader, OffsetWriter *pOffsetWriter)
Encode TIFF metadata from the metadata containers into a memory block blob.
Definition tiffimage_int.cpp:2045
static ByteOrder decode(ExifData &exifData, IptcData &iptcData, XmpData &xmpData, const byte *pData, size_t size, uint32_t root, FindDecoderFct findDecoderFct, TiffHeaderBase *pHeader=nullptr)
Decode TIFF metadata from a data buffer pData of length size into the provided metadata containers.
Definition tiffimage_int.cpp:2028
A container for IPTC data. This is a top-level class of the Exiv2 library.
Definition iptc.hpp:153
A container for XMP data. This is a top-level class of the Exiv2 library.
Definition xmp_exiv2.hpp:138
Helper structure for the Matroska tags lookup table.
Definition matroskavideo.hpp:39
EncoderFct(*)(const std::string &make, uint32_t extendedTag, IfdId group) FindEncoderFct
Type for a function pointer for a function to encode a TIFF component.
Definition tifffwd_int.hpp:68
void(TiffEncoder::*)(TiffEntryBase *, const Exifdatum *) EncoderFct
Function pointer type for a TiffDecoder member function to decode a TIFF component.
Definition tifffwd_int.hpp:60
DecoderFct(*)(const std::string &make, uint32_t extendedTag, IfdId group) FindDecoderFct
Type for a function pointer for a function to decode a TIFF component.
Definition tifffwd_int.hpp:64
std::stack< TiffPathItem > TiffPath
Stack to hold a path from the TIFF root element to a TIFF entry.
Definition tifffwd_int.hpp:77
std::vector< IfdId > PrimaryGroups
Type for a list of primary image groups.
Definition tifffwd_int.hpp:80
void(TiffDecoder::*)(const TiffEntryBase *) DecoderFct
Function pointer type for a TiffDecoder member function to decode a TIFF component.
Definition tifffwd_int.hpp:55
std::pair< uint32_t, IfdId > TiffGroupKey
Data structure used to list image tags for TIFF and TIFF-like images.
Definition tiffimage_int.hpp:133
std::pair< IfdId, uint32_t > TiffTreeParent
Data structure used as a row of the table which describes TIFF trees. Multiple trees are needed as TI...
Definition tiffimage_int.hpp:152
bool isTiffImageTag(uint16_t tag, IfdId group)
Convenience function to check if tag, group is in the list of TIFF image tags.
Definition tiffimage_int.cpp:2306
std::unordered_map< TiffGroupKey, NewTiffCompFct, TiffGroupKey_hash > TiffGroupTable
Data structure used as a row (element) of a table (array) defining the TIFF component used for each t...
Definition tiffimage_int.hpp:145
IfdId
Type to specify the IFD to which a metadata belongs.
Definition tags.hpp:34
EXIV2API ExifData::const_iterator make(const ExifData &ed)
Return the camera make. Please keep in mind that this accessor is provided for convenience only and w...
Definition easyaccess.cpp:333
ByteOrder
Type to express the byte order (little or big endian)
Definition types.hpp:34
WriteMethod
Type to indicate write method used by TIFF parsers.
Definition types.hpp:41
Utility class containing a character array. All it does is to take care of memory allocation and dele...
Definition types.hpp:124
Definition tiffimage_int.hpp:135
TIFF mapping table for functions to decode special cases.
Definition tiffcomposite_int.hpp:342