#include <image.hpp>
Inheritance diagram for Exiv2::JpegBase:
Public Member Functions | |
Creators | |
virtual | ~JpegBase () |
Virtual destructor. | |
Manipulators | |
int | readMetadata () |
Read all metadata from the file into the internal data buffers. This method returns success even when no metadata is found in the image. Callers must therefore check the size of indivdual metadata types before accessing the data. | |
int | writeMetadata () |
Write all buffered metadata to associated file. All existing metadata sections in the file are either replaced or erased. If data for a given metadata type has not been assigned, then that metadata type will be erased from the file. | |
void | setExifData (const byte *buf, long size) |
Set the Exif data. The data is copied into an internal data buffer and is not written until writeMetadata is called. | |
void | clearExifData () |
Erase any buffered Exif data. Exif data is not removed from the actual file until writeMetadata is called. | |
void | setIptcData (const byte *buf, long size) |
Set the Iptc data. The data is copied into an internal data buffer and is not written until writeMetadata is called. | |
void | clearIptcData () |
Erase any buffered Iptc data. Iptc data is not removed from the actual file until writeMetadata is called. | |
void | setComment (const std::string &comment) |
Set the image comment. The data is copied into an internal data buffer and is not written until writeMetadata is called. | |
void | clearComment () |
Erase any buffered comment. Comment is not removed from the actual file until writeMetadata is called. | |
void | setMetadata (const Image &image) |
Copy all existing metadata from source Image. The data is copied into internal buffers and is not written until writeMetadata is called. | |
void | clearMetadata () |
Erase all buffered metadata. Metadata is not removed from the actual file until writeMetadata is called. | |
Accessors | |
bool | good () const |
Check if the Image instance is valid. Use after object construction. | |
long | sizeExifData () const |
Return the size of the Exif data in bytes. | |
const byte * | exifData () const |
Return a read-only pointer to an Exif data buffer. Do not attempt to write to this buffer. | |
long | sizeIptcData () const |
Return the size of the Iptc data in bytes. | |
const byte * | iptcData () const |
Return a read-only pointer to an Iptc data buffer. Do not attempt to write to this buffer. | |
std::string | comment () const |
Return a copy of the image comment. May be an empty string. | |
Protected Member Functions | |
Creators | |
JpegBase (const std::string &path, bool create, const byte initData[], size_t 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 file is overwritten. | |
Accessors | |
virtual int | writeHeader (FILE *ofp) const =0 |
Writes the image header (aka signature) to the file stream. | |
virtual bool | isThisType (FILE *ifp, bool advance) const =0 |
Determine if the content of the stream is of the type of this class. | |
Static Protected Attributes | |
const byte | sos_ = 0xda |
JPEG SOS marker. | |
const byte | eoi_ = 0xd9 |
JPEG EOI marker. | |
const byte | app0_ = 0xe0 |
JPEG APP0 marker. | |
const byte | app1_ = 0xe1 |
JPEG APP1 marker. | |
const byte | app13_ = 0xed |
JPEG APP13 marker. | |
const byte | com_ = 0xfe |
JPEG Comment marker. | |
const char | exifId_ [] = "Exif\0\0" |
Exif identifier. | |
const char | jfifId_ [] = "JFIF\0" |
JFIF identifier. | |
const char | ps3Id_ [] = "Photoshop 3.0\0" |
Photoshop marker. | |
const char | bimId_ [] = "8BIM" |
Photoshop marker. | |
const uint16_t | iptc_ = 0x0404 |
Photoshop Iptc marker. |
|
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 file is overwritten.
|
|
Check if the Image instance is valid. Use after object construction.
Implements Exiv2::Image. |
|
Determine if the content of the stream is of the type of 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.
Implemented in Exiv2::JpegImage, and Exiv2::ExvImage. |
|
Read all metadata from the file into the internal data buffers. This method returns success even when no metadata is found in the image. Callers must therefore check the size of indivdual metadata types before accessing the data.
Implements Exiv2::Image. |
|
Set the image comment. The data is copied into an internal data buffer and is not written until writeMetadata is called.
Implements Exiv2::Image. |
|
Set the Exif data. The data is copied into an internal data buffer and is not written until writeMetadata is called.
Implements Exiv2::Image. |
|
Set the Iptc data. The data is copied into an internal data buffer and is not written until writeMetadata is called.
Implements Exiv2::Image. |
|
Copy all existing metadata from source Image. The data is copied into internal buffers and is not written until writeMetadata is called.
Implements Exiv2::Image. |
|
Writes the image header (aka signature) to the file stream.
Implemented in Exiv2::JpegImage, and Exiv2::ExvImage. |
|
Write all buffered metadata to associated file. All existing metadata sections in the file are either replaced or erased. If data for a given metadata type has not been assigned, then that metadata type will be erased from the file.
Implements Exiv2::Image. |