refinery
RAW file processor
|
Uses Exiv2 to supply Exif data. More...
#include <licensed/gpl/refinery/exif_exiv2.h>
Public Member Functions | |
Exiv2ExifData (Exiv2::ExifData &exiv2ExifData) | |
constructor. | |
~Exiv2ExifData () | |
destructor. | |
virtual bool | hasKey (const char *key) const |
True iff the Exif data contains the given key. | |
virtual std::string | getString (const char *key) const |
Returns the specified Exif value as a string. | |
virtual void | getBytes (const char *key, std::vector< byte > &outBytes) const |
Copies the specified Exif value into a byte-array. | |
virtual int | getInt (const char *key) const |
Returns the specified Exif value as an int. | |
virtual float | getFloat (const char *key) const |
Returns the specified Exif value as a float. |
Uses Exiv2 to supply Exif data.
Exiv2 is complete and has a useful API, but its license is GPL and so any code that links to it must use a GPL-compatible license.
This is a shallow wrapper around the Exiv2 data, so the original Exiv2 data must exist for the lifetime of this object.
When the header is included, Exiv2ExifData can be initialized automatically where an ExifData is expected, as in the following example:
Exiv2::Image::AutoPtr exivImage(Exiv2::ImageFactory::open("image.NEF")); // assert exivImage.get() != 0 exivImage->readMetadata(); const Exiv2::ExifData& exivData(exivImage->exifData()); // assert !exivData.empty() refinery::ImageReader reader; std::auto_ptr<GrayImage> grayImagePtr( reader.readGrayImage(fb, exivData)); // exivData converts to an ExifData
Definition at line 55 of file exif_exiv2.h.
refinery::Exiv2ExifData::Exiv2ExifData | ( | Exiv2::ExifData & | exiv2ExifData | ) |
constructor.
exiv2ExifData | The Exiv2 data. |
refinery::Exiv2ExifData::~Exiv2ExifData | ( | ) |
destructor.
virtual void refinery::Exiv2ExifData::getBytes | ( | const char * | key, |
std::vector< byte > & | outBytes | ||
) | const [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. |
Implements refinery::ExifData.
virtual float refinery::Exiv2ExifData::getFloat | ( | const char * | key | ) | const [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". |
Implements refinery::ExifData.
virtual int refinery::Exiv2ExifData::getInt | ( | const char * | key | ) | const [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". |
Implements refinery::ExifData.
virtual std::string refinery::Exiv2ExifData::getString | ( | const char * | key | ) | const [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". |
Implements refinery::ExifData.
virtual bool refinery::Exiv2ExifData::hasKey | ( | const char * | key | ) | const [virtual] |
True iff the Exif data contains the given key.
[in] | key | Exif key, for instance "Exif.Image.Orientation". |
Implements refinery::ExifData.