#include <image.hpp>
Static Public Member Functions | |
static Image::AutoPtr | open (const std::string &path) |
Create an Image subclass of the appropriate type by reading the specified file. Image type is derived from the file contents. | |
static Image::AutoPtr | open (const byte *data, long size) |
Create an Image subclass of the appropriate type by reading the provided memory. Image type is derived from the memory contents. | |
static Image::AutoPtr | open (BasicIo::AutoPtr io) |
Create an Image subclass of the appropriate type by reading the provided BasicIo instance. Image type is derived from the data provided by io. The passed in io instance is (re)opened by this method. | |
static Image::AutoPtr | create (int type, const std::string &path) |
Create an Image subclass of the requested type by creating a new image file. If the file already exists, it will be overwritten. | |
static Image::AutoPtr | create (int type) |
Create an Image subclass of the requested type by creating a new image in memory. | |
static Image::AutoPtr | create (int type, BasicIo::AutoPtr io) |
Create an Image subclass of the requested type by writing a new image to a BasicIo instance. If the BasicIo instance already contains data, it will be overwritten. | |
static int | getType (const std::string &path) |
Returns the image type of the provided file. | |
static int | getType (const byte *data, long size) |
Returns the image type of the provided data buffer. | |
static int | getType (BasicIo &io) |
Returns the image type of data provided by a BasicIo instance. The passed in io instance is (re)opened by this method. | |
static AccessMode | checkMode (int type, MetadataId metadataId) |
Returns the access mode or supported metadata functions for an image type and a metadata type. | |
static bool | checkType (int type, BasicIo &io, bool advance) |
Determine if the content of io is an image of type. | |
Friends | |
bool | Image::good () const |
Classes | |
struct | Registry |
Struct for storing image types and function pointers. |
The factory is implemented as a static class.
static Image::AutoPtr Exiv2::ImageFactory::open | ( | const std::string & | path | ) | [static] |
Create an Image subclass of the appropriate type by reading the specified file. Image type is derived from the file contents.
path | Image file. The contents of the file are tested to determine the image type. File extension is ignored. |
Error | If opening the file fails or it contains data of an unknown image type. |
static Image::AutoPtr Exiv2::ImageFactory::open | ( | const byte * | data, | |
long | size | |||
) | [static] |
Create an Image subclass of the appropriate type by reading the provided memory. Image type is derived from the memory contents.
data | Pointer to a data buffer containing an image. The contents of the memory are tested to determine the image type. | |
size | Number of bytes pointed to by data. |
Error | If the memory contains data of an unknown image type. |
static Image::AutoPtr Exiv2::ImageFactory::open | ( | BasicIo::AutoPtr | io | ) | [static] |
Create an Image subclass of the appropriate type by reading the provided BasicIo instance. Image type is derived from the data provided by io. The passed in io instance is (re)opened by this method.
io | An auto-pointer that owns a BasicIo instance that provides image data. The contents of the image data are tested to determine the type. |
static Image::AutoPtr Exiv2::ImageFactory::create | ( | int | type, | |
const std::string & | path | |||
) | [static] |
Create an Image subclass of the requested type by creating a new image file. If the file already exists, it will be overwritten.
type | Type of the image to be created. | |
path | Image file to create. File extension is ignored. |
Error | If the image type is not supported. |
static Image::AutoPtr Exiv2::ImageFactory::create | ( | int | type | ) | [static] |
static Image::AutoPtr Exiv2::ImageFactory::create | ( | int | type, | |
BasicIo::AutoPtr | io | |||
) | [static] |
Create an Image subclass of the requested type by writing a new image to a BasicIo instance. If the BasicIo instance already contains data, it will be overwritten.
type | Type of the image to be created. | |
io | An auto-pointer that owns a BasicIo instance that will be written to when creating a new image. |
static int Exiv2::ImageFactory::getType | ( | const std::string & | path | ) | [static] |
Returns the image type of the provided file.
path | Image file. The contents of the file are tested to determine the image type. File extension is ignored. |
static int Exiv2::ImageFactory::getType | ( | const byte * | data, | |
long | size | |||
) | [static] |
Returns the image type of the provided data buffer.
data | Pointer to a data buffer containing an image. The contents of the memory are tested to determine the image type. | |
size | Number of bytes pointed to by data. |
static int Exiv2::ImageFactory::getType | ( | BasicIo & | io | ) | [static] |
Returns the image type of data provided by a BasicIo instance. The passed in io instance is (re)opened by this method.
io | A BasicIo instance that provides image data. The contents of the image data are tested to determine the type. |
static AccessMode Exiv2::ImageFactory::checkMode | ( | int | type, | |
MetadataId | metadataId | |||
) | [static] |
Returns the access mode or supported metadata functions for an image type and a metadata type.
type | The image type. | |
metadataId | The metadata identifier. |
Error(13) | if the image type is not supported. |
static bool Exiv2::ImageFactory::checkType | ( | int | type, | |
BasicIo & | io, | |||
bool | advance | |||
) | [static] |
Determine if the content of io is an image of type.
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.
type | Type of the image. | |
io | 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. |