27 #ifndef TIFFCOMPOSITE_INT_HPP_ 28 #define TIFFCOMPOSITE_INT_HPP_ 79 const uint32_t
none = 0x10000;
80 const uint32_t
root = 0x20000;
81 const uint32_t
next = 0x30000;
82 const uint32_t
all = 0x40000;
83 const uint32_t
pana = 0x80000;
96 : extendedTag_(extendedTag), group_(group) {}
101 uint16_t tag()
const {
return static_cast<uint16_t
>(extendedTag_ & 0xffff); }
111 uint32_t extendedTag_;
145 long write(
const byte* pData,
long wcount);
154 void setTarget(
int id, uint32_t target);
160 const byte* pHeader_;
206 AutoPtr
object =AutoPtr(0));
257 uint16_t tag()
const {
return tag_; }
268 AutoPtr clone()
const;
278 uint32_t& imageIdx)
const;
284 uint32_t writeImage(
IoWrapper& ioWrapper,
290 uint32_t size()
const;
294 uint32_t count()
const;
301 uint32_t sizeData()
const;
308 uint32_t sizeImage()
const;
314 virtual int idx()
const;
332 virtual uint32_t doWrite(
IoWrapper& ioWrapper,
337 uint32_t& imageIdx) =0;
345 virtual uint32_t doWriteData(
IoWrapper& ioWrapper,
349 uint32_t& imageIdx)
const =0;
351 virtual uint32_t doWriteImage(
IoWrapper& ioWrapper,
354 virtual uint32_t doSize()
const =0;
356 virtual uint32_t doCount()
const =0;
358 virtual uint32_t doSizeData()
const =0;
360 virtual uint32_t doSizeImage()
const =0;
388 uint16_t
tag()
const {
return static_cast<uint16_t
>(extendedTag_ & 0xffff); }
440 void setData(
byte* pData, int32_t size);
459 TiffType tiffType()
const {
return tiffType_; }
465 int32_t
offset()
const {
return offset_; }
469 virtual int idx()
const;
499 virtual uint32_t doWrite(
IoWrapper& ioWrapper,
509 virtual uint32_t doCount()
const;
515 virtual uint32_t doWriteData(
IoWrapper& ioWrapper,
519 uint32_t& imageIdx)
const;
524 virtual uint32_t doWriteImage(
IoWrapper& ioWrapper,
527 virtual uint32_t doSize()
const;
529 virtual uint32_t doSizeData()
const;
531 virtual uint32_t doSizeImage()
const;
535 static uint32_t writeOffset(
byte* buf,
605 szTag_(szTag), szGroup_(szGroup) {}
621 virtual void setStrips(
const Value* pSize,
624 uint32_t baseOffset) =0;
629 uint16_t szTag()
const {
return szTag_; }
637 const uint16_t szTag_;
638 const IfdId szGroup_;
661 pDataArea_(0), sizeDataArea_(0) {}
668 virtual void setStrips(
const Value* pSize,
671 uint32_t baseOffset);
690 virtual uint32_t doWrite(
IoWrapper& ioWrapper,
705 virtual uint32_t doWriteData(
IoWrapper& ioWrapper,
709 uint32_t& imageIdx)
const;
713 virtual uint32_t doSizeData()
const;
720 uint32_t sizeDataArea_;
750 virtual void setStrips(
const Value* pSize,
753 uint32_t baseOffset);
766 virtual uint32_t doWrite(
IoWrapper& ioWrapper,
785 virtual uint32_t doWriteData(
IoWrapper& ioWrapper,
789 uint32_t& imageIdx)
const;
794 virtual uint32_t doWriteImage(
IoWrapper& ioWrapper,
797 virtual uint32_t doSize()
const;
799 virtual uint32_t doSizeData()
const;
801 virtual uint32_t doSizeImage()
const;
806 typedef std::vector<std::pair<const byte*, uint32_t> > Strips;
825 :
TiffEntryBase(tag, group), dtTag_(dtTag), dtGroup_(dtGroup) {}
832 uint16_t dtTag()
const {
return dtTag_; }
852 const uint16_t dtTag_;
853 const IfdId dtGroup_;
875 bool hasNext()
const {
return hasNext_; }
900 virtual uint32_t doWrite(
IoWrapper& ioWrapper,
915 virtual uint32_t doWriteData(
IoWrapper& ioWrapper,
919 uint32_t& imageIdx)
const;
926 virtual uint32_t doWriteImage(
IoWrapper& ioWrapper,
932 virtual uint32_t doSize()
const;
937 virtual uint32_t doCount()
const;
942 virtual uint32_t doSizeData()
const;
947 virtual uint32_t doSizeImage()
const;
959 uint32_t writeDirEntry(
IoWrapper& ioWrapper,
966 uint32_t& imageIdx)
const;
971 Components components_;
1016 virtual uint32_t doWrite(
IoWrapper& ioWrapper,
1021 uint32_t& imageIdx);
1031 virtual uint32_t doWriteData(
IoWrapper& ioWrapper,
1035 uint32_t& imageIdx)
const;
1040 virtual uint32_t doWriteImage(
IoWrapper& ioWrapper,
1043 uint32_t doSize()
const;
1045 virtual uint32_t doSizeData()
const;
1047 virtual uint32_t doSizeImage()
const;
1058 typedef std::vector<TiffDirectory*> Ifds;
1101 virtual uint32_t doWrite(
IoWrapper& ioWrapper,
1106 uint32_t& imageIdx);
1113 virtual uint32_t doCount()
const;
1120 virtual uint32_t doSize()
const;
1159 bool hasNext =
true);
1171 bool readHeader(
const byte* pData, uint32_t size,
ByteOrder byteOrder);
1184 uint32_t sizeHeader()
const;
1192 uint32_t mnOffset()
const;
1198 uint32_t ifdOffset()
const;
1215 uint32_t baseOffset()
const;
1233 virtual uint32_t doWrite(
IoWrapper& ioWrapper,
1238 uint32_t& imageIdx);
1248 virtual uint32_t doWriteData(
IoWrapper& ioWrapper,
1252 uint32_t& imageIdx)
const;
1257 virtual uint32_t doWriteImage(
IoWrapper& ioWrapper,
1263 virtual uint32_t doSize()
const;
1269 virtual uint32_t doCount()
const;
1274 virtual uint32_t doSizeData()
const;
1279 virtual uint32_t doSizeImage()
const;
1319 uint32_t size(uint16_t tag,
IfdId group)
const;
1332 uint32_t
tagStep()
const {
return elDefaultDef_.size(0, group_); }
1378 uint32_t addElement(uint32_t idx,
const ArrayDef& def);
1391 bool initialize(
IfdId group);
1404 void iniOrigDataBuf();
1406 bool updOrigDataBuf(
const byte* pData, uint32_t size);
1413 const ArrayCfg* cfg()
const {
return arrayCfg_; }
1448 virtual uint32_t doWrite(
IoWrapper& ioWrapper,
1453 uint32_t& imageIdx);
1460 virtual uint32_t doCount()
const;
1466 virtual uint32_t doSize()
const;
1485 Components elements_;
1537 virtual uint32_t doWrite(
IoWrapper& ioWrapper,
1542 uint32_t& imageIdx);
1551 virtual uint32_t doCount()
const;
1558 virtual uint32_t doSize()
const;
1595 template<IfdId newGroup>
1602 template<IfdId newGroup>
1609 template<const ArrayCfg* arrayCfg,
int N, const ArrayDef (&arrayDef)[N]>
1618 template<const ArrayCfg* arrayCfg>
1626 template<const ArraySet* arraySet,
int N, CfgSelFct cfgSelFct>
1634 template<u
int16_t szTag, IfdId szGroup>
1642 template<u
int16_t dtTag, IfdId dtGroup>
1650 template<u
int16_t szTag, IfdId szGroup>
1658 template<u
int16_t dtTag, IfdId dtGroup>
1668 #endif // #ifndef TIFFCOMPOSITE_INT_HPP_ CryptFct cryptFct_
Crypt function, 0 if not used.
Definition: tiffcomposite_int.hpp:1337
This class is the basis for Makernote support in TIFF. It contains a pointer to a concrete Makernote...
Definition: tiffcomposite_int.hpp:1073
const TiffType ttTiffDouble
TIFF DOUBLE type.
Definition: tiffcomposite_int.hpp:67
TIFF composite visitor to read the TIFF structure from a block of memory and build the composite from...
Definition: tiffvisitor_int.hpp:630
bool concat_
If true, concatenate gaps between defined tags to single tags.
Definition: tiffcomposite_int.hpp:1340
Search key for TIFF mapping structures.
Definition: tiffcomposite_int.hpp:400
const uint32_t next
Special tag: next IFD.
Definition: tiffcomposite_int.hpp:81
An interface for simple binary IO.
Definition: basicio.hpp:55
TiffComponent::AutoPtr newTiffBinaryArray0(uint16_t tag, IfdId group)
Function to create and initialize a new binary array entry.
Definition: tiffcomposite_int.hpp:1610
uint32_t extendedTag_
Tag (32 bit so that it can contain special tags)
Definition: tiffcomposite_int.hpp:392
uint32_t count_
Number of components.
Definition: tiffcomposite_int.hpp:1323
std::vector< TiffComponent * > Components
Container type to hold all metadata.
Definition: tiffcomposite_int.hpp:179
const TiffType ttUnsignedByte
Exif BYTE type.
Definition: tiffcomposite_int.hpp:56
int(* CfgSelFct)(uint16_t, const byte *, uint32_t, TiffComponent *const)
Function pointer type for a function to determine which cfg + def of a corresponding array set to use...
Definition: tiffcomposite_int.hpp:1309
bool operator==(const TagDetails &td, const LensTypeAndFocalLengthAndMaxAperture <fl)
Compare tag details with a lens entry.
Definition: canonmn_int.cpp:1991
IfdId dtGroup() const
Return the group of the related entry which has the data area.
Definition: tiffcomposite_int.hpp:835
TiffComponent::AutoPtr newTiffThumbSize(uint16_t tag, IfdId group)
Function to create and initialize a new TIFF entry for a thumbnail (size)
Definition: tiffcomposite_int.hpp:1643
const TiffType ttSignedLong
Exif SLONG type.
Definition: tiffcomposite_int.hpp:64
TiffType tiffType_
TIFF type of the element.
Definition: tiffcomposite_int.hpp:1322
Internal TIFF parser related typedefs and forward definitions.
Composite to model an array of different tags. The tag types as well as other aspects of the array ar...
Definition: tiffcomposite_int.hpp:1356
ByteOrder
Type to express the byte order (little or big endian)
Definition: types.hpp:113
Utility class containing a character array. All it does is to take care of memory allocation and dele...
Definition: types.hpp:204
bool operator==(uint32_t idx) const
Comparison with idx.
Definition: tiffcomposite_int.hpp:1317
ArrayDef elDefaultDef_
Default element.
Definition: tiffcomposite_int.hpp:1341
const byte * pData() const
Return a pointer to the binary representation of the value of this component.
Definition: tiffcomposite_int.hpp:474
TiffComponent::AutoPtr newTiffMnEntry(uint16_t tag, IfdId group)
Function to create and initialize a new TIFF makernote entry.
Definition: tiffcomposite_int.cpp:1910
TiffComponent::AutoPtr newTiffDirectory(uint16_t tag, IfdId)
Function to create and initialize a new TIFF directory.
Definition: tiffcomposite_int.hpp:1596
TiffComponent::AutoPtr newTiffImageData(uint16_t tag, IfdId group)
Function to create and initialize a new TIFF entry for image data.
Definition: tiffcomposite_int.hpp:1651
TypeId
Exiv2 value type identifiers.
Definition: types.hpp:130
uint32_t e_
Extended tag.
Definition: tiffcomposite_int.hpp:404
int32_t offset() const
Return the offset to the data area relative to the base for the component (usually the start of the T...
Definition: tiffcomposite_int.hpp:465
TIFF composite visitor to decode metadata from the TIFF tree and add it to an Image, which is supplied in the constructor (Visitor pattern). Used by TiffParser to decode the metadata from a TIFF composite.
Definition: tiffvisitor_int.hpp:284
IfdId group_
Group for the elements.
Definition: tiffcomposite_int.hpp:1334
const ArrayCfg cfg_
Binary array configuration.
Definition: tiffcomposite_int.hpp:1346
const int defSize_
Size of the array definition array.
Definition: tiffcomposite_int.hpp:1348
void setOffset(int32_t offset)
Set the offset.
Definition: tiffcomposite_int.hpp:438
const char * make_
Camera make for which these mapping functions apply.
Definition: tiffcomposite_int.hpp:391
This abstract base class provides the common functionality of an IFD directory entry and defines an e...
Definition: tiffcomposite_int.hpp:414
const uint32_t none
Dummy tag.
Definition: tiffcomposite_int.hpp:79
uint8_t byte
1 byte unsigned integer type.
Definition: types.hpp:105
const uint32_t all
Special tag: all tags in a group.
Definition: tiffcomposite_int.hpp:82
A TIFF IFD entry containing the size of a data area of a related TiffDataEntry. This component is use...
Definition: tiffcomposite_int.hpp:819
Combination of array configuration and definition for arrays.
Definition: tiffcomposite_int.hpp:1345
std::auto_ptr< TiffComponent > AutoPtr
TiffComponent auto_ptr type.
Definition: tiffcomposite_int.hpp:177
byte * start() const
Return a pointer to the start of the binary representation of the component.
Definition: tiffcomposite_int.hpp:262
bool hasSize_
If true, first tag is the size element.
Definition: tiffcomposite_int.hpp:1338
Simple IO wrapper to ensure that the header is only written if there is any other data at all...
Definition: tiffcomposite_int.hpp:124
Type definitions for Exiv2 and related functionality.
const ArrayDef * elDef() const
Return the array definition of this element.
Definition: tiffcomposite_int.hpp:1522
A standard TIFF IFD entry consisting of a value which is an offset to a data area and the data area...
Definition: tiffcomposite_int.hpp:653
TiffComponent::AutoPtr newTiffBinaryArray2(uint16_t tag, IfdId group)
Function to create and initialize a new complex binary array entry.
Definition: tiffcomposite_int.hpp:1627
const TiffType ttUnsignedShort
Exif SHORT type.
Definition: tiffcomposite_int.hpp:58
DecoderFct decoderFct_
Decoder function for matching tags.
Definition: tiffcomposite_int.hpp:394
uint32_t extendedTag() const
Return the extended tag (32 bit so that it can contain special tags)
Definition: tiffcomposite_int.hpp:104
TypeId toTypeId(TiffType tiffType, uint16_t tag, IfdId group)
Convert the tiffType of a tag and group to an Exiv2 typeId.
Definition: tiffcomposite_int.cpp:1858
IfdId group() const
Return the group.
Definition: tiffcomposite_int.hpp:106
uint32_t idx_
Index in bytes from the start.
Definition: tiffcomposite_int.hpp:1321
This class models a TIFF sub-directory (sub-IFD). A sub-IFD is an entry with one or more values that ...
Definition: tiffcomposite_int.hpp:984
const ArrayDef * def_
Binary array definition array.
Definition: tiffcomposite_int.hpp:1347
bool decoded() const
Return the flag which indicates if the array was decoded.
Definition: tiffcomposite_int.hpp:1420
std::stack< TiffPathItem > TiffPath
Stack to hold a path from the TIFF root element to a TIFF entry.
Definition: tifffwd_int.hpp:111
TiffType elTiffType_
Type for the array entry and the size element, if any.
Definition: tiffcomposite_int.hpp:1336
Interface class for components of a TIFF directory hierarchy (Composite pattern). Both TIFF directori...
Definition: tiffcomposite_int.hpp:174
const TiffType ttAsciiString
Exif ASCII type.
Definition: tiffcomposite_int.hpp:57
TiffType toTiffType(TypeId typeId)
Convert the Exiv2 typeId to a TIFF value type.
Definition: tiffcomposite_int.cpp:1877
const TiffType ttTiffFloat
TIFF FLOAT type.
Definition: tiffcomposite_int.hpp:66
bool hasFillers_
If true, write all defined tags.
Definition: tiffcomposite_int.hpp:1339
int defSize() const
Return the number of elements in the definition.
Definition: tiffcomposite_int.hpp:1418
Key(const std::string &m, uint32_t e, IfdId g)
Constructor.
Definition: tiffcomposite_int.hpp:402
uint16_t TiffType
TIFF value type.
Definition: tiffcomposite_int.hpp:54
Abstract base class defining the interface for TIFF composite visitors (Visitor pattern) ...
Definition: tiffvisitor_int.hpp:73
void setIdx(int idx)
Set the unique id of the entry in the image.
Definition: tiffcomposite_int.hpp:493
void setCount(uint32_t count)
Set the number of components in this entry.
Definition: tiffcomposite_int.hpp:491
A standard TIFF IFD entry.
Definition: tiffcomposite_int.hpp:566
IfdId szGroup() const
Return the group of the entry which has the size.
Definition: tiffcomposite_int.hpp:632
void setElByteOrder(ByteOrder byteOrder)
Set the byte order of this element.
Definition: tiffcomposite_int.hpp:1514
const uint32_t pana
Special tag: root IFD of Panasonic RAW images.
Definition: tiffcomposite_int.hpp:83
TiffComponent::AutoPtr newTiffThumbData(uint16_t tag, IfdId group)
Function to create and initialize a new TIFF entry for a thumbnail (data)
Definition: tiffcomposite_int.hpp:1635
Exiv2::Exifdatum & setValue(Exiv2::Exifdatum &exifDatum, const T &value)
Set the value of exifDatum to value. If the object already has a value, it is replaced. Otherwise a new ValueType<T> value is created and set to value.
Definition: exif.cpp:193
Additional configuration for a binary array.
Definition: tiffcomposite_int.hpp:1327
void(TiffEncoder::* EncoderFct)(TiffEntryBase *, const Exifdatum *)
Function pointer type for a TiffDecoder member function to decode a TIFF component.
Definition: tifffwd_int.hpp:88
TiffComponent::AutoPtr newTiffEntry(uint16_t tag, IfdId group)
Function to create and initialize a new TIFF entry.
Definition: tiffcomposite_int.cpp:1905
TiffComponent::AutoPtr newTiffSubIfd(uint16_t tag, IfdId group)
Function to create and initialize a new TIFF sub-directory.
Definition: tiffcomposite_int.hpp:1603
Interface for a standard TIFF IFD entry consisting of a value which is a set of offsets to a data are...
Definition: tiffcomposite_int.hpp:598
void setDecoded(bool decoded)
Set a flag to indicate if the array was decoded.
Definition: tiffcomposite_int.hpp:1408
IPTC string type.
Definition: types.hpp:147
void setStart(const byte *pStart)
Set a pointer to the start of the binary representation of the component in a memory buffer...
Definition: tiffcomposite_int.hpp:232
Class to insert pointers or offsets to computed addresses at specific locations in an image...
Definition: tiffimage_int.hpp:426
const TiffType ttSignedByte
Exif SBYTE type.
Definition: tiffcomposite_int.hpp:61
Tiff IFD Makernote. This is a concrete class suitable for all IFD makernotes.
Definition: tiffcomposite_int.hpp:1149
Common interface for all types of values used with metadata.
Definition: value.hpp:60
std::auto_ptr< Value > AutoPtr
Shortcut for a Value auto pointer.
Definition: value.hpp:63
const TiffType ttUnsignedLong
Exif LONG type.
Definition: tiffcomposite_int.hpp:59
TiffComponent::AutoPtr newTiffBinaryArray1(uint16_t tag, IfdId group)
Function to create and initialize a new simple binary array entry.
Definition: tiffcomposite_int.hpp:1619
std::string m_
Camera make.
Definition: tiffcomposite_int.hpp:403
A standard TIFF IFD entry consisting of a value which is an array of offsets to image data areas...
Definition: tiffcomposite_int.hpp:736
const TiffType ttUndefined
Exif UNDEFINED type.
Definition: tiffcomposite_int.hpp:62
IfdId g_
Group
Definition: tiffcomposite_int.hpp:405
void setElDef(const ArrayDef &def)
Set the array definition for this element.
Definition: tiffcomposite_int.hpp:1510
uint16_t tag() const
Return the tag corresponding to the extended tag.
Definition: tiffcomposite_int.hpp:388
ByteOrder elByteOrder() const
Return the byte order of this element.
Definition: tiffcomposite_int.hpp:1526
bool cmpGroupLt(TiffComponent const *lhs, TiffComponent const *rhs)
Compare two TIFF component pointers by group. Return true if the group of component lhs is less than ...
Definition: tiffcomposite_int.cpp:1898
uint32_t tagStep() const
Return the size of the default tag, which is used to calculate tag numbers as idx/tagStep.
Definition: tiffcomposite_int.hpp:1332
EncoderFct encoderFct_
Encoder function for matching tags.
Definition: tiffcomposite_int.hpp:395
IfdId group_
Group that contains the tag.
Definition: tiffcomposite_int.hpp:393
DataBuf(* CryptFct)(uint16_t, const byte *, uint32_t, TiffComponent *const)
Function pointer type for a crypt function used for binary arrays.
Definition: tiffcomposite_int.hpp:1312
TiffComponent::AutoPtr newTiffBinaryElement(uint16_t tag, IfdId group)
Function to create and initialize a new binary array element.
Definition: tiffcomposite_int.cpp:1915
const TiffType ttTiffIfd
TIFF IFD type.
Definition: tiffcomposite_int.hpp:68
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition: asfvideo.hpp:36
void setImageByteOrder(ByteOrder byteOrder)
Set the byte order used for the image.
Definition: tiffcomposite_int.hpp:1179
This class models a TIFF directory (Ifd). It is a composite component of the TIFF tree...
Definition: tiffcomposite_int.hpp:861
const uint32_t root
Special tag: root IFD.
Definition: tiffcomposite_int.hpp:80
TIFF composite visitor to encode metadata from an image to the TIFF tree. The metadata containers and...
Definition: tiffvisitor_int.hpp:384
void(TiffDecoder::* DecoderFct)(const TiffEntryBase *)
Function pointer type for a TiffDecoder member function to decode a TIFF component.
Definition: tifffwd_int.hpp:83
bool cmpTagLt(TiffComponent const *lhs, TiffComponent const *rhs)
Compare two TIFF component pointers by tag. Return true if the tag of component lhs is less than that...
Definition: tiffcomposite_int.cpp:1890
TiffComponent::AutoPtr newTiffImageSize(uint16_t tag, IfdId group)
Function to create and initialize a new TIFF entry for image data (size)
Definition: tiffcomposite_int.hpp:1659
An Exif metadatum, consisting of an ExifKey and a Value and methods to manipulate these...
Definition: exif.hpp:59
IfdId group() const
Return the group id of this component.
Definition: tiffcomposite_int.hpp:260
Element of a TiffBinaryArray.
Definition: tiffcomposite_int.hpp:1495
const ArrayDef * def() const
Return a pointer to the definition.
Definition: tiffcomposite_int.hpp:1416
const Value * pValue() const
Return a const pointer to the converted value of this component.
Definition: tiffcomposite_int.hpp:476
ByteOrder imageByteOrder() const
Return the byte order used for the image.
Definition: tiffcomposite_int.hpp:1209
const TiffType ttUnsignedRational
Exif RATIONAL type.
Definition: tiffcomposite_int.hpp:60
Defines one tag in a binary array.
Definition: tiffcomposite_int.hpp:1315
A tupel consisting of extended Tag and group used as an item in TIFF paths.
Definition: tiffcomposite_int.hpp:90
ByteOrder byteOrder_
Byte order, invalidByteOrder to inherit.
Definition: tiffcomposite_int.hpp:1335
IfdId
Type to specify the IFD to which a metadata belongs.
Definition: tags_int.hpp:54
const TiffType ttSignedRational
Exif SRATIONAL type.
Definition: tiffcomposite_int.hpp:65
TIFF mapping table for functions to decode special cases.
Definition: tiffcomposite_int.hpp:376
const TiffType ttSignedShort
Exif SSHORT type.
Definition: tiffcomposite_int.hpp:63
Value interface and concrete subclasses.