A subclass of ImageFileFormat for reading and writing JPEG files. More...
Inherits ImageFileFormat.
Public Member Functions | |
| JPEGImageFormat () | |
| ~JPEGImageFormat () | |
| void | setQuality (float newQuality) |
| Specifies the quality to be used when writing a JPEG file. | |
| String | getFormatName () |
| Returns a description of this file format. | |
| bool | canUnderstand (InputStream &input) |
| Returns true if the given stream seems to contain data that this format understands. | |
| Image | decodeImage (InputStream &input) |
| Tries to decode and return an image from the given stream. | |
| bool | writeImageToStream (const Image &sourceImage, OutputStream &destStream) |
| Attempts to write an image to a stream. | |
A subclass of ImageFileFormat for reading and writing JPEG files.
| JPEGImageFormat::JPEGImageFormat | ( | ) |
| JPEGImageFormat::~JPEGImageFormat | ( | ) |
| void JPEGImageFormat::setQuality | ( | float | newQuality ) |
Specifies the quality to be used when writing a JPEG file.
| newQuality | a value 0 to 1.0, where 0 is low quality, 1.0 is best, or any negative value is "default" quality |
| String JPEGImageFormat::getFormatName | ( | ) | [virtual] |
| bool JPEGImageFormat::canUnderstand | ( | InputStream & | input ) | [virtual] |
Returns true if the given stream seems to contain data that this format understands.
The format class should only read the first few bytes of the stream and sniff for header bytes that it understands.
Implements ImageFileFormat.
| Image JPEGImageFormat::decodeImage | ( | InputStream & | input ) | [virtual] |
Tries to decode and return an image from the given stream.
This will be called for an image format after calling its canUnderStand() method to see if it can handle the stream.
| input | the stream to read the data from. The stream will be positioned at the start of the image data (but this may not necessarily be position 0) |
Implements ImageFileFormat.
| bool JPEGImageFormat::writeImageToStream | ( | const Image & | sourceImage, |
| OutputStream & | destStream | ||
| ) | [virtual] |
Attempts to write an image to a stream.
To specify extra information like encoding quality, there will be appropriate parameters in the subclasses of the specific file types.
Implements ImageFileFormat.