Exiv2::CrwImage Class Reference

Class to access raw Canon Crw images. Only Exif metadata and a comment are supported. Crw format does not contain Iptc metadata. More...

#include <crwimage.hpp>

Inheritance diagram for Exiv2::CrwImage:

Inheritance graph
[legend]
Collaboration diagram for Exiv2::CrwImage:

Collaboration graph
[legend]
List of all members.

Public Member Functions

Creators
 CrwImage (BasicIo::AutoPtr io, bool create)
 Constructor that can either open an existing Crw image or create a new image from scratch. If a new image is to be created, any existing data is overwritten. Since the constructor can not return a result, callers should check the good() method after object construction to determine success or failure.
 ~CrwImage ()
 Destructor.
Manipulators
void readMetadata ()
 Read all metadata supported by a specific image format from the image. Before this method is called, the various metadata types will be empty.
void writeMetadata ()
 Todo: Write metadata back to the image. This method is not yet implemented.
void setExifData (const ExifData &exifData)
 Assign new exif data. The new exif data is not written to the image until the writeMetadata() method is called.
void clearExifData ()
 Erase any buffered Exif data. Exif data is not removed from the actual image until the writeMetadata() method is called.
void setIptcData (const IptcData &iptcData)
 Not supported. Crw format does not contain Iptc metadata. Calling this function will do nothing.
void clearIptcData ()
 Not supported. Crw format does not contain Iptc metadata. Calling this function will do nothing.
void setComment (const std::string &comment)
 Set the image comment. The new comment is not written to the image until the writeMetadata() method is called.
void clearComment ()
 Erase any buffered comment. Comment is not removed from the actual image until the writeMetadata() method is called.
void setMetadata (const Image &image)
 Copy all existing metadata from source Image. The data is copied into internal buffers and is not written to the image until the writeMetadata() method is called.
void clearMetadata ()
 Erase all buffered metadata. Metadata is not removed from the actual image until the writeMetadata() method is called.
ExifDataexifData ()
 Returns an ExifData instance containing currently buffered Exif data.
IptcDataiptcData ()
 Returns an IptcData instance containing currently buffered Iptc data.
Accessors
bool good () const
 Check if the Image instance is valid. Use after object construction.
const ExifDataexifData () const
 Returns an ExifData instance containing currently buffered Exif data.
const IptcDataiptcData () const
 Returns an IptcData instance containing currently buffered Iptc data.
std::string comment () const
 Return a copy of the image comment. May be an empty string.
BasicIoio () const
 Return a reference to the BasicIo instance being used for Io.

Friends

bool isCrwType (BasicIo &iIo, bool advance)
 Check if the file iIo is a Crw image.

Detailed Description

Class to access raw Canon Crw images. Only Exif metadata and a comment are supported. Crw format does not contain Iptc metadata.


Constructor & Destructor Documentation

Exiv2::CrwImage::CrwImage BasicIo::AutoPtr  io,
bool  create
 

Constructor that can either open an existing Crw image or create a new image from scratch. If a new image is to be created, any existing data is overwritten. Since the constructor can not return a result, callers should check the good() method after object construction to determine success or failure.

Parameters:
io An auto-pointer that owns a BasicIo instance used for reading and writing image metadata. Important: The constructor takes ownership of the passed in BasicIo instance through the auto-pointer. Callers should not continue to use the BasicIo instance after it is passed to this method. Use the Image::io() method to get a temporary reference.
create Specifies if an existing image should be read (false) or if a new file should be created (true).


Member Function Documentation

const ExifData& Exiv2::CrwImage::exifData  )  const [inline, virtual]
 

Returns an ExifData instance containing currently buffered Exif data.

The Exif data may have been read from the image by a previous call to readMetadata() or added directly. The Exif data in the returned instance will be written to the image when writeMetadata() is called.

Returns:
read only ExifData instance containing Exif values

Implements Exiv2::Image.

ExifData& Exiv2::CrwImage::exifData  )  [inline, virtual]
 

Returns an ExifData instance containing currently buffered Exif data.

The contained Exif data may have been read from the image by a previous call to readMetadata() or added directly. The Exif data in the returned instance will be written to the image when writeMetadata() is called.

Returns:
modifiable ExifData instance containing Exif values

Implements Exiv2::Image.

bool Exiv2::CrwImage::good  )  const [virtual]
 

Check if the Image instance is valid. Use after object construction.

Returns:
true if the Image is in a valid state.

Implements Exiv2::Image.

BasicIo& Exiv2::CrwImage::io  )  const [inline, virtual]
 

Return a reference to the BasicIo instance being used for Io.

This refence is particularly useful to reading the results of operations on a MemIo instance. For example after metadata has been modified and the writeMetadata() method has been called, this method can be used to get access to the modified image.

Returns:
BasicIo instance that can be used to read or write image data directly.
Note:
If the returned BasicIo is used to write to the image, the Image class will not see those changes until the readMetadata() method is called.

Implements Exiv2::Image.

const IptcData& Exiv2::CrwImage::iptcData  )  const [inline, virtual]
 

Returns an IptcData instance containing currently buffered Iptc data.

The contained Iptc data may have been read from the image by a previous call to readMetadata() or added directly. The Iptc data in the returned instance will be written to the image when writeMetadata() is called.

Returns:
modifiable IptcData instance containing Iptc values

Implements Exiv2::Image.

IptcData& Exiv2::CrwImage::iptcData  )  [inline, virtual]
 

Returns an IptcData instance containing currently buffered Iptc data.

The contained Iptc data may have been read from the image by a previous call to readMetadata() or added directly. The Iptc data in the returned instance will be written to the image when writeMetadata() is called.

Returns:
modifiable IptcData instance containing Iptc values

Implements Exiv2::Image.

void Exiv2::CrwImage::readMetadata  )  [virtual]
 

Read all metadata supported by a specific image format from the image. Before this method is called, the various metadata types will be empty.

This method returns success even if no metadata is found in the image. Callers must therefore check the size of individual metadata types before accessing the data.

Exceptions:
Error if opening or reading of the file fails or the image data is not valid (does not look like data of the specific image type).

Implements Exiv2::Image.

void Exiv2::CrwImage::setComment const std::string &  comment  )  [virtual]
 

Set the image comment. The new comment is not written to the image until the writeMetadata() method is called.

Parameters:
comment String containing comment.

Implements Exiv2::Image.

void Exiv2::CrwImage::setExifData const ExifData exifData  )  [virtual]
 

Assign new exif data. The new exif data is not written to the image until the writeMetadata() method is called.

Parameters:
exifData An ExifData instance holding exif data to be copied

Implements Exiv2::Image.

void Exiv2::CrwImage::setMetadata const Image image  )  [virtual]
 

Copy all existing metadata from source Image. The data is copied into internal buffers and is not written to the image until the writeMetadata() method is called.

Parameters:
image Metadata source. All metadata types are copied.

Implements Exiv2::Image.


The documentation for this class was generated from the following files:
Generated on Wed Dec 20 19:43:38 2006 for Exiv2 by  doxygen 1.3.9.1