Exiv2
Loading...
Searching...
No Matches
tiffvisitor_int.hpp
1// SPDX-License-Identifier: GPL-2.0-or-later
2
3#ifndef TIFFVISITOR_INT_HPP_
4#define TIFFVISITOR_INT_HPP_
5
6// *****************************************************************************
7// included header files
8#include "exif.hpp"
9#include "tifffwd_int.hpp"
10#include "types.hpp"
11
12#include <array>
13
14// *****************************************************************************
15// namespace extensions
16namespace Exiv2 {
17class IptcData;
18class XmpData;
19
20namespace Internal {
21// *****************************************************************************
22// class definitions
23
40 public:
42 enum GoEvent {
47 // Note: If you add more events here, adjust the events_ constant too!
48 };
49
50 private:
51 static const int events_ = 2;
52 std::array<bool, events_> go_{true, true};
53
54 public:
56
57
58 virtual ~TiffVisitor() = default;
60
62
63
74 void setGo(GoEvent event, bool go);
76 virtual void visitEntry(TiffEntry* object) = 0;
78 virtual void visitDataEntry(TiffDataEntry* object) = 0;
80 virtual void visitImageEntry(TiffImageEntry* object) = 0;
82 virtual void visitSizeEntry(TiffSizeEntry* object) = 0;
84 virtual void visitDirectory(TiffDirectory* object) = 0;
89 virtual void visitDirectoryNext(TiffDirectory* object);
94 virtual void visitDirectoryEnd(TiffDirectory* object);
96 virtual void visitSubIfd(TiffSubIfd* object) = 0;
98 virtual void visitMnEntry(TiffMnEntry* object) = 0;
100 virtual void visitIfdMakernote(TiffIfdMakernote* object) = 0;
102 virtual void visitIfdMakernoteEnd(TiffIfdMakernote* object);
104 virtual void visitBinaryArray(TiffBinaryArray* object) = 0;
109 virtual void visitBinaryArrayEnd(TiffBinaryArray* object);
111 virtual void visitBinaryElement(TiffBinaryElement* object) = 0;
113
115
116
117 [[nodiscard]] bool go(GoEvent event) const;
119
120}; // class TiffVisitor
121
128class TiffFinder : public TiffVisitor {
129 public:
131
132
133 constexpr TiffFinder(uint16_t tag, IfdId group) : tag_(tag), group_(group) {
134 }
135 TiffFinder(const TiffFinder&) = delete;
136 TiffFinder& operator=(const TiffFinder&) = delete;
138 ~TiffFinder() override = default;
140
142
143
144 void visitEntry(TiffEntry* object) override;
146 void visitDataEntry(TiffDataEntry* object) override;
148 void visitImageEntry(TiffImageEntry* object) override;
150 void visitSizeEntry(TiffSizeEntry* object) override;
152 void visitDirectory(TiffDirectory* object) override;
154 void visitSubIfd(TiffSubIfd* object) override;
156 void visitMnEntry(TiffMnEntry* object) override;
158 void visitIfdMakernote(TiffIfdMakernote* object) override;
160 void visitBinaryArray(TiffBinaryArray* object) override;
162 void visitBinaryElement(TiffBinaryElement* object) override;
163
165 void findObject(TiffComponent* object);
167 void init(uint16_t tag, IfdId group);
169
171
172
176 [[nodiscard]] TiffComponent* result() const {
177 return tiffComponent_;
178 }
180
181 private:
182 uint16_t tag_;
183 IfdId group_;
184 TiffComponent* tiffComponent_{};
185}; // class TiffFinder
186
192class TiffCopier : public TiffVisitor {
193 public:
195
196
204 TiffCopier(TiffComponent* pRoot, uint32_t root, const TiffHeaderBase* pHeader, const PrimaryGroups* pPrimaryGroups);
205 TiffCopier(const TiffCopier&) = delete;
206 TiffCopier& operator=(const TiffCopier&) = delete;
208 ~TiffCopier() override = default;
210
212
213
214 void visitEntry(TiffEntry* object) override;
216 void visitDataEntry(TiffDataEntry* object) override;
218 void visitImageEntry(TiffImageEntry* object) override;
220 void visitSizeEntry(TiffSizeEntry* object) override;
222 void visitDirectory(TiffDirectory* object) override;
224 void visitSubIfd(TiffSubIfd* object) override;
226 void visitMnEntry(TiffMnEntry* object) override;
228 void visitIfdMakernote(TiffIfdMakernote* object) override;
230 void visitBinaryArray(TiffBinaryArray* object) override;
232 void visitBinaryElement(TiffBinaryElement* object) override;
233
235 void copyObject(const TiffComponent* object);
237
238 private:
239 TiffComponent* pRoot_;
240 uint32_t root_;
241 const TiffHeaderBase* pHeader_;
242 const PrimaryGroups* pPrimaryGroups_;
243}; // class TiffCopier
244
251class TiffDecoder : public TiffVisitor {
252 public:
254
255
260 TiffDecoder(ExifData& exifData, IptcData& iptcData, XmpData& xmpData, TiffComponent* pRoot,
261 FindDecoderFct findDecoderFct);
262 TiffDecoder(const TiffDecoder&) = delete;
263 TiffDecoder& operator=(const TiffDecoder&) = delete;
265 ~TiffDecoder() override = default;
267
269
270
271 void visitEntry(TiffEntry* object) override;
273 void visitDataEntry(TiffDataEntry* object) override;
275 void visitImageEntry(TiffImageEntry* object) override;
277 void visitSizeEntry(TiffSizeEntry* object) override;
279 void visitDirectory(TiffDirectory* object) override;
281 void visitSubIfd(TiffSubIfd* object) override;
283 void visitMnEntry(TiffMnEntry* object) override;
285 void visitIfdMakernote(TiffIfdMakernote* object) override;
287 void visitBinaryArray(TiffBinaryArray* object) override;
289 void visitBinaryElement(TiffBinaryElement* object) override;
290
292 void decodeTiffEntry(const TiffEntryBase* object);
294 void decodeStdTiffEntry(const TiffEntryBase* object);
296 void decodeIptc(const TiffEntryBase* object);
298 void decodeXmp(const TiffEntryBase* object);
300 void decodeCanonAFInfo(const TiffEntryBase* object);
302
303 private:
305
306
314 void getObjData(const byte*& pData, size_t& size, uint16_t tag, IfdId group, const TiffEntryBase* object);
316
317 // DATA
318 ExifData& exifData_;
319 IptcData& iptcData_;
320 XmpData& xmpData_;
321 TiffComponent* pRoot_;
322 FindDecoderFct findDecoderFct_;
323 std::string make_;
324 bool decodedIptc_{false};
325
326}; // class TiffDecoder
327
343class TiffEncoder : public TiffVisitor {
344 public:
346
347
352 TiffEncoder(ExifData& exifData, IptcData& iptcData, XmpData& xmpData, TiffComponent* pRoot, bool isNewImage,
353 const PrimaryGroups* pPrimaryGroups, const TiffHeaderBase* pHeader, FindEncoderFct findEncoderFct);
354 TiffEncoder(const TiffEncoder&) = delete;
355 TiffEncoder& operator=(const TiffEncoder&) = delete;
357 ~TiffEncoder() override = default;
359
361
362
363 void visitEntry(TiffEntry* object) override;
365 void visitDataEntry(TiffDataEntry* object) override;
367 void visitImageEntry(TiffImageEntry* object) override;
369 void visitSizeEntry(TiffSizeEntry* object) override;
371 void visitDirectory(TiffDirectory* object) override;
373 void visitDirectoryNext(TiffDirectory* object) override;
375 void visitSubIfd(TiffSubIfd* object) override;
377 void visitMnEntry(TiffMnEntry* object) override;
379 void visitIfdMakernote(TiffIfdMakernote* object) override;
381 void visitIfdMakernoteEnd(TiffIfdMakernote* object) override;
383 void visitBinaryArray(TiffBinaryArray* object) override;
385 void visitBinaryArrayEnd(TiffBinaryArray* object) override;
387 void visitBinaryElement(TiffBinaryElement* object) override;
388
408 void encodeTiffComponent(TiffEntryBase* object, const Exifdatum* datum = nullptr);
409
411 void encodeBinaryElement(TiffBinaryElement* object, const Exifdatum* datum);
413 void encodeBinaryArray(TiffBinaryArray* object, const Exifdatum* datum);
415 void encodeDataEntry(TiffDataEntry* object, const Exifdatum* datum);
417 void encodeTiffEntry(TiffEntry* object, const Exifdatum* datum);
419 void encodeImageEntry(TiffImageEntry* object, const Exifdatum* datum);
421 void encodeMnEntry(TiffMnEntry* object, const Exifdatum* datum);
423 void encodeSizeEntry(TiffSizeEntry* object, const Exifdatum* datum);
425 void encodeSubIfd(TiffSubIfd* object, const Exifdatum* datum);
426
428 void encodeTiffEntryBase(TiffEntryBase* object, const Exifdatum* datum);
430 void encodeOffsetEntry(TiffEntryBase* object, const Exifdatum* datum);
431
433 // Todo void encodeNikonSubIfd(TiffEntryBase* object, const Exifdatum* datum);
434
436 void encodeIptc(TiffEntryBase* object, const Exifdatum* datum);
449 void add(TiffComponent* pRootDir, TiffComponent* pSourceDir, uint32_t root);
451 void setDirty(bool flag = true);
453
455
456
460 [[nodiscard]] ByteOrder byteOrder() const {
461 return byteOrder_;
462 }
467 [[nodiscard]] bool dirty() const;
469 [[nodiscard]] WriteMethod writeMethod() const {
470 return writeMethod_;
471 }
473
474 private:
476
477
482 void encodeIptc();
487 void encodeXmp();
489
491
492
497 static uint32_t updateDirEntry(byte* buf, ByteOrder byteOrder, TiffComponent* pTiffComponent);
507 [[nodiscard]] bool isImageTag(uint16_t tag, IfdId group) const;
509
510 // DATA
511 ExifData exifData_;
512 const IptcData& iptcData_;
513 const XmpData& xmpData_;
514 bool del_{true};
515 const TiffHeaderBase* pHeader_;
516 TiffComponent* pRoot_;
517 bool isNewImage_;
518 const PrimaryGroups* pPrimaryGroups_;
519 TiffComponent* pSourceTree_{nullptr};
520 ByteOrder byteOrder_;
521 ByteOrder origByteOrder_;
522 FindEncoderFct findEncoderFct_;
523 std::string make_;
524 bool dirty_{false};
525 WriteMethod writeMethod_{wmNonIntrusive};
526
527}; // class TiffEncoder
528
536 public:
538
539
540 constexpr TiffRwState(ByteOrder byteOrder, size_t baseOffset) : byteOrder_(byteOrder), baseOffset_(baseOffset) {
541 }
543
545
546
550 [[nodiscard]] ByteOrder byteOrder() const {
551 return byteOrder_;
552 }
564 [[nodiscard]] size_t baseOffset() const {
565 return baseOffset_;
566 }
568
569 private:
570 ByteOrder byteOrder_;
571 size_t baseOffset_;
572}; // TiffRwState
573
579class TiffReader : public TiffVisitor {
580 public:
582
583
592 TiffReader(const byte* pData, size_t size, TiffComponent* pRoot, TiffRwState state);
593 TiffReader(const TiffReader&) = delete;
594 TiffReader& operator=(const TiffReader&) = delete;
595
597 ~TiffReader() override = default;
599
601
602
603 void visitEntry(TiffEntry* object) override;
605 void visitDataEntry(TiffDataEntry* object) override;
607 void visitImageEntry(TiffImageEntry* object) override;
609 void visitSizeEntry(TiffSizeEntry* object) override;
611 void visitDirectory(TiffDirectory* object) override;
613 void visitSubIfd(TiffSubIfd* object) override;
615 void visitMnEntry(TiffMnEntry* object) override;
617 void visitIfdMakernote(TiffIfdMakernote* object) override;
619 void visitIfdMakernoteEnd(TiffIfdMakernote* object) override;
621 void visitBinaryArray(TiffBinaryArray* object) override;
623 void visitBinaryElement(TiffBinaryElement* object) override;
624
626 void readTiffEntry(TiffEntryBase* object);
635 void setMnState(const TiffRwState* state = nullptr);
637 void setOrigState();
639 bool circularReference(const byte* start, IfdId group);
641 int nextIdx(IfdId group);
642
652 void postProcess();
654
656
657
658 [[nodiscard]] ByteOrder byteOrder() const;
660 [[nodiscard]] size_t baseOffset() const;
662
663 private:
664 using DirList = std::map<const byte*, IfdId>;
665 using IdxSeq = std::map<IfdId, int>;
666 using PostList = std::vector<TiffComponent*>;
667
668 // DATA
669 const byte* pData_;
670 size_t size_;
671 const byte* pLast_;
672 TiffComponent* pRoot_;
673 TiffRwState* pState_;
674 TiffRwState origState_;
675 TiffRwState mnState_;
676 DirList dirList_;
677 IdxSeq idxSeq_;
678 PostList postList_;
679 bool postProc_{false};
680};
681
682} // namespace Internal
683} // namespace Exiv2
684
685#endif // #ifndef TIFFVISITOR_INT_HPP_
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
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
Element of a TiffBinaryArray.
Definition tiffcomposite_int.hpp:1394
Interface class for components of a TIFF directory hierarchy (Composite pattern). Both TIFF directori...
Definition tiffcomposite_int.hpp:152
Copy all image tags from the source tree (the tree that is traversed) to a target tree,...
Definition tiffvisitor_int.hpp:192
~TiffCopier() override=default
Virtual destructor.
void visitMnEntry(TiffMnEntry *object) override
Copy a TIFF makernote if it is an image tag.
Definition tiffvisitor_int.cpp:170
void visitDataEntry(TiffDataEntry *object) override
Copy a TIFF data entry if it is an image tag.
Definition tiffvisitor_int.cpp:150
void visitImageEntry(TiffImageEntry *object) override
Copy a TIFF image entry if it is an image tag.
Definition tiffvisitor_int.cpp:154
void visitDirectory(TiffDirectory *object) override
Copy a TIFF directory if it is an image tag.
Definition tiffvisitor_int.cpp:162
void visitIfdMakernote(TiffIfdMakernote *object) override
Copy an IFD makernote if it is an image tag.
Definition tiffvisitor_int.cpp:174
void visitEntry(TiffEntry *object) override
Copy a TIFF entry if it is an image tag.
Definition tiffvisitor_int.cpp:146
void visitBinaryElement(TiffBinaryElement *object) override
Copy an element of a binary array if it is an image tag.
Definition tiffvisitor_int.cpp:182
void visitSizeEntry(TiffSizeEntry *object) override
Copy a TIFF size entry if it is an image tag.
Definition tiffvisitor_int.cpp:158
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
void visitBinaryArray(TiffBinaryArray *object) override
Copy a binary array if it is an image tag.
Definition tiffvisitor_int.cpp:178
void visitSubIfd(TiffSubIfd *object) override
Copy a TIFF sub-IFD if it is an image tag.
Definition tiffvisitor_int.cpp:166
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
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
TIFF composite visitor to decode metadata from the TIFF tree and add it to an Image,...
Definition tiffvisitor_int.hpp:251
void visitMnEntry(TiffMnEntry *object) override
Decode a TIFF makernote.
Definition tiffvisitor_int.cpp:229
void visitImageEntry(TiffImageEntry *object) override
Decode a TIFF image entry.
Definition tiffvisitor_int.cpp:213
void visitBinaryArray(TiffBinaryArray *object) override
Decode a binary array.
Definition tiffvisitor_int.cpp:434
void visitDataEntry(TiffDataEntry *object) override
Decode a TIFF data entry.
Definition tiffvisitor_int.cpp:209
void visitSubIfd(TiffSubIfd *object) override
Decode a TIFF sub-IFD.
Definition tiffvisitor_int.cpp:225
void decodeStdTiffEntry(const TiffEntryBase *object)
Decode a standard TIFF entry.
Definition tiffvisitor_int.cpp:427
void decodeIptc(const TiffEntryBase *object)
Decode IPTC data from an IPTCNAA tag or Photoshop ImageResources.
Definition tiffvisitor_int.cpp:289
void decodeCanonAFInfo(const TiffEntryBase *object)
Decode Exif.Canon.AFInfo.
Definition tiffvisitor_int.cpp:345
void visitIfdMakernote(TiffIfdMakernote *object) override
Decode an IFD makernote.
Definition tiffvisitor_int.cpp:234
~TiffDecoder() override=default
Virtual destructor.
void visitSizeEntry(TiffSizeEntry *object) override
Decode a TIFF size entry.
Definition tiffvisitor_int.cpp:217
void decodeTiffEntry(const TiffEntryBase *object)
Entry function, determines how to decode each tag.
Definition tiffvisitor_int.cpp:417
void visitBinaryElement(TiffBinaryElement *object) override
Decode an element of a binary array.
Definition tiffvisitor_int.cpp:440
void visitEntry(TiffEntry *object) override
Decode a TIFF entry.
Definition tiffvisitor_int.cpp:205
void decodeXmp(const TiffEntryBase *object)
Decode XMP packet from an XMLPacket tag.
Definition tiffvisitor_int.cpp:264
void visitDirectory(TiffDirectory *object) override
Decode a TIFF directory.
Definition tiffvisitor_int.cpp:221
This class models a TIFF directory (Ifd). It is a composite component of the TIFF tree.
Definition tiffcomposite_int.hpp:823
TIFF composite visitor to encode metadata from an image to the TIFF tree. The metadata containers and...
Definition tiffvisitor_int.hpp:343
void visitSizeEntry(TiffSizeEntry *object) override
Encode a TIFF size entry.
Definition tiffvisitor_int.cpp:574
void encodeMnEntry(TiffMnEntry *object, const Exifdatum *datum)
Callback encoder function for a Makernote entry.
Definition tiffvisitor_int.cpp:861
void encodeSubIfd(TiffSubIfd *object, const Exifdatum *datum)
Callback encoder function for a sub-IFD entry.
Definition tiffvisitor_int.cpp:871
void visitDirectory(TiffDirectory *object) override
Encode a TIFF directory.
Definition tiffvisitor_int.cpp:578
void visitIfdMakernoteEnd(TiffIfdMakernote *object) override
Reset encoder to its original state, undo makernote specific settings.
Definition tiffvisitor_int.cpp:653
~TiffEncoder() override=default
Virtual destructor.
void visitMnEntry(TiffMnEntry *object) override
Encode a TIFF makernote.
Definition tiffvisitor_int.cpp:612
void encodeTiffEntryBase(TiffEntryBase *object, const Exifdatum *datum)
Special encoder function for the base part of a TIFF entry.
Definition tiffvisitor_int.cpp:875
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
void setDirty(bool flag=true)
Set the dirty flag and end of traversing signal.
Definition tiffvisitor_int.cpp:553
void encodeImageEntry(TiffImageEntry *object, const Exifdatum *datum)
Callback encoder function for an image entry.
Definition tiffvisitor_int.cpp:793
void visitDirectoryNext(TiffDirectory *object) override
Update directory entries.
Definition tiffvisitor_int.cpp:582
void visitIfdMakernote(TiffIfdMakernote *object) override
Encode an IFD makernote.
Definition tiffvisitor_int.cpp:625
void encodeTiffEntry(TiffEntry *object, const Exifdatum *datum)
Callback encoder function for a standard TIFF entry.
Definition tiffvisitor_int.cpp:789
void encodeBinaryArray(TiffBinaryArray *object, const Exifdatum *datum)
Callback encoder function for a binary array.
Definition tiffvisitor_int.cpp:753
void encodeOffsetEntry(TiffEntryBase *object, const Exifdatum *datum)
Special encoder function for an offset entry.
Definition tiffvisitor_int.cpp:895
void encodeIptc(TiffEntryBase *object, const Exifdatum *datum)
Special encoder function to encode SubIFD contents to Image group if it contains primary image data.
void visitBinaryArray(TiffBinaryArray *object) override
Encode a binary array.
Definition tiffvisitor_int.cpp:659
void visitImageEntry(TiffImageEntry *object) override
Encode a TIFF image entry.
Definition tiffvisitor_int.cpp:570
void encodeBinaryElement(TiffBinaryElement *object, const Exifdatum *datum)
Callback encoder function for an element of a binary array.
Definition tiffvisitor_int.cpp:757
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
void add(TiffComponent *pRootDir, TiffComponent *pSourceDir, uint32_t root)
Add metadata from image to the TIFF composite.
Definition tiffvisitor_int.cpp:915
void encodeDataEntry(TiffDataEntry *object, const Exifdatum *datum)
Callback encoder function for a data entry.
Definition tiffvisitor_int.cpp:761
void encodeSizeEntry(TiffSizeEntry *object, const Exifdatum *datum)
Callback encoder function for a size entry.
Definition tiffvisitor_int.cpp:867
void visitEntry(TiffEntry *object) override
Encode a TIFF entry.
Definition tiffvisitor_int.cpp:562
void visitDataEntry(TiffDataEntry *object) override
Encode a TIFF data entry.
Definition tiffvisitor_int.cpp:566
void visitBinaryArrayEnd(TiffBinaryArray *object) override
Re-encrypt binary array if necessary.
Definition tiffvisitor_int.cpp:665
void visitBinaryElement(TiffBinaryElement *object) override
Encode an element of a binary array.
Definition tiffvisitor_int.cpp:692
void visitSubIfd(TiffSubIfd *object) override
Encode a TIFF sub-IFD.
Definition tiffvisitor_int.cpp:608
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
WriteMethod writeMethod() const
Return the write method used.
Definition tiffvisitor_int.hpp:469
This abstract base class provides the common functionality of an IFD directory entry and defines an e...
Definition tiffcomposite_int.hpp:380
A standard TIFF IFD entry.
Definition tiffcomposite_int.hpp:568
Search the composite for a component with tag and group. Return a pointer to the component or 0,...
Definition tiffvisitor_int.hpp:128
void visitIfdMakernote(TiffIfdMakernote *object) override
Find tag and group in an IFD makernote.
Definition tiffvisitor_int.cpp:116
void visitEntry(TiffEntry *object) override
Find tag and group in a TIFF entry.
Definition tiffvisitor_int.cpp:88
void visitSizeEntry(TiffSizeEntry *object) override
Find tag and group in a TIFF size entry.
Definition tiffvisitor_int.cpp:100
void visitSubIfd(TiffSubIfd *object) override
Find tag and group in a TIFF sub-IFD.
Definition tiffvisitor_int.cpp:108
void visitBinaryArray(TiffBinaryArray *object) override
Find tag and group in a binary array.
Definition tiffvisitor_int.cpp:120
~TiffFinder() override=default
Virtual destructor.
void visitDataEntry(TiffDataEntry *object) override
Find tag and group in a TIFF data entry.
Definition tiffvisitor_int.cpp:92
constexpr TiffFinder(uint16_t tag, IfdId group)
Constructor, taking tag and group of the component to find.
Definition tiffvisitor_int.hpp:133
void visitDirectory(TiffDirectory *object) override
Find tag and group in a TIFF directory.
Definition tiffvisitor_int.cpp:104
void visitMnEntry(TiffMnEntry *object) override
Find tag and group in a TIFF makernote.
Definition tiffvisitor_int.cpp:112
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
void visitImageEntry(TiffImageEntry *object) override
Find tag and group in a TIFF image entry.
Definition tiffvisitor_int.cpp:96
void init(uint16_t tag, IfdId group)
Initialize the Finder for a new search.
Definition tiffvisitor_int.cpp:74
void visitBinaryElement(TiffBinaryElement *object) override
Find tag and group in an element of a binary array.
Definition tiffvisitor_int.cpp:124
void findObject(TiffComponent *object)
Check if object matches tag and group.
Definition tiffvisitor_int.cpp:81
Contains internal objects which are not published and are not part of the libexiv2 API.
Definition tiffimage_int.hpp:29
Tiff IFD Makernote. This is a concrete class suitable for all IFD makernotes.
Definition tiffcomposite_int.hpp:1067
A standard TIFF IFD entry consisting of a value which is an array of offsets to image data areas....
Definition tiffcomposite_int.hpp:714
This class is the basis for Makernote support in TIFF. It contains a pointer to a concrete Makernote....
Definition tiffcomposite_int.hpp:1006
TIFF composite visitor to read the TIFF structure from a block of memory and build the composite from...
Definition tiffvisitor_int.hpp:579
void visitEntry(TiffEntry *object) override
Read a TIFF entry from the data buffer.
Definition tiffvisitor_int.cpp:1017
size_t baseOffset() const
Return the base offset. See class TiffRwState for details.
Definition tiffvisitor_int.cpp:1003
void visitIfdMakernoteEnd(TiffIfdMakernote *object) override
Reset reader to its original state, undo makernote specific settings.
Definition tiffvisitor_int.cpp:1222
void readDataEntryBase(TiffDataEntryBase *object)
Read a TiffDataEntryBase from the data buffer.
Definition tiffvisitor_int.cpp:1007
void visitDirectory(TiffDirectory *object) override
Read a TIFF directory from the data buffer.
Definition tiffvisitor_int.cpp:1065
ByteOrder byteOrder() const
Return the byte order.
Definition tiffvisitor_int.cpp:999
void setMnState(const TiffRwState *state=nullptr)
Set the state of the reader to one suitable for the Makernote.
Definition tiffvisitor_int.cpp:987
void visitSubIfd(TiffSubIfd *object) override
Read a TIFF sub-IFD from the data buffer.
Definition tiffvisitor_int.cpp:1139
int nextIdx(IfdId group)
Return the next idx sequence number for group.
Definition tiffvisitor_int.cpp:1051
void visitDataEntry(TiffDataEntry *object) override
Read a TIFF data entry from the data buffer.
Definition tiffvisitor_int.cpp:1021
void readTiffEntry(TiffEntryBase *object)
Read a standard TIFF entry from the data buffer.
Definition tiffvisitor_int.cpp:1227
void visitImageEntry(TiffImageEntry *object) override
Read a TIFF image entry from the data buffer.
Definition tiffvisitor_int.cpp:1025
~TiffReader() override=default
Virtual destructor.
void setOrigState()
Set the state to the original state as set in the constructor.
Definition tiffvisitor_int.cpp:983
void visitSizeEntry(TiffSizeEntry *object) override
Read a TIFF size entry from the data buffer.
Definition tiffvisitor_int.cpp:1029
bool circularReference(const byte *start, IfdId group)
Check IFD directory pointer start for circular reference.
Definition tiffvisitor_int.cpp:1039
void visitBinaryElement(TiffBinaryElement *object) override
Read an element of a binary array from the data buffer.
Definition tiffvisitor_int.cpp:1408
void visitMnEntry(TiffMnEntry *object) override
Read a TIFF makernote entry from the data buffer.
Definition tiffvisitor_int.cpp:1179
void visitIfdMakernote(TiffIfdMakernote *object) override
Read an IFD makernote from the data buffer.
Definition tiffvisitor_int.cpp:1197
void visitBinaryArray(TiffBinaryArray *object) override
Read a binary array from the data buffer.
Definition tiffvisitor_int.cpp:1330
void postProcess()
Read deferred components.
Definition tiffvisitor_int.cpp:1055
Simple state class containing relevant state information for the TIFF reader. This is in a separate c...
Definition tiffvisitor_int.hpp:535
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
size_t baseOffset() const
Return the base offset.
Definition tiffvisitor_int.hpp:564
constexpr TiffRwState(ByteOrder byteOrder, size_t baseOffset)
Constructor.
Definition tiffvisitor_int.hpp:540
A TIFF IFD entry containing the size of a data area of a related TiffDataEntry. This component is use...
Definition tiffcomposite_int.hpp:778
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
Abstract base class defining the interface for TIFF composite visitors (Visitor pattern)
Definition tiffvisitor_int.hpp:39
virtual void visitDataEntry(TiffDataEntry *object)=0
Operation to perform for a TIFF data entry.
bool go(GoEvent event) const
Check if stop flag for event is clear, return true if it's clear.
Definition tiffvisitor_int.cpp:58
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
virtual void visitBinaryArrayEnd(TiffBinaryArray *object)
Operation to perform for a TIFF binary array, at the end of the processing.
Definition tiffvisitor_int.cpp:71
virtual void visitBinaryElement(TiffBinaryElement *object)=0
Operation to perform for an element of a binary array.
GoEvent
Events for the stop/go flag. See setGo().
Definition tiffvisitor_int.hpp:42
@ geTraverse
Signal to control traversing of the composite tree.
Definition tiffvisitor_int.hpp:44
@ geKnownMakernote
Signal used by TiffReader to signal an unknown makernote.
Definition tiffvisitor_int.hpp:46
virtual void visitBinaryArray(TiffBinaryArray *object)=0
Operation to perform for a binary array.
virtual void visitSubIfd(TiffSubIfd *object)=0
Operation to perform for a TIFF sub-IFD.
virtual void visitDirectory(TiffDirectory *object)=0
Operation to perform for a TIFF directory.
virtual void visitImageEntry(TiffImageEntry *object)=0
Operation to perform for a TIFF image entry.
virtual void visitMnEntry(TiffMnEntry *object)=0
Operation to perform for the makernote component.
virtual void visitIfdMakernote(TiffIfdMakernote *object)=0
Operation to perform for an IFD makernote.
virtual ~TiffVisitor()=default
Virtual destructor.
virtual void visitSizeEntry(TiffSizeEntry *object)=0
Operation to perform for a TIFF size entry.
void setGo(GoEvent event, bool go)
Set the stop/go flag: true for go, false for stop.
Definition tiffvisitor_int.cpp:54
virtual void visitEntry(TiffEntry *object)=0
Operation to perform for a TIFF entry.
virtual void visitIfdMakernoteEnd(TiffIfdMakernote *object)
Operation to perform after processing an IFD makernote.
Definition tiffvisitor_int.cpp:68
virtual void visitDirectoryEnd(TiffDirectory *object)
Operation to perform for a TIFF directory, at the end of the processing.
Definition tiffvisitor_int.cpp:65
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
Encoding and decoding of Exif data.
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
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::vector< IfdId > PrimaryGroups
Type for a list of primary image groups.
Definition tifffwd_int.hpp:80
Class CrwImage to access Canon CRW images. References: The Canon RAW (CRW) File Format by Phil Harv...
Definition asfvideo.hpp:15
IfdId
Type to specify the IFD to which a metadata belongs.
Definition tags.hpp:34
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