torque Torque Game Engine Documentation
TGE Version 1.5.2

GBitmap Class Reference

#include <gBitmap.h>

Inheritance diagram for GBitmap:

Inheritance graph
[legend]

Public Types

enum  BitmapFormat {
  Palettized = 0,
  Intensity = 1,
  RGB = 2,
  RGBA = 3,
  Alpha = 4,
  RGB565 = 5,
  RGB5551 = 6,
  Luminance = 7
}
 BitmapFormat and UsageHint are written to the stream in write(. More...
enum  Constants { c_maxMipLevels = 12 }

Public Member Functions

 GBitmap ()
 GBitmap (const GBitmap &)
 GBitmap (const U32 in_width, const U32 in_height, const bool in_extrudeMipLevels=false, const BitmapFormat in_format=RGB)
virtual ~GBitmap ()
void allocateBitmap (const U32 in_width, const U32 in_height, const bool in_extrudeMipLevels=false, const BitmapFormat in_format=RGB)
void extrudeMipLevels (bool clearBorders=false)
void extrudeMipLevelsDetail ()
GBitmapcreatePaddedBitmap ()
void copyRect (const GBitmap *src, const RectI &srcRect, const Point2I &dstPoint)
BitmapFormat getFormat () const
bool setFormat (BitmapFormat fmt)
U32 getNumMipLevels () const
U32 getWidth (const U32 in_mipLevel=0) const
U32 getHeight (const U32 in_mipLevel=0) const
U8getAddress (const S32 in_x, const S32 in_y, const U32 mipLevel=U32(0))
const U8getAddress (const S32 in_x, const S32 in_y, const U32 mipLevel=U32(0)) const
const U8getBits (const U32 in_mipLevel=0) const
U8getWritableBits (const U32 in_mipLevel=0)
bool getColorBGRA (const U32 x, const U32 y, ColorI &rColor) const
bool setColorBGRA (const U32 x, const U32 y, ColorI &rColor)
bool getColor (const U32 x, const U32 y, ColorI &rColor) const
bool setColor (const U32 x, const U32 y, ColorI &rColor)
GPalette const * getPalette () const
 Note that on set palette, the bitmap deletes its palette.
void setPalette (GPalette *in_pPalette)
void deleteImage ()
bool readJPEG (Stream &io_rStream)
bool writeJPEG (Stream &io_rStream) const
bool readPNG (Stream &io_rStream)
bool writePNG (Stream &io_rStream, const bool compressHard=false) const
bool writePNGUncompressed (Stream &io_rStream) const
bool readBmp8 (Stream &io_rStream)
bool writeBmp8 (Stream &io_rStream)
bool readMSBmp (Stream &io_rStream)
bool writeMSBmp (Stream &io_rStream) const
bool readGIF (Stream &io_rStream)
bool writeGIF (Stream &io_rStream) const
bool read (Stream &io_rStream)
bool write (Stream &io_rStream) const

Static Public Member Functions

static GBitmapload (const char *path)
static ResourceObjectfindBmpResource (const char *path)

Data Fields

BitmapFormat internalFormat
U8pBits
U32 byteSize
U32 width
U32 height
U32 bytesPerPixel
U32 numMipLevels
U32 mipLevelOffsets [c_maxMipLevels]
GPalettepPalette
 Note that this palette pointer is ALWAYS owned by the bitmap, and will be deleted on exit, or written out on a write.

Static Public Attributes

static U32 sBitmapIdSource

Private Member Functions

bool _writePNG (Stream &stream, const U32, const U32, const U32) const

Static Private Attributes

static const U32 csFileVersion

Member Enumeration Documentation

BitmapFormat and UsageHint are written to the stream in write(.

..), be sure to maintain compatability if they are changed.

Enumerator:
Palettized 
Intensity 
RGB 
RGBA 
Alpha 
RGB565 
RGB5551 
Luminance 

Enumerator:
c_maxMipLevels 


Constructor & Destructor Documentation

GBitmap::GBitmap (  ) 

GBitmap::GBitmap ( const GBitmap  ) 

GBitmap::GBitmap ( const U32  in_width,
const U32  in_height,
const bool  in_extrudeMipLevels = false,
const BitmapFormat  in_format = RGB 
)

virtual GBitmap::~GBitmap (  )  [virtual]


Member Function Documentation

static GBitmap* GBitmap::load ( const char *  path  )  [static]

static ResourceObject* GBitmap::findBmpResource ( const char *  path  )  [static]

void GBitmap::allocateBitmap ( const U32  in_width,
const U32  in_height,
const bool  in_extrudeMipLevels = false,
const BitmapFormat  in_format = RGB 
)

void GBitmap::extrudeMipLevels ( bool  clearBorders = false  ) 

void GBitmap::extrudeMipLevelsDetail (  ) 

GBitmap* GBitmap::createPaddedBitmap (  ) 

void GBitmap::copyRect ( const GBitmap src,
const RectI srcRect,
const Point2I dstPoint 
)

GBitmap::BitmapFormat GBitmap::getFormat (  )  const [inline]

bool GBitmap::setFormat ( BitmapFormat  fmt  ) 

U32 GBitmap::getNumMipLevels (  )  const [inline]

U32 GBitmap::getWidth ( const U32  in_mipLevel = 0  )  const [inline]

U32 GBitmap::getHeight ( const U32  in_mipLevel = 0  )  const [inline]

U8 * GBitmap::getAddress ( const S32  in_x,
const S32  in_y,
const U32  mipLevel = U32(0) 
) [inline]

const U8 * GBitmap::getAddress ( const S32  in_x,
const S32  in_y,
const U32  mipLevel = U32(0) 
) const [inline]

const U8 * GBitmap::getBits ( const U32  in_mipLevel = 0  )  const [inline]

U8 * GBitmap::getWritableBits ( const U32  in_mipLevel = 0  )  [inline]

bool GBitmap::getColorBGRA ( const U32  x,
const U32  y,
ColorI rColor 
) const

bool GBitmap::setColorBGRA ( const U32  x,
const U32  y,
ColorI rColor 
)

bool GBitmap::getColor ( const U32  x,
const U32  y,
ColorI rColor 
) const

bool GBitmap::setColor ( const U32  x,
const U32  y,
ColorI rColor 
)

const GPalette * GBitmap::getPalette (  )  const [inline]

Note that on set palette, the bitmap deletes its palette.

void GBitmap::setPalette ( GPalette in_pPalette  ) 

void GBitmap::deleteImage (  ) 

bool GBitmap::readJPEG ( Stream io_rStream  ) 

bool GBitmap::writeJPEG ( Stream io_rStream  )  const

bool GBitmap::readPNG ( Stream io_rStream  ) 

bool GBitmap::writePNG ( Stream io_rStream,
const bool  compressHard = false 
) const

bool GBitmap::writePNGUncompressed ( Stream io_rStream  )  const

bool GBitmap::readBmp8 ( Stream io_rStream  ) 

bool GBitmap::writeBmp8 ( Stream io_rStream  ) 

bool GBitmap::readMSBmp ( Stream io_rStream  ) 

bool GBitmap::writeMSBmp ( Stream io_rStream  )  const

bool GBitmap::readGIF ( Stream io_rStream  ) 

bool GBitmap::writeGIF ( Stream io_rStream  )  const

bool GBitmap::read ( Stream io_rStream  ) 

bool GBitmap::write ( Stream io_rStream  )  const

bool GBitmap::_writePNG ( Stream stream,
const   U32,
const   U32,
const   U32 
) const [private]


Field Documentation

U32 GBitmap::mipLevelOffsets[c_maxMipLevels]

Note that this palette pointer is ALWAYS owned by the bitmap, and will be deleted on exit, or written out on a write.

const U32 GBitmap::csFileVersion [static, private]




All Rights Reserved GarageGames.com, Inc. 1999-2005
Auto-magically Generated with Doxygen