Exiv2
|
Stateless parser class for data in PNG chunk format. Images use this class to decode and encode PNG-based data. More...
#include <pngchunk_int.hpp>
Public Types | |
enum | TxtChunkType { tEXt_Chunk = 0, zTXt_Chunk = 1, iTXt_Chunk = 2 } |
Text Chunk types. | |
Static Public Member Functions | |
static void | decodeIHDRChunk (const DataBuf &data, int *outWidth, int *outHeight) |
Decode PNG IHDR chunk data from a data buffer data and return image size to outWidth and outHeight. More... | |
static void | decodeTXTChunk (Image *pImage, const DataBuf &data, TxtChunkType type) |
Decode PNG tEXt, zTXt, or iTXt chunk data from pImage passed by data buffer data and extract Comment, Exif, Iptc, Xmp metadata accordingly. More... | |
static DataBuf | keyTXTChunk (const DataBuf &data, bool stripHeader=false) |
Return PNG TXT chunk key as data buffer. More... | |
static std::string | makeMetadataChunk (const std::string &metadata, MetadataId type) |
Return a complete PNG chunk data compressed or not as buffer. Data returned is formated accordingly with metadata type to host passed by metadata. More... | |
Stateless parser class for data in PNG chunk format. Images use this class to decode and encode PNG-based data.
|
static |
Decode PNG IHDR chunk data from a data buffer data and return image size to outWidth and outHeight.
data | PNG Chunk data buffer. |
outWidth | Integer pointer to be set to the width of the image. |
outHeight | Integer pointer to be set to the height of the image. |
References Exiv2::getLong(), and Exiv2::DataBuf::pData_.
Referenced by Exiv2::PngImage::readMetadata().
|
static |
Decode PNG tEXt, zTXt, or iTXt chunk data from pImage passed by data buffer data and extract Comment, Exif, Iptc, Xmp metadata accordingly.
pImage | Pointer to the image to hold the metadata |
data | PNG Chunk data buffer. |
type | PNG Chunk TXT type. |
References keyTXTChunk(), Exiv2::DataBuf::pData_, Exiv2::DataBuf::size_, and Exiv2::string.
Referenced by Exiv2::PngImage::readMetadata().
|
static |
Return PNG TXT chunk key as data buffer.
data | PNG Chunk data buffer. |
stripHeader | Set true if chunk data start with header bytes, else false (default). |
References Exiv2::DataBuf::alloc(), Exiv2::append(), Exiv2::ExifData::clear(), Exiv2::Image::clearIptcData(), Exiv2::Image::comment(), Exiv2::TiffParser::decode(), Exiv2::XmpParser::decode(), Exiv2::IptcParser::decode(), Exiv2::XmpData::empty(), Exiv2::IptcData::empty(), Exiv2::ExifData::empty(), Exiv2::Image::exifData(), EXV_WARNING, Exiv2::Image::iptcData(), Exiv2::Photoshop::locateIptcIrb(), Exiv2::DataBuf::pData_, Exiv2::Image::setByteOrder(), Exiv2::Image::setComment(), Exiv2::DataBuf::size_, Exiv2::string, Exiv2::Image::xmpData(), and Exiv2::Image::xmpPacket().
Referenced by decodeTXTChunk(), and Exiv2::PngImage::writeMetadata().
|
static |
Return a complete PNG chunk data compressed or not as buffer. Data returned is formated accordingly with metadata type to host passed by metadata.
metadata | metadata buffer. |
type | metadata type. |
References Exiv2::DataBuf::alloc(), Exiv2::DataBuf::pData_, Exiv2::DataBuf::size_, Exiv2::string, and Exiv2::ul2Data().
Referenced by Exiv2::PngImage::writeMetadata().