Exiv2
makernote_int.hpp
1// ***************************************************************** -*- C++ -*-
2/*
3 * Copyright (C) 2004-2021 Exiv2 authors
4 * This program is part of the Exiv2 distribution.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
19 */
20#ifndef MAKERNOTE_INT_HPP_
21#define MAKERNOTE_INT_HPP_
22
23// *****************************************************************************
24// included header files
25#include "tifffwd_int.hpp"
26#include "tags_int.hpp"
27#include "ini.hpp"
28#include "types.hpp"
29
30// + standard includes
31#include <string>
32
33// *****************************************************************************
34// namespace extensions
35namespace Exiv2 {
36 namespace Internal {
37// *****************************************************************************
38// function prototypes
42 std::string getExiv2ConfigPath();
43
47 std::string readExiv2Config(const std::string& section,const std::string& value,const std::string& def);
48
49
50// *****************************************************************************
51// class definitions
52
54 using NewMnFct = TiffComponent* (*)(uint16_t tag,
55 IfdId group,
56 IfdId mnGroup,
57 const byte* pData,
58 uint32_t size,
59 ByteOrder byteOrder);
60
62 using NewMnFct2 = TiffComponent* (*)(uint16_t tag,
63 IfdId group,
64 IfdId mnGroup);
65
68 struct MakeKey;
76 bool operator==(const std::string& key) const;
77
79 bool operator==(IfdId key) const;
80
81 // DATA
82 const char* make_;
86 };
87
92 public:
104 static TiffComponent* create(uint16_t tag,
105 IfdId group,
106 const std::string& make,
107 const byte* pData,
108 uint32_t size,
109 ByteOrder byteOrder);
114 static TiffComponent* create(uint16_t tag,
115 IfdId group,
116 IfdId mnGroup);
117
118 protected:
121 private:
122 static const TiffMnRegistry registry_[]; //<! List of makernotes
123 }; // class TiffMnCreator
124
126 class MnHeader {
127 public:
129
130
131 virtual ~MnHeader() = default;
133
135
136 virtual bool read(const byte* pData,
137 uint32_t size,
142 virtual void setByteOrder(ByteOrder byteOrder);
144
146
147 virtual uint32_t size() const =0;
149 virtual uint32_t write(IoWrapper& ioWrapper,
150 ByteOrder byteOrder) const =0;
155 virtual uint32_t ifdOffset() const;
161 virtual ByteOrder byteOrder() const;
167 virtual uint32_t baseOffset(uint32_t mnOffset) const;
169
170 }; // class MnHeader
171
173 class OlympusMnHeader : public MnHeader {
174 public:
176
177
180 ~OlympusMnHeader() override = default;
182
184 bool read(const byte* pData, uint32_t size, ByteOrder byteOrder) override;
186
188 uint32_t size() const override;
189 uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const override;
190 uint32_t ifdOffset() const override;
192
193 static uint32_t sizeOfSignature();
194
195 private:
196 DataBuf header_;
197 static const byte signature_[];
198
199 }; // class OlympusMnHeader
200
202 class Olympus2MnHeader : public MnHeader {
203 public:
205
206
209 ~Olympus2MnHeader() override = default;
211
213 bool read(const byte* pData, uint32_t size, ByteOrder byteOrder) override;
215
217 uint32_t size() const override;
218 uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const override;
219 uint32_t ifdOffset() const override;
220 uint32_t baseOffset(uint32_t mnOffset) const override;
222
223 static uint32_t sizeOfSignature();
224
225 private:
226 DataBuf header_;
227 static const byte signature_[];
228
229 }; // class Olympus2MnHeader
230
232 class FujiMnHeader : public MnHeader {
233 public:
235
236
237 FujiMnHeader();
239 ~FujiMnHeader() override = default;
241
243 bool read(const byte* pData, uint32_t size, ByteOrder byteOrder) override;
244 // setByteOrder not implemented
246
248 uint32_t size() const override;
249 uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const override;
250 uint32_t ifdOffset() const override;
251 ByteOrder byteOrder() const override;
252 uint32_t baseOffset(uint32_t mnOffset) const override;
254
255 static uint32_t sizeOfSignature();
256
257 private:
258 DataBuf header_;
259 static const byte signature_[];
260 static const ByteOrder byteOrder_;
261 uint32_t start_;
262
263 }; // class FujiMnHeader
264
266 class Nikon2MnHeader : public MnHeader {
267 public:
269
270
273 ~Nikon2MnHeader() override = default;
275
277 bool read(const byte* pData, uint32_t size, ByteOrder byteOrder) override;
279
281 uint32_t size() const override;
282 uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const override;
283 uint32_t ifdOffset() const override;
285
286 static uint32_t sizeOfSignature();
287
288 private:
289 DataBuf buf_;
290 uint32_t start_;
291 static const byte signature_[];
292
293 }; // class Nikon2MnHeader
294
296 class Nikon3MnHeader : public MnHeader {
297 public:
299
300
303 ~Nikon3MnHeader() override = default;
305
307 bool read(const byte* pData, uint32_t size, ByteOrder byteOrder) override;
308 void setByteOrder(ByteOrder byteOrder) override;
310
312 uint32_t size() const override;
313 uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const override;
314 uint32_t ifdOffset() const override;
315 ByteOrder byteOrder() const override;
316 uint32_t baseOffset(uint32_t mnOffset) const override;
318
319 static uint32_t sizeOfSignature();
320
321 private:
322 DataBuf buf_;
323 ByteOrder byteOrder_;
324 uint32_t start_;
325 static const byte signature_[];
326
327 }; // class Nikon3MnHeader
328
331 public:
333
334
337 ~PanasonicMnHeader() override = default;
339
341 bool read(const byte* pData, uint32_t size, ByteOrder byteOrder) override;
343
345 uint32_t size() const override;
346 uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const override;
347 uint32_t ifdOffset() const override;
349
350 static uint32_t sizeOfSignature();
351
352 private:
353 DataBuf buf_;
354 uint32_t start_;
355 static const byte signature_[];
356
357 }; // class PanasonicMnHeader
358
361 public:
363
364
367 ~PentaxDngMnHeader() override = default;
369
371 bool read(const byte* pData, uint32_t size, ByteOrder byteOrder) override;
373
375 uint32_t size() const override;
376 uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const override;
377 uint32_t ifdOffset() const override;
378 uint32_t baseOffset(uint32_t mnOffset) const override;
380
381 static uint32_t sizeOfSignature();
382
383 private:
384 DataBuf header_;
385 static const byte signature_[];
386
387 }; // class PentaxDngMnHeader
388
390 class PentaxMnHeader : public MnHeader {
391 public:
393
394
397 ~PentaxMnHeader() override = default;
399
401 bool read(const byte* pData, uint32_t size, ByteOrder byteOrder) override;
403
405 uint32_t size() const override;
406 uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const override;
407 uint32_t ifdOffset() const override;
409
410 static uint32_t sizeOfSignature();
411
412 private:
413 DataBuf header_;
414 static const byte signature_[];
415
416 }; // class PentaxMnHeader
417
419 class SamsungMnHeader : public MnHeader {
420 public:
422
423
426
428 bool read(const byte* pData, uint32_t size, ByteOrder byteOrder) override;
430
432 uint32_t size() const override;
433 uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const override;
434 uint32_t baseOffset(uint32_t mnOffset) const override;
436
437 }; // class SamsungMnHeader
438
440 class SigmaMnHeader : public MnHeader {
441 public:
443
444
447 ~SigmaMnHeader() override = default;
449
451 bool read(const byte* pData, uint32_t size, ByteOrder byteOrder) override;
453
455 uint32_t size() const override;
456 uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const override;
457 uint32_t ifdOffset() const override;
459
460 static uint32_t sizeOfSignature();
461
462 private:
463 DataBuf buf_;
464 uint32_t start_;
465 static const byte signature1_[];
466 static const byte signature2_[];
467
468 }; // class SigmaMnHeader
469
471 class SonyMnHeader : public MnHeader {
472 public:
474
475
476 SonyMnHeader();
478 ~SonyMnHeader() override = default;
480
482 bool read(const byte* pData, uint32_t size, ByteOrder byteOrder) override;
484
486 uint32_t size() const override;
487 uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const override;
488 uint32_t ifdOffset() const override;
490
491 static uint32_t sizeOfSignature();
492
493 private:
494 DataBuf buf_;
495 uint32_t start_;
496 static const byte signature_[];
497
498 }; // class SonyMnHeader
499
501 class Casio2MnHeader : public MnHeader {
502 public:
504
505
508 ~Casio2MnHeader() override = default;
510
512 bool read(const byte* pData, uint32_t size, ByteOrder byteOrder) override;
514
516 uint32_t size() const override;
517 uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const override;
518 uint32_t ifdOffset() const override;
519 ByteOrder byteOrder() const override;
521
522 static uint32_t sizeOfSignature();
523
524 private:
525 DataBuf buf_;
526 uint32_t start_;
527 static const byte signature_[];
528 static const ByteOrder byteOrder_;
529
530 }; // class Casio2MnHeader
531
532 // *****************************************************************************
533// template, inline and free functions
534
536 TiffComponent* newIfdMn(uint16_t tag,
537 IfdId group,
538 IfdId mnGroup,
539 const byte* pData,
540 uint32_t size,
541 ByteOrder byteOrder);
542
544 TiffComponent* newIfdMn2(uint16_t tag,
545 IfdId group,
546 IfdId mnGroup);
547
549 TiffComponent* newOlympusMn(uint16_t tag,
550 IfdId group,
551 IfdId mnGroup,
552 const byte* pData,
553 uint32_t size,
554 ByteOrder byteOrder);
555
557 TiffComponent* newOlympusMn2(uint16_t tag,
558 IfdId group,
559 IfdId mnGroup);
560
562 TiffComponent* newOlympus2Mn2(uint16_t tag,
563 IfdId group,
564 IfdId mnGroup);
565
567 TiffComponent* newFujiMn(uint16_t tag,
568 IfdId group,
569 IfdId mnGroup,
570 const byte* pData,
571 uint32_t size,
572 ByteOrder byteOrder);
573
575 TiffComponent* newFujiMn2(uint16_t tag,
576 IfdId group,
577 IfdId mnGroup);
578
583 TiffComponent* newNikonMn(uint16_t tag,
584 IfdId group,
585 IfdId mnGroup,
586 const byte* pData,
587 uint32_t size,
588 ByteOrder byteOrder);
589
591 TiffComponent* newNikon2Mn2(uint16_t tag,
592 IfdId group,
593 IfdId mnGroup);
594
596 TiffComponent* newNikon3Mn2(uint16_t tag,
597 IfdId group,
598 IfdId mnGroup);
599
601 TiffComponent* newPanasonicMn(uint16_t tag,
602 IfdId group,
603 IfdId mnGroup,
604 const byte* pData,
605 uint32_t size,
606 ByteOrder byteOrder);
607
609 TiffComponent* newPanasonicMn2(uint16_t tag,
610 IfdId group,
611 IfdId mnGroup);
612
614 TiffComponent* newPentaxMn(uint16_t tag,
615 IfdId group,
616 IfdId mnGroup,
617 const byte* pData,
618 uint32_t size,
619 ByteOrder byteOrder);
620
622 TiffComponent* newPentaxMn2(uint16_t tag,
623 IfdId group,
624 IfdId mnGroup);
625
627 TiffComponent* newPentaxDngMn2(uint16_t tag,
628 IfdId group,
629 IfdId mnGroup);
630
632 TiffComponent* newSamsungMn(uint16_t tag,
633 IfdId group,
634 IfdId mnGroup,
635 const byte* pData,
636 uint32_t size,
637 ByteOrder byteOrder);
638
640 TiffComponent* newSamsungMn2(uint16_t tag,
641 IfdId group,
642 IfdId mnGroup);
643
645 TiffComponent* newSigmaMn(uint16_t tag,
646 IfdId group,
647 IfdId mnGroup,
648 const byte* pData,
649 uint32_t size,
650 ByteOrder byteOrder);
651
653 TiffComponent* newSigmaMn2(uint16_t tag,
654 IfdId group,
655 IfdId mnGroup);
656
658 TiffComponent* newSonyMn(uint16_t tag,
659 IfdId group,
660 IfdId mnGroup,
661 const byte* pData,
662 uint32_t size,
663 ByteOrder byteOrder);
664
666 TiffComponent* newSony1Mn2(uint16_t tag,
667 IfdId group,
668 IfdId mnGroup);
669
671 TiffComponent* newSony2Mn2(uint16_t tag,
672 IfdId group,
673 IfdId mnGroup);
674
676 TiffComponent* newCasioMn(uint16_t tag,
677 IfdId group,
678 IfdId mnGroup,
679 const byte* pData,
680 uint32_t size,
681 ByteOrder byteOrder);
682
684 TiffComponent* newCasio2Mn2(uint16_t tag,
685 IfdId group,
686 IfdId mnGroup);
687
697 int sonyCsSelector(uint16_t tag, const byte* pData, uint32_t size, TiffComponent* const pRoot);
698
708 int sony2010eSelector(uint16_t tag, const byte* pData, uint32_t size, TiffComponent* const pRoot);
709
719 int sony2FpSelector(uint16_t tag, const byte* pData, uint32_t size, TiffComponent* const pRoot);
720
730 int sonyMisc2bSelector(uint16_t tag, const byte* pData, uint32_t size, TiffComponent* const pRoot);
731
741 int sonyMisc3cSelector(uint16_t tag, const byte* pData, uint32_t size, TiffComponent* const pRoot);
742
752 int nikonSelector(uint16_t tag, const byte* pData, uint32_t size, TiffComponent* const pRoot);
753
763 int nikonAf2Selector(uint16_t tag, const byte* pData, uint32_t size, TiffComponent* const pRoot);
764
781 DataBuf nikonCrypt(uint16_t tag, const byte* pData, uint32_t size, TiffComponent* const pRoot);
782
783}} // namespace Internal, Exiv2
784
785#endif // #ifndef MAKERNOTE_INT_HPP_
Header of a Casio2 Makernote.
Definition: makernote_int.hpp:501
ByteOrder byteOrder() const override
Return the byte order for the makernote. If the return value is invalidByteOrder, this means that the...
Definition: makernote_int.cpp:788
static uint32_t sizeOfSignature()
Return the size of the makernote header signature.
Definition: makernote_int.cpp:768
~Casio2MnHeader() override=default
Virtual destructor.
uint32_t size() const override
Return the size of the header (in bytes).
Definition: makernote_int.cpp:778
bool read(const byte *pData, uint32_t size, ByteOrder byteOrder) override
Read the header from a data buffer, return true if ok.
Definition: makernote_int.cpp:793
uint32_t write(IoWrapper &ioWrapper, ByteOrder byteOrder) const override
Write the header to a data buffer, return the number of bytes written.
Definition: makernote_int.cpp:805
uint32_t ifdOffset() const override
Return the offset to the start of the Makernote IFD from the start of the Makernote (= the start of t...
Definition: makernote_int.cpp:783
Casio2MnHeader()
Default constructor.
Definition: makernote_int.cpp:773
Header of a Fujifilm Makernote.
Definition: makernote_int.hpp:232
uint32_t ifdOffset() const override
Return the offset to the start of the Makernote IFD from the start of the Makernote (= the start of t...
Definition: makernote_int.cpp:363
~FujiMnHeader() override=default
Virtual destructor.
uint32_t baseOffset(uint32_t mnOffset) const override
Return the base offset for the makernote IFD entries relative to the start of the TIFF header....
Definition: makernote_int.cpp:373
FujiMnHeader()
Default constructor.
Definition: makernote_int.cpp:353
bool read(const byte *pData, uint32_t size, ByteOrder byteOrder) override
Read the header from a data buffer, return true if ok.
Definition: makernote_int.cpp:378
uint32_t write(IoWrapper &ioWrapper, ByteOrder byteOrder) const override
Write the header to a data buffer, return the number of bytes written.
Definition: makernote_int.cpp:392
ByteOrder byteOrder() const override
Return the byte order for the makernote. If the return value is invalidByteOrder, this means that the...
Definition: makernote_int.cpp:368
static uint32_t sizeOfSignature()
Return the size of the makernote header signature.
Definition: makernote_int.cpp:348
uint32_t size() const override
Return the size of the header (in bytes).
Definition: makernote_int.cpp:358
Simple IO wrapper to ensure that the header is only written if there is any other data at all.
Definition: tiffcomposite_int.hpp:122
Makernote header interface. This class is used with TIFF makernotes.
Definition: makernote_int.hpp:126
virtual uint32_t write(IoWrapper &ioWrapper, ByteOrder byteOrder) const =0
Write the header to a data buffer, return the number of bytes written.
virtual void setByteOrder(ByteOrder byteOrder)
Set the byte order for the makernote.
Definition: makernote_int.cpp:235
virtual bool read(const byte *pData, uint32_t size, ByteOrder byteOrder)=0
Read the header from a data buffer, return true if ok.
virtual uint32_t baseOffset(uint32_t mnOffset) const
Return the base offset for the makernote IFD entries relative to the start of the TIFF header....
Definition: makernote_int.cpp:249
virtual uint32_t ifdOffset() const
Return the offset to the start of the Makernote IFD from the start of the Makernote (= the start of t...
Definition: makernote_int.cpp:239
virtual ~MnHeader()=default
Virtual destructor.
virtual ByteOrder byteOrder() const
Return the byte order for the makernote. If the return value is invalidByteOrder, this means that the...
Definition: makernote_int.cpp:244
virtual uint32_t size() const =0
Return the size of the header (in bytes).
Header of a Nikon 2 Makernote.
Definition: makernote_int.hpp:266
uint32_t write(IoWrapper &ioWrapper, ByteOrder byteOrder) const override
Write the header to a data buffer, return the number of bytes written.
Definition: makernote_int.cpp:435
uint32_t size() const override
Return the size of the header (in bytes).
Definition: makernote_int.cpp:413
~Nikon2MnHeader() override=default
Virtual destructor.
Nikon2MnHeader()
Default constructor.
Definition: makernote_int.cpp:408
static uint32_t sizeOfSignature()
Return the size of the makernote header signature.
Definition: makernote_int.cpp:403
bool read(const byte *pData, uint32_t size, ByteOrder byteOrder) override
Read the header from a data buffer, return true if ok.
Definition: makernote_int.cpp:423
uint32_t ifdOffset() const override
Return the offset to the start of the Makernote IFD from the start of the Makernote (= the start of t...
Definition: makernote_int.cpp:418
Header of a Nikon 3 Makernote.
Definition: makernote_int.hpp:296
Nikon3MnHeader()
Default constructor.
Definition: makernote_int.cpp:452
void setByteOrder(ByteOrder byteOrder) override
Set the byte order for the makernote.
Definition: makernote_int.cpp:507
uint32_t write(IoWrapper &ioWrapper, ByteOrder byteOrder) const override
Write the header to a data buffer, return the number of bytes written.
Definition: makernote_int.cpp:493
~Nikon3MnHeader() override=default
Virtual destructor.
uint32_t ifdOffset() const override
Return the offset to the start of the Makernote IFD from the start of the Makernote (= the start of t...
Definition: makernote_int.cpp:463
uint32_t baseOffset(uint32_t mnOffset) const override
Return the base offset for the makernote IFD entries relative to the start of the TIFF header....
Definition: makernote_int.cpp:473
bool read(const byte *pData, uint32_t size, ByteOrder byteOrder) override
Read the header from a data buffer, return true if ok.
Definition: makernote_int.cpp:478
static uint32_t sizeOfSignature()
Return the size of the makernote header signature.
Definition: makernote_int.cpp:447
uint32_t size() const override
Return the size of the header (in bytes).
Definition: makernote_int.cpp:458
ByteOrder byteOrder() const override
Return the byte order for the makernote. If the return value is invalidByteOrder, this means that the...
Definition: makernote_int.cpp:468
Header of an Olympus II Makernote.
Definition: makernote_int.hpp:202
bool read(const byte *pData, uint32_t size, ByteOrder byteOrder) override
Read the header from a data buffer, return true if ok.
Definition: makernote_int.cpp:325
uint32_t ifdOffset() const override
Return the offset to the start of the Makernote IFD from the start of the Makernote (= the start of t...
Definition: makernote_int.cpp:315
uint32_t size() const override
Return the size of the header (in bytes).
Definition: makernote_int.cpp:310
uint32_t write(IoWrapper &ioWrapper, ByteOrder byteOrder) const override
Write the header to a data buffer, return the number of bytes written.
Definition: makernote_int.cpp:336
uint32_t baseOffset(uint32_t mnOffset) const override
Return the base offset for the makernote IFD entries relative to the start of the TIFF header....
Definition: makernote_int.cpp:320
Olympus2MnHeader()
Default constructor.
Definition: makernote_int.cpp:305
static uint32_t sizeOfSignature()
Return the size of the makernote header signature.
Definition: makernote_int.cpp:300
~Olympus2MnHeader() override=default
Virtual destructor.
Header of an Olympus Makernote.
Definition: makernote_int.hpp:173
bool read(const byte *pData, uint32_t size, ByteOrder byteOrder) override
Read the header from a data buffer, return true if ok.
Definition: makernote_int.cpp:278
static uint32_t sizeOfSignature()
Return the size of the makernote header signature.
Definition: makernote_int.cpp:258
uint32_t ifdOffset() const override
Return the offset to the start of the Makernote IFD from the start of the Makernote (= the start of t...
Definition: makernote_int.cpp:273
uint32_t size() const override
Return the size of the header (in bytes).
Definition: makernote_int.cpp:268
OlympusMnHeader()
Default constructor.
Definition: makernote_int.cpp:263
uint32_t write(IoWrapper &ioWrapper, ByteOrder byteOrder) const override
Write the header to a data buffer, return the number of bytes written.
Definition: makernote_int.cpp:289
~OlympusMnHeader() override=default
Virtual destructor.
Header of a Panasonic Makernote.
Definition: makernote_int.hpp:330
bool read(const byte *pData, uint32_t size, ByteOrder byteOrder) override
Read the header from a data buffer, return true if ok.
Definition: makernote_int.cpp:536
uint32_t size() const override
Return the size of the header (in bytes).
Definition: makernote_int.cpp:526
uint32_t ifdOffset() const override
Return the offset to the start of the Makernote IFD from the start of the Makernote (= the start of t...
Definition: makernote_int.cpp:531
PanasonicMnHeader()
Default constructor.
Definition: makernote_int.cpp:521
uint32_t write(IoWrapper &ioWrapper, ByteOrder byteOrder) const override
Write the header to a data buffer, return the number of bytes written.
Definition: makernote_int.cpp:548
~PanasonicMnHeader() override=default
Virtual destructor.
static uint32_t sizeOfSignature()
Return the size of the makernote header signature.
Definition: makernote_int.cpp:516
Header of an Pentax DNG Makernote.
Definition: makernote_int.hpp:360
PentaxDngMnHeader()
Default constructor.
Definition: makernote_int.cpp:564
bool read(const byte *pData, uint32_t size, ByteOrder byteOrder) override
Read the header from a data buffer, return true if ok.
Definition: makernote_int.cpp:584
uint32_t baseOffset(uint32_t mnOffset) const override
Return the base offset for the makernote IFD entries relative to the start of the TIFF header....
Definition: makernote_int.cpp:574
uint32_t write(IoWrapper &ioWrapper, ByteOrder byteOrder) const override
Write the header to a data buffer, return the number of bytes written.
Definition: makernote_int.cpp:595
uint32_t ifdOffset() const override
Return the offset to the start of the Makernote IFD from the start of the Makernote (= the start of t...
Definition: makernote_int.cpp:579
~PentaxDngMnHeader() override=default
Virtual destructor.
static uint32_t sizeOfSignature()
Return the size of the makernote header signature.
Definition: makernote_int.cpp:559
uint32_t size() const override
Return the size of the header (in bytes).
Definition: makernote_int.cpp:569
Header of an Pentax Makernote.
Definition: makernote_int.hpp:390
uint32_t ifdOffset() const override
Return the offset to the start of the Makernote IFD from the start of the Makernote (= the start of t...
Definition: makernote_int.cpp:621
static uint32_t sizeOfSignature()
Return the size of the makernote header signature.
Definition: makernote_int.cpp:606
uint32_t size() const override
Return the size of the header (in bytes).
Definition: makernote_int.cpp:616
~PentaxMnHeader() override=default
Virtual destructor.
bool read(const byte *pData, uint32_t size, ByteOrder byteOrder) override
Read the header from a data buffer, return true if ok.
Definition: makernote_int.cpp:626
uint32_t write(IoWrapper &ioWrapper, ByteOrder byteOrder) const override
Write the header to a data buffer, return the number of bytes written.
Definition: makernote_int.cpp:637
PentaxMnHeader()
Default constructor.
Definition: makernote_int.cpp:611
Header of a Samsung Makernote, only used for the relative offset.
Definition: makernote_int.hpp:419
SamsungMnHeader()
Default constructor.
Definition: makernote_int.cpp:644
uint32_t baseOffset(uint32_t mnOffset) const override
Return the base offset for the makernote IFD entries relative to the start of the TIFF header....
Definition: makernote_int.cpp:654
uint32_t size() const override
Return the size of the header (in bytes).
Definition: makernote_int.cpp:649
bool read(const byte *pData, uint32_t size, ByteOrder byteOrder) override
Read the header from a data buffer, return true if ok.
Definition: makernote_int.cpp:659
uint32_t write(IoWrapper &ioWrapper, ByteOrder byteOrder) const override
Write the header to a data buffer, return the number of bytes written.
Definition: makernote_int.cpp:666
Header of a Sigma Makernote.
Definition: makernote_int.hpp:440
uint32_t size() const override
Return the size of the header (in bytes).
Definition: makernote_int.cpp:690
bool read(const byte *pData, uint32_t size, ByteOrder byteOrder) override
Read the header from a data buffer, return true if ok.
Definition: makernote_int.cpp:700
uint32_t write(IoWrapper &ioWrapper, ByteOrder byteOrder) const override
Write the header to a data buffer, return the number of bytes written.
Definition: makernote_int.cpp:713
static uint32_t sizeOfSignature()
Return the size of the makernote header signature.
Definition: makernote_int.cpp:679
SigmaMnHeader()
Default constructor.
Definition: makernote_int.cpp:685
~SigmaMnHeader() override=default
Virtual destructor.
uint32_t ifdOffset() const override
Return the offset to the start of the Makernote IFD from the start of the Makernote (= the start of t...
Definition: makernote_int.cpp:695
Header of a Sony Makernote.
Definition: makernote_int.hpp:471
SonyMnHeader()
Default constructor.
Definition: makernote_int.cpp:729
~SonyMnHeader() override=default
Virtual destructor.
static uint32_t sizeOfSignature()
Return the size of the makernote header signature.
Definition: makernote_int.cpp:724
bool read(const byte *pData, uint32_t size, ByteOrder byteOrder) override
Read the header from a data buffer, return true if ok.
Definition: makernote_int.cpp:744
uint32_t ifdOffset() const override
Return the offset to the start of the Makernote IFD from the start of the Makernote (= the start of t...
Definition: makernote_int.cpp:739
uint32_t size() const override
Return the size of the header (in bytes).
Definition: makernote_int.cpp:734
uint32_t write(IoWrapper &ioWrapper, ByteOrder byteOrder) const override
Write the header to a data buffer, return the number of bytes written.
Definition: makernote_int.cpp:756
Interface class for components of a TIFF directory hierarchy (Composite pattern). Both TIFF directori...
Definition: tiffcomposite_int.hpp:172
TIFF makernote factory for concrete TIFF makernotes.
Definition: makernote_int.hpp:91
~TiffMnCreator()
Prevent destruction (needed if used as a policy class)
Definition: makernote_int.hpp:120
static TiffComponent * create(uint16_t tag, IfdId group, const std::string &make, const byte *pData, uint32_t size, ByteOrder byteOrder)
Create the Makernote for camera make and details from the makernote entry itself if needed....
Definition: makernote_int.cpp:194
int nikonSelector(uint16_t tag, const byte *pData, uint32_t size, TiffComponent *const)
Function to select cfg + def of a Nikon complex binary array.
Definition: makernote_int.cpp:1144
TiffComponent * newSigmaMn(uint16_t tag, IfdId group, IfdId mnGroup, const byte *, uint32_t size, ByteOrder)
Function to create a Sigma makernote.
Definition: makernote_int.cpp:1008
TiffComponent * newPanasonicMn2(uint16_t tag, IfdId group, IfdId mnGroup)
Function to create a Panasonic makernote.
Definition: makernote_int.cpp:941
TiffComponent * newFujiMn(uint16_t tag, IfdId group, IfdId mnGroup, const byte *, uint32_t size, ByteOrder)
Function to create a Fujifilm makernote.
Definition: makernote_int.cpp:866
int sonyMisc3cSelector(uint16_t, const byte *, uint32_t, TiffComponent *const pRoot)
Function to select cfg + def of the SonyMisc3c (tag 9400) complex binary array.
Definition: makernote_int.cpp:1256
TiffComponent * newSony2Mn2(uint16_t tag, IfdId group, IfdId mnGroup)
Function to create a Sony2 makernote.
Definition: makernote_int.cpp:1053
int sonyMisc2bSelector(uint16_t, const byte *, uint32_t, TiffComponent *const pRoot)
Function to select cfg + def of the SonyMisc2b (tag 9404b) complex binary array.
Definition: makernote_int.cpp:1228
TiffComponent * newOlympus2Mn2(uint16_t tag, IfdId group, IfdId mnGroup)
Function to create an Olympus II makernote.
Definition: makernote_int.cpp:859
TiffComponent * newFujiMn2(uint16_t tag, IfdId group, IfdId mnGroup)
Function to create a Fujifilm makernote.
Definition: makernote_int.cpp:878
TiffComponent *(*)(uint16_t tag, IfdId group, IfdId mnGroup, const byte *pData, uint32_t size, ByteOrder byteOrder) NewMnFct
Type for a pointer to a function creating a makernote (image)
Definition: makernote_int.hpp:59
int sonyCsSelector(uint16_t, const byte *, uint32_t, TiffComponent *const pRoot)
Function to select cfg + def of the Sony Camera Settings complex binary array.
Definition: makernote_int.cpp:1198
TiffComponent * newSonyMn(uint16_t tag, IfdId group, IfdId, const byte *pData, uint32_t size, ByteOrder)
Function to create a Sony makernote.
Definition: makernote_int.cpp:1027
TiffComponent * newPanasonicMn(uint16_t tag, IfdId group, IfdId mnGroup, const byte *, uint32_t size, ByteOrder)
Function to create a Panasonic makernote.
Definition: makernote_int.cpp:929
int sony2010eSelector(uint16_t, const byte *, uint32_t, TiffComponent *const pRoot)
Function to select cfg + def of the Sony 2010 Miscellaneous Information complex binary array.
Definition: makernote_int.cpp:1209
TiffComponent *(*)(uint16_t tag, IfdId group, IfdId mnGroup) NewMnFct2
Type for a pointer to a function creating a makernote (group)
Definition: makernote_int.hpp:64
TiffComponent * newNikon3Mn2(uint16_t tag, IfdId group, IfdId mnGroup)
Function to create a Nikon3 makernote.
Definition: makernote_int.cpp:922
DataBuf nikonCrypt(uint16_t tag, const byte *pData, uint32_t size, TiffComponent *const pRoot)
Encrypt and decrypt Nikon data.
Definition: makernote_int.cpp:1160
TiffComponent * newSigmaMn2(uint16_t tag, IfdId group, IfdId mnGroup)
Function to create a Sigma makernote.
Definition: makernote_int.cpp:1020
TiffComponent * newOlympusMn2(uint16_t tag, IfdId group, IfdId mnGroup)
Function to create an Olympus makernote.
Definition: makernote_int.cpp:852
int nikonAf2Selector(uint16_t tag, const byte *, uint32_t size, TiffComponent *const)
Function to select cfg + def of a Nikon complex binary array.
Definition: makernote_int.cpp:1151
std::string getExiv2ConfigPath()
Determine the path to the Exiv2 configuration file.
Definition: makernote_int.cpp:106
int sony2FpSelector(uint16_t, const byte *, uint32_t, TiffComponent *const pRoot)
Function to select cfg + def of the Sony2Fp (tag 9402) complex binary array.
Definition: makernote_int.cpp:1218
TiffComponent * newCasioMn(uint16_t tag, IfdId group, IfdId, const byte *pData, uint32_t size, ByteOrder)
Function to create a Casio2 makernote.
Definition: makernote_int.cpp:1060
TiffComponent * newNikon2Mn2(uint16_t tag, IfdId group, IfdId mnGroup)
Function to create a Nikon2 makernote.
Definition: makernote_int.cpp:915
IfdId
Type to specify the IFD to which a metadata belongs.
Definition: tags_int.hpp:46
TiffComponent * newSamsungMn(uint16_t tag, IfdId group, IfdId mnGroup, const byte *pData, uint32_t size, ByteOrder)
Function to create a Samsung makernote.
Definition: makernote_int.cpp:980
TiffComponent * newSamsungMn2(uint16_t tag, IfdId group, IfdId mnGroup)
Function to create a Samsung makernote.
Definition: makernote_int.cpp:1001
TiffComponent * newPentaxMn(uint16_t tag, IfdId group, IfdId, const byte *pData, uint32_t size, ByteOrder)
Function to create an Pentax makernote.
Definition: makernote_int.cpp:948
std::string readExiv2Config(const std::string &section, const std::string &value, const std::string &def)
Read value from Exiv2 configuration file.
Definition: makernote_int.cpp:140
TiffComponent * newNikonMn(uint16_t tag, IfdId group, IfdId, const byte *pData, uint32_t size, ByteOrder)
Function to create a Nikon makernote. This will create the appropriate Nikon 1, 2 or 3 makernote,...
Definition: makernote_int.cpp:885
TiffComponent * newIfdMn2(uint16_t tag, IfdId group, IfdId mnGroup)
Function to create a simple IFD makernote (Canon, Minolta, Nikon1)
Definition: makernote_int.cpp:827
TiffComponent * newSony1Mn2(uint16_t tag, IfdId group, IfdId mnGroup)
Function to create a Sony1 makernote.
Definition: makernote_int.cpp:1046
TiffComponent * newPentaxDngMn2(uint16_t tag, IfdId group, IfdId mnGroup)
Function to create an Pentax DNG makernote.
Definition: makernote_int.cpp:973
TiffComponent * newCasio2Mn2(uint16_t tag, IfdId group, IfdId mnGroup)
Function to create a Casio2 makernote.
Definition: makernote_int.cpp:1076
TiffComponent * newOlympusMn(uint16_t tag, IfdId group, IfdId, const byte *pData, uint32_t size, ByteOrder)
Function to create an Olympus makernote.
Definition: makernote_int.cpp:834
TiffComponent * newIfdMn(uint16_t tag, IfdId group, IfdId mnGroup, const byte *, uint32_t size, ByteOrder)
Function to create a simple IFD makernote (Canon, Minolta, Nikon1)
Definition: makernote_int.cpp:815
TiffComponent * newPentaxMn2(uint16_t tag, IfdId group, IfdId mnGroup)
Function to create an Pentax makernote.
Definition: makernote_int.cpp:966
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition: basicio.hpp:43
EXIV2API ExifData::const_iterator make(const ExifData &ed)
Return the camera make.
Definition: easyaccess.cpp:437
ByteOrder
Type to express the byte order (little or big endian)
Definition: types.hpp:83
Utility class containing a character array. All it does is to take care of memory allocation and dele...
Definition: types.hpp:162
Makernote registry structure.
Definition: makernote_int.hpp:67
bool operator==(const std::string &key) const
Compare a TiffMnRegistry structure with a key being the make string from the image....
Definition: makernote_int.cpp:181
NewMnFct2 newMnFct2_
Makernote create function (group)
Definition: makernote_int.hpp:85
IfdId mnGroup_
Group identifier.
Definition: makernote_int.hpp:83
NewMnFct newMnFct_
Makernote create function (image)
Definition: makernote_int.hpp:84
const char * make_
Camera make.
Definition: makernote_int.hpp:82