refinery
RAW file processor
|
An in-memory, fake Exif data container. More...
#include <refinery/exif.h>
Public Member Functions | |
InMemoryExifData () | |
constructor. | |
~InMemoryExifData () | |
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. | |
virtual void | setString (const char *key, const std::string &s) |
Sets a string Exif datum. |
An in-memory, fake Exif data container.
This only returns Exif data that has been set in it programmatically. It's useful for testing or as a base class for other Exif parsers.
InMemoryExifData exifData; exifData.setString("Exif.Image.Model", "NIKON D5000"); std::string model(exifData.getString("Exif.Image.Model")); std::cout << "Camera: " << model << std::endl;
refinery::InMemoryExifData::InMemoryExifData | ( | ) |
constructor.
refinery::InMemoryExifData::~InMemoryExifData | ( | ) |
destructor.
virtual void refinery::InMemoryExifData::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::InMemoryExifData::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::InMemoryExifData::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::InMemoryExifData::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::InMemoryExifData::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.
virtual void refinery::InMemoryExifData::setString | ( | const char * | key, |
const std::string & | s | ||
) | [virtual] |
Sets a string Exif datum.
[in] | key | Exif key, for instance "Exif.Image.Model". |
[in] | s | String, for instance "NIKON D5000". |