libHSPlasma
Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
plBitmap Class Reference

Abstract base class for all renderable surface textures. More...

#include <plBitmap.h>

Inheritance diagram for plBitmap:
hsKeyedObject plCreatable plCubicEnvironmap plMipmap plRenderTarget plDynamicTextMap plLODMipmap plCubicRenderTarget plDynamicCamMap plDynamicEnvMap

Classes

struct  DirectXInfo
struct  UncompressedInfo

Public Types

enum  Flags {
  kAlphaChannelFlag = 0x1, kAlphaBitFlag = 0x2, kBumpEnvMap = 0x4, kForce32Bit = 0x8,
  kDontThrowAwayImage = 0x10, kForceOneMipLevel = 0x20, kNoMaxSize = 0x40, kIntensityMap = 0x80,
  kHalfSize = 0x100, kUserOwnsBitmap = 0x200, kForceRewrite = 0x400, kForceNonCompressed = 0x800,
  kIsTexture = 0x1000, kIsOffscreen = 0x2000, kIsProjected = 0x4000, kIsOrtho = 0x8000
}
enum  CompressionType { kUncompressed, kDirectXCompression, kJPEGCompression }
enum  ColorSpace { kNoSpace, kDirectSpace, kGraySpace, kIndexSpace }
enum  DxtType {
  kDXTError, kDXT1, kDXT2_UNUSED, kDXT3,
  kDXT4_UNUSED, kDXT5
}
enum  ColorFormat {
  kRGB8888, kRGB4444, kRGB1555, kInten8,
  kAInten88
}

Public Member Functions

 plBitmap ()
void setConfig (ColorFormat format)
virtual void read (hsStream *S, plResManager *mgr)
virtual void write (hsStream *S, plResManager *mgr)
unsigned char getBPP () const
unsigned char getSpace () const
unsigned short getFlags () const
unsigned char getCompressionType () const
unsigned char getDXCompression () const
unsigned char getDXBlockSize () const
unsigned char getARGBType () const
unsigned int getLowModTime () const
unsigned int getHighModTime () const
void setBPP (unsigned char bpp)
void setSpace (unsigned char space)
void setFlags (unsigned short flags)
void setCompressionType (unsigned char type)
void setDXCompression (unsigned char type)
void setDXBlockSize (unsigned char size)
void setARGBType (unsigned char type)
void setModTime (unsigned int low, unsigned int high)
- Public Member Functions inherited from hsKeyedObject
void init (const plString &name)
plKey getKey () const
void setKey (plKey key)
- Public Member Functions inherited from plCreatable
 plCreatable ()
virtual ~plCreatable ()
virtual short ClassIndex () const =0
short ClassIndex (PlasmaVer ver) const
virtual const char * ClassName () const
virtual bool ClassInstance (short) const
virtual bool isStub () const
virtual void prcWrite (pfPrcHelper *prc)
virtual void prcParse (const pfPrcTag *tag, plResManager *mgr)

Static Public Attributes

static const char * kCompressionTypeNames []
static const char * kSpaceNames []
static const char * kUncompressedTypeNames []
static const char * kCompressedTypeNames []

Protected Member Functions

virtual void IPrcWrite (pfPrcHelper *prc)
virtual void IPrcParse (const pfPrcTag *tag, plResManager *mgr)
void IRead (hsStream *S)
void IWrite (hsStream *S)

Protected Attributes

unsigned char fPixelSize
unsigned char fSpace
unsigned short fFlags
unsigned char fCompressionType
union {
   DirectXInfo   fDXInfo
   UncompressedInfo   fUncompressedInfo
}; 
unsigned int fLowModTime
unsigned int fHighModTime

Detailed Description

Abstract base class for all renderable surface textures.

This class provides the common base for all texture types, including static mipmap and environmaps, dynamic text maps, and render targets for animated layers.

Member Enumeration Documentation

Enumerator:
kRGB8888 

32-bit ARGB color pixels, 8 bits per channel

kRGB4444 

16-bit ARGB color pixels, 4 bits per channel

kRGB1555 

16-bit RGB color pixels, 5 bits per channel + 1 alpha bit

kInten8 

8-bit intensity pixels (e.g. grayscale)

kAInten88 

8-bit intensity pixels + 8-bit alpha channel

Enumerator:
kNoSpace 

Image has no color space

kDirectSpace 

Image uses complete ARGB pixels

kGraySpace 

Image uses greyscale color space, 0-255 intensity

kIndexSpace 

Image data uses a lookup index into a color table

Enumerator:
kUncompressed 

Image data is stored as raw (A)RGB data

kDirectXCompression 

Image is DXT compressed

kJPEGCompression 

Image is JPEG compressed

Enumerator:
kDXTError 

Invalid DXT compression type

kDXT1 

DXT1 compression

kDXT2_UNUSED 

DXT2 compression (not used)

kDXT3 

DXT3 compression

kDXT4_UNUSED 

DXT4 compression (not used)

kDXT5 

DXT5 compression

Enumerator:
kAlphaChannelFlag 

Texture contains a full alpha channel

kAlphaBitFlag 

Texture contains an alpha (transparent) bit

kBumpEnvMap 

Texture uses bump maps

kForce32Bit 

Unknown

kDontThrowAwayImage 

Unknown

kForceOneMipLevel 

Don't generate smaller mipmaps – only use top-level quality

kNoMaxSize 

Unknown

kIntensityMap 

Unknown

kHalfSize 

Unknown

kUserOwnsBitmap 

Unknown

kForceRewrite 

Unknown

kForceNonCompressed 

Never compress this image

kIsTexture 

Unknown

kIsOffscreen 

Unknown

kIsProjected 

Used for projection lights

kIsOrtho 

Unknown

Constructor & Destructor Documentation

plBitmap::plBitmap ( )

Member Function Documentation

unsigned char plBitmap::getARGBType ( ) const

Returns a non-DirectX texture's configuration type

unsigned char plBitmap::getBPP ( ) const

Returns the texture's number of bits per pixel

unsigned char plBitmap::getCompressionType ( ) const

Returns the texture's top-level compression type

unsigned char plBitmap::getDXBlockSize ( ) const

Returns the DirectX texture's DXT Block size

unsigned char plBitmap::getDXCompression ( ) const

Returns the DirectX texture's DXT compression level

unsigned short plBitmap::getFlags ( ) const

Returns the texture's display flag set

unsigned int plBitmap::getHighModTime ( ) const

Returns the high word of the texture's modification timestamp

unsigned int plBitmap::getLowModTime ( ) const

Returns the low word of the texture's modification timestamp

unsigned char plBitmap::getSpace ( ) const

Returns the texture's color space

virtual void plBitmap::IPrcParse ( const pfPrcTag tag,
plResManager mgr 
)
protectedvirtual

This must be overloaded by subclasses to parse PRC data specific to the class from the PRC document. It is called once for each tag that is a child to the Creatable tag itself, so subclasses should check for each supported tag and handle it accordingly if it matches. If the tag is not recognized, it should be passed along to the parent class.

Reimplemented from hsKeyedObject.

Reimplemented in plLODMipmap, plDynamicCamMap, plCubicRenderTarget, plMipmap, plDynamicTextMap, plRenderTarget, plDynamicEnvMap, and plCubicEnvironmap.

virtual void plBitmap::IPrcWrite ( pfPrcHelper prc)
protectedvirtual

This must be overloaded by subclasses to write PRC data specific to the class to the PRC document. Do not write the top-level creatable tag, that is handled by prcWrite().

Reimplemented from hsKeyedObject.

Reimplemented in plLODMipmap, plDynamicCamMap, plCubicRenderTarget, plMipmap, plDynamicTextMap, plRenderTarget, plDynamicEnvMap, and plCubicEnvironmap.

void plBitmap::IRead ( hsStream S)
protected

Performs internal plBitmap header read

Reimplemented in plMipmap, and plRenderTarget.

void plBitmap::IWrite ( hsStream S)
protected

Performs internal plBitmap header write

Reimplemented in plMipmap, and plRenderTarget.

virtual void plBitmap::read ( hsStream ,
plResManager  
)
virtual

Reads this creatable directly from the stream. If any keys are read, they will be added to the plResManager automatically.

Reimplemented from hsKeyedObject.

Reimplemented in plLODMipmap, plDynamicCamMap, plCubicRenderTarget, plMipmap, plDynamicTextMap, plRenderTarget, plDynamicEnvMap, and plCubicEnvironmap.

void plBitmap::setARGBType ( unsigned char  type)

Set the texture's non-DXT configuration type

void plBitmap::setBPP ( unsigned char  bpp)

Set the texture's number of bits per pixel

void plBitmap::setCompressionType ( unsigned char  type)

Set the texture's top-level compression type

void plBitmap::setConfig ( ColorFormat  format)

Set pixel configuration based on color type

void plBitmap::setDXBlockSize ( unsigned char  size)

Set the texture's DXT block size

void plBitmap::setDXCompression ( unsigned char  type)

Set the texture's DXT compression level

void plBitmap::setFlags ( unsigned short  flags)

Set the texture's display flags

void plBitmap::setModTime ( unsigned int  low,
unsigned int  high 
)

Set the texture's modification timestamp

void plBitmap::setSpace ( unsigned char  space)

Set the texture's color space

virtual void plBitmap::write ( hsStream ,
plResManager  
)
virtual

Writes this creatable directly to the stream. The plResManager is used to manage any key references written by this creatable.

Reimplemented from hsKeyedObject.

Reimplemented in plLODMipmap, plDynamicCamMap, plCubicRenderTarget, plMipmap, plDynamicTextMap, plRenderTarget, plDynamicEnvMap, and plCubicEnvironmap.

Member Data Documentation

union { ... }
unsigned char plBitmap::fCompressionType
protected
DirectXInfo plBitmap::fDXInfo
unsigned short plBitmap::fFlags
protected
unsigned int plBitmap::fHighModTime
protected
unsigned int plBitmap::fLowModTime
protected
unsigned char plBitmap::fPixelSize
protected
unsigned char plBitmap::fSpace
protected
UncompressedInfo plBitmap::fUncompressedInfo
const char* plBitmap::kCompressedTypeNames[]
static

Textual name lookup for DXT compression types

const char* plBitmap::kCompressionTypeNames[]
static

Textual name lookup for compression types

const char* plBitmap::kSpaceNames[]
static

Textual name lookup for color spaces

const char* plBitmap::kUncompressedTypeNames[]
static

Textual name lookup for color layouts


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