Exiv2::Photoshop Struct Reference

Helper class, has methods to deal with Photoshop "Information Resource Blocks" (IRBs). More...

#include <jpgimage.hpp>

List of all members.

Static Public Member Functions

static bool valid (const byte *pPsData, long sizePsData)
 Validates all IRBs.
static int locateIrb (const byte *pPsData, long sizePsData, uint16_t psTag, const byte **record, uint32_t *const sizeHdr, uint32_t *const sizeData)
 Locates the data for a Photoshop tag in a Photoshop formated memory buffer. Operates on raw data to simplify reuse.
static int locateIptcIrb (const byte *pPsData, long sizePsData, const byte **record, uint32_t *const sizeHdr, uint32_t *const sizeData)
 Forwards to locateIrb() with psTag = iptc_.
static DataBuf setIptcIrb (const byte *pPsData, long sizePsData, const IptcData &iptcData)
 Set the new IPTC IRB, keeps existing IRBs but removes the IPTC block if there is no new IPTC data to write.

Static Public Attributes

static const char ps3Id_ [] = "Photoshop 3.0\0"
 Photoshop marker
static const char bimId_ [] = "8BIM"
 Photoshop marker
static const uint16_t iptc_ = 0x0404
 Photoshop IPTC marker

Detailed Description

Helper class, has methods to deal with Photoshop "Information Resource Blocks" (IRBs).


Member Function Documentation

int Exiv2::Photoshop::locateIrb ( const byte pPsData,
long  sizePsData,
uint16_t  psTag,
const byte **  record,
uint32_t *const   sizeHdr,
uint32_t *const   sizeData 
) [static]

Locates the data for a Photoshop tag in a Photoshop formated memory buffer. Operates on raw data to simplify reuse.

Parameters:
pPsData Pointer to buffer containing entire payload of Photoshop formated data, e.g., from APP13 Jpeg segment.
Parameters:
sizePsData Size in bytes of pPsData.
Parameters:
psTag Tag number of the block to look for.
Parameters:
record Output value that is set to the start of the data block within pPsData (may not be null).
Parameters:
sizeHdr Output value that is set to the size of the header within the data block pointed to by record (may not be null).
Parameters:
sizeData Output value that is set to the size of the actual data within the data block pointed to by record (may not be null).
Returns:
0 if successful;
3 if no data for psTag was found in pPsData;
-2 if the pPsData buffer does not contain valid data.

References bimId_, Exiv2::getULong(), and Exiv2::getUShort().

Referenced by locateIptcIrb().

DataBuf Exiv2::Photoshop::setIptcIrb ( const byte pPsData,
long  sizePsData,
const IptcData iptcData 
) [static]

Set the new IPTC IRB, keeps existing IRBs but removes the IPTC block if there is no new IPTC data to write.

Parameters:
pPsData Existing IRB buffer
Parameters:
sizePsData Size of the IRB buffer, may be 0
Parameters:
iptcData Iptc data to embed, may be empty
Returns:
A data buffer containing the new IRB buffer, may have 0 size

References Exiv2::append(), bimId_, Exiv2::IptcParser::encode(), Exiv2::hexdump(), iptc_, locateIptcIrb(), Exiv2::DataBuf::pData_, Exiv2::DataBuf::size_, Exiv2::ul2Data(), and Exiv2::us2Data().

bool Exiv2::Photoshop::valid ( const byte pPsData,
long  sizePsData 
) [static]

Validates all IRBs.

Parameters:
pPsData Existing IRB buffer
Parameters:
sizePsData Size of the IRB buffer, may be 0
Returns:
true if all IRBs are valid;
false otherwise

References locateIptcIrb().

Referenced by Exiv2::JpegBase::readMetadata().


The documentation for this struct was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Fri Jan 28 09:44:16 2011 for Exiv2 by  doxygen 1.6.3