refinery
RAW file processor
Public Types | Public Member Functions

refinery::ExifData Class Reference

Holds Exif information for an image. More...

#include <refinery/exif.h>

Inheritance diagram for refinery::ExifData:
Inheritance graph
[legend]

List of all members.

Public Types

typedef unsigned char byte
 For raw data.

Public Member Functions

virtual ~ExifData ()
 destructor.
virtual bool hasKey (const char *key) const =0
 True iff the Exif data contains the given key.
virtual std::string getString (const char *key) const =0
 Returns the specified Exif value as a string.
virtual void getBytes (const char *key, std::vector< byte > &outBytes) const =0
 Copies the specified Exif value into a byte-array.
virtual int getInt (const char *key) const =0
 Returns the specified Exif value as an int.
virtual float getFloat (const char *key) const =0
 Returns the specified Exif value as a float.

Detailed Description

Holds Exif information for an image.

This data is passed to the Image constructor, after which any Exif information is only accessed through the image's CameraData.

This is a virtual class because several strategies exist for parsing Exif data from an image. Extend this class if you want to use a new strategy. Keep in mind Exif parsing for raw files is extremely finicky because each camera format is different. Some winning strategies aren't included because they come in different programming languages or with incompatible licenses. This extensible ExifData class can handle both cases.

Definition at line 23 of file exif.h.


Member Typedef Documentation

typedef unsigned char refinery::ExifData::byte

For raw data.

Definition at line 25 of file exif.h.


Constructor & Destructor Documentation

virtual refinery::ExifData::~ExifData ( ) [inline, virtual]

destructor.

Definition at line 27 of file exif.h.


Member Function Documentation

virtual void refinery::ExifData::getBytes ( const char *  key,
std::vector< byte > &  outBytes 
) const [pure virtual]

Copies the specified Exif value into a byte-array.

Existing data will be erased.

This throws an error if the Exif data doesn't exist. Use hasKey() to verify that it does before calling this method.

Parameters:
[in]keyExif key, for instance "Exif.Nikon3.LinearizationTable".
[out]outBytesByte-array to fill.

Implemented in refinery::Exiv2ExifData, refinery::InMemoryExifData, and refinery::DcrawExifData.

virtual float refinery::ExifData::getFloat ( const char *  key) const [pure virtual]

Returns the specified Exif value as a float.

This throws an error if the Exif data doesn't exist. Use hasKey() to verify that it does before calling this method.

Parameters:
[in]keyExif key, for instance "Exif.Image.XResolution".
Returns:
A float representation of the Exif value.

Implemented in refinery::Exiv2ExifData, refinery::InMemoryExifData, and refinery::DcrawExifData.

virtual int refinery::ExifData::getInt ( const char *  key) const [pure virtual]

Returns the specified Exif value as an int.

This throws an error if the Exif data doesn't exist. Use hasKey() to verify that it does before calling this method.

Parameters:
[in]keyExif key, for instance "Exif.Image.Orientation".
Returns:
An int representation of the Exif value.

Implemented in refinery::Exiv2ExifData, refinery::InMemoryExifData, and refinery::DcrawExifData.

virtual std::string refinery::ExifData::getString ( const char *  key) const [pure virtual]

Returns the specified Exif value as a string.

This throws an error if the Exif data doesn't exist. Use hasKey() to verify that it does before calling this method.

Parameters:
[in]keyExif key, for instance "Exif.Image.Model".
Returns:
A string representation of the Exif value.

Implemented in refinery::Exiv2ExifData, refinery::InMemoryExifData, and refinery::DcrawExifData.

virtual bool refinery::ExifData::hasKey ( const char *  key) const [pure virtual]

True iff the Exif data contains the given key.

Parameters:
[in]keyExif key, for instance "Exif.Image.Orientation".
Returns:
True iff the Exif data contains the key.

Implemented in refinery::Exiv2ExifData, refinery::InMemoryExifData, and refinery::DcrawExifData.


The documentation for this class was generated from the following file:
 All Classes Functions Variables Typedefs Enumerations Enumerator