JpegReader Class Reference

#include <Pt/Gfx/JpegReader.h>

JPEG image reader. More...

Public Member Functions

 JpegReader ()
 Default Constructor.
 JpegReader (std::istream &is, Image &image)
 Construct with target stream and image.
 ~JpegReader ()
 Destructor.
void attach (std::istream &is, Image &image)
 Attach to target stream and image.
void detach ()
 Detach from target stream.
void reset ()
 Reset to begin new compression/decompression.
Image * advance ()
 Reads image data from the target stream.
Image & get ()
 Reads the whole image from the stream.

Detailed Description

JpegReader decodes JPEG data from an iostream into an Image. Attach a stream and an image, then call get() to read the whole image, or advance() to consume bytes as they become available. The reader does not own the stream or the image. detach() releases both. reset() starts a new decode on the same pair.

The image format is chosen by the decoder. Use this type when the input is JPEG; use PngReader for PNG.