tiffvisitor_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 TIFFVISITOR_INT_HPP_
#define TIFFVISITOR_INT_HPP_
// *****************************************************************************
// included header files
#include "exif.hpp"
#include "tifffwd_int.hpp"
#include "types.hpp"
// + standard includes
#include <memory>
#include <iostream>
#include <iomanip>
#include <cassert>
#include <map>
#include <set>
#include <vector>
// *****************************************************************************
// 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;
bool go_[events_];
public:
TiffVisitor();
virtual ~TiffVisitor();
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;
bool go(GoEvent event) const;
}; // class TiffVisitor
class TiffFinder : public TiffVisitor {
public:
TiffFinder(uint16_t tag, IfdId group)
: tag_(tag), group_(group), tiffComponent_(0) {}
virtual ~TiffFinder();
virtual void visitEntry(TiffEntry* object);
virtual void visitDataEntry(TiffDataEntry* object);
virtual void visitImageEntry(TiffImageEntry* object);
virtual void visitSizeEntry(TiffSizeEntry* object);
virtual void visitDirectory(TiffDirectory* object);
virtual void visitSubIfd(TiffSubIfd* object);
virtual void visitMnEntry(TiffMnEntry* object);
virtual void visitIfdMakernote(TiffIfdMakernote* object);
virtual void visitBinaryArray(TiffBinaryArray* object);
virtual void visitBinaryElement(TiffBinaryElement* object);
void findObject(TiffComponent* object);
void init(uint16_t tag, IfdId group);
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);
virtual ~TiffCopier();
virtual void visitEntry(TiffEntry* object);
virtual void visitDataEntry(TiffDataEntry* object);
virtual void visitImageEntry(TiffImageEntry* object);
virtual void visitSizeEntry(TiffSizeEntry* object);
virtual void visitDirectory(TiffDirectory* object);
virtual void visitSubIfd(TiffSubIfd* object);
virtual void visitMnEntry(TiffMnEntry* object);
virtual void visitIfdMakernote(TiffIfdMakernote* object);
virtual void visitBinaryArray(TiffBinaryArray* object);
virtual void visitBinaryElement(TiffBinaryElement* object);
void copyObject(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* const pRoot,
FindDecoderFct findDecoderFct
);
virtual ~TiffDecoder();
virtual void visitEntry(TiffEntry* object);
virtual void visitDataEntry(TiffDataEntry* object);
virtual void visitImageEntry(TiffImageEntry* object);
virtual void visitSizeEntry(TiffSizeEntry* object);
virtual void visitDirectory(TiffDirectory* object);
virtual void visitSubIfd(TiffSubIfd* object);
virtual void visitMnEntry(TiffMnEntry* object);
virtual void visitIfdMakernote(TiffIfdMakernote* object);
virtual void visitBinaryArray(TiffBinaryArray* object);
virtual void visitBinaryElement(TiffBinaryElement* object);
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(byte const*& pData,
long& size,
uint16_t tag,
IfdId group,
const TiffEntryBase* object);
private:
// DATA
ExifData& exifData_;
IptcData& iptcData_;
XmpData& xmpData_;
TiffComponent* const pRoot_;
const FindDecoderFct findDecoderFct_;
std::string make_;
bool decodedIptc_;
}; // class TiffDecoder
class TiffEncoder : public TiffVisitor {
public:
TiffEncoder(
const ExifData& exifData,
const IptcData& iptcData,
const XmpData& xmpData,
TiffComponent* pRoot,
const bool isNewImage,
const PrimaryGroups* pPrimaryGroups,
const TiffHeaderBase* pHeader,
FindEncoderFct findEncoderFct
);
virtual ~TiffEncoder();
virtual void visitEntry(TiffEntry* object);
virtual void visitDataEntry(TiffDataEntry* object);
virtual void visitImageEntry(TiffImageEntry* object);
virtual void visitSizeEntry(TiffSizeEntry* object);
virtual void visitDirectory(TiffDirectory* object);
virtual void visitDirectoryNext(TiffDirectory* object);
virtual void visitSubIfd(TiffSubIfd* object);
virtual void visitMnEntry(TiffMnEntry* object);
virtual void visitIfdMakernote(TiffIfdMakernote* object);
virtual void visitIfdMakernoteEnd(TiffIfdMakernote* object);
virtual void visitBinaryArray(TiffBinaryArray* object);
virtual void visitBinaryArrayEnd(TiffBinaryArray* object);
virtual void visitBinaryElement(TiffBinaryElement* object);
void encodeTiffComponent(
TiffEntryBase* object,
const Exifdatum* datum =0
);
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);
ByteOrder byteOrder() const { return byteOrder_; }
bool dirty() const;
WriteMethod writeMethod() const { return writeMethod_; }
private:
void encodeIptc();
void encodeXmp();
uint32_t updateDirEntry(byte* buf,
ByteOrder byteOrder,
TiffComponent* pTiffComponent) const;
bool isImageTag(uint16_t tag, IfdId group) const;
private:
// DATA
ExifData exifData_;
const IptcData& iptcData_;
const XmpData& xmpData_;
bool del_;
const TiffHeaderBase* pHeader_;
TiffComponent* pRoot_;
const bool isNewImage_;
const PrimaryGroups* pPrimaryGroups_;
TiffComponent* pSourceTree_;
ByteOrder byteOrder_;
ByteOrder origByteOrder_;
const FindEncoderFct findEncoderFct_;
std::string make_;
bool dirty_;
WriteMethod writeMethod_;
}; // class TiffEncoder
class TiffRwState {
public:
TiffRwState(ByteOrder byteOrder,
uint32_t baseOffset)
: byteOrder_(byteOrder),
baseOffset_(baseOffset) {}
ByteOrder byteOrder() const { return byteOrder_; }
uint32_t baseOffset() const { return baseOffset_; }
private:
ByteOrder byteOrder_;
uint32_t baseOffset_;
}; // TiffRwState
class TiffReader : public TiffVisitor {
public:
TiffReader(const byte* pData,
uint32_t size,
TiffComponent* pRoot,
TiffRwState state);
virtual ~TiffReader();
virtual void visitEntry(TiffEntry* object);
virtual void visitDataEntry(TiffDataEntry* object);
virtual void visitImageEntry(TiffImageEntry* object);
virtual void visitSizeEntry(TiffSizeEntry* object);
virtual void visitDirectory(TiffDirectory* object);
virtual void visitSubIfd(TiffSubIfd* object);
virtual void visitMnEntry(TiffMnEntry* object);
virtual void visitIfdMakernote(TiffIfdMakernote* object);
virtual void visitIfdMakernoteEnd(TiffIfdMakernote* object);
virtual void visitBinaryArray(TiffBinaryArray* object);
virtual void visitBinaryElement(TiffBinaryElement* object);
void readTiffEntry(TiffEntryBase* object);
void readDataEntryBase(TiffDataEntryBase* object);
void setMnState(const TiffRwState* state =0);
void setOrigState();
bool circularReference(const byte* start, IfdId group);
int nextIdx(IfdId group);
void postProcess();
ByteOrder byteOrder() const;
uint32_t baseOffset() const;
private:
typedef std::map<const byte*, IfdId> DirList;
typedef std::map<uint16_t, int> IdxSeq;
typedef std::vector<TiffComponent*> PostList;
// DATA
const byte* pData_;
const uint32_t size_;
const byte* pLast_;
TiffComponent* const pRoot_;
TiffRwState* pState_;
TiffRwState origState_;
TiffRwState mnState_;
DirList dirList_;
IdxSeq idxSeq_;
PostList postList_;
bool postProc_;
}; // class TiffReader
}} // namespace Internal, 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:434
Exiv2::Exifdatum
An Exif metadatum, consisting of an ExifKey and a Value and methods to manipulate these.
Definition: exif.hpp:59
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:1354
Exiv2::Internal::TiffBinaryElement
Element of a TiffBinaryArray.
Definition: tiffcomposite_int.hpp:1493
Exiv2::Internal::TiffComponent
Interface class for components of a TIFF directory hierarchy (Composite pattern). Both TIFF directori...
Definition: tiffcomposite_int.hpp:171
Exiv2::Internal::TiffCopier
Copy all image tags from the source tree (the tree that is traversed) to a target tree,...
Definition: tiffvisitor_int.hpp:216
Exiv2::Internal::TiffCopier::visitEntry
virtual void visitEntry(TiffEntry *object)
Copy a TIFF entry if it is an image tag.
Definition: tiffvisitor_int.cpp:225
Exiv2::Internal::TiffCopier::visitMnEntry
virtual void visitMnEntry(TiffMnEntry *object)
Copy a TIFF makernote if it is an image tag.
Definition: tiffvisitor_int.cpp:255
Exiv2::Internal::TiffCopier::visitDirectory
virtual void visitDirectory(TiffDirectory *object)
Copy a TIFF directory if it is an image tag.
Definition: tiffvisitor_int.cpp:245
Exiv2::Internal::TiffCopier::visitSizeEntry
virtual void visitSizeEntry(TiffSizeEntry *object)
Copy a TIFF size entry if it is an image tag.
Definition: tiffvisitor_int.cpp:240
Exiv2::Internal::TiffCopier::visitIfdMakernote
virtual void visitIfdMakernote(TiffIfdMakernote *object)
Copy an IFD makernote if it is an image tag.
Definition: tiffvisitor_int.cpp:260
Exiv2::Internal::TiffCopier::visitBinaryElement
virtual void visitBinaryElement(TiffBinaryElement *object)
Copy an element of a binary array if it is an image tag.
Definition: tiffvisitor_int.cpp:270
Exiv2::Internal::TiffCopier::visitImageEntry
virtual void visitImageEntry(TiffImageEntry *object)
Copy a TIFF image entry if it is an image tag.
Definition: tiffvisitor_int.cpp:235
Exiv2::Internal::TiffCopier::visitSubIfd
virtual void visitSubIfd(TiffSubIfd *object)
Copy a TIFF sub-IFD if it is an image tag.
Definition: tiffvisitor_int.cpp:250
Exiv2::Internal::TiffCopier::visitBinaryArray
virtual void visitBinaryArray(TiffBinaryArray *object)
Copy a binary array if it is an image tag.
Definition: tiffvisitor_int.cpp:265
Exiv2::Internal::TiffCopier::TiffCopier
TiffCopier(TiffComponent *pRoot, uint32_t root, const TiffHeaderBase *pHeader, const PrimaryGroups *pPrimaryGroups)
Constructor.
Definition: tiffvisitor_int.cpp:190
Exiv2::Internal::TiffCopier::~TiffCopier
virtual ~TiffCopier()
Virtual destructor.
Definition: tiffvisitor_int.cpp:204
Exiv2::Internal::TiffCopier::copyObject
void copyObject(TiffComponent *object)
Check if object is an image tag and if so, copy it to the target tree.
Definition: tiffvisitor_int.cpp:208
Exiv2::Internal::TiffCopier::visitDataEntry
virtual void visitDataEntry(TiffDataEntry *object)
Copy a TIFF data entry if it is an image tag.
Definition: tiffvisitor_int.cpp:230
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:595
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:650
Exiv2::Internal::TiffDecoder
TIFF composite visitor to decode metadata from the TIFF tree and add it to an Image,...
Definition: tiffvisitor_int.hpp:276
Exiv2::Internal::TiffDecoder::TiffDecoder
TiffDecoder(ExifData &exifData, IptcData &iptcData, XmpData &xmpData, TiffComponent *const pRoot, FindDecoderFct findDecoderFct)
Constructor, taking metadata containers to add the metadata to, the root element of the composite to ...
Definition: tiffvisitor_int.cpp:275
Exiv2::Internal::TiffDecoder::visitEntry
virtual void visitEntry(TiffEntry *object)
Decode a TIFF entry.
Definition: tiffvisitor_int.cpp:311
Exiv2::Internal::TiffDecoder::decodeStdTiffEntry
void decodeStdTiffEntry(const TiffEntryBase *object)
Decode a standard TIFF entry.
Definition: tiffvisitor_int.cpp:553
Exiv2::Internal::TiffDecoder::~TiffDecoder
virtual ~TiffDecoder()
Virtual destructor.
Definition: tiffvisitor_int.cpp:307
Exiv2::Internal::TiffDecoder::decodeIptc
void decodeIptc(const TiffEntryBase *object)
Decode IPTC data from an IPTCNAA tag or Photoshop ImageResources.
Definition: tiffvisitor_int.cpp:413
Exiv2::Internal::TiffDecoder::decodeCanonAFInfo
void decodeCanonAFInfo(const TiffEntryBase *object)
Decode Exif.Canon.AFInfo.
Definition: tiffvisitor_int.cpp:471
Exiv2::Internal::TiffDecoder::visitMnEntry
virtual void visitMnEntry(TiffMnEntry *object)
Decode a TIFF makernote.
Definition: tiffvisitor_int.cpp:341
Exiv2::Internal::TiffDecoder::visitBinaryElement
virtual void visitBinaryElement(TiffBinaryElement *object)
Decode an element of a binary array.
Definition: tiffvisitor_int.cpp:569
Exiv2::Internal::TiffDecoder::visitDirectory
virtual void visitDirectory(TiffDirectory *object)
Decode a TIFF directory.
Definition: tiffvisitor_int.cpp:331
Exiv2::Internal::TiffDecoder::decodeTiffEntry
void decodeTiffEntry(const TiffEntryBase *object)
Entry function, determines how to decode each tag.
Definition: tiffvisitor_int.cpp:537
Exiv2::Internal::TiffDecoder::visitImageEntry
virtual void visitImageEntry(TiffImageEntry *object)
Decode a TIFF image entry.
Definition: tiffvisitor_int.cpp:321
Exiv2::Internal::TiffDecoder::visitIfdMakernote
virtual void visitIfdMakernote(TiffIfdMakernote *object)
Decode an IFD makernote.
Definition: tiffvisitor_int.cpp:347
Exiv2::Internal::TiffDecoder::visitSubIfd
virtual void visitSubIfd(TiffSubIfd *object)
Decode a TIFF sub-IFD.
Definition: tiffvisitor_int.cpp:336
Exiv2::Internal::TiffDecoder::visitSizeEntry
virtual void visitSizeEntry(TiffSizeEntry *object)
Decode a TIFF size entry.
Definition: tiffvisitor_int.cpp:326
Exiv2::Internal::TiffDecoder::decodeXmp
void decodeXmp(const TiffEntryBase *object)
Decode XMP packet from an XMLPacket tag.
Definition: tiffvisitor_int.cpp:386
Exiv2::Internal::TiffDecoder::visitDataEntry
virtual void visitDataEntry(TiffDataEntry *object)
Decode a TIFF data entry.
Definition: tiffvisitor_int.cpp:316
Exiv2::Internal::TiffDecoder::visitBinaryArray
virtual void visitBinaryArray(TiffBinaryArray *object)
Decode a binary array.
Definition: tiffvisitor_int.cpp:562
Exiv2::Internal::TiffDirectory
This class models a TIFF directory (Ifd). It is a composite component of the TIFF tree.
Definition: tiffcomposite_int.hpp:858
Exiv2::Internal::TiffEncoder
TIFF composite visitor to encode metadata from an image to the TIFF tree. The metadata containers and...
Definition: tiffvisitor_int.hpp:376
Exiv2::Internal::TiffEncoder::visitEntry
virtual void visitEntry(TiffEntry *object)
Encode a TIFF entry.
Definition: tiffvisitor_int.cpp:724
Exiv2::Internal::TiffEncoder::~TiffEncoder
virtual ~TiffEncoder()
Virtual destructor.
Definition: tiffvisitor_int.cpp:623
Exiv2::Internal::TiffEncoder::encodeMnEntry
void encodeMnEntry(TiffMnEntry *object, const Exifdatum *datum)
Callback encoder function for a Makernote entry.
Definition: tiffvisitor_int.cpp:1071
Exiv2::Internal::TiffEncoder::encodeSubIfd
void encodeSubIfd(TiffSubIfd *object, const Exifdatum *datum)
Callback encoder function for a sub-IFD entry.
Definition: tiffvisitor_int.cpp:1082
Exiv2::Internal::TiffEncoder::visitSizeEntry
virtual void visitSizeEntry(TiffSizeEntry *object)
Encode a TIFF size entry.
Definition: tiffvisitor_int.cpp:739
Exiv2::Internal::TiffEncoder::visitDirectoryNext
virtual void visitDirectoryNext(TiffDirectory *object)
Update directory entries.
Definition: tiffvisitor_int.cpp:749
Exiv2::Internal::TiffEncoder::visitIfdMakernoteEnd
virtual void visitIfdMakernoteEnd(TiffIfdMakernote *object)
Reset encoder to its original state, undo makernote specific settings.
Definition: tiffvisitor_int.cpp:832
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:1087
Exiv2::Internal::TiffEncoder::visitBinaryElement
virtual void visitBinaryElement(TiffBinaryElement *object)
Encode an element of a binary array.
Definition: tiffvisitor_int.cpp:873
Exiv2::Internal::TiffEncoder::setDirty
void setDirty(bool flag=true)
Set the dirty flag and end of traversing signal.
Definition: tiffvisitor_int.cpp:712
Exiv2::Internal::TiffEncoder::encodeImageEntry
void encodeImageEntry(TiffImageEntry *object, const Exifdatum *datum)
Callback encoder function for an image entry.
Definition: tiffvisitor_int.cpp:999
Exiv2::Internal::TiffEncoder::encodeTiffComponent
void encodeTiffComponent(TiffEntryBase *object, const Exifdatum *datum=0)
Top level encoder function. Determines how to encode each TIFF component. This function is called by ...
Definition: tiffvisitor_int.cpp:890
Exiv2::Internal::TiffEncoder::visitIfdMakernote
virtual void visitIfdMakernote(TiffIfdMakernote *object)
Encode an IFD makernote.
Definition: tiffvisitor_int.cpp:803
Exiv2::Internal::TiffEncoder::visitBinaryArrayEnd
virtual void visitBinaryArrayEnd(TiffBinaryArray *object)
Re-encrypt binary array if necessary.
Definition: tiffvisitor_int.cpp:846
Exiv2::Internal::TiffEncoder::TiffEncoder
TiffEncoder(const ExifData &exifData, const IptcData &iptcData, const XmpData &xmpData, TiffComponent *pRoot, const 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:574
Exiv2::Internal::TiffEncoder::encodeTiffEntry
void encodeTiffEntry(TiffEntry *object, const Exifdatum *datum)
Callback encoder function for a standard TIFF entry.
Definition: tiffvisitor_int.cpp:994
Exiv2::Internal::TiffEncoder::encodeBinaryArray
void encodeBinaryArray(TiffBinaryArray *object, const Exifdatum *datum)
Callback encoder function for a binary array.
Definition: tiffvisitor_int.cpp:950
Exiv2::Internal::TiffEncoder::encodeOffsetEntry
void encodeOffsetEntry(TiffEntryBase *object, const Exifdatum *datum)
Special encoder function for an offset entry.
Definition: tiffvisitor_int.cpp:1112
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::encodeBinaryElement
void encodeBinaryElement(TiffBinaryElement *object, const Exifdatum *datum)
Callback encoder function for an element of a binary array.
Definition: tiffvisitor_int.cpp:955
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:718
Exiv2::Internal::TiffEncoder::visitSubIfd
virtual void visitSubIfd(TiffSubIfd *object)
Encode a TIFF sub-IFD.
Definition: tiffvisitor_int.cpp:784
Exiv2::Internal::TiffEncoder::visitImageEntry
virtual void visitImageEntry(TiffImageEntry *object)
Encode a TIFF image entry.
Definition: tiffvisitor_int.cpp:734
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:1138
Exiv2::Internal::TiffEncoder::visitDirectory
virtual void visitDirectory(TiffDirectory *object)
Encode a TIFF directory.
Definition: tiffvisitor_int.cpp:744
Exiv2::Internal::TiffEncoder::visitDataEntry
virtual void visitDataEntry(TiffDataEntry *object)
Encode a TIFF data entry.
Definition: tiffvisitor_int.cpp:729
Exiv2::Internal::TiffEncoder::encodeDataEntry
void encodeDataEntry(TiffDataEntry *object, const Exifdatum *datum)
Callback encoder function for a data entry.
Definition: tiffvisitor_int.cpp:960
Exiv2::Internal::TiffEncoder::encodeSizeEntry
void encodeSizeEntry(TiffSizeEntry *object, const Exifdatum *datum)
Callback encoder function for a size entry.
Definition: tiffvisitor_int.cpp:1077
Exiv2::Internal::TiffEncoder::visitBinaryArray
virtual void visitBinaryArray(TiffBinaryArray *object)
Encode a binary array.
Definition: tiffvisitor_int.cpp:839
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:506
Exiv2::Internal::TiffEncoder::visitMnEntry
virtual void visitMnEntry(TiffMnEntry *object)
Encode a TIFF makernote.
Definition: tiffvisitor_int.cpp:789
Exiv2::Internal::TiffEncoder::writeMethod
WriteMethod writeMethod() const
Return the write method used.
Definition: tiffvisitor_int.hpp:513
Exiv2::Internal::TiffEntryBase
This abstract base class provides the common functionality of an IFD directory entry and defines an e...
Definition: tiffcomposite_int.hpp:411
Exiv2::Internal::TiffEntry
A standard TIFF IFD entry.
Definition: tiffcomposite_int.hpp:563
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:156
Exiv2::Internal::TiffFinder::visitBinaryElement
virtual void visitBinaryElement(TiffBinaryElement *object)
Find tag and group in an element of a binary array.
Definition: tiffvisitor_int.cpp:185
Exiv2::Internal::TiffFinder::visitMnEntry
virtual void visitMnEntry(TiffMnEntry *object)
Find tag and group in a TIFF makernote.
Definition: tiffvisitor_int.cpp:170
Exiv2::Internal::TiffFinder::visitEntry
virtual void visitEntry(TiffEntry *object)
Find tag and group in a TIFF entry.
Definition: tiffvisitor_int.cpp:140
Exiv2::Internal::TiffFinder::visitImageEntry
virtual void visitImageEntry(TiffImageEntry *object)
Find tag and group in a TIFF image entry.
Definition: tiffvisitor_int.cpp:150
Exiv2::Internal::TiffFinder::visitSizeEntry
virtual void visitSizeEntry(TiffSizeEntry *object)
Find tag and group in a TIFF size entry.
Definition: tiffvisitor_int.cpp:155
Exiv2::Internal::TiffFinder::~TiffFinder
virtual ~TiffFinder()
Virtual destructor.
Definition: tiffvisitor_int.cpp:128
Exiv2::Internal::TiffFinder::visitIfdMakernote
virtual void visitIfdMakernote(TiffIfdMakernote *object)
Find tag and group in an IFD makernote.
Definition: tiffvisitor_int.cpp:175
Exiv2::Internal::TiffFinder::visitDataEntry
virtual void visitDataEntry(TiffDataEntry *object)
Find tag and group in a TIFF data entry.
Definition: tiffvisitor_int.cpp:145
Exiv2::Internal::TiffFinder::visitDirectory
virtual void visitDirectory(TiffDirectory *object)
Find tag and group in a TIFF directory.
Definition: tiffvisitor_int.cpp:160
Exiv2::Internal::TiffFinder::visitSubIfd
virtual void visitSubIfd(TiffSubIfd *object)
Find tag and group in a TIFF sub-IFD.
Definition: tiffvisitor_int.cpp:165
Exiv2::Internal::TiffFinder::init
void init(uint16_t tag, IfdId group)
Initialize the Finder for a new search.
Definition: tiffvisitor_int.cpp:120
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:202
Exiv2::Internal::TiffFinder::visitBinaryArray
virtual void visitBinaryArray(TiffBinaryArray *object)
Find tag and group in a binary array.
Definition: tiffvisitor_int.cpp:180
Exiv2::Internal::TiffFinder::TiffFinder
TiffFinder(uint16_t tag, IfdId group)
Constructor, taking tag and group of the component to find.
Definition: tiffvisitor_int.hpp:161
Exiv2::Internal::TiffFinder::findObject
void findObject(TiffComponent *object)
Check if object matches tag and group.
Definition: tiffvisitor_int.cpp:132
Exiv2::Internal::TiffHeaderBase
Abstract base class defining the interface of an image header. Used internally by classes for TIFF-ba...
Definition: tiffimage_int.hpp:52
Exiv2::Internal::TiffIfdMakernote
Tiff IFD Makernote. This is a concrete class suitable for all IFD makernotes.
Definition: tiffcomposite_int.hpp:1147
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:733
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:1071
Exiv2::Internal::TiffReader
TIFF composite visitor to read the TIFF structure from a block of memory and build the composite from...
Definition: tiffvisitor_int.hpp:622
Exiv2::Internal::TiffReader::readDataEntryBase
void readDataEntryBase(TiffDataEntryBase *object)
Read a TiffDataEntryBase from the data buffer.
Definition: tiffvisitor_int.cpp:1264
Exiv2::Internal::TiffReader::byteOrder
ByteOrder byteOrder() const
Return the byte order.
Definition: tiffvisitor_int.cpp:1252
Exiv2::Internal::TiffReader::visitIfdMakernote
virtual void visitIfdMakernote(TiffIfdMakernote *object)
Read an IFD makernote from the data buffer.
Definition: tiffvisitor_int.cpp:1489
Exiv2::Internal::TiffReader::visitSizeEntry
virtual void visitSizeEntry(TiffSizeEntry *object)
Read a TIFF size entry from the data buffer.
Definition: tiffvisitor_int.cpp:1292
Exiv2::Internal::TiffReader::setMnState
void setMnState(const TiffRwState *state=0)
Set the state of the reader to one suitable for the Makernote.
Definition: tiffvisitor_int.cpp:1238
Exiv2::Internal::TiffReader::visitBinaryElement
virtual void visitBinaryElement(TiffBinaryElement *object)
Read an element of a binary array from the data buffer.
Definition: tiffvisitor_int.cpp:1734
Exiv2::Internal::TiffReader::nextIdx
int nextIdx(IfdId group)
Return the next idx sequence number for group.
Definition: tiffvisitor_int.cpp:1319
Exiv2::Internal::TiffReader::readTiffEntry
void readTiffEntry(TiffEntryBase *object)
Read a standard TIFF entry from the data buffer.
Definition: tiffvisitor_int.cpp:1527
Exiv2::Internal::TiffReader::visitImageEntry
virtual void visitImageEntry(TiffImageEntry *object)
Read a TIFF image entry from the data buffer.
Definition: tiffvisitor_int.cpp:1287
Exiv2::Internal::TiffReader::visitDataEntry
virtual void visitDataEntry(TiffDataEntry *object)
Read a TIFF data entry from the data buffer.
Definition: tiffvisitor_int.cpp:1282
Exiv2::Internal::TiffReader::visitIfdMakernoteEnd
virtual void visitIfdMakernoteEnd(TiffIfdMakernote *object)
Reset reader to its original state, undo makernote specific settings.
Definition: tiffvisitor_int.cpp:1521
Exiv2::Internal::TiffReader::visitMnEntry
virtual void visitMnEntry(TiffMnEntry *object)
Read a TIFF makernote entry from the data buffer.
Definition: tiffvisitor_int.cpp:1465
Exiv2::Internal::TiffReader::visitEntry
virtual void visitEntry(TiffEntry *object)
Read a TIFF entry from the data buffer.
Definition: tiffvisitor_int.cpp:1277
Exiv2::Internal::TiffReader::visitBinaryArray
virtual void visitBinaryArray(TiffBinaryArray *object)
Read a binary array from the data buffer.
Definition: tiffvisitor_int.cpp:1654
Exiv2::Internal::TiffReader::setOrigState
void setOrigState()
Set the state to the original state as set in the constructor.
Definition: tiffvisitor_int.cpp:1233
Exiv2::Internal::TiffReader::baseOffset
uint32_t baseOffset() const
Return the base offset. See class TiffRwState for details.
Definition: tiffvisitor_int.cpp:1258
Exiv2::Internal::TiffReader::TiffReader
TiffReader(const byte *pData, uint32_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:1211
Exiv2::Internal::TiffReader::circularReference
bool circularReference(const byte *start, IfdId group)
Check IFD directory pointer start for circular reference.
Definition: tiffvisitor_int.cpp:1305
Exiv2::Internal::TiffReader::visitDirectory
virtual void visitDirectory(TiffDirectory *object)
Read a TIFF directory from the data buffer.
Definition: tiffvisitor_int.cpp:1335
Exiv2::Internal::TiffReader::postProcess
void postProcess()
Read deferred components.
Definition: tiffvisitor_int.cpp:1324
Exiv2::Internal::TiffReader::visitSubIfd
virtual void visitSubIfd(TiffSubIfd *object)
Read a TIFF sub-IFD from the data buffer.
Definition: tiffvisitor_int.cpp:1415
Exiv2::Internal::TiffReader::~TiffReader
virtual ~TiffReader()
Virtual destructor.
Definition: tiffvisitor_int.cpp:1229
Exiv2::Internal::TiffRwState
Simple state class containing relevant state information for the TIFF reader. This is in a separate c...
Definition: tiffvisitor_int.hpp:580
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:597
Exiv2::Internal::TiffRwState::TiffRwState
TiffRwState(ByteOrder byteOrder, uint32_t baseOffset)
Constructor.
Definition: tiffvisitor_int.hpp:585
Exiv2::Internal::TiffRwState::baseOffset
uint32_t baseOffset() const
Return the base offset.
Definition: tiffvisitor_int.hpp:609
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:816
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:982
Exiv2::Internal::TiffVisitor
Abstract base class defining the interface for TIFF composite visitors (Visitor pattern)
Definition: tiffvisitor_int.hpp:65
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:98
Exiv2::Internal::TiffVisitor::TiffVisitor
TiffVisitor()
Default constructor. Initialises all stop/go flags to true.
Definition: tiffvisitor_int.cpp:81
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:104
Exiv2::Internal::TiffVisitor::~TiffVisitor
virtual ~TiffVisitor()
Virtual destructor.
Definition: tiffvisitor_int.cpp:88
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:116
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:68
Exiv2::Internal::TiffVisitor::geTraverse
@ geTraverse
Signal to control traversing of the composite tree.
Definition: tiffvisitor_int.hpp:70
Exiv2::Internal::TiffVisitor::geKnownMakernote
@ geKnownMakernote
Signal used by TiffReader to signal an unknown makernote.
Definition: tiffvisitor_int.hpp:72
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::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:92
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:112
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:108
Exiv2::IptcData
A container for IPTC data. This is a top-level class of the Exiv2 library.
Definition: iptc.hpp:170
Exiv2::XmpData
A container for XMP data. This is a top-level class of the Exiv2 library.
Definition: xmp_exiv2.hpp:166
exif.hpp
Encoding and decoding of Exif data.
Exiv2::Internal::FindDecoderFct
DecoderFct(* FindDecoderFct)(const std::string &make, uint32_t extendedTag, IfdId group)
Type for a function pointer for a function to decode a TIFF component.
Definition: tifffwd_int.hpp:85
Exiv2::Internal::PrimaryGroups
std::vector< IfdId > PrimaryGroups
Type for a list of primary image groups.
Definition: tifffwd_int.hpp:107
Exiv2::Internal::IfdId
IfdId
Type to specify the IFD to which a metadata belongs.
Definition: tags_int.hpp:46
Exiv2::Internal::FindEncoderFct
EncoderFct(* FindEncoderFct)(const std::string &make, uint32_t extendedTag, IfdId group)
Type for a function pointer for a function to encode a TIFF component.
Definition: tifffwd_int.hpp:91
Exiv2
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition: asfvideo.hpp:36
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