forked from Exiv2/exiv2
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakernote_int.hpp
785 lines (690 loc) · 29.8 KB
/
makernote_int.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
// ***************************************************************** -*- C++ -*-
/*
* Copyright (C) 2004-2021 Exiv2 authors
* This program is part of the Exiv2 distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MAKERNOTE_INT_HPP_
#define MAKERNOTE_INT_HPP_
// *****************************************************************************
// included header files
#include "tifffwd_int.hpp"
#include "tags_int.hpp"
#include "ini.hpp"
#include "types.hpp"
// + standard includes
#include <string>
// *****************************************************************************
// namespace extensions
namespace Exiv2 {
namespace Internal {
// *****************************************************************************
// function prototypes
/*!
@brief Determine the path to the Exiv2 configuration file
*/
std::string getExiv2ConfigPath();
/*!
@brief Read value from Exiv2 configuration file
*/
std::string readExiv2Config(const std::string& section,const std::string& value,const std::string& def);
// *****************************************************************************
// class definitions
//! Type for a pointer to a function creating a makernote (image)
using NewMnFct = TiffComponent* (*)(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 (group)
using NewMnFct2 = TiffComponent* (*)(uint16_t tag,
IfdId group,
IfdId mnGroup);
//! Makernote registry structure
struct TiffMnRegistry {
struct MakeKey;
/*!
@brief Compare a TiffMnRegistry structure with a key being the make
string from the image. The two are equal if
TiffMnRegistry::make_ equals a substring of the key of the
same size. E.g., registry = "OLYMPUS",
key = "OLYMPUS OPTICAL CO.,LTD" (found in the image) match.
*/
bool operator==(const std::string& key) const;
//! Compare a TiffMnRegistry structure with a makernote group
bool operator==(IfdId key) const;
// DATA
const char* make_; //!< Camera make
IfdId mnGroup_; //!< Group identifier
NewMnFct newMnFct_; //!< Makernote create function (image)
NewMnFct2 newMnFct2_; //!< Makernote create function (group)
};
/*!
@brief TIFF makernote factory for concrete TIFF makernotes.
*/
class TiffMnCreator {
public:
/*!
@brief Create the Makernote for camera \em make and details from
the makernote entry itself if needed. Return a pointer to
the newly created TIFF component. Set tag and group of the
new component to \em tag and \em group. This method is used
when a makernote is parsed from the Exif block.
@note Ownership for the component is transferred to the caller,
who is responsible to delete the component. No smart pointer
is used to indicate this transfer here in order to reduce
file dependencies.
*/
static TiffComponent* create(uint16_t tag,
IfdId group,
const std::string& make,
const byte* pData,
uint32_t size,
ByteOrder byteOrder);
/*!
@brief Create the Makernote for a given group. This method is used
when a makernote is written back from Exif tags.
*/
static TiffComponent* create(uint16_t tag,
IfdId group,
IfdId mnGroup);
protected:
//! Prevent destruction (needed if used as a policy class)
~TiffMnCreator() {}
private:
static const TiffMnRegistry registry_[]; //<! List of makernotes
}; // class TiffMnCreator
//! Makernote header interface. This class is used with TIFF makernotes.
class MnHeader {
public:
//! @name Creators
//@{
//! Virtual destructor.
virtual ~MnHeader() = default;
//@}
//! @name Manipulators
//@{
//! Read the header from a data buffer, return true if ok
virtual bool read(const byte* pData,
uint32_t size,
ByteOrder byteOrder) =0;
/*!
@brief Set the byte order for the makernote.
*/
virtual void setByteOrder(ByteOrder byteOrder);
//@}
//! @name Accessors
//@{
//! Return the size of the header (in bytes).
virtual uint32_t size() const =0;
//! Write the header to a data buffer, return the number of bytes written.
virtual uint32_t write(IoWrapper& ioWrapper,
ByteOrder byteOrder) const =0;
/*!
@brief Return the offset to the start of the Makernote IFD from
the start of the Makernote (= the start of the header).
*/
virtual uint32_t ifdOffset() const;
/*!
@brief Return the byte order for the makernote. If the return value is
invalidByteOrder, this means that the byte order of the the
image should be used for the makernote.
*/
virtual ByteOrder byteOrder() const;
/*!
@brief Return the base offset for the makernote IFD entries relative
to the start of the TIFF header. \em mnOffset is the offset
to the makernote from the start of the TIFF header.
*/
virtual uint32_t baseOffset(uint32_t mnOffset) const;
//@}
}; // class MnHeader
//! Header of an Olympus Makernote
class OlympusMnHeader : public MnHeader {
public:
//! @name Creators
//@{
//! Default constructor
OlympusMnHeader();
//! Virtual destructor.
~OlympusMnHeader() override = default;
//@}
//! @name Manipulators
//@{
bool read(const byte* pData, uint32_t size, ByteOrder byteOrder) override;
//@}
//! @name Accessors
//@{
uint32_t size() const override;
uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const override;
uint32_t ifdOffset() const override;
//@}
//! Return the size of the makernote header signature
static uint32_t sizeOfSignature();
private:
DataBuf header_; //!< Data buffer for the makernote header
static const byte signature_[]; //!< Olympus makernote header signature
}; // class OlympusMnHeader
//! Header of an Olympus II Makernote
class Olympus2MnHeader : public MnHeader {
public:
//! @name Creators
//@{
//! Default constructor
Olympus2MnHeader();
//! Virtual destructor.
~Olympus2MnHeader() override = default;
//@}
//! @name Manipulators
//@{
bool read(const byte* pData, uint32_t size, ByteOrder byteOrder) override;
//@}
//! @name Accessors
//@{
uint32_t size() const override;
uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const override;
uint32_t ifdOffset() const override;
uint32_t baseOffset(uint32_t mnOffset) const override;
//@}
//! Return the size of the makernote header signature
static uint32_t sizeOfSignature();
private:
DataBuf header_; //!< Data buffer for the makernote header
static const byte signature_[]; //!< Olympus makernote header signature
}; // class Olympus2MnHeader
//! Header of a Fujifilm Makernote
class FujiMnHeader : public MnHeader {
public:
//! @name Creators
//@{
//! Default constructor
FujiMnHeader();
//! Virtual destructor.
~FujiMnHeader() override = default;
//@}
//! @name Manipulators
//@{
bool read(const byte* pData, uint32_t size, ByteOrder byteOrder) override;
// setByteOrder not implemented
//@}
//! @name Accessors
//@{
uint32_t size() const override;
uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const override;
uint32_t ifdOffset() const override;
ByteOrder byteOrder() const override;
uint32_t baseOffset(uint32_t mnOffset) const override;
//@}
//! Return the size of the makernote header signature
static uint32_t sizeOfSignature();
private:
DataBuf header_; //!< Data buffer for the makernote header
static const byte signature_[]; //!< Fujifilm makernote header signature
static const ByteOrder byteOrder_; //!< Byteorder for makernote (always II)
uint32_t start_; //!< Start of the mn IFD rel. to mn start
}; // class FujiMnHeader
//! Header of a Nikon 2 Makernote
class Nikon2MnHeader : public MnHeader {
public:
//! @name Creators
//@{
//! Default constructor
Nikon2MnHeader();
//! Virtual destructor.
~Nikon2MnHeader() override = default;
//@}
//! @name Manipulators
//@{
bool read(const byte* pData, uint32_t size, ByteOrder byteOrder) override;
//@}
//! @name Accessors
//@{
uint32_t size() const override;
uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const override;
uint32_t ifdOffset() const override;
//@}
//! Return the size of the makernote header signature
static uint32_t sizeOfSignature();
private:
DataBuf buf_; //!< Raw header data
uint32_t start_; //!< Start of the mn IFD rel. to mn start
static const byte signature_[]; //!< Nikon 2 makernote header signature
}; // class Nikon2MnHeader
//! Header of a Nikon 3 Makernote
class Nikon3MnHeader : public MnHeader {
public:
//! @name Creators
//@{
//! Default constructor
Nikon3MnHeader();
//! Virtual destructor.
~Nikon3MnHeader() override = default;
//@}
//! @name Manipulators
//@{
bool read(const byte* pData, uint32_t size, ByteOrder byteOrder) override;
void setByteOrder(ByteOrder byteOrder) override;
//@}
//! @name Accessors
//@{
uint32_t size() const override;
uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const override;
uint32_t ifdOffset() const override;
ByteOrder byteOrder() const override;
uint32_t baseOffset(uint32_t mnOffset) const override;
//@}
//! Return the size of the makernote header signature
static uint32_t sizeOfSignature();
private:
DataBuf buf_; //!< Raw header data
ByteOrder byteOrder_; //!< Byteorder for makernote
uint32_t start_; //!< Start of the mn IFD rel. to mn start
static const byte signature_[]; //!< Nikon 3 makernote header signature
}; // class Nikon3MnHeader
//! Header of a Panasonic Makernote
class PanasonicMnHeader : public MnHeader {
public:
//! @name Creators
//@{
//! Default constructor
PanasonicMnHeader();
//! Virtual destructor.
~PanasonicMnHeader() override = default;
//@}
//! @name Manipulators
//@{
bool read(const byte* pData, uint32_t size, ByteOrder byteOrder) override;
//@}
//! @name Accessors
//@{
uint32_t size() const override;
uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const override;
uint32_t ifdOffset() const override;
//@}
//! Return the size of the makernote header signature
static uint32_t sizeOfSignature();
private:
DataBuf buf_; //!< Raw header data
uint32_t start_; //!< Start of the mn IFD rel. to mn start
static const byte signature_[]; //!< Panasonic makernote header signature
}; // class PanasonicMnHeader
//! Header of an Pentax DNG Makernote
class PentaxDngMnHeader : public MnHeader {
public:
//! @name Creators
//@{
//! Default constructor
PentaxDngMnHeader();
//! Virtual destructor.
~PentaxDngMnHeader() override = default;
//@}
//! @name Manipulators
//@{
bool read(const byte* pData, uint32_t size, ByteOrder byteOrder) override;
//@}
//! @name Accessors
//@{
uint32_t size() const override;
uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const override;
uint32_t ifdOffset() const override;
uint32_t baseOffset(uint32_t mnOffset) const override;
//@}
//! Return the size of the makernote header signature
static uint32_t sizeOfSignature();
private:
DataBuf header_; //!< Data buffer for the makernote header
static const byte signature_[]; //!< Pentax DNG makernote header signature
}; // class PentaxDngMnHeader
//! Header of an Pentax Makernote
class PentaxMnHeader : public MnHeader {
public:
//! @name Creators
//@{
//! Default constructor
PentaxMnHeader();
//! Virtual destructor.
~PentaxMnHeader() override = default;
//@}
//! @name Manipulators
//@{
bool read(const byte* pData, uint32_t size, ByteOrder byteOrder) override;
//@}
//! @name Accessors
//@{
uint32_t size() const override;
uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const override;
uint32_t ifdOffset() const override;
//@}
//! Return the size of the makernote header signature
static uint32_t sizeOfSignature();
private:
DataBuf header_; //!< Data buffer for the makernote header
static const byte signature_[]; //!< Pentax makernote header signature
}; // class PentaxMnHeader
//! Header of a Samsung Makernote, only used for the relative offset
class SamsungMnHeader : public MnHeader {
public:
//! @name Creators
//@{
//! Default constructor
SamsungMnHeader();
//@}
//! @name Manipulators
//@{
bool read(const byte* pData, uint32_t size, ByteOrder byteOrder) override;
//@}
//! @name Accessors
//@{
uint32_t size() const override;
uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const override;
uint32_t baseOffset(uint32_t mnOffset) const override;
//@}
}; // class SamsungMnHeader
//! Header of a Sigma Makernote
class SigmaMnHeader : public MnHeader {
public:
//! @name Creators
//@{
//! Default constructor
SigmaMnHeader();
//! Virtual destructor.
~SigmaMnHeader() override = default;
//@}
//! @name Manipulators
//@{
bool read(const byte* pData, uint32_t size, ByteOrder byteOrder) override;
//@}
//! @name Accessors
//@{
uint32_t size() const override;
uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const override;
uint32_t ifdOffset() const override;
//@}
//! Return the size of the makernote header signature
static uint32_t sizeOfSignature();
private:
DataBuf buf_; //!< Raw header data
uint32_t start_; //!< Start of the mn IFD rel. to mn start
static const byte signature1_[]; //!< Sigma makernote header signature 1
static const byte signature2_[]; //!< Sigma makernote header signature 2
}; // class SigmaMnHeader
//! Header of a Sony Makernote
class SonyMnHeader : public MnHeader {
public:
//! @name Creators
//@{
//! Default constructor
SonyMnHeader();
//! Virtual destructor.
~SonyMnHeader() override = default;
//@}
//! @name Manipulators
//@{
bool read(const byte* pData, uint32_t size, ByteOrder byteOrder) override;
//@}
//! @name Accessors
//@{
uint32_t size() const override;
uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const override;
uint32_t ifdOffset() const override;
//@}
//! Return the size of the makernote header signature
static uint32_t sizeOfSignature();
private:
DataBuf buf_; //!< Raw header data
uint32_t start_; //!< Start of the mn IFD rel. to mn start
static const byte signature_[]; //!< Sony makernote header signature
}; // class SonyMnHeader
//! Header of a Casio2 Makernote
class Casio2MnHeader : public MnHeader {
public:
//! @name Creators
//@{
//! Default constructor
Casio2MnHeader();
//! Virtual destructor.
~Casio2MnHeader() override = default;
//@}
//! @name Manipulators
//@{
bool read(const byte* pData, uint32_t size, ByteOrder byteOrder) override;
//@}
//! @name Accessors
//@{
uint32_t size() const override;
uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const override;
uint32_t ifdOffset() const override;
ByteOrder byteOrder() const override;
//@}
//! Return the size of the makernote header signature
static uint32_t sizeOfSignature();
private:
DataBuf buf_; //!< Raw header data
uint32_t start_; //!< Start of the mn IFD rel. to mn start
static const byte signature_[]; //!< Casio makernote header signature
static const ByteOrder byteOrder_; //!< Byteorder for makernote (always big endian)
}; // class Casio2MnHeader
// *****************************************************************************
// template, inline and free functions
//! Function to create a simple IFD makernote (Canon, Minolta, Nikon1)
TiffComponent* newIfdMn(uint16_t tag,
IfdId group,
IfdId mnGroup,
const byte* pData,
uint32_t size,
ByteOrder byteOrder);
//! Function to create a simple IFD makernote (Canon, Minolta, Nikon1)
TiffComponent* newIfdMn2(uint16_t tag,
IfdId group,
IfdId mnGroup);
//! Function to create an Olympus makernote
TiffComponent* newOlympusMn(uint16_t tag,
IfdId group,
IfdId mnGroup,
const byte* pData,
uint32_t size,
ByteOrder byteOrder);
//! Function to create an Olympus makernote
TiffComponent* newOlympusMn2(uint16_t tag,
IfdId group,
IfdId mnGroup);
//! Function to create an Olympus II makernote
TiffComponent* newOlympus2Mn2(uint16_t tag,
IfdId group,
IfdId mnGroup);
//! Function to create a Fujifilm makernote
TiffComponent* newFujiMn(uint16_t tag,
IfdId group,
IfdId mnGroup,
const byte* pData,
uint32_t size,
ByteOrder byteOrder);
//! Function to create a Fujifilm makernote
TiffComponent* newFujiMn2(uint16_t tag,
IfdId group,
IfdId mnGroup);
/*!
@brief Function to create a Nikon makernote. This will create the
appropriate Nikon 1, 2 or 3 makernote, based on the arguments.
*/
TiffComponent* newNikonMn(uint16_t tag,
IfdId group,
IfdId mnGroup,
const byte* pData,
uint32_t size,
ByteOrder byteOrder);
//! Function to create a Nikon2 makernote
TiffComponent* newNikon2Mn2(uint16_t tag,
IfdId group,
IfdId mnGroup);
//! Function to create a Nikon3 makernote
TiffComponent* newNikon3Mn2(uint16_t tag,
IfdId group,
IfdId mnGroup);
//! Function to create a Panasonic makernote
TiffComponent* newPanasonicMn(uint16_t tag,
IfdId group,
IfdId mnGroup,
const byte* pData,
uint32_t size,
ByteOrder byteOrder);
//! Function to create a Panasonic makernote
TiffComponent* newPanasonicMn2(uint16_t tag,
IfdId group,
IfdId mnGroup);
//! Function to create an Pentax makernote
TiffComponent* newPentaxMn(uint16_t tag,
IfdId group,
IfdId mnGroup,
const byte* pData,
uint32_t size,
ByteOrder byteOrder);
//! Function to create an Pentax makernote
TiffComponent* newPentaxMn2(uint16_t tag,
IfdId group,
IfdId mnGroup);
//! Function to create an Pentax DNG makernote
TiffComponent* newPentaxDngMn2(uint16_t tag,
IfdId group,
IfdId mnGroup);
//! Function to create a Samsung makernote
TiffComponent* newSamsungMn(uint16_t tag,
IfdId group,
IfdId mnGroup,
const byte* pData,
uint32_t size,
ByteOrder byteOrder);
//! Function to create a Samsung makernote
TiffComponent* newSamsungMn2(uint16_t tag,
IfdId group,
IfdId mnGroup);
//! Function to create a Sigma makernote
TiffComponent* newSigmaMn(uint16_t tag,
IfdId group,
IfdId mnGroup,
const byte* pData,
uint32_t size,
ByteOrder byteOrder);
//! Function to create a Sigma makernote
TiffComponent* newSigmaMn2(uint16_t tag,
IfdId group,
IfdId mnGroup);
//! Function to create a Sony makernote
TiffComponent* newSonyMn(uint16_t tag,
IfdId group,
IfdId mnGroup,
const byte* pData,
uint32_t size,
ByteOrder byteOrder);
//! Function to create a Sony1 makernote
TiffComponent* newSony1Mn2(uint16_t tag,
IfdId group,
IfdId mnGroup);
//! Function to create a Sony2 makernote
TiffComponent* newSony2Mn2(uint16_t tag,
IfdId group,
IfdId mnGroup);
//! Function to create a Casio2 makernote
TiffComponent* newCasioMn(uint16_t tag,
IfdId group,
IfdId mnGroup,
const byte* pData,
uint32_t size,
ByteOrder byteOrder);
//! Function to create a Casio2 makernote
TiffComponent* newCasio2Mn2(uint16_t tag,
IfdId group,
IfdId mnGroup);
/*!
@brief Function to select cfg + def of the Sony Camera Settings complex binary array.
@param tag Tag number of the binary array
@param pData Pointer to the raw array data.
@param size Size of the array data.
@param pRoot Pointer to the root component of the TIFF tree.
@return An index into the array set, -1 if no match was found.
*/
int sonyCsSelector(uint16_t tag, const byte* pData, uint32_t size, TiffComponent* const pRoot);
/*!
@brief Function to select cfg + def of the Sony 2010 Miscellaneous Information complex binary array.
@param tag Tag number of the binary array
@param pData Pointer to the raw array data.
@param size Size of the array data.
@param pRoot Pointer to the root component of the TIFF tree.
@return An index into the array set, -1 if no match was found.
*/
int sony2010eSelector(uint16_t tag, const byte* pData, uint32_t size, TiffComponent* const pRoot);
/*!
@brief Function to select cfg + def of the Sony2Fp (tag 9402) complex binary array.
@param tag Tag number of the binary array
@param pData Pointer to the raw array data.
@param size Size of the array data.
@param pRoot Pointer to the root component of the TIFF tree.
@return An index into the array set, -1 if no match was found.
*/
int sony2FpSelector(uint16_t tag, const byte* pData, uint32_t size, TiffComponent* const pRoot);
/*!
@brief Function to select cfg + def of the SonyMisc2b (tag 9404b) complex binary array.
@param tag Tag number of the binary array
@param pData Pointer to the raw array data.
@param size Size of the array data.
@param pRoot Pointer to the root component of the TIFF tree.
@return An index into the array set, -1 if no match was found.
*/
int sonyMisc2bSelector(uint16_t tag, const byte* pData, uint32_t size, TiffComponent* const pRoot);
/*!
@brief Function to select cfg + def of the SonyMisc3c (tag 9400) complex binary array.
@param tag Tag number of the binary array
@param pData Pointer to the raw array data.
@param size Size of the array data.
@param pRoot Pointer to the root component of the TIFF tree.
@return An index into the array set, -1 if no match was found.
*/
int sonyMisc3cSelector(uint16_t tag, const byte* pData, uint32_t size, TiffComponent* const pRoot);
/*!
@brief Function to select cfg + def of a Nikon complex binary array.
@param tag Tag number of the binary array
@param pData Pointer to the raw array data.
@param size Size of the array data.
@param pRoot Pointer to the root component of the TIFF tree.
@return An index into the array set, -1 if no match was found.
*/
int nikonSelector(uint16_t tag, const byte* pData, uint32_t size, TiffComponent* const pRoot);
/*!
@brief Function to select cfg + def of a Nikon complex binary array.
@param tag Tag number of the binary array
@param pData Pointer to the raw array data.
@param size Size of the array data.
@param pRoot Pointer to the root component of the TIFF tree.
@return An index into the array set, -1 if no match was found.
*/
int nikonAf2Selector(uint16_t tag, const byte* pData, uint32_t size, TiffComponent* const pRoot);
/*!
@brief Encrypt and decrypt Nikon data.
Checks the version of the Nikon data array and en/decrypts (portions of) it as
needed. (The Nikon encryption algorithm is symmetric.)
@note This function requires access to other components of the composite, it
should only be called after all other components are read.
@param tag Tag number of the binary array
@param pData Pointer to the start of the data to en/decrypt.
@param size Size of the data buffer.
@param pRoot Pointer to the root element of the composite.
@return En/decrypted data. Ownership of the memory is passed to the caller.
The buffer may be empty in case no decryption was needed.
*/
DataBuf nikonCrypt(uint16_t tag, const byte* pData, uint32_t size, TiffComponent* const pRoot);
}} // namespace Internal, Exiv2
#endif // #ifndef MAKERNOTE_INT_HPP_