refinery
RAW file processor
|
Holds Exif information for an image. More...
#include <refinery/exif.h>
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. |
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.
typedef unsigned char refinery::ExifData::byte |
virtual refinery::ExifData::~ExifData | ( | ) | [inline, virtual] |
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.
[in] | key | Exif key, for instance "Exif.Nikon3.LinearizationTable". |
[out] | outBytes | Byte-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.
[in] | key | Exif key, for instance "Exif.Image.XResolution". |
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.
[in] | key | Exif key, for instance "Exif.Image.Orientation". |
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.
[in] | key | Exif key, for instance "Exif.Image.Model". |
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.
[in] | key | Exif key, for instance "Exif.Image.Orientation". |
Implemented in refinery::Exiv2ExifData, refinery::InMemoryExifData, and refinery::DcrawExifData.