Exiv2::TiffParser Class Reference

Stateless parser class for data in TIFF format. Images use this class to decode and encode TIFF data. It is a wrapper of the internal class Internal::TiffParserWorker. More...

#include <tiffimage.hpp>

Static Public Member Functions

static ByteOrder decode (ExifData &exifData, IptcData &iptcData, XmpData &xmpData, const byte *pData, uint32_t size)
 Decode metadata from a buffer pData of length size with data in TIFF format to the provided metadata containers. More...
 
static WriteMethod encode (BasicIo &io, const byte *pData, uint32_t size, ByteOrder byteOrder, const ExifData &exifData, const IptcData &iptcData, const XmpData &xmpData)
 Encode metadata from the provided metadata to TIFF format. More...
 

Detailed Description

Stateless parser class for data in TIFF format. Images use this class to decode and encode TIFF data. It is a wrapper of the internal class Internal::TiffParserWorker.

Member Function Documentation

static ByteOrder Exiv2::TiffParser::decode ( ExifData exifData,
IptcData iptcData,
XmpData xmpData,
const byte pData,
uint32_t  size 
)
static

Decode metadata from a buffer pData of length size with data in TIFF format to the provided metadata containers.

Parameters
exifDataExif metadata container.
iptcDataIPTC metadata container.
xmpDataXMP metadata container.
pDataPointer to the data buffer. Must point to data in TIFF format; no checks are performed.
sizeLength of the data buffer.
Returns
Byte order in which the data is encoded.
static WriteMethod Exiv2::TiffParser::encode ( BasicIo io,
const byte pData,
uint32_t  size,
ByteOrder  byteOrder,
const ExifData exifData,
const IptcData iptcData,
const XmpData xmpData 
)
static

Encode metadata from the provided metadata to TIFF format.

The original binary image in the memory block pData, size is parsed and updated in-place if possible ("non-intrusive" writing). If that is not possible (e.g., if new tags were added), the entire TIFF structure is re-written to the io instance ("intrusive" writing).
The return value indicates which write method was used. If it is wmNonIntrusive, the original memory pData, size contains the result and nothing is written to io. If the return value is wmIntrusive, a new TIFF structure was created and written to io. The memory block pData, size may be partly updated in this case and should not be used anymore.

Note
If there is no metadata to encode, i.e., all metadata containers are empty, then the return value is wmIntrusive and nothing is written to io, i.e., no TIFF header is written.
Parameters
ioIO instance to write the binary image to in case of "intrusive" writing. Nothing is written to io in the case of "non-intrusive" writing.
pDataPointer to the binary image data buffer. Must point to data in TIFF format; no checks are performed. Will be modified if "non-intrusive" writing is possible.
sizeLength of the data buffer.
byteOrderByte order to use.
exifDataExif metadata container.
iptcDataIPTC metadata container.
xmpDataXMP metadata container.
Returns
Write method used.

The documentation for this class was generated from the following file: