Exiv2
Static Public Member Functions | List of all members
Exiv2::Internal::TiffParserWorker Class Reference

Stateless parser class for data in TIFF format. Images use this class to decode and encode TIFF-based data. More...

#include <tiffimage_int.hpp>

Static Public Member Functions

static ByteOrder decode (ExifData &exifData, IptcData &iptcData, XmpData &xmpData, const byte *pData, uint32_t size, uint32_t root, FindDecoderFct findDecoderFct, TiffHeaderBase *pHeader=0)
 Decode TIFF metadata from a data buffer pData of length size into the provided metadata containers. More...
 
static WriteMethod encode (BasicIo &io, const byte *pData, uint32_t size, const ExifData &exifData, const IptcData &iptcData, const XmpData &xmpData, uint32_t root, FindEncoderFct findEncoderFct, TiffHeaderBase *pHeader, OffsetWriter *pOffsetWriter)
 Encode TIFF metadata from the metadata containers into a memory block blob. More...
 

Detailed Description

Stateless parser class for data in TIFF format. Images use this class to decode and encode TIFF-based data.

Member Function Documentation

◆ decode()

ByteOrder Exiv2::Internal::TiffParserWorker::decode ( ExifData exifData,
IptcData iptcData,
XmpData xmpData,
const byte pData,
uint32_t  size,
uint32_t  root,
FindDecoderFct  findDecoderFct,
TiffHeaderBase pHeader = 0 
)
static

Decode TIFF metadata from a data buffer pData of length size into the provided metadata containers.

This is the entry point to access image data in TIFF format. The parser uses classes TiffHeader and the TiffComponent and TiffVisitor hierarchies.

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.
rootRoot tag of the TIFF tree for new TIFF components.
findDecoderFctFunction to access special decoding info.
pHeaderOptional pointer to a TIFF header. If not provided, a standard TIFF header is used.
Returns
Byte order in which the data is encoded, invalidByteOrder if decoding failed.

References Exiv2::Internal::TiffHeaderBase::byteOrder(), and Exiv2::Internal::Tag::root.

Referenced by Exiv2::OrfParser::decode(), Exiv2::Cr2Parser::decode(), Exiv2::Rw2Parser::decode(), and Exiv2::TiffParser::decode().

◆ encode()

WriteMethod Exiv2::Internal::TiffParserWorker::encode ( BasicIo io,
const byte pData,
uint32_t  size,
const ExifData exifData,
const IptcData iptcData,
const XmpData xmpData,
uint32_t  root,
FindEncoderFct  findEncoderFct,
TiffHeaderBase pHeader,
OffsetWriter pOffsetWriter 
)
static

Encode TIFF metadata from the metadata containers into a memory block blob.

1) Parse the binary image, if one is provided, and 2) attempt updating the parsed tree in-place ("non-intrusive writing") 3) else, create a new tree and write a new TIFF structure ("intrusive writing"). If there is a parsed tree, it is only used to access the image data in this case.

References Exiv2::Internal::TiffEncoder::add(), Exiv2::Internal::TiffHeaderBase::byteOrder(), Exiv2::Internal::TiffCreator::create(), EXV_INFO, Exiv2::DataBuf::pData_, Exiv2::Internal::Tag::root, Exiv2::DataBuf::size_, Exiv2::BasicIo::transfer(), and Exiv2::Internal::OffsetWriter::writeOffsets().


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