Exiv2
|
Helper class to access Exiv2 files. More...
#include <jpgimage.hpp>
Public Member Functions | |
Creators | |
ExvImage (BasicIo::AutoPtr io, bool create) | |
Constructor that can either open an existing EXV 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. | |
![]() | |
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 () |
Write metadata back to the image. |
Protected Member Functions | |
Manipulators | |
int | writeHeader (BasicIo &oIo) const |
Writes the image header (aka signature) to the BasicIo instance. | |
![]() | |
JpegBase (int type, BasicIo::AutoPtr io, bool create, const byte initData[], long dataSize) | |
Constructor that can either open an existing image or create a new image from scratch. If a new image is to be created, any existing data is overwritten. |
Friends | |
EXIV2API bool | isExvType (BasicIo &iIo, bool advance) |
Check if the file iIo is an EXV file. |
Accessors | |
std::string | mimeType () const |
Return the MIME type of the image. | |
bool | isThisType (BasicIo &iIo, bool advance) const |
Determine if the content of the BasicIo instance is of the type supported by this class. |
Additional Inherited Members | |
![]() | |
typedef std::auto_ptr< Image > | AutoPtr |
Image auto_ptr type. | |
![]() | |
BasicIo::AutoPtr | io_ |
Image data IO pointer. | |
ExifData | exifData_ |
Exif data container. | |
IptcData | iptcData_ |
IPTC data container. | |
XmpData | xmpData_ |
XMP data container. | |
std::string | comment_ |
User comment. | |
std::string | xmpPacket_ |
XMP packet. | |
int | pixelWidth_ |
image pixel width | |
int | pixelHeight_ |
image pixel height | |
NativePreviewList | nativePreviews_ |
list of native previews | |
![]() | |
static const byte | sos_ = 0xda |
JPEG SOS marker. | |
static const byte | eoi_ = 0xd9 |
JPEG EOI marker. | |
static const byte | app0_ = 0xe0 |
JPEG APP0 marker. | |
static const byte | app1_ = 0xe1 |
JPEG APP1 marker. | |
static const byte | app13_ = 0xed |
JPEG APP13 marker. | |
static const byte | com_ = 0xfe |
JPEG Comment marker. | |
static const byte | sof0_ = 0xc0 |
JPEG Start-Of-Frame marker. | |
static const byte | sof1_ = 0xc1 |
JPEG Start-Of-Frame marker. | |
static const byte | sof2_ = 0xc2 |
JPEG Start-Of-Frame marker. | |
static const byte | sof3_ = 0xc3 |
JPEG Start-Of-Frame marker. | |
static const byte | sof5_ = 0xc5 |
JPEG Start-Of-Frame marker. | |
static const byte | sof6_ = 0xc6 |
JPEG Start-Of-Frame marker. | |
static const byte | sof7_ = 0xc7 |
JPEG Start-Of-Frame marker. | |
static const byte | sof9_ = 0xc9 |
JPEG Start-Of-Frame marker. | |
static const byte | sof10_ = 0xca |
JPEG Start-Of-Frame marker. | |
static const byte | sof11_ = 0xcb |
JPEG Start-Of-Frame marker. | |
static const byte | sof13_ = 0xcd |
JPEG Start-Of-Frame marker. | |
static const byte | sof14_ = 0xce |
JPEG Start-Of-Frame marker. | |
static const byte | sof15_ = 0xcf |
JPEG Start-Of-Frame marker. | |
static const char | exifId_ [] = "Exif\0\0" |
Exif identifier. | |
static const char | jfifId_ [] = "JFIF\0" |
JFIF identifier. | |
static const char | xmpId_ [] = "http://ns.adobe.com/xap/1.0/\0" |
XMP packet identifier. |
Helper class to access Exiv2 files.
Exiv2::ExvImage::ExvImage | ( | BasicIo::AutoPtr | io, |
bool | create | ||
) |
Constructor that can either open an existing EXV 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.
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). |
|
protectedvirtual |
Determine if the content of the BasicIo instance is of the type supported by this class.
The advance flag determines if the read position in the stream is moved (see below). This applies only if the type matches and the function returns true. If the type does not match, the stream position is not changed. However, if reading from the stream fails, the stream position is undefined. Consult the stream state to obtain more information in this case.
iIo | BasicIo instance to read from. |
advance | Flag indicating whether the position of the io should be advanced by the number of characters read to analyse the data (true) or left at its original position (false). This applies only if the type matches. |
Implements Exiv2::JpegBase.
References isExvType.
|
virtual |
Return the MIME type of the image.
Implements Exiv2::Image.
|
protectedvirtual |
Writes the image header (aka signature) to the BasicIo instance.
oIo | BasicIo instance that the header is written to. |
Implements Exiv2::JpegBase.
References Exiv2::BasicIo::error(), and Exiv2::BasicIo::write().