Gnash  0.8.10
Public Member Functions | Static Public Member Functions | Protected Attributes
gnash::image::Input Class Reference

The base class for reading image data. More...

#include <GnashImage.h>

Inheritance diagram for gnash::image::Input:
gnash::image::JpegInput

List of all members.

Public Member Functions

 Input (boost::shared_ptr< IOChannel > in)
 Construct an Input object to read from an IOChannel.
virtual ~Input ()
virtual void read ()=0
 Begin processing the image data.
virtual size_t getHeight () const =0
 Get the image's height in pixels.
virtual size_t getWidth () const =0
 Get the image's width in pixels.
virtual size_t getComponents () const =0
 Get number of components (channels)
virtual void readScanline (unsigned char *rgbData)=0
 Read a scanline's worth of image data into the given buffer.
ImageType imageType ()
 Get the ImageType of the image.

Static Public Member Functions

static DSOEXPORT std::auto_ptr
< ImageRGBA
readSWFJpeg3 (boost::shared_ptr< gnash::IOChannel > in)
 For reading SWF JPEG3-style image data, like ordinary JPEG, but stores the data in ImageRGBA format.
static DSOEXPORT std::auto_ptr
< GnashImage
readImageData (boost::shared_ptr< gnash::IOChannel > in, FileType type)
 Read image data from an IOChannel into an GnashImage.

Protected Attributes

boost::shared_ptr< IOChannel_inStream
ImageType _type

Detailed Description

The base class for reading image data.


Constructor & Destructor Documentation

gnash::image::Input::Input ( boost::shared_ptr< IOChannel in) [inline]

Construct an Input object to read from an IOChannel.

Parameters:
inThe stream to read data from. Ownership is shared between caller and Input, so it is freed automatically when the last owner is destroyed.
virtual gnash::image::Input::~Input ( ) [inline, virtual]

Member Function Documentation

virtual size_t gnash::image::Input::getComponents ( ) const [pure virtual]

Get number of components (channels)

Returns:
The number of components, e.g. 3 for RGB

Implemented in gnash::image::JpegInput.

virtual size_t gnash::image::Input::getHeight ( ) const [pure virtual]

Get the image's height in pixels.

Returns:
The height of the image in pixels.

Implemented in gnash::image::JpegInput.

virtual size_t gnash::image::Input::getWidth ( ) const [pure virtual]

Get the image's width in pixels.

Returns:
The width of the image in pixels.

Implemented in gnash::image::JpegInput.

ImageType gnash::image::Input::imageType ( ) [inline]

Get the ImageType of the image.

Returns:
The type of the image. This is GNASH_IMAGE_INVALID at least until read() has been called and reads some valid data.

References _type.

virtual void gnash::image::Input::read ( ) [pure virtual]

Begin processing the image data.

Implemented in gnash::image::JpegInput.

std::auto_ptr< GnashImage > gnash::image::Input::readImageData ( boost::shared_ptr< gnash::IOChannel in,
FileType  type 
) [static]

Read image data from an IOChannel into an GnashImage.

Parameters:
inThe IOChannel to read the image from.
typeThe type of image to read.
Returns:
An GnashImage with the read image data. If type is an unsupported FileType or image reading fails, a NULL auto_ptr is returned.

References gnash::GNASH_FILETYPE_PNG, gnash::image::createPngInput(), gnash::GNASH_FILETYPE_GIF, gnash::image::createGifInput(), gnash::GNASH_FILETYPE_JPEG, gnash::image::JpegInput::create(), height, width, gnash::image::TYPE_RGB, gnash::image::TYPE_RGBA, _, gnash::key::e, gnash::key::i, and gnash::image::scanline().

virtual void gnash::image::Input::readScanline ( unsigned char *  rgbData) [pure virtual]

Read a scanline's worth of image data into the given buffer.

Parameters:
rgbDataThe buffer for writing raw RGB data to.

Implemented in gnash::image::JpegInput.

std::auto_ptr< ImageRGBA > gnash::image::Input::readSWFJpeg3 ( boost::shared_ptr< gnash::IOChannel in) [static]

For reading SWF JPEG3-style image data, like ordinary JPEG, but stores the data in ImageRGBA format.

References gnash::image::JpegInput::createSWFJpeg2HeaderOnly(), assert, height, width, y, data, gnash::image::scanline(), and x.


Member Data Documentation

boost::shared_ptr<IOChannel> gnash::image::Input::_inStream [protected]

The documentation for this class was generated from the following files: