Page Speed Optimization Libraries
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
pagespeed::image_compression::ScanlineToFrameReaderAdapter Class Reference

Scanline API to MultipleFrame API adapters. More...

#include "scanline_interface_frame_adapter.h"

Inheritance diagram for pagespeed::image_compression::ScanlineToFrameReaderAdapter:

Public Member Functions

 ScanlineToFrameReaderAdapter (ScanlineReaderInterface *scanline_reader, MessageHandler *message_handler)
 Acquires ownership of 'scanline_reader'.
virtual ScanlineStatus Reset ()
 Resets the MultipleFrameReader to its initial state.
virtual ScanlineStatus Initialize ()
virtual bool HasMoreFrames () const
virtual bool HasMoreScanlines () const
virtual ScanlineStatus PrepareNextFrame ()
virtual ScanlineStatus ReadNextScanline (const void **out_scanline_bytes)
virtual ScanlineStatus GetFrameSpec (FrameSpec *frame_spec) const
virtual ScanlineStatus GetImageSpec (ImageSpec *image_spec) const
- Public Member Functions inherited from pagespeed::image_compression::MultipleFrameReader
 MultipleFrameReader (MessageHandler *handler)
ScanlineStatus Initialize (const void *image_buffer, size_t buffer_length)
MessageHandlermessage_handler () const
virtual ScanlineStatus set_quirks_mode (QuirksMode quirks_mode)
virtual QuirksMode quirks_mode () const
bool Reset (ScanlineStatus *status)
bool Initialize (const void *image_buffer, size_t buffer_length, ScanlineStatus *status)
bool Initialize (ScanlineStatus *status)
bool PrepareNextFrame (ScanlineStatus *status)
bool ReadNextScanline (const void **out_scanline_bytes, ScanlineStatus *status)
bool GetFrameSpec (FrameSpec *frame_spec, ScanlineStatus *status)
bool GetImageSpec (ImageSpec *image_spec, ScanlineStatus *status)
bool set_quirks_mode (QuirksMode quirks_mode, ScanlineStatus *status)

Additional Inherited Members

- Protected Attributes inherited from pagespeed::image_compression::MultipleFrameReader
const void * image_buffer_
size_t buffer_length_

Detailed Description

Scanline API to MultipleFrame API adapters.

The class ScanlineToFrameReaderAdapter takes ownership of a ScanlineReaderInterface and exposes MultipleFrameReader methods.

Member Function Documentation

virtual ScanlineStatus pagespeed::image_compression::ScanlineToFrameReaderAdapter::GetFrameSpec ( FrameSpec frame_spec) const

Assigns to '*frame_spec' the FrameSpec describing the current frame.

TODO(vchudnov): Consider simplifying this method to return frame_spec rather than the ScanlineStatus.

Implements pagespeed::image_compression::MultipleFrameReader.

virtual ScanlineStatus pagespeed::image_compression::ScanlineToFrameReaderAdapter::GetImageSpec ( ImageSpec image_spec) const

Copies into '*image_spec' the ImageSpec describing the image.

Implements pagespeed::image_compression::MultipleFrameReader.

virtual bool pagespeed::image_compression::ScanlineToFrameReaderAdapter::HasMoreFrames ( ) const

Returns true iff the image being read has additional frames beyond the current frame being read. For any well-formed image with at least one frame (or for a well-formed static image), this will return true before the first call to PrepareNextFrame().

Implements pagespeed::image_compression::MultipleFrameReader.

virtual bool pagespeed::image_compression::ScanlineToFrameReaderAdapter::HasMoreScanlines ( ) const

Returns true iff the current frame has more scanlines that have not yet been read.

Implements pagespeed::image_compression::MultipleFrameReader.

virtual ScanlineStatus pagespeed::image_compression::ScanlineToFrameReaderAdapter::Initialize ( )

Initializes MultipleFrameReader to read image data of length 'buffer_length_' from 'image_buffer_'. This function should take care of calling Reset() if necessary, so that the sequence "Reset(); Initialize();" is never needed.

Implements pagespeed::image_compression::MultipleFrameReader.

virtual ScanlineStatus pagespeed::image_compression::ScanlineToFrameReaderAdapter::PrepareNextFrame ( )

Prepares to read scanlines from the frame after the current one. Must be called before reading from the first frame.

Implements pagespeed::image_compression::MultipleFrameReader.

virtual ScanlineStatus pagespeed::image_compression::ScanlineToFrameReaderAdapter::ReadNextScanline ( const void **  out_scanline_bytes)

Reads the next available scanline in the current frame and copies a pointer to it into '*out_scanline_bytes'. This class retains ownership of the read scanline. The scanline encodes as many pixels as the width of the current frame, which is not necessarily the width of the whole image.

Implements pagespeed::image_compression::MultipleFrameReader.

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