Exiv2::Cr2Image Class Reference

Class to access raw Canon CR2 images. Exif metadata is supported directly, IPTC is read from the Exif data, if present. More...

#include <cr2image.hpp>

Inheritance diagram for Exiv2::Cr2Image:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

Creators
 Cr2Image (BasicIo::AutoPtr io, bool create)
 Constructor that can either open an existing CR2 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.
Manipulators
void readMetadata ()
 Read all metadata supported by a specific image format from the image. Before this method is called, the image metadata will be cleared.
void writeMetadata ()
 Todo: Write metadata back to the image. This method is not yet implemented. Calling it will throw an Error(31).
void setExifData (const ExifData &exifData)
 Todo: Not supported yet, requires writeMetadata(). Calling this function will throw an Error(32).
void setIptcData (const IptcData &iptcData)
 Todo: Not supported yet, requires writeMetadata(). Calling this function will throw an Error(32).
void setComment (const std::string &comment)
 Not supported. CR2 format does not contain a comment. Calling this function will throw an Error(32).
Accessors
std::string mimeType () const
 Return the MIME type of the image.
int pixelWidth () const
 Return the pixel width of the image.
int pixelHeight () const
 Return the pixel height of the image.

Detailed Description

Class to access raw Canon CR2 images. Exif metadata is supported directly, IPTC is read from the Exif data, if present.


Constructor & Destructor Documentation

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

Constructor that can either open an existing CR2 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

std::string Exiv2::Cr2Image::mimeType  )  const [virtual]
 

Return the MIME type of the image.

Note:
For each supported image format, the library knows only one MIME type. This may not be the most specific MIME type for that format. In particular, several RAW formats are variants of the TIFF format with the same magic as TIFF itself. Class TiffImage handles most of them and thus they all have MIME type "image/tiff", although a more specific MIME type may exist (e.g., "image/x-nikon-nef").

Implements Exiv2::Image.

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

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

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.


The documentation for this class was generated from the following file:
Generated on Thu Dec 31 03:57:59 2009 for Exiv2 by  doxygen 1.3.9.1