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
35 namespace 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  typedef TiffComponent* (*NewMnFct)(uint16_t tag,
55  IfdId group,
56  IfdId mnGroup,
57  const byte* pData,
58  uint32_t size,
59  ByteOrder byteOrder);
60 
62  typedef TiffComponent* (*NewMnFct2)(uint16_t tag,
63  IfdId group,
64  IfdId mnGroup);
65 
67  struct TiffMnRegistry {
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 
91  class TiffMnCreator {
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  virtual ~MnHeader();
133 
135  virtual bool read(const byte* pData,
137  uint32_t size,
138  ByteOrder byteOrder) =0;
142  virtual void setByteOrder(ByteOrder byteOrder);
144 
146  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  OlympusMnHeader();
180  virtual ~OlympusMnHeader();
182 
184  virtual bool read(const byte* pData,
185  uint32_t size,
188 
190  virtual uint32_t size() const;
191  virtual uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const;
192  virtual uint32_t ifdOffset() const;
194  static uint32_t sizeOfSignature();
196 
197  private:
198  DataBuf header_;
199  static const byte signature_[];
200 
201  }; // class OlympusMnHeader
202 
204  class Olympus2MnHeader : public MnHeader {
205  public:
207 
211  virtual ~Olympus2MnHeader();
213 
215  virtual bool read(const byte* pData,
216  uint32_t size,
219 
221  virtual uint32_t size() const;
222  virtual uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const;
223  virtual uint32_t ifdOffset() const;
224  virtual uint32_t baseOffset(uint32_t mnOffset) const;
226  static uint32_t sizeOfSignature();
228 
229  private:
230  DataBuf header_;
231  static const byte signature_[];
232 
233  }; // class Olympus2MnHeader
234 
236  class FujiMnHeader : public MnHeader {
237  public:
239 
240  FujiMnHeader();
243  virtual ~FujiMnHeader();
245 
247  virtual bool read(const byte* pData,
248  uint32_t size,
250  // setByteOrder not implemented
252 
254  virtual uint32_t size() const;
255  virtual uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const;
256  virtual uint32_t ifdOffset() const;
257  virtual ByteOrder byteOrder() const;
258  virtual uint32_t baseOffset(uint32_t mnOffset) const;
260  static uint32_t sizeOfSignature();
262 
263  private:
264  DataBuf header_;
265  static const byte signature_[];
266  static const ByteOrder byteOrder_;
267  uint32_t start_;
268 
269  }; // class FujiMnHeader
270 
272  class Nikon2MnHeader : public MnHeader {
273  public:
275 
276  Nikon2MnHeader();
279  virtual ~Nikon2MnHeader();
281 
283  virtual bool read(const byte* pData,
284  uint32_t size,
287 
289  virtual uint32_t size() const;
290  virtual uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const;
291  virtual uint32_t ifdOffset() const;
293  static uint32_t sizeOfSignature();
295 
296  private:
297  DataBuf buf_;
298  uint32_t start_;
299  static const byte signature_[];
300 
301  }; // class Nikon2MnHeader
302 
304  class Nikon3MnHeader : public MnHeader {
305  public:
307 
308  Nikon3MnHeader();
311  virtual ~Nikon3MnHeader();
313 
315  virtual bool read(const byte* pData,
316  uint32_t size,
318  virtual void setByteOrder(ByteOrder byteOrder);
320 
322  virtual uint32_t size() const;
323  virtual uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const;
324  virtual uint32_t ifdOffset() const;
325  virtual ByteOrder byteOrder() const;
326  virtual uint32_t baseOffset(uint32_t mnOffset) const;
328  static uint32_t sizeOfSignature();
330 
331  private:
332  DataBuf buf_;
333  ByteOrder byteOrder_;
334  uint32_t start_;
335  static const byte signature_[];
336 
337  }; // class Nikon3MnHeader
338 
340  class PanasonicMnHeader : public MnHeader {
341  public:
343 
347  virtual ~PanasonicMnHeader();
349 
351  virtual bool read(const byte* pData,
352  uint32_t size,
355 
357  virtual uint32_t size() const;
358  virtual uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const;
359  virtual uint32_t ifdOffset() const;
361  static uint32_t sizeOfSignature();
363 
364  private:
365  DataBuf buf_;
366  uint32_t start_;
367  static const byte signature_[];
368 
369  }; // class PanasonicMnHeader
370 
372  class PentaxDngMnHeader : public MnHeader {
373  public:
375 
379  virtual ~PentaxDngMnHeader();
381 
383  virtual bool read(const byte* pData,
384  uint32_t size,
387 
389  virtual uint32_t size() const;
390  virtual uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const;
391  virtual uint32_t ifdOffset() const;
392  virtual uint32_t baseOffset(uint32_t mnOffset) const;
394  static uint32_t sizeOfSignature();
396 
397  private:
398  DataBuf header_;
399  static const byte signature_[];
400 
401  }; // class PentaxDngMnHeader
402 
404  class PentaxMnHeader : public MnHeader {
405  public:
407 
408  PentaxMnHeader();
411  virtual ~PentaxMnHeader();
413 
415  virtual bool read(const byte* pData,
416  uint32_t size,
419 
421  virtual uint32_t size() const;
422  virtual uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const;
423  virtual uint32_t ifdOffset() const;
425  static uint32_t sizeOfSignature();
427 
428  private:
429  DataBuf header_;
430  static const byte signature_[];
431 
432  }; // class PentaxMnHeader
433 
435  class SamsungMnHeader : public MnHeader {
436  public:
438 
439  SamsungMnHeader();
442 
444  virtual bool read(const byte* pData,
445  uint32_t size,
448 
450  virtual uint32_t size() const;
451  virtual uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const;
452  virtual uint32_t baseOffset(uint32_t mnOffset) const;
454 
455  }; // class SamsungMnHeader
456 
458  class SigmaMnHeader : public MnHeader {
459  public:
461 
462  SigmaMnHeader();
465  virtual ~SigmaMnHeader();
467 
469  virtual bool read(const byte* pData,
470  uint32_t size,
473 
475  virtual uint32_t size() const;
476  virtual uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const;
477  virtual uint32_t ifdOffset() const;
479  static uint32_t sizeOfSignature();
481 
482  private:
483  DataBuf buf_;
484  uint32_t start_;
485  static const byte signature1_[];
486  static const byte signature2_[];
487 
488  }; // class SigmaMnHeader
489 
491  class SonyMnHeader : public MnHeader {
492  public:
494 
495  SonyMnHeader();
498  virtual ~SonyMnHeader();
500 
502  virtual bool read(const byte* pData,
503  uint32_t size,
506 
508  virtual uint32_t size() const;
509  virtual uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const;
510  virtual uint32_t ifdOffset() const;
512  static uint32_t sizeOfSignature();
514 
515  private:
516  DataBuf buf_;
517  uint32_t start_;
518  static const byte signature_[];
519 
520  }; // class SonyMnHeader
521 
523  class Casio2MnHeader : public MnHeader {
524  public:
526 
527  Casio2MnHeader();
530  virtual ~Casio2MnHeader();
532 
534  virtual bool read(const byte* pData,
535  uint32_t size,
538 
540  virtual uint32_t size() const;
541  virtual uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const;
542  virtual uint32_t ifdOffset() const;
543  virtual ByteOrder byteOrder() const;
545  static uint32_t sizeOfSignature();
547 
548  private:
549  DataBuf buf_;
550  uint32_t start_;
551  static const byte signature_[];
552  static const ByteOrder byteOrder_;
553 
554  }; // class Casio2MnHeader
555 
556  // *****************************************************************************
557 // template, inline and free functions
558 
560  TiffComponent* newIfdMn(uint16_t tag,
561  IfdId group,
562  IfdId mnGroup,
563  const byte* pData,
564  uint32_t size,
565  ByteOrder byteOrder);
566 
568  TiffComponent* newIfdMn2(uint16_t tag,
569  IfdId group,
570  IfdId mnGroup);
571 
573  TiffComponent* newOlympusMn(uint16_t tag,
574  IfdId group,
575  IfdId mnGroup,
576  const byte* pData,
577  uint32_t size,
578  ByteOrder byteOrder);
579 
581  TiffComponent* newOlympusMn2(uint16_t tag,
582  IfdId group,
583  IfdId mnGroup);
584 
586  TiffComponent* newOlympus2Mn2(uint16_t tag,
587  IfdId group,
588  IfdId mnGroup);
589 
591  TiffComponent* newFujiMn(uint16_t tag,
592  IfdId group,
593  IfdId mnGroup,
594  const byte* pData,
595  uint32_t size,
596  ByteOrder byteOrder);
597 
599  TiffComponent* newFujiMn2(uint16_t tag,
600  IfdId group,
601  IfdId mnGroup);
602 
607  TiffComponent* newNikonMn(uint16_t tag,
608  IfdId group,
609  IfdId mnGroup,
610  const byte* pData,
611  uint32_t size,
612  ByteOrder byteOrder);
613 
615  TiffComponent* newNikon2Mn2(uint16_t tag,
616  IfdId group,
617  IfdId mnGroup);
618 
620  TiffComponent* newNikon3Mn2(uint16_t tag,
621  IfdId group,
622  IfdId mnGroup);
623 
625  TiffComponent* newPanasonicMn(uint16_t tag,
626  IfdId group,
627  IfdId mnGroup,
628  const byte* pData,
629  uint32_t size,
630  ByteOrder byteOrder);
631 
633  TiffComponent* newPanasonicMn2(uint16_t tag,
634  IfdId group,
635  IfdId mnGroup);
636 
638  TiffComponent* newPentaxMn(uint16_t tag,
639  IfdId group,
640  IfdId mnGroup,
641  const byte* pData,
642  uint32_t size,
643  ByteOrder byteOrder);
644 
646  TiffComponent* newPentaxMn2(uint16_t tag,
647  IfdId group,
648  IfdId mnGroup);
649 
651  TiffComponent* newPentaxDngMn2(uint16_t tag,
652  IfdId group,
653  IfdId mnGroup);
654 
656  TiffComponent* newSamsungMn(uint16_t tag,
657  IfdId group,
658  IfdId mnGroup,
659  const byte* pData,
660  uint32_t size,
661  ByteOrder byteOrder);
662 
664  TiffComponent* newSamsungMn2(uint16_t tag,
665  IfdId group,
666  IfdId mnGroup);
667 
669  TiffComponent* newSigmaMn(uint16_t tag,
670  IfdId group,
671  IfdId mnGroup,
672  const byte* pData,
673  uint32_t size,
674  ByteOrder byteOrder);
675 
677  TiffComponent* newSigmaMn2(uint16_t tag,
678  IfdId group,
679  IfdId mnGroup);
680 
682  TiffComponent* newSonyMn(uint16_t tag,
683  IfdId group,
684  IfdId mnGroup,
685  const byte* pData,
686  uint32_t size,
687  ByteOrder byteOrder);
688 
690  TiffComponent* newSony1Mn2(uint16_t tag,
691  IfdId group,
692  IfdId mnGroup);
693 
695  TiffComponent* newSony2Mn2(uint16_t tag,
696  IfdId group,
697  IfdId mnGroup);
698 
700  TiffComponent* newCasioMn(uint16_t tag,
701  IfdId group,
702  IfdId mnGroup,
703  const byte* pData,
704  uint32_t size,
705  ByteOrder byteOrder);
706 
708  TiffComponent* newCasio2Mn2(uint16_t tag,
709  IfdId group,
710  IfdId mnGroup);
711 
721  int sonyCsSelector(uint16_t tag, const byte* pData, uint32_t size, TiffComponent* const pRoot);
722 
732  int sony2010eSelector(uint16_t tag, const byte* pData, uint32_t size, TiffComponent* const pRoot);
733 
743  int nikonSelector(uint16_t tag, const byte* pData, uint32_t size, TiffComponent* const pRoot);
744 
754  int nikonAf2Selector(uint16_t tag, const byte* pData, uint32_t size, TiffComponent* const pRoot);
755 
772  DataBuf nikonCrypt(uint16_t tag, const byte* pData, uint32_t size, TiffComponent* const pRoot);
773 
774 }} // namespace Internal, Exiv2
775 
776 #endif // #ifndef MAKERNOTE_INT_HPP_
Utility class containing a character array. All it does is to take care of memory allocation and dele...
Definition: types.hpp:193
Header of a Casio2 Makernote.
Definition: makernote_int.hpp:523
virtual uint32_t size() const
Return the size of the header (in bytes).
Definition: makernote_int.cpp:815
virtual ~Casio2MnHeader()
Virtual destructor.
Definition: makernote_int.cpp:811
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:820
virtual uint32_t write(IoWrapper &ioWrapper, ByteOrder byteOrder) const
Write the header to a data buffer, return the number of bytes written.
Definition: makernote_int.cpp:842
virtual bool read(const byte *pData, uint32_t size, ByteOrder byteOrder)
Read the header from a data buffer, return true if ok.
Definition: makernote_int.cpp:830
static uint32_t sizeOfSignature()
Return the size of the makernote header signature.
Definition: makernote_int.cpp:801
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:825
Casio2MnHeader()
Default constructor.
Definition: makernote_int.cpp:806
Header of a Fujifilm Makernote.
Definition: makernote_int.hpp:236
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:367
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:362
FujiMnHeader()
Default constructor.
Definition: makernote_int.cpp:343
virtual ~FujiMnHeader()
Virtual destructor.
Definition: makernote_int.cpp:348
virtual uint32_t size() const
Return the size of the header (in bytes).
Definition: makernote_int.cpp:352
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:357
static uint32_t sizeOfSignature()
Return the size of the makernote header signature.
Definition: makernote_int.cpp:338
virtual bool read(const byte *pData, uint32_t size, ByteOrder byteOrder)
Read the header from a data buffer, return true if ok.
Definition: makernote_int.cpp:372
virtual uint32_t write(IoWrapper &ioWrapper, ByteOrder byteOrder) const
Write the header to a data buffer, return the number of bytes written.
Definition: makernote_int.cpp:389
Simple IO wrapper to ensure that the header is only written if there is any other data at all.
Definition: tiffcomposite_int.hpp:121
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:211
virtual bool read(const byte *pData, uint32_t size, ByteOrder byteOrder)=0
Read the header from a data buffer, return true if ok.
virtual ~MnHeader()
Virtual destructor.
Definition: makernote_int.cpp:207
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:225
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:215
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:220
virtual uint32_t size() const =0
Return the size of the header (in bytes).
Header of a Nikon 2 Makernote.
Definition: makernote_int.hpp:272
virtual ~Nikon2MnHeader()
Virtual destructor.
Definition: makernote_int.cpp:410
virtual uint32_t write(IoWrapper &ioWrapper, ByteOrder byteOrder) const
Write the header to a data buffer, return the number of bytes written.
Definition: makernote_int.cpp:436
Nikon2MnHeader()
Default constructor.
Definition: makernote_int.cpp:405
virtual uint32_t size() const
Return the size of the header (in bytes).
Definition: makernote_int.cpp:414
static uint32_t sizeOfSignature()
Return the size of the makernote header signature.
Definition: makernote_int.cpp:400
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:419
virtual bool read(const byte *pData, uint32_t size, ByteOrder byteOrder)
Read the header from a data buffer, return true if ok.
Definition: makernote_int.cpp:424
Header of a Nikon 3 Makernote.
Definition: makernote_int.hpp:304
virtual uint32_t size() const
Return the size of the header (in bytes).
Definition: makernote_int.cpp:465
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:475
Nikon3MnHeader()
Default constructor.
Definition: makernote_int.cpp:453
virtual bool read(const byte *pData, uint32_t size, ByteOrder byteOrder)
Read the header from a data buffer, return true if ok.
Definition: makernote_int.cpp:485
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:470
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:480
virtual ~Nikon3MnHeader()
Virtual destructor.
Definition: makernote_int.cpp:461
virtual uint32_t write(IoWrapper &ioWrapper, ByteOrder byteOrder) const
Write the header to a data buffer, return the number of bytes written.
Definition: makernote_int.cpp:500
virtual void setByteOrder(ByteOrder byteOrder)
Set the byte order for the makernote.
Definition: makernote_int.cpp:514
static uint32_t sizeOfSignature()
Return the size of the makernote header signature.
Definition: makernote_int.cpp:448
Header of an Olympus II Makernote.
Definition: makernote_int.hpp:204
virtual uint32_t write(IoWrapper &ioWrapper, ByteOrder byteOrder) const
Write the header to a data buffer, return the number of bytes written.
Definition: makernote_int.cpp:326
virtual bool read(const byte *pData, uint32_t size, ByteOrder byteOrder)
Read the header from a data buffer, return true if ok.
Definition: makernote_int.cpp:312
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:307
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:302
virtual uint32_t size() const
Return the size of the header (in bytes).
Definition: makernote_int.cpp:297
Olympus2MnHeader()
Default constructor.
Definition: makernote_int.cpp:288
static uint32_t sizeOfSignature()
Return the size of the makernote header signature.
Definition: makernote_int.cpp:283
virtual ~Olympus2MnHeader()
Virtual destructor.
Definition: makernote_int.cpp:293
Header of an Olympus Makernote.
Definition: makernote_int.hpp:173
static uint32_t sizeOfSignature()
Return the size of the makernote header signature.
Definition: makernote_int.cpp:234
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:253
virtual bool read(const byte *pData, uint32_t size, ByteOrder byteOrder)
Read the header from a data buffer, return true if ok.
Definition: makernote_int.cpp:258
virtual uint32_t write(IoWrapper &ioWrapper, ByteOrder byteOrder) const
Write the header to a data buffer, return the number of bytes written.
Definition: makernote_int.cpp:272
OlympusMnHeader()
Default constructor.
Definition: makernote_int.cpp:239
virtual uint32_t size() const
Return the size of the header (in bytes).
Definition: makernote_int.cpp:248
virtual ~OlympusMnHeader()
Virtual destructor.
Definition: makernote_int.cpp:244
Header of a Panasonic Makernote.
Definition: makernote_int.hpp:340
virtual uint32_t write(IoWrapper &ioWrapper, ByteOrder byteOrder) const
Write the header to a data buffer, return the number of bytes written.
Definition: makernote_int.cpp:559
virtual ~PanasonicMnHeader()
Virtual destructor.
Definition: makernote_int.cpp:533
PanasonicMnHeader()
Default constructor.
Definition: makernote_int.cpp:528
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:542
virtual bool read(const byte *pData, uint32_t size, ByteOrder byteOrder)
Read the header from a data buffer, return true if ok.
Definition: makernote_int.cpp:547
static uint32_t sizeOfSignature()
Return the size of the makernote header signature.
Definition: makernote_int.cpp:523
virtual uint32_t size() const
Return the size of the header (in bytes).
Definition: makernote_int.cpp:537
Header of an Pentax DNG Makernote.
Definition: makernote_int.hpp:372
PentaxDngMnHeader()
Default constructor.
Definition: makernote_int.cpp:575
virtual uint32_t write(IoWrapper &ioWrapper, ByteOrder byteOrder) const
Write the header to a data buffer, return the number of bytes written.
Definition: makernote_int.cpp:613
virtual bool read(const byte *pData, uint32_t size, ByteOrder byteOrder)
Read the header from a data buffer, return true if ok.
Definition: makernote_int.cpp:599
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:589
virtual ~PentaxDngMnHeader()
Virtual destructor.
Definition: makernote_int.cpp:580
virtual uint32_t size() const
Return the size of the header (in bytes).
Definition: makernote_int.cpp:584
static uint32_t sizeOfSignature()
Return the size of the makernote header signature.
Definition: makernote_int.cpp:570
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:594
Header of an Pentax Makernote.
Definition: makernote_int.hpp:404
virtual bool read(const byte *pData, uint32_t size, ByteOrder byteOrder)
Read the header from a data buffer, return true if ok.
Definition: makernote_int.cpp:648
virtual uint32_t size() const
Return the size of the header (in bytes).
Definition: makernote_int.cpp:638
static uint32_t sizeOfSignature()
Return the size of the makernote header signature.
Definition: makernote_int.cpp:624
virtual ~PentaxMnHeader()
Virtual destructor.
Definition: makernote_int.cpp:634
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:643
virtual uint32_t write(IoWrapper &ioWrapper, ByteOrder byteOrder) const
Write the header to a data buffer, return the number of bytes written.
Definition: makernote_int.cpp:662
PentaxMnHeader()
Default constructor.
Definition: makernote_int.cpp:629
Header of a Samsung Makernote, only used for the relative offset.
Definition: makernote_int.hpp:435
SamsungMnHeader()
Default constructor.
Definition: makernote_int.cpp:669
virtual uint32_t write(IoWrapper &ioWrapper, ByteOrder byteOrder) const
Write the header to a data buffer, return the number of bytes written.
Definition: makernote_int.cpp:691
virtual bool read(const byte *pData, uint32_t size, ByteOrder byteOrder)
Read the header from a data buffer, return true if ok.
Definition: makernote_int.cpp:684
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:679
virtual uint32_t size() const
Return the size of the header (in bytes).
Definition: makernote_int.cpp:674
Header of a Sigma Makernote.
Definition: makernote_int.hpp:458
virtual uint32_t write(IoWrapper &ioWrapper, ByteOrder byteOrder) const
Write the header to a data buffer, return the number of bytes written.
Definition: makernote_int.cpp:742
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:724
virtual ~SigmaMnHeader()
Virtual destructor.
Definition: makernote_int.cpp:715
static uint32_t sizeOfSignature()
Return the size of the makernote header signature.
Definition: makernote_int.cpp:704
virtual uint32_t size() const
Return the size of the header (in bytes).
Definition: makernote_int.cpp:719
SigmaMnHeader()
Default constructor.
Definition: makernote_int.cpp:710
virtual bool read(const byte *pData, uint32_t size, ByteOrder byteOrder)
Read the header from a data buffer, return true if ok.
Definition: makernote_int.cpp:729
Header of a Sony Makernote.
Definition: makernote_int.hpp:491
SonyMnHeader()
Default constructor.
Definition: makernote_int.cpp:758
virtual ~SonyMnHeader()
Virtual destructor.
Definition: makernote_int.cpp:763
static uint32_t sizeOfSignature()
Return the size of the makernote header signature.
Definition: makernote_int.cpp:753
virtual uint32_t write(IoWrapper &ioWrapper, ByteOrder byteOrder) const
Write the header to a data buffer, return the number of bytes written.
Definition: makernote_int.cpp:789
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:772
virtual bool read(const byte *pData, uint32_t size, ByteOrder byteOrder)
Read the header from a data buffer, return true if ok.
Definition: makernote_int.cpp:777
virtual uint32_t size() const
Return the size of the header (in bytes).
Definition: makernote_int.cpp:767
Interface class for components of a TIFF directory hierarchy (Composite pattern). Both TIFF directori...
Definition: tiffcomposite_int.hpp:171
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:166
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:1183
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:1045
TiffComponent * newPanasonicMn2(uint16_t tag, IfdId group, IfdId mnGroup)
Function to create a Panasonic makernote.
Definition: makernote_int.cpp:978
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:903
TiffComponent * newSony2Mn2(uint16_t tag, IfdId group, IfdId mnGroup)
Function to create a Sony2 makernote.
Definition: makernote_int.cpp:1090
TiffComponent * newOlympus2Mn2(uint16_t tag, IfdId group, IfdId mnGroup)
Function to create an Olympus II makernote.
Definition: makernote_int.cpp:896
TiffComponent * newFujiMn2(uint16_t tag, IfdId group, IfdId mnGroup)
Function to create a Fujifilm makernote.
Definition: makernote_int.cpp:915
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:1237
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:1064
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:966
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:1248
TiffComponent * newNikon3Mn2(uint16_t tag, IfdId group, IfdId mnGroup)
Function to create a Nikon3 makernote.
Definition: makernote_int.cpp:959
DataBuf nikonCrypt(uint16_t tag, const byte *pData, uint32_t size, TiffComponent *const pRoot)
Encrypt and decrypt Nikon data.
Definition: makernote_int.cpp:1199
TiffComponent * newSigmaMn2(uint16_t tag, IfdId group, IfdId mnGroup)
Function to create a Sigma makernote.
Definition: makernote_int.cpp:1057
TiffComponent * newOlympusMn2(uint16_t tag, IfdId group, IfdId mnGroup)
Function to create an Olympus makernote.
Definition: makernote_int.cpp:889
TiffComponent *(* NewMnFct2)(uint16_t tag, IfdId group, IfdId mnGroup)
Type for a pointer to a function creating a makernote (group)
Definition: makernote_int.hpp:62
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:1190
std::string getExiv2ConfigPath()
Determine the path to the Exiv2 configuration file.
Definition: makernote_int.cpp:94
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:1097
TiffComponent * newNikon2Mn2(uint16_t tag, IfdId group, IfdId mnGroup)
Function to create a Nikon2 makernote.
Definition: makernote_int.cpp:952
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:1016
TiffComponent * newSamsungMn2(uint16_t tag, IfdId group, IfdId mnGroup)
Function to create a Samsung makernote.
Definition: makernote_int.cpp:1038
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:985
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:113
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:922
TiffComponent * newIfdMn2(uint16_t tag, IfdId group, IfdId mnGroup)
Function to create a simple IFD makernote (Canon, Minolta, Nikon1)
Definition: makernote_int.cpp:864
TiffComponent *(* NewMnFct)(uint16_t tag, IfdId group, IfdId mnGroup, const byte *pData, uint32_t size, ByteOrder byteOrder)
Type for a pointer to a function creating a makernote (image)
Definition: makernote_int.hpp:54
TiffComponent * newSony1Mn2(uint16_t tag, IfdId group, IfdId mnGroup)
Function to create a Sony1 makernote.
Definition: makernote_int.cpp:1083
TiffComponent * newPentaxDngMn2(uint16_t tag, IfdId group, IfdId mnGroup)
Function to create an Pentax DNG makernote.
Definition: makernote_int.cpp:1009
TiffComponent * newCasio2Mn2(uint16_t tag, IfdId group, IfdId mnGroup)
Function to create a Casio2 makernote.
Definition: makernote_int.cpp:1113
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:871
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:852
TiffComponent * newPentaxMn2(uint16_t tag, IfdId group, IfdId mnGroup)
Function to create an Pentax makernote.
Definition: makernote_int.cpp:1002
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition: asfvideo.hpp:36
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:102
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:154
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