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. | |
static WriteMethod | encode (Blob &blob, 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. |
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.
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.
exifData | Exif metadata container. | |
iptcData | IPTC metadata container. | |
xmpData | XMP metadata container. | |
pData | Pointer to the data buffer. Must point to data in TIFF format; no checks are performed. | |
size | Length of the data buffer. |
References Exiv2::Internal::TiffMapping::findDecoder(), and Exiv2::Internal::Tag::root.
Referenced by Exiv2::TiffImage::readMetadata(), Exiv2::RafImage::readMetadata(), Exiv2::MrwImage::readMetadata(), and Exiv2::Jp2Image::readMetadata().
WriteMethod Exiv2::TiffParser::encode | ( | Blob & | blob, | |
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 blob ("intrusive" writing).
The return value indicates which write method was used. If it is wmNonIntrusive
, the original memory pData, size contains the result and blob is empty. If the return value is wmIntrusive
, a new TIFF structure was created and returned in blob. The memory block pData, size may be partly updated in this case and should not be used anymore.
wmIntrusive
and the blob is empty, i.e., no TIFF header is written.blob | Container for the binary image if "intrusive" writing is necessary. Empty otherwise. | |
pData | Pointer 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. | |
size | Length of the data buffer. | |
byteOrder | Byte order to use. | |
exifData | Exif metadata container. | |
iptcData | IPTC metadata container. | |
xmpData | XMP metadata container. |
References Exiv2::ExifData::begin(), Exiv2::ExifData::end(), Exiv2::ExifData::erase(), EXV_COUNTOF, Exiv2::Internal::TiffMapping::findEncoder(), and Exiv2::Internal::Tag::root.
Referenced by Exiv2::TiffImage::writeMetadata().