Exiv2::CiffHeader Class Reference

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.hpp>

Collaboration diagram for Exiv2::CiffHeader:

Collaboration graph
[legend]

List of all members.

Public Types

typedef std::auto_ptr< CiffHeaderAutoPtr
 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.
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.
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.
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.
void decode (Image &image) const
 Decode the Crw image and add it to image.
void print (std::ostream &os, const std::string &prefix="") const
 Print debug info for the Crw image to os.
ByteOrder byteOrder () const
 Return the byte order (little or big endian).
CiffComponentfindComponent (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.

Static Public Member Functions

static const char * signature ()
 Return a pointer to the Canon Crw signature.


Detailed Description

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.

Member Function Documentation

void Exiv2::CiffHeader::read ( const byte pData,
uint32_t  size 
)

Read the Crw image from a data buffer, starting with the Ciff header.

Parameters:
pData Pointer to the data buffer.
size Number of bytes in the data buffer.
Exceptions:
Error If the image cannot be parsed.

References Exiv2::getULong(), Exiv2::CiffDirectory::readDirectory(), and signature().

void Exiv2::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.

Parameters:
crwTagId Tag to be added.
crwDir Parent directory of the tag.
buf Value to be set.

References Exiv2::CiffComponent::add(), Exiv2::CrwMap::loadStack(), and Exiv2::CiffComponent::setValue().

void Exiv2::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.

Parameters:
crwTagId Tag id to be removed.
crwDir Parent directory of the tag.

References Exiv2::CrwMap::loadStack(), and Exiv2::CiffComponent::remove().

void Exiv2::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.

Parameters:
blob Binary image to add to.
Exceptions:
Error If the image cannot be written.

References Exiv2::append(), Exiv2::ul2Data(), and Exiv2::CiffComponent::write().

Referenced by Exiv2::CrwParser::encode().

void Exiv2::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.

Parameters:
image Image to add metadata to

References Exiv2::CiffComponent::decode().

void Exiv2::CiffHeader::print ( std::ostream &  os,
const std::string &  prefix = "" 
) const

Print debug info for the Crw image to os.

Parameters:
os Output stream to write to.
prefix Prefix to be written before each line of output.

References Exiv2::CiffComponent::print().

CiffComponent * Exiv2::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::CiffComponent::findComponent().


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

Generated on Fri Jun 20 14:38:16 2008 for Exiv2 by  doxygen 1.5.5