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:

Ogre::ImageCodec Ogre::JPEGCodec Ogre::PNGCodec Ogre::TGACodec Ogre::JPGCodec 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. More...

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. More...

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

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


Static Public Methods

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

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


Protected Types

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

Static Protected Attributes

CodecList ms_mapCodecs
 A map that contains all the registered codecs. More...


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.


Member Typedef Documentation

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


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::ImageCodec.

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::ImageCodec.

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::ImageCodec.

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

Gets the codec registered for the passed in file extension.

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

Returns the type of the codec as a String.

Implemented in Ogre::ImageCodec.

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

Registers a new codec in the database.


Member Data Documentation

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

A map that contains all the registered codecs.

Copyright © 2002 by The OGRE Team