ScummVM API documentation
Image::Codec Class Referenceabstract

#include <codec.h>

Inheritance diagram for Image::Codec:
Image::BitmapRawDecoder Image::CDToonsDecoder Image::CinepakDecoder Image::HLZDecoder Image::HNM6Decoder Image::Indeo3Decoder Image::Indeo::IndeoDecoderBase Image::JPEGDecoder Image::JYV1Decoder Image::MJPEGDecoder Image::MSRLE4Decoder Image::MSRLEDecoder Image::MSVideo1Decoder Image::QTRLEDecoder Image::RPZADecoder Image::SMCDecoder Image::SVQ1Decoder Image::XanDecoder

Public Types

enum  DitherType { kDitherTypeUnknown, kDitherTypeVFW, kDitherTypeQT }
 

Public Member Functions

virtual const Graphics::SurfacedecodeFrame (Common::SeekableReadStream &stream)=0
 
virtual Graphics::PixelFormat getPixelFormat () const =0
 
virtual bool setOutputPixelFormat (const Graphics::PixelFormat &format)
 
virtual bool containsPalette () const
 
virtual const byte * getPalette ()
 
virtual bool hasDirtyPalette () const
 
virtual bool canDither (DitherType type) const
 
virtual void setDither (DitherType type, const byte *palette)
 
virtual void setCodecAccuracy (CodecAccuracy accuracy)
 

Static Public Member Functions

static byte * createQuickTimeDitherTable (const byte *palette, uint colorCount)
 

Detailed Description

An abstract representation of a image codec.

Unlike ImageDecoder, the entire info for a frame may not be present within the stream. The codec may rely on the supporting container for parameters and can also rely on a previous (or future) frame. When decoding, the previous frame may not destroyed and could be maintained for use in the next one.

An ImageDecoder can always be a Codec, but a Codec may not necessarily be able to be an ImageDecoder.

Used in image:

Used in video:

  • AVIDecoder
  • QuickTimeDecoder
  • VMDDecoder

Member Enumeration Documentation

◆ DitherType

A type of dithering.

Enumerator
kDitherTypeUnknown 

Unknown

kDitherTypeVFW 

Video for Windows dithering

kDitherTypeQT 

QuickTime dithering

Member Function Documentation

◆ decodeFrame()

virtual const Graphics::Surface* Image::Codec::decodeFrame ( Common::SeekableReadStream stream)
pure virtual

◆ getPixelFormat()

◆ setOutputPixelFormat()

virtual bool Image::Codec::setOutputPixelFormat ( const Graphics::PixelFormat format)
inlinevirtual

Select the preferred format to use, for codecs where this is faster than converting the image afterwards. Returns true if supported, and false otherwise.

Reimplemented in Image::Indeo::IndeoDecoderBase, Image::CinepakDecoder, Image::JPEGDecoder, Image::Indeo3Decoder, Image::MJPEGDecoder, Image::XanDecoder, and Image::SVQ1Decoder.

◆ containsPalette()

virtual bool Image::Codec::containsPalette ( ) const
inlinevirtual

Can this codec's frames contain a palette?

Reimplemented in Image::CinepakDecoder, Image::CDToonsDecoder, Image::QTRLEDecoder, and Image::RPZADecoder.

◆ getPalette()

virtual const byte* Image::Codec::getPalette ( )
inlinevirtual

Get the palette last decoded from decodeImage

Reimplemented in Image::CinepakDecoder, Image::CDToonsDecoder, Image::QTRLEDecoder, and Image::RPZADecoder.

◆ hasDirtyPalette()

virtual bool Image::Codec::hasDirtyPalette ( ) const
inlinevirtual

Does the codec have a dirty palette?

Reimplemented in Image::CinepakDecoder, Image::CDToonsDecoder, Image::QTRLEDecoder, and Image::RPZADecoder.

◆ canDither()

virtual bool Image::Codec::canDither ( DitherType  type) const
inlinevirtual

Can the codec dither down to 8bpp?

Reimplemented in Image::CinepakDecoder, Image::QTRLEDecoder, and Image::RPZADecoder.

◆ setDither()

virtual void Image::Codec::setDither ( DitherType  type,
const byte *  palette 
)
inlinevirtual

Activate dithering mode with a palette

Reimplemented in Image::CinepakDecoder, Image::QTRLEDecoder, and Image::RPZADecoder.

◆ setCodecAccuracy()

virtual void Image::Codec::setCodecAccuracy ( CodecAccuracy  accuracy)
inlinevirtual

Set the decoding accuracy of the codec, if supported

Reimplemented in Image::JPEGDecoder, and Image::MJPEGDecoder.

◆ createQuickTimeDitherTable()

static byte* Image::Codec::createQuickTimeDitherTable ( const byte *  palette,
uint  colorCount 
)
static

Create a dither table, as used by QuickTime codecs.


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