Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Ogre::Codec Class Reference

Abstract class that defines a 'codec'. More...

#include <OgreCodec.h>

Inheritance diagram for Ogre::Codec:

Inheritance graph
[legend]
List of all members.

Public Methods

virtual void code (const DataChunk &input, DataChunk *output,...) const=0
 Codes the data in the input chunk and saves the result in the output chunk.

virtual void codeToFile (const DataChunk &input, const String &outFileName, CodecData *pData) const=0
 Codes the data in the input chunk and saves the result in the output filename provided.

virtual CodecDatadecode (const DataChunk &input, DataChunk *output,...) const=0
 Codes the data from the input chunk into the output chunk.

virtual String getType () const=0
 Returns the type of the codec as a String.


Static Public Methods

void registerCodec (Codec *pCodec)
 Registers a new codec in the database.

Codec * getCodec (const String &extension)
 Gets the codec registered for the passed in file extension.


Protected Types

typedef std::map< String,
Codec * > 
CodecList

Static Protected Attributes

CodecList ms_mapCodecs
 A map that contains all the registered codecs.


Detailed Description

Abstract class that defines a 'codec'.

Remarks:
A codec class works like a two-way filter for data - data entered on one end (the decode end) gets processed and transformed into easily usable data while data passed the other way around codes it back.

The codec concept is a pretty generic one - you can easily understand how it can be used for images, sounds, archives, even compressed data.

Definition at line 41 of file OgreCodec.h.


Member Typedef Documentation

typedef std::map< String, Codec* > Ogre::Codec::CodecList [protected]
 

Definition at line 44 of file OgreCodec.h.


Member Function Documentation

virtual void Ogre::Codec::code const DataChunk   input,
DataChunk   output,
...   
const [pure virtual]
 

Codes the data in the input chunk and saves the result in the output chunk.

Note:
Has a variable number of arguments, which depend on the codec type.

Implemented in Ogre::BMPCodec, Ogre::DDSCodec, Ogre::ILImageCodec, Ogre::ImageCodec, Ogre::JPEGCodec, Ogre::PNGCodec, and Ogre::TGACodec.

virtual void Ogre::Codec::codeToFile const DataChunk   input,
const String   outFileName,
CodecData   pData
const [pure virtual]
 

Codes the data in the input chunk and saves the result in the output filename provided.

Provided for efficiency since coding to memory is progressive therefore memory required is unknown leading to reallocations.

Parameters:
input  The input data
outFileName  The filename to write to
pData  Extra information to be passed to the codec (codec type specific)

Implemented in Ogre::ILImageCodec, and Ogre::ImageCodec.

Referenced by Ogre::Win32Window::writeContentsToFile(), Ogre::SDLWindow::writeContentsToFile(), Ogre::D3D9RenderWindow::writeContentsToFile(), and Ogre::D3D7RenderWindow::writeContentsToFile().

virtual CodecData* Ogre::Codec::decode const DataChunk   input,
DataChunk   output,
...   
const [pure virtual]
 

Codes the data from the input chunk into the output chunk.

Remarks:
The returned CodecData pointer is a pointer to a class that holds information about the decoded buffer. For an image, this would be the size, the bitdepht, etc.
Note:
Has a variable number of arguments, which depend on the codec type.

Implemented in Ogre::BMPCodec, Ogre::DDSCodec, Ogre::ILImageCodec, Ogre::ImageCodec, Ogre::JPEGCodec, and Ogre::TGACodec.

Referenced by Ogre::Image::load().

Codec * Ogre::Codec::getCodec const String   extension [static]
 

Gets the codec registered for the passed in file extension.

Definition at line 35 of file OgreCodec.cpp.

References Except, ms_mapCodecs, and Ogre::String::toLowerCase().

virtual String Ogre::Codec::getType   const [pure virtual]
 

Returns the type of the codec as a String.

Implemented in Ogre::BMPCodec, Ogre::DDSCodec, Ogre::ILImageCodec, Ogre::ImageCodec, Ogre::JPEGCodec, Ogre::JPGCodec, Ogre::PNGCodec, and Ogre::TGACodec.

Referenced by registerCodec().

void Ogre::Codec::registerCodec Codec *    pCodec [static]
 

Registers a new codec in the database.

Definition at line 63 of file OgreCodec.h.

References getType().


Member Data Documentation

std::map< String, Codec * > Ogre::Codec::ms_mapCodecs [static, protected]
 

A map that contains all the registered codecs.

Definition at line 32 of file OgreCodec.cpp.

Referenced by getCodec().


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

Copyright © 2002-2003 by The OGRE Team
Last modified Fri May 14 23:25:57 2004