Loading...
Searching...
No Matches
tiffvisitor_int.hpp
// SPDX-License-Identifier: GPL-2.0-or-later
#ifndef TIFFVISITOR_INT_HPP_
#define TIFFVISITOR_INT_HPP_
// *****************************************************************************
// included header files
#include "exif.hpp"
#include "tifffwd_int.hpp"
#include "types.hpp"
#include <array>
// *****************************************************************************
// namespace extensions
namespace Exiv2 {
class IptcData;
class XmpData;
namespace Internal {
// *****************************************************************************
// class definitions
class TiffVisitor {
public:
enum GoEvent {
geTraverse = 0,
geKnownMakernote = 1
// Note: If you add more events here, adjust the events_ constant too!
};
private:
static const int events_ = 2;
std::array<bool, events_> go_{true, true};
public:
virtual ~TiffVisitor() = default;
void setGo(GoEvent event, bool go);
virtual void visitEntry(TiffEntry* object) = 0;
virtual void visitDataEntry(TiffDataEntry* object) = 0;
virtual void visitImageEntry(TiffImageEntry* object) = 0;
virtual void visitSizeEntry(TiffSizeEntry* object) = 0;
virtual void visitDirectory(TiffDirectory* object) = 0;
virtual void visitDirectoryNext(TiffDirectory* object);
virtual void visitDirectoryEnd(TiffDirectory* object);
virtual void visitSubIfd(TiffSubIfd* object) = 0;
virtual void visitMnEntry(TiffMnEntry* object) = 0;
virtual void visitIfdMakernote(TiffIfdMakernote* object) = 0;
virtual void visitIfdMakernoteEnd(TiffIfdMakernote* object);
virtual void visitBinaryArray(TiffBinaryArray* object) = 0;
virtual void visitBinaryArrayEnd(TiffBinaryArray* object);
virtual void visitBinaryElement(TiffBinaryElement* object) = 0;
[[nodiscard]] bool go(GoEvent event) const;
}; // class TiffVisitor
class TiffFinder : public TiffVisitor {
public:
constexpr TiffFinder(uint16_t tag, IfdId group) : tag_(tag), group_(group) {
}
TiffFinder(const TiffFinder&) = delete;
TiffFinder& operator=(const TiffFinder&) = delete;
~TiffFinder() override = default;
void visitEntry(TiffEntry* object) override;
void visitDataEntry(TiffDataEntry* object) override;
void visitImageEntry(TiffImageEntry* object) override;
void visitSizeEntry(TiffSizeEntry* object) override;
void visitDirectory(TiffDirectory* object) override;
void visitSubIfd(TiffSubIfd* object) override;
void visitMnEntry(TiffMnEntry* object) override;
void visitIfdMakernote(TiffIfdMakernote* object) override;
void visitBinaryArray(TiffBinaryArray* object) override;
void visitBinaryElement(TiffBinaryElement* object) override;
void findObject(TiffComponent* object);
void init(uint16_t tag, IfdId group);
[[nodiscard]] TiffComponent* result() const {
return tiffComponent_;
}
private:
uint16_t tag_;
IfdId group_;
TiffComponent* tiffComponent_{};
}; // class TiffFinder
class TiffCopier : public TiffVisitor {
public:
TiffCopier(TiffComponent* pRoot, uint32_t root, const TiffHeaderBase* pHeader, const PrimaryGroups* pPrimaryGroups);
TiffCopier(const TiffCopier&) = delete;
TiffCopier& operator=(const TiffCopier&) = delete;
~TiffCopier() override = default;
void visitEntry(TiffEntry* object) override;
void visitDataEntry(TiffDataEntry* object) override;
void visitImageEntry(TiffImageEntry* object) override;
void visitSizeEntry(TiffSizeEntry* object) override;
void visitDirectory(TiffDirectory* object) override;
void visitSubIfd(TiffSubIfd* object) override;
void visitMnEntry(TiffMnEntry* object) override;
void visitIfdMakernote(TiffIfdMakernote* object) override;
void visitBinaryArray(TiffBinaryArray* object) override;
void visitBinaryElement(TiffBinaryElement* object) override;
void copyObject(const TiffComponent* object);
private:
TiffComponent* pRoot_;
uint32_t root_;
const TiffHeaderBase* pHeader_;
const PrimaryGroups* pPrimaryGroups_;
}; // class TiffCopier
class TiffDecoder : public TiffVisitor {
public:
TiffDecoder(ExifData& exifData, IptcData& iptcData, XmpData& xmpData, TiffComponent* pRoot,
FindDecoderFct findDecoderFct);
TiffDecoder(const TiffDecoder&) = delete;
TiffDecoder& operator=(const TiffDecoder&) = delete;
~TiffDecoder() override = default;
void visitEntry(TiffEntry* object) override;
void visitDataEntry(TiffDataEntry* object) override;
void visitImageEntry(TiffImageEntry* object) override;
void visitSizeEntry(TiffSizeEntry* object) override;
void visitDirectory(TiffDirectory* object) override;
void visitSubIfd(TiffSubIfd* object) override;
void visitMnEntry(TiffMnEntry* object) override;
void visitIfdMakernote(TiffIfdMakernote* object) override;
void visitBinaryArray(TiffBinaryArray* object) override;
void visitBinaryElement(TiffBinaryElement* object) override;
void decodeTiffEntry(const TiffEntryBase* object);
void decodeStdTiffEntry(const TiffEntryBase* object);
void decodeIptc(const TiffEntryBase* object);
void decodeXmp(const TiffEntryBase* object);
void decodeCanonAFInfo(const TiffEntryBase* object);
private:
void getObjData(const byte*& pData, size_t& size, uint16_t tag, IfdId group, const TiffEntryBase* object);
// DATA
ExifData& exifData_;
IptcData& iptcData_;
XmpData& xmpData_;
TiffComponent* pRoot_;
FindDecoderFct findDecoderFct_;
std::string make_;
bool decodedIptc_{false};
}; // class TiffDecoder
class TiffEncoder : public TiffVisitor {
public:
TiffEncoder(ExifData& exifData, IptcData& iptcData, XmpData& xmpData, TiffComponent* pRoot, bool isNewImage,
const PrimaryGroups* pPrimaryGroups, const TiffHeaderBase* pHeader, FindEncoderFct findEncoderFct);
TiffEncoder(const TiffEncoder&) = delete;
TiffEncoder& operator=(const TiffEncoder&) = delete;
~TiffEncoder() override = default;
void visitEntry(TiffEntry* object) override;
void visitDataEntry(TiffDataEntry* object) override;
void visitImageEntry(TiffImageEntry* object) override;
void visitSizeEntry(TiffSizeEntry* object) override;
void visitDirectory(TiffDirectory* object) override;
void visitDirectoryNext(TiffDirectory* object) override;
void visitSubIfd(TiffSubIfd* object) override;
void visitMnEntry(TiffMnEntry* object) override;
void visitIfdMakernote(TiffIfdMakernote* object) override;
void visitIfdMakernoteEnd(TiffIfdMakernote* object) override;
void visitBinaryArray(TiffBinaryArray* object) override;
void visitBinaryArrayEnd(TiffBinaryArray* object) override;
void visitBinaryElement(TiffBinaryElement* object) override;
void encodeTiffComponent(TiffEntryBase* object, const Exifdatum* datum = nullptr);
void encodeBinaryElement(TiffBinaryElement* object, const Exifdatum* datum);
void encodeBinaryArray(TiffBinaryArray* object, const Exifdatum* datum);
void encodeDataEntry(TiffDataEntry* object, const Exifdatum* datum);
void encodeTiffEntry(TiffEntry* object, const Exifdatum* datum);
void encodeImageEntry(TiffImageEntry* object, const Exifdatum* datum);
void encodeMnEntry(TiffMnEntry* object, const Exifdatum* datum);
void encodeSizeEntry(TiffSizeEntry* object, const Exifdatum* datum);
void encodeSubIfd(TiffSubIfd* object, const Exifdatum* datum);
void encodeTiffEntryBase(TiffEntryBase* object, const Exifdatum* datum);
void encodeOffsetEntry(TiffEntryBase* object, const Exifdatum* datum);
// Todo void encodeNikonSubIfd(TiffEntryBase* object, const Exifdatum* datum);
void encodeIptc(TiffEntryBase* object, const Exifdatum* datum);
void add(TiffComponent* pRootDir, TiffComponent* pSourceDir, uint32_t root);
void setDirty(bool flag = true);
[[nodiscard]] ByteOrder byteOrder() const {
return byteOrder_;
}
[[nodiscard]] bool dirty() const;
[[nodiscard]] WriteMethod writeMethod() const {
return writeMethod_;
}
private:
void encodeIptc();
void encodeXmp();
static uint32_t updateDirEntry(byte* buf, ByteOrder byteOrder, TiffComponent* pTiffComponent);
[[nodiscard]] bool isImageTag(uint16_t tag, IfdId group) const;
// DATA
ExifData exifData_;
const IptcData& iptcData_;
const XmpData& xmpData_;
bool del_{true};
const TiffHeaderBase* pHeader_;
TiffComponent* pRoot_;
bool isNewImage_;
const PrimaryGroups* pPrimaryGroups_;
TiffComponent* pSourceTree_{nullptr};
ByteOrder byteOrder_;
ByteOrder origByteOrder_;
FindEncoderFct findEncoderFct_;
std::string make_;
bool dirty_{false};
WriteMethod writeMethod_{wmNonIntrusive};
}; // class TiffEncoder
class TiffRwState {
public:
constexpr TiffRwState(ByteOrder byteOrder, size_t baseOffset) : byteOrder_(byteOrder), baseOffset_(baseOffset) {
}
[[nodiscard]] ByteOrder byteOrder() const {
return byteOrder_;
}
[[nodiscard]] size_t baseOffset() const {
return baseOffset_;
}
private:
ByteOrder byteOrder_;
size_t baseOffset_;
}; // TiffRwState
class TiffReader : public TiffVisitor {
public:
TiffReader(const byte* pData, size_t size, TiffComponent* pRoot, TiffRwState state);
TiffReader(const TiffReader&) = delete;
TiffReader& operator=(const TiffReader&) = delete;
~TiffReader() override = default;
void visitEntry(TiffEntry* object) override;
void visitDataEntry(TiffDataEntry* object) override;
void visitImageEntry(TiffImageEntry* object) override;
void visitSizeEntry(TiffSizeEntry* object) override;
void visitDirectory(TiffDirectory* object) override;
void visitSubIfd(TiffSubIfd* object) override;
void visitMnEntry(TiffMnEntry* object) override;
void visitIfdMakernote(TiffIfdMakernote* object) override;
void visitIfdMakernoteEnd(TiffIfdMakernote* object) override;
void visitBinaryArray(TiffBinaryArray* object) override;
void visitBinaryElement(TiffBinaryElement* object) override;
void readTiffEntry(TiffEntryBase* object);
void readDataEntryBase(TiffDataEntryBase* object);
void setMnState(const TiffRwState* state = nullptr);
void setOrigState();
bool circularReference(const byte* start, IfdId group);
int nextIdx(IfdId group);
void postProcess();
[[nodiscard]] ByteOrder byteOrder() const;
[[nodiscard]] size_t baseOffset() const;
private:
using DirList = std::map<const byte*, IfdId>;
using IdxSeq = std::map<IfdId, int>;
using PostList = std::vector<TiffComponent*>;
// DATA
const byte* pData_;
size_t size_;
const byte* pLast_;
TiffComponent* pRoot_;
TiffRwState* pState_;
TiffRwState origState_;
TiffRwState mnState_;
DirList dirList_;
IdxSeq idxSeq_;
PostList postList_;
bool postProc_{false};
};
} // namespace Internal
} // namespace Exiv2
#endif // #ifndef TIFFVISITOR_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::Exifdatum
An Exif metadatum, consisting of an ExifKey and a Value and methods to manipulate these.
Definition exif.hpp:41
Exiv2::Internal::TiffBinaryArray
Composite to model an array of different tags. The tag types as well as other aspects of the array ar...
Definition tiffcomposite_int.hpp:1263
Exiv2::Internal::TiffBinaryElement
Element of a TiffBinaryArray.
Definition tiffcomposite_int.hpp:1394
Exiv2::Internal::TiffComponent
Interface class for components of a TIFF directory hierarchy (Composite pattern). Both TIFF directori...
Definition tiffcomposite_int.hpp:152
Exiv2::Internal::TiffCopier::~TiffCopier
~TiffCopier() override=default
Virtual destructor.
Exiv2::Internal::TiffCopier::visitMnEntry
void visitMnEntry(TiffMnEntry *object) override
Copy a TIFF makernote if it is an image tag.
Definition tiffvisitor_int.cpp:170
Exiv2::Internal::TiffCopier::visitDataEntry
void visitDataEntry(TiffDataEntry *object) override
Copy a TIFF data entry if it is an image tag.
Definition tiffvisitor_int.cpp:150
Exiv2::Internal::TiffCopier::visitImageEntry
void visitImageEntry(TiffImageEntry *object) override
Copy a TIFF image entry if it is an image tag.
Definition tiffvisitor_int.cpp:154
Exiv2::Internal::TiffCopier::visitDirectory
void visitDirectory(TiffDirectory *object) override
Copy a TIFF directory if it is an image tag.
Definition tiffvisitor_int.cpp:162
Exiv2::Internal::TiffCopier::visitIfdMakernote
void visitIfdMakernote(TiffIfdMakernote *object) override
Copy an IFD makernote if it is an image tag.
Definition tiffvisitor_int.cpp:174
Exiv2::Internal::TiffCopier::visitEntry
void visitEntry(TiffEntry *object) override
Copy a TIFF entry if it is an image tag.
Definition tiffvisitor_int.cpp:146
Exiv2::Internal::TiffCopier::visitBinaryElement
void visitBinaryElement(TiffBinaryElement *object) override
Copy an element of a binary array if it is an image tag.
Definition tiffvisitor_int.cpp:182
Exiv2::Internal::TiffCopier::visitSizeEntry
void visitSizeEntry(TiffSizeEntry *object) override
Copy a TIFF size entry if it is an image tag.
Definition tiffvisitor_int.cpp:158
Exiv2::Internal::TiffCopier::copyObject
void copyObject(const TiffComponent *object)
Check if object is an image tag and if so, copy it to the target tree.
Definition tiffvisitor_int.cpp:133
Exiv2::Internal::TiffCopier::visitBinaryArray
void visitBinaryArray(TiffBinaryArray *object) override
Copy a binary array if it is an image tag.
Definition tiffvisitor_int.cpp:178
Exiv2::Internal::TiffCopier::visitSubIfd
void visitSubIfd(TiffSubIfd *object) override
Copy a TIFF sub-IFD if it is an image tag.
Definition tiffvisitor_int.cpp:166
Exiv2::Internal::TiffCopier::TiffCopier
TiffCopier(TiffComponent *pRoot, uint32_t root, const TiffHeaderBase *pHeader, const PrimaryGroups *pPrimaryGroups)
Constructor.
Definition tiffvisitor_int.cpp:128
Exiv2::Internal::TiffDataEntryBase
Interface for a standard TIFF IFD entry consisting of a value which is a set of offsets to a data are...
Definition tiffcomposite_int.hpp:598
Exiv2::Internal::TiffDataEntry
A standard TIFF IFD entry consisting of a value which is an offset to a data area and the data area....
Definition tiffcomposite_int.hpp:649
Exiv2::Internal::TiffDecoder::visitMnEntry
void visitMnEntry(TiffMnEntry *object) override
Decode a TIFF makernote.
Definition tiffvisitor_int.cpp:229
Exiv2::Internal::TiffDecoder::visitImageEntry
void visitImageEntry(TiffImageEntry *object) override
Decode a TIFF image entry.
Definition tiffvisitor_int.cpp:213
Exiv2::Internal::TiffDecoder::visitBinaryArray
void visitBinaryArray(TiffBinaryArray *object) override
Decode a binary array.
Definition tiffvisitor_int.cpp:434
Exiv2::Internal::TiffDecoder::visitDataEntry
void visitDataEntry(TiffDataEntry *object) override
Decode a TIFF data entry.
Definition tiffvisitor_int.cpp:209
Exiv2::Internal::TiffDecoder::visitSubIfd
void visitSubIfd(TiffSubIfd *object) override
Decode a TIFF sub-IFD.
Definition tiffvisitor_int.cpp:225
Exiv2::Internal::TiffDecoder::TiffDecoder
TiffDecoder(ExifData &exifData, IptcData &iptcData, XmpData &xmpData, TiffComponent *pRoot, FindDecoderFct findDecoderFct)
Constructor, taking metadata containers to add the metadata to, the root element of the composite to ...
Definition tiffvisitor_int.cpp:186
Exiv2::Internal::TiffDecoder::decodeStdTiffEntry
void decodeStdTiffEntry(const TiffEntryBase *object)
Decode a standard TIFF entry.
Definition tiffvisitor_int.cpp:427
Exiv2::Internal::TiffDecoder::decodeIptc
void decodeIptc(const TiffEntryBase *object)
Decode IPTC data from an IPTCNAA tag or Photoshop ImageResources.
Definition tiffvisitor_int.cpp:289
Exiv2::Internal::TiffDecoder::decodeCanonAFInfo
void decodeCanonAFInfo(const TiffEntryBase *object)
Decode Exif.Canon.AFInfo.
Definition tiffvisitor_int.cpp:345
Exiv2::Internal::TiffDecoder::visitIfdMakernote
void visitIfdMakernote(TiffIfdMakernote *object) override
Decode an IFD makernote.
Definition tiffvisitor_int.cpp:234
Exiv2::Internal::TiffDecoder::~TiffDecoder
~TiffDecoder() override=default
Virtual destructor.
Exiv2::Internal::TiffDecoder::visitSizeEntry
void visitSizeEntry(TiffSizeEntry *object) override
Decode a TIFF size entry.
Definition tiffvisitor_int.cpp:217
Exiv2::Internal::TiffDecoder::decodeTiffEntry
void decodeTiffEntry(const TiffEntryBase *object)
Entry function, determines how to decode each tag.
Definition tiffvisitor_int.cpp:417
Exiv2::Internal::TiffDecoder::visitBinaryElement
void visitBinaryElement(TiffBinaryElement *object) override
Decode an element of a binary array.
Definition tiffvisitor_int.cpp:440
Exiv2::Internal::TiffDecoder::visitEntry
void visitEntry(TiffEntry *object) override
Decode a TIFF entry.
Definition tiffvisitor_int.cpp:205
Exiv2::Internal::TiffDecoder::decodeXmp
void decodeXmp(const TiffEntryBase *object)
Decode XMP packet from an XMLPacket tag.
Definition tiffvisitor_int.cpp:264
Exiv2::Internal::TiffDecoder::visitDirectory
void visitDirectory(TiffDirectory *object) override
Decode a TIFF directory.
Definition tiffvisitor_int.cpp:221
Exiv2::Internal::TiffDirectory
This class models a TIFF directory (Ifd). It is a composite component of the TIFF tree.
Definition tiffcomposite_int.hpp:823
Exiv2::Internal::TiffEncoder::TiffEncoder
TiffEncoder(ExifData &exifData, IptcData &iptcData, XmpData &xmpData, TiffComponent *pRoot, bool isNewImage, const PrimaryGroups *pPrimaryGroups, const TiffHeaderBase *pHeader, FindEncoderFct findEncoderFct)
Constructor, taking the root element of the composite to encode to, the image with the metadata to en...
Definition tiffvisitor_int.cpp:444
Exiv2::Internal::TiffEncoder::visitSizeEntry
void visitSizeEntry(TiffSizeEntry *object) override
Encode a TIFF size entry.
Definition tiffvisitor_int.cpp:574
Exiv2::Internal::TiffEncoder::encodeMnEntry
void encodeMnEntry(TiffMnEntry *object, const Exifdatum *datum)
Callback encoder function for a Makernote entry.
Definition tiffvisitor_int.cpp:861
Exiv2::Internal::TiffEncoder::encodeSubIfd
void encodeSubIfd(TiffSubIfd *object, const Exifdatum *datum)
Callback encoder function for a sub-IFD entry.
Definition tiffvisitor_int.cpp:871
Exiv2::Internal::TiffEncoder::visitDirectory
void visitDirectory(TiffDirectory *object) override
Encode a TIFF directory.
Definition tiffvisitor_int.cpp:578
Exiv2::Internal::TiffEncoder::visitIfdMakernoteEnd
void visitIfdMakernoteEnd(TiffIfdMakernote *object) override
Reset encoder to its original state, undo makernote specific settings.
Definition tiffvisitor_int.cpp:653
Exiv2::Internal::TiffEncoder::~TiffEncoder
~TiffEncoder() override=default
Virtual destructor.
Exiv2::Internal::TiffEncoder::visitMnEntry
void visitMnEntry(TiffMnEntry *object) override
Encode a TIFF makernote.
Definition tiffvisitor_int.cpp:612
Exiv2::Internal::TiffEncoder::encodeTiffEntryBase
void encodeTiffEntryBase(TiffEntryBase *object, const Exifdatum *datum)
Special encoder function for the base part of a TIFF entry.
Definition tiffvisitor_int.cpp:875
Exiv2::Internal::TiffEncoder::encodeTiffComponent
void encodeTiffComponent(TiffEntryBase *object, const Exifdatum *datum=nullptr)
Top level encoder function. Determines how to encode each TIFF component. This function is called by ...
Definition tiffvisitor_int.cpp:705
Exiv2::Internal::TiffEncoder::setDirty
void setDirty(bool flag=true)
Set the dirty flag and end of traversing signal.
Definition tiffvisitor_int.cpp:553
Exiv2::Internal::TiffEncoder::encodeImageEntry
void encodeImageEntry(TiffImageEntry *object, const Exifdatum *datum)
Callback encoder function for an image entry.
Definition tiffvisitor_int.cpp:793
Exiv2::Internal::TiffEncoder::visitDirectoryNext
void visitDirectoryNext(TiffDirectory *object) override
Update directory entries.
Definition tiffvisitor_int.cpp:582
Exiv2::Internal::TiffEncoder::visitIfdMakernote
void visitIfdMakernote(TiffIfdMakernote *object) override
Encode an IFD makernote.
Definition tiffvisitor_int.cpp:625
Exiv2::Internal::TiffEncoder::encodeTiffEntry
void encodeTiffEntry(TiffEntry *object, const Exifdatum *datum)
Callback encoder function for a standard TIFF entry.
Definition tiffvisitor_int.cpp:789
Exiv2::Internal::TiffEncoder::encodeBinaryArray
void encodeBinaryArray(TiffBinaryArray *object, const Exifdatum *datum)
Callback encoder function for a binary array.
Definition tiffvisitor_int.cpp:753
Exiv2::Internal::TiffEncoder::encodeOffsetEntry
void encodeOffsetEntry(TiffEntryBase *object, const Exifdatum *datum)
Special encoder function for an offset entry.
Definition tiffvisitor_int.cpp:895
Exiv2::Internal::TiffEncoder::encodeIptc
void encodeIptc(TiffEntryBase *object, const Exifdatum *datum)
Special encoder function to encode SubIFD contents to Image group if it contains primary image data.
Exiv2::Internal::TiffEncoder::visitBinaryArray
void visitBinaryArray(TiffBinaryArray *object) override
Encode a binary array.
Definition tiffvisitor_int.cpp:659
Exiv2::Internal::TiffEncoder::visitImageEntry
void visitImageEntry(TiffImageEntry *object) override
Encode a TIFF image entry.
Definition tiffvisitor_int.cpp:570
Exiv2::Internal::TiffEncoder::encodeBinaryElement
void encodeBinaryElement(TiffBinaryElement *object, const Exifdatum *datum)
Callback encoder function for an element of a binary array.
Definition tiffvisitor_int.cpp:757
Exiv2::Internal::TiffEncoder::dirty
bool dirty() const
True if any tag was deleted or allocated in the process of visiting a TIFF composite tree.
Definition tiffvisitor_int.cpp:558
Exiv2::Internal::TiffEncoder::add
void add(TiffComponent *pRootDir, TiffComponent *pSourceDir, uint32_t root)
Add metadata from image to the TIFF composite.
Definition tiffvisitor_int.cpp:915
Exiv2::Internal::TiffEncoder::encodeDataEntry
void encodeDataEntry(TiffDataEntry *object, const Exifdatum *datum)
Callback encoder function for a data entry.
Definition tiffvisitor_int.cpp:761
Exiv2::Internal::TiffEncoder::encodeSizeEntry
void encodeSizeEntry(TiffSizeEntry *object, const Exifdatum *datum)
Callback encoder function for a size entry.
Definition tiffvisitor_int.cpp:867
Exiv2::Internal::TiffEncoder::visitEntry
void visitEntry(TiffEntry *object) override
Encode a TIFF entry.
Definition tiffvisitor_int.cpp:562
Exiv2::Internal::TiffEncoder::visitDataEntry
void visitDataEntry(TiffDataEntry *object) override
Encode a TIFF data entry.
Definition tiffvisitor_int.cpp:566
Exiv2::Internal::TiffEncoder::visitBinaryArrayEnd
void visitBinaryArrayEnd(TiffBinaryArray *object) override
Re-encrypt binary array if necessary.
Definition tiffvisitor_int.cpp:665
Exiv2::Internal::TiffEncoder::visitBinaryElement
void visitBinaryElement(TiffBinaryElement *object) override
Encode an element of a binary array.
Definition tiffvisitor_int.cpp:692
Exiv2::Internal::TiffEncoder::visitSubIfd
void visitSubIfd(TiffSubIfd *object) override
Encode a TIFF sub-IFD.
Definition tiffvisitor_int.cpp:608
Exiv2::Internal::TiffEncoder::byteOrder
ByteOrder byteOrder() const
Return the applicable byte order. May be different for the Makernote and the rest of the TIFF entries...
Definition tiffvisitor_int.hpp:460
Exiv2::Internal::TiffEncoder::writeMethod
WriteMethod writeMethod() const
Return the write method used.
Definition tiffvisitor_int.hpp:469
Exiv2::Internal::TiffEntryBase
This abstract base class provides the common functionality of an IFD directory entry and defines an e...
Definition tiffcomposite_int.hpp:380
Exiv2::Internal::TiffEntry
A standard TIFF IFD entry.
Definition tiffcomposite_int.hpp:568
Exiv2::Internal::TiffFinder
Search the composite for a component with tag and group. Return a pointer to the component or 0,...
Definition tiffvisitor_int.hpp:128
Exiv2::Internal::TiffFinder::visitIfdMakernote
void visitIfdMakernote(TiffIfdMakernote *object) override
Find tag and group in an IFD makernote.
Definition tiffvisitor_int.cpp:116
Exiv2::Internal::TiffFinder::visitEntry
void visitEntry(TiffEntry *object) override
Find tag and group in a TIFF entry.
Definition tiffvisitor_int.cpp:88
Exiv2::Internal::TiffFinder::visitSizeEntry
void visitSizeEntry(TiffSizeEntry *object) override
Find tag and group in a TIFF size entry.
Definition tiffvisitor_int.cpp:100
Exiv2::Internal::TiffFinder::visitSubIfd
void visitSubIfd(TiffSubIfd *object) override
Find tag and group in a TIFF sub-IFD.
Definition tiffvisitor_int.cpp:108
Exiv2::Internal::TiffFinder::visitBinaryArray
void visitBinaryArray(TiffBinaryArray *object) override
Find tag and group in a binary array.
Definition tiffvisitor_int.cpp:120
Exiv2::Internal::TiffFinder::~TiffFinder
~TiffFinder() override=default
Virtual destructor.
Exiv2::Internal::TiffFinder::visitDataEntry
void visitDataEntry(TiffDataEntry *object) override
Find tag and group in a TIFF data entry.
Definition tiffvisitor_int.cpp:92
Exiv2::Internal::TiffFinder::TiffFinder
constexpr TiffFinder(uint16_t tag, IfdId group)
Constructor, taking tag and group of the component to find.
Definition tiffvisitor_int.hpp:133
Exiv2::Internal::TiffFinder::visitDirectory
void visitDirectory(TiffDirectory *object) override
Find tag and group in a TIFF directory.
Definition tiffvisitor_int.cpp:104
Exiv2::Internal::TiffFinder::visitMnEntry
void visitMnEntry(TiffMnEntry *object) override
Find tag and group in a TIFF makernote.
Definition tiffvisitor_int.cpp:112
Exiv2::Internal::TiffFinder::result
TiffComponent * result() const
Return the search result. 0 if no TIFF component was found for the tag and group combination.
Definition tiffvisitor_int.hpp:176
Exiv2::Internal::TiffFinder::visitImageEntry
void visitImageEntry(TiffImageEntry *object) override
Find tag and group in a TIFF image entry.
Definition tiffvisitor_int.cpp:96
Exiv2::Internal::TiffFinder::init
void init(uint16_t tag, IfdId group)
Initialize the Finder for a new search.
Definition tiffvisitor_int.cpp:74
Exiv2::Internal::TiffFinder::visitBinaryElement
void visitBinaryElement(TiffBinaryElement *object) override
Find tag and group in an element of a binary array.
Definition tiffvisitor_int.cpp:124
Exiv2::Internal::TiffFinder::findObject
void findObject(TiffComponent *object)
Check if object matches tag and group.
Definition tiffvisitor_int.cpp:81
Exiv2::Internal::TiffHeaderBase
Contains internal objects which are not published and are not part of the libexiv2 API.
Definition tiffimage_int.hpp:29
Exiv2::Internal::TiffIfdMakernote
Tiff IFD Makernote. This is a concrete class suitable for all IFD makernotes.
Definition tiffcomposite_int.hpp:1067
Exiv2::Internal::TiffImageEntry
A standard TIFF IFD entry consisting of a value which is an array of offsets to image data areas....
Definition tiffcomposite_int.hpp:714
Exiv2::Internal::TiffMnEntry
This class is the basis for Makernote support in TIFF. It contains a pointer to a concrete Makernote....
Definition tiffcomposite_int.hpp:1006
Exiv2::Internal::TiffReader::visitEntry
void visitEntry(TiffEntry *object) override
Read a TIFF entry from the data buffer.
Definition tiffvisitor_int.cpp:1017
Exiv2::Internal::TiffReader::baseOffset
size_t baseOffset() const
Return the base offset. See class TiffRwState for details.
Definition tiffvisitor_int.cpp:1003
Exiv2::Internal::TiffReader::visitIfdMakernoteEnd
void visitIfdMakernoteEnd(TiffIfdMakernote *object) override
Reset reader to its original state, undo makernote specific settings.
Definition tiffvisitor_int.cpp:1222
Exiv2::Internal::TiffReader::TiffReader
TiffReader(const byte *pData, size_t size, TiffComponent *pRoot, TiffRwState state)
Constructor. The data buffer and table describing the TIFF structure of the data are set in the const...
Definition tiffvisitor_int.cpp:977
Exiv2::Internal::TiffReader::readDataEntryBase
void readDataEntryBase(TiffDataEntryBase *object)
Read a TiffDataEntryBase from the data buffer.
Definition tiffvisitor_int.cpp:1007
Exiv2::Internal::TiffReader::visitDirectory
void visitDirectory(TiffDirectory *object) override
Read a TIFF directory from the data buffer.
Definition tiffvisitor_int.cpp:1065
Exiv2::Internal::TiffReader::byteOrder
ByteOrder byteOrder() const
Return the byte order.
Definition tiffvisitor_int.cpp:999
Exiv2::Internal::TiffReader::setMnState
void setMnState(const TiffRwState *state=nullptr)
Set the state of the reader to one suitable for the Makernote.
Definition tiffvisitor_int.cpp:987
Exiv2::Internal::TiffReader::visitSubIfd
void visitSubIfd(TiffSubIfd *object) override
Read a TIFF sub-IFD from the data buffer.
Definition tiffvisitor_int.cpp:1139
Exiv2::Internal::TiffReader::nextIdx
int nextIdx(IfdId group)
Return the next idx sequence number for group.
Definition tiffvisitor_int.cpp:1051
Exiv2::Internal::TiffReader::visitDataEntry
void visitDataEntry(TiffDataEntry *object) override
Read a TIFF data entry from the data buffer.
Definition tiffvisitor_int.cpp:1021
Exiv2::Internal::TiffReader::readTiffEntry
void readTiffEntry(TiffEntryBase *object)
Read a standard TIFF entry from the data buffer.
Definition tiffvisitor_int.cpp:1227
Exiv2::Internal::TiffReader::visitImageEntry
void visitImageEntry(TiffImageEntry *object) override
Read a TIFF image entry from the data buffer.
Definition tiffvisitor_int.cpp:1025
Exiv2::Internal::TiffReader::~TiffReader
~TiffReader() override=default
Virtual destructor.
Exiv2::Internal::TiffReader::setOrigState
void setOrigState()
Set the state to the original state as set in the constructor.
Definition tiffvisitor_int.cpp:983
Exiv2::Internal::TiffReader::visitSizeEntry
void visitSizeEntry(TiffSizeEntry *object) override
Read a TIFF size entry from the data buffer.
Definition tiffvisitor_int.cpp:1029
Exiv2::Internal::TiffReader::circularReference
bool circularReference(const byte *start, IfdId group)
Check IFD directory pointer start for circular reference.
Definition tiffvisitor_int.cpp:1039
Exiv2::Internal::TiffReader::visitBinaryElement
void visitBinaryElement(TiffBinaryElement *object) override
Read an element of a binary array from the data buffer.
Definition tiffvisitor_int.cpp:1408
Exiv2::Internal::TiffReader::visitMnEntry
void visitMnEntry(TiffMnEntry *object) override
Read a TIFF makernote entry from the data buffer.
Definition tiffvisitor_int.cpp:1179
Exiv2::Internal::TiffReader::visitIfdMakernote
void visitIfdMakernote(TiffIfdMakernote *object) override
Read an IFD makernote from the data buffer.
Definition tiffvisitor_int.cpp:1197
Exiv2::Internal::TiffReader::visitBinaryArray
void visitBinaryArray(TiffBinaryArray *object) override
Read a binary array from the data buffer.
Definition tiffvisitor_int.cpp:1330
Exiv2::Internal::TiffReader::postProcess
void postProcess()
Read deferred components.
Definition tiffvisitor_int.cpp:1055
Exiv2::Internal::TiffRwState
Simple state class containing relevant state information for the TIFF reader. This is in a separate c...
Definition tiffvisitor_int.hpp:535
Exiv2::Internal::TiffRwState::byteOrder
ByteOrder byteOrder() const
Return the applicable byte order. May be different for the Makernote and the rest of the TIFF entries...
Definition tiffvisitor_int.hpp:550
Exiv2::Internal::TiffRwState::baseOffset
size_t baseOffset() const
Return the base offset.
Definition tiffvisitor_int.hpp:564
Exiv2::Internal::TiffRwState::TiffRwState
constexpr TiffRwState(ByteOrder byteOrder, size_t baseOffset)
Constructor.
Definition tiffvisitor_int.hpp:540
Exiv2::Internal::TiffSizeEntry
A TIFF IFD entry containing the size of a data area of a related TiffDataEntry. This component is use...
Definition tiffcomposite_int.hpp:778
Exiv2::Internal::TiffSubIfd
This class models a TIFF sub-directory (sub-IFD). A sub-IFD is an entry with one or more values that ...
Definition tiffcomposite_int.hpp:932
Exiv2::Internal::TiffVisitor
Abstract base class defining the interface for TIFF composite visitors (Visitor pattern).
Definition tiffvisitor_int.hpp:39
Exiv2::Internal::TiffVisitor::visitDataEntry
virtual void visitDataEntry(TiffDataEntry *object)=0
Operation to perform for a TIFF data entry.
Exiv2::Internal::TiffVisitor::go
bool go(GoEvent event) const
Check if stop flag for event is clear, return true if it's clear.
Definition tiffvisitor_int.cpp:58
Exiv2::Internal::TiffVisitor::visitDirectoryNext
virtual void visitDirectoryNext(TiffDirectory *object)
Operation to perform for a TIFF directory, after all components and before the next entry is processe...
Definition tiffvisitor_int.cpp:62
Exiv2::Internal::TiffVisitor::visitBinaryArrayEnd
virtual void visitBinaryArrayEnd(TiffBinaryArray *object)
Operation to perform for a TIFF binary array, at the end of the processing.
Definition tiffvisitor_int.cpp:71
Exiv2::Internal::TiffVisitor::visitBinaryElement
virtual void visitBinaryElement(TiffBinaryElement *object)=0
Operation to perform for an element of a binary array.
Exiv2::Internal::TiffVisitor::GoEvent
GoEvent
Events for the stop/go flag. See setGo().
Definition tiffvisitor_int.hpp:42
Exiv2::Internal::TiffVisitor::geTraverse
@ geTraverse
Signal to control traversing of the composite tree.
Definition tiffvisitor_int.hpp:44
Exiv2::Internal::TiffVisitor::geKnownMakernote
@ geKnownMakernote
Signal used by TiffReader to signal an unknown makernote.
Definition tiffvisitor_int.hpp:46
Exiv2::Internal::TiffVisitor::visitBinaryArray
virtual void visitBinaryArray(TiffBinaryArray *object)=0
Operation to perform for a binary array.
Exiv2::Internal::TiffVisitor::visitSubIfd
virtual void visitSubIfd(TiffSubIfd *object)=0
Operation to perform for a TIFF sub-IFD.
Exiv2::Internal::TiffVisitor::visitDirectory
virtual void visitDirectory(TiffDirectory *object)=0
Operation to perform for a TIFF directory.
Exiv2::Internal::TiffVisitor::visitImageEntry
virtual void visitImageEntry(TiffImageEntry *object)=0
Operation to perform for a TIFF image entry.
Exiv2::Internal::TiffVisitor::visitMnEntry
virtual void visitMnEntry(TiffMnEntry *object)=0
Operation to perform for the makernote component.
Exiv2::Internal::TiffVisitor::visitIfdMakernote
virtual void visitIfdMakernote(TiffIfdMakernote *object)=0
Operation to perform for an IFD makernote.
Exiv2::Internal::TiffVisitor::~TiffVisitor
virtual ~TiffVisitor()=default
Virtual destructor.
Exiv2::Internal::TiffVisitor::visitSizeEntry
virtual void visitSizeEntry(TiffSizeEntry *object)=0
Operation to perform for a TIFF size entry.
Exiv2::Internal::TiffVisitor::setGo
void setGo(GoEvent event, bool go)
Set the stop/go flag: true for go, false for stop.
Definition tiffvisitor_int.cpp:54
Exiv2::Internal::TiffVisitor::visitEntry
virtual void visitEntry(TiffEntry *object)=0
Operation to perform for a TIFF entry.
Exiv2::Internal::TiffVisitor::visitIfdMakernoteEnd
virtual void visitIfdMakernoteEnd(TiffIfdMakernote *object)
Operation to perform after processing an IFD makernote.
Definition tiffvisitor_int.cpp:68
Exiv2::Internal::TiffVisitor::visitDirectoryEnd
virtual void visitDirectoryEnd(TiffDirectory *object)
Operation to perform for a TIFF directory, at the end of the processing.
Definition tiffvisitor_int.cpp:65
Exiv2::IptcData
A container for IPTC data. This is a top-level class of the Exiv2 library.
Definition iptc.hpp:153
Exiv2::XmpData
A container for XMP data. This is a top-level class of the Exiv2 library.
Definition xmp_exiv2.hpp:138
exif.hpp
Encoding and decoding of Exif data.
Exiv2::Internal
Helper structure for the Matroska tags lookup table.
Definition matroskavideo.hpp:39
Exiv2::Internal::FindDecoderFct
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
Exiv2::Internal::FindEncoderFct
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
Exiv2::Internal::PrimaryGroups
std::vector< IfdId > PrimaryGroups
Type for a list of primary image groups.
Definition tifffwd_int.hpp:80
Exiv2
Class CrwImage to access Canon CRW images. References: The Canon RAW (CRW) File Format by Phil Harv...
Definition asfvideo.hpp:15
Exiv2::IfdId
IfdId
Type to specify the IFD to which a metadata belongs.
Definition tags.hpp:34
Exiv2::ByteOrder
ByteOrder
Type to express the byte order (little or big endian).
Definition types.hpp:34
Exiv2::WriteMethod
WriteMethod
Type to indicate write method used by TIFF parsers.
Definition types.hpp:41