Om
1.0.0
A universal framework for multimedia simulation
|
An interface for an object that decodes and encodes images. More...
#include <omImageTranscoder.h>
Public Member Functions | |
virtual ImageFormat | getImageFormat () const =0 |
Return an object that represents the image format that this transcoder can encode and decode. More... | |
virtual Bool | canEncode (const Image &image) const =0 |
Return whether or not this transcoder is able to encode the specified image. More... | |
virtual Bool | encode (const Image &image, DataOutputStream &stream, const ResourceSet *resourceSet=((void *) 0), ResourceManager *manager=((void *) 0)) const =0 |
Encode the specified image and send the output to the a data output stream. More... | |
virtual Bool | encode (const ResourceID &identifier, const Image &image, const ResourceSet *resourceSet=((void *) 0), ResourceManager *manager=((void *) 0)) |
Save the specified image at the specified ID location. More... | |
virtual Bool | canDecode (const ResourceID &identifier) const |
Return whether or not the specified identifier refers to a valid image format for this transcoder. More... | |
virtual Bool | canDecode (const UByte *inputData, Size inputDataSizeInBytes) const =0 |
Return whether or not the specified image data can be decoded using this transcoder. More... | |
Bool | decode (const UByte *inputData, Size inputDataSizeInBytes, Image &image, ResourceSet *resourceSet=((void *) 0), ResourceManager *manager=((void *) 0)) const |
Decode the data from the specified data pointer and return an image. More... | |
virtual Bool | decode (DataInputStream &stream, Image &image, ResourceSet *resourceSet=((void *) 0), ResourceManager *manager=((void *) 0)) const =0 |
Decode image data from the specified DataInputStream and return an image. More... | |
virtual Image * | decode (ResourceID &identifier, ResourceSet *resourceSet=((void *) 0), ResourceManager *manager=((void *) 0)) |
Load the image pointed to by the specified identifier. More... | |
Public Member Functions inherited from om::resources::ResourceTypeTranscoder< Image > | |
virtual const ResourceType & | getResourceType () const |
Return an object that represents the resource type that this transcoder can read and write. More... | |
virtual Bool | canEncode (const Image &resource) const =0 |
Return whether or not this transcoder is able to encode the specified resource. More... | |
virtual Bool | encode (const ResourceID &identifier, const Image &resource, const ResourceSet *resourceSet=((void *) 0), ResourceManager *manager=((void *) 0))=0 |
Save the specified resource object at the specified ID location. More... | |
Public Member Functions inherited from om::resources::ResourceTranscoder | |
virtual | ~ResourceTranscoder () |
Destroy a resource transcoder and release all of its resources. More... | |
virtual const ResourceFormat & | getResourceFormat () const =0 |
Return an object that represents the resource format that this transcoder can read and write. More... | |
An interface for an object that decodes and encodes images.
The purpose of this interface is to provide a common interface for classes that provide functionality to encode and decode images to and from their format and a simpler representation in memory.
In general, one uses the encoding functionality by passing in a reference to an image object already existing in memory to the encode() function. The job of the encoder is then to covert the image object to an encoded stream of bytes, represented by a Data object.
Similarly, the decode() method takes a data object and outputs an image object. Finally, the last method, canDecode(), takes as a parameter a reference to a data object and returns whether or not this data represents an encoded image that the decoder can decode.
|
pure virtual |
Return an object that represents the image format that this transcoder can encode and decode.
Implemented in om::images::io::BMPTranscoder, om::images::io::JPEGTranscoder, om::images::io::PNGTranscoder, om::images::io::TGATranscoder, and om::images::io::TIFFTranscoder.
Return whether or not this transcoder is able to encode the specified image.
Implemented in om::images::io::BMPTranscoder, om::images::io::JPEGTranscoder, om::images::io::PNGTranscoder, om::images::io::TGATranscoder, and om::images::io::TIFFTranscoder.
|
pure virtual |
Encode the specified image and send the output to the a data output stream.
If the encoding succeeds, the encoded image data is sent to the data output stream and TRUE is returned. Otherwise, FALSE is returned and no data is sent to the stream.
Implemented in om::images::io::BMPTranscoder, om::images::io::JPEGTranscoder, om::images::io::PNGTranscoder, om::images::io::TGATranscoder, and om::images::io::TIFFTranscoder.
|
virtual |
Save the specified image at the specified ID location.
The method returns whether or not the resource was successfully written.
|
virtual |
Return whether or not the specified identifier refers to a valid image format for this transcoder.
If the identifier represents a valid image format, TRUE is returned. Otherwise, if the resource is not valid, FALSE is returned.
Implements om::resources::ResourceTranscoder.
|
pure virtual |
Return whether or not the specified image data can be decoded using this transcoder.
The transcoder examines the data and determines if the data contains a valid image in the transcoder's format. If so, TRUE is returned. Otherwise, FALSE is returned.
Implemented in om::images::io::BMPTranscoder, om::images::io::JPEGTranscoder, om::images::io::PNGTranscoder, om::images::io::TGATranscoder, and om::images::io::TIFFTranscoder.
Bool om::images::io::ImageTranscoder::decode | ( | const UByte * | inputData, |
Size | inputDataSizeInBytes, | ||
Image & | image, | ||
ResourceSet * | resourceSet = ((void *) 0) , |
||
ResourceManager * | manager = ((void *) 0) |
||
) | const |
Decode the data from the specified data pointer and return an image.
The image is returned in the specified output image reference.
If the decoding succeeds, the function creates an image and places it in the image output reference paramter and TRUE is returned. Otherwise, if the decoding fails, FALSE is returned.
|
pure virtual |
Decode image data from the specified DataInputStream and return an image.
The image is returned in the output image reference.
If the decoding succeeds, the function creates an image and places it in the image output reference paramter and TRUE is returned. Otherwise, if the decoding fails, FALSE is returned.
Implemented in om::images::io::BMPTranscoder, om::images::io::JPEGTranscoder, om::images::io::PNGTranscoder, om::images::io::TGATranscoder, and om::images::io::TIFFTranscoder.
|
virtual |
Load the image pointed to by the specified identifier.
The caller can supply a pointer to a resource manager which can be used to manage the creation of child resources.
If the method fails, the return value will be NULL.
Implements om::resources::ResourceTypeTranscoder< Image >.