![]() |
Exiv2
|
This class models the header of a CRW (Canon Raw data) image. It is the head of a CIFF parse tree, consisting of CiffDirectory and CiffEntry objects. Most of its methods will walk the parse tree to perform the requested action. More...
#include <crwimage_int.hpp>
Public Types | |
typedef std::auto_ptr< CiffHeader > | AutoPtr |
CiffHeader auto_ptr type. | |
Public Member Functions | |
Creators | |
CiffHeader () | |
Default constructor. | |
virtual | ~CiffHeader () |
Virtual destructor. | |
Manipulators | |
void | read (const byte *pData, uint32_t size) |
Read the CRW image from a data buffer, starting with the Ciff header. More... | |
void | add (uint16_t crwTagId, uint16_t crwDir, DataBuf buf) |
Set the value of entry crwTagId in directory crwDir to buf. If this tag doesn't exist, it is added along with all directories needed. More... | |
void | remove (uint16_t crwTagId, uint16_t crwDir) |
Remove entry crwTagId in directory crwDir from the parse tree. If it's the last entry in the directory, the directory is removed as well, etc. More... | |
Accessors | |
void | write (Blob &blob) const |
Write the CRW image to the binary image blob, starting with the Ciff header. This method appends to the blob. More... | |
void | decode (Image &image) const |
Decode the CRW image and add it to image. More... | |
void | print (std::ostream &os, const std::string &prefix="") const |
Print debug info for the CRW image to os. More... | |
ByteOrder | byteOrder () const |
Return the byte order (little or big endian). | |
CiffComponent * | findComponent (uint16_t crwTagId, uint16_t crwDir) const |
Finds crwTagId in directory crwDir in the parse tree, returning a pointer to the component or 0 if not found. More... | |
Static Public Member Functions | |
static const char * | signature () |
Return a pointer to the Canon CRW signature. | |
This class models the header of a CRW (Canon Raw data) image. It is the head of a CIFF parse tree, consisting of CiffDirectory and CiffEntry objects. Most of its methods will walk the parse tree to perform the requested action.
void Exiv2::Internal::CiffHeader::add | ( | uint16_t | crwTagId, |
uint16_t | crwDir, | ||
DataBuf | buf | ||
) |
Set the value of entry crwTagId in directory crwDir to buf. If this tag doesn't exist, it is added along with all directories needed.
References Exiv2::Internal::CiffComponent::add(), Exiv2::Internal::CrwMap::loadStack(), and Exiv2::Internal::CiffComponent::setValue().
void Exiv2::Internal::CiffHeader::decode | ( | Image & | image | ) | const |
Decode the CRW image and add it to image.
Walk the parse tree and convert CIFF entries to metadata entries which are added to image.
image | Image to add metadata to |
References Exiv2::Internal::CiffComponent::decode().
CiffComponent * Exiv2::Internal::CiffHeader::findComponent | ( | uint16_t | crwTagId, |
uint16_t | crwDir | ||
) | const |
Finds crwTagId in directory crwDir in the parse tree, returning a pointer to the component or 0 if not found.
Finds crwTagId in directory crwDir, returning a pointer to the component or 0 if not found.
References Exiv2::Internal::CiffComponent::findComponent().
void Exiv2::Internal::CiffHeader::print | ( | std::ostream & | os, |
const std::string & | prefix = "" |
||
) | const |
Print debug info for the CRW image to os.
os | Output stream to write to. |
prefix | Prefix to be written before each line of output. |
References Exiv2::Internal::CiffComponent::print().
void Exiv2::Internal::CiffHeader::read | ( | const byte * | pData, |
uint32_t | size | ||
) |
Read the CRW image from a data buffer, starting with the Ciff header.
pData | Pointer to the data buffer. |
size | Number of bytes in the data buffer. |
Error | If the image cannot be parsed. |
References Exiv2::getULong(), Exiv2::Internal::CiffDirectory::readDirectory(), and signature().
void Exiv2::Internal::CiffHeader::remove | ( | uint16_t | crwTagId, |
uint16_t | crwDir | ||
) |
Remove entry crwTagId in directory crwDir from the parse tree. If it's the last entry in the directory, the directory is removed as well, etc.
crwTagId | Tag id to be removed. |
crwDir | Parent directory of the tag. |
References Exiv2::Internal::CrwMap::loadStack(), and Exiv2::Internal::CiffComponent::remove().
void Exiv2::Internal::CiffHeader::write | ( | Blob & | blob | ) | const |
Write the CRW image to the binary image blob, starting with the Ciff header. This method appends to the blob.
blob | Binary image to add to. |
Error | If the image cannot be written. |
References Exiv2::append(), Exiv2::ul2Data(), and Exiv2::Internal::CiffComponent::write().