| 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
16 namespace Exiv2 {
17 class IptcData;
18 class XmpData;
19
20 namespace Internal {
21// *****************************************************************************
22// class definitions
23
39 class TiffVisitor {
40 public:
42 enum GoEvent {
44 geTraverse = 0,
46 geKnownMakernote = 1
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
128 class 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 }
179
180
181 private:
182 uint16_t tag_;
183 IfdId group_;
184 TiffComponent* tiffComponent_{};
185}; // class TiffFinder
186
192 class 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
251 class 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
343 class 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 }
463
467 [[nodiscard]] bool dirty() const;
469 [[nodiscard]] WriteMethod writeMethod() const {
470 return writeMethod_;
471 }
472
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
535 class TiffRwState {
536 public:
538
539
540 constexpr TiffRwState(ByteOrder byteOrder, size_t baseOffset) : byteOrder_(byteOrder), baseOffset_(baseOffset) {
541 }
542
543
545
546
550 [[nodiscard]] ByteOrder byteOrder() const {
551 return byteOrder_;
552 }
553
564 [[nodiscard]] size_t baseOffset() const {
565 return baseOffset_;
566 }
567
568
569 private:
570 ByteOrder byteOrder_;
571 size_t baseOffset_;
572}; // TiffRwState
573
579 class 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);
628 void readDataEntryBase(TiffDataEntryBase* 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_
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