Torque2D Reference
|
#include <gBitmap.h>
Public Types | |
enum | BitmapFormat { Palettized = 0, Intensity = 1, RGB = 2, RGBA = 3, Alpha = 4, RGB565 = 5, RGB5551 = 6, Luminance = 7 } |
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 () |
GBitmap * | createPowerOfTwoBitmap () |
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 |
U8 * | getAddress (const S32 in_x, const S32 in_y, const U32 mipLevel=U32(0)) |
const U8 * | getAddress (const S32 in_x, const S32 in_y, const U32 mipLevel=U32(0)) const |
const U8 * | getBits (const U32 in_mipLevel=0) const |
U8 * | getWritableBits (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. More... | |
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 | readMSBmp (Stream &io_rStream) |
bool | writeMSBmp (Stream &io_rStream) const |
bool | read (Stream &io_rStream) |
bool | write (Stream &io_rStream) const |
![]() | |
ResourceInstance () | |
virtual | ~ResourceInstance () |
Static Public Member Functions | |
static GBitmap * | load (const char *path) |
static ResourceObject * | findBmpResource (const char *path) |
Public Attributes | |
BitmapFormat | internalFormat |
U8 * | pBits |
U32 | byteSize |
U32 | width |
U32 | height |
U32 | bytesPerPixel |
U32 | numMipLevels |
U32 | mipLevelOffsets [c_maxMipLevels] |
bool | mForce16Bit |
GPalette * | pPalette |
![]() | |
ResourceObject * | mSourceResource |
Pointer to the ResourceObject that stores all our book-keeping data. More... | |
Static Public Attributes | |
static U32 | sBitmapIdSource = 0 |
enum BitmapFormat |
enum Constants |
GBitmap | ( | ) |
GBitmap | ( | const U32 | in_width, |
const U32 | in_height, | ||
const bool | in_extrudeMipLevels = false , |
||
const BitmapFormat | in_format = RGB |
||
) |
|
virtual |
void allocateBitmap | ( | const U32 | in_width, |
const U32 | in_height, | ||
const bool | in_extrudeMipLevels = false , |
||
const BitmapFormat | in_format = RGB |
||
) |
GBitmap * createPowerOfTwoBitmap | ( | ) |
void deleteImage | ( | ) |
void extrudeMipLevels | ( | bool | clearBorders = false | ) |
void extrudeMipLevelsDetail | ( | ) |
|
static |
|
inline |
|
inline |
|
inline |
bool getColor | ( | const U32 | x, |
const U32 | y, | ||
ColorI & | rColor | ||
) | const |
bool getColorBGRA | ( | const U32 | x, |
const U32 | y, | ||
ColorI & | rColor | ||
) | const |
|
inline |
|
inline |
|
inline |
|
inline |
Note that on set palette, the bitmap deletes its palette.
|
inline |
|
inline |
|
static |
bool read | ( | Stream & | io_rStream | ) |
bool readJPEG | ( | Stream & | io_rStream | ) |
bool readMSBmp | ( | Stream & | io_rStream | ) |
bool readPNG | ( | Stream & | io_rStream | ) |
bool setColor | ( | const U32 | x, |
const U32 | y, | ||
ColorI & | rColor | ||
) |
bool setColorBGRA | ( | const U32 | x, |
const U32 | y, | ||
ColorI & | rColor | ||
) |
bool setFormat | ( | BitmapFormat | fmt | ) |
void setPalette | ( | GPalette * | in_pPalette | ) |
bool write | ( | Stream & | io_rStream | ) | const |
bool writeJPEG | ( | Stream & | io_rStream | ) | const |
bool writeMSBmp | ( | Stream & | io_rStream | ) | const |
bool writePNG | ( | Stream & | io_rStream, |
const bool | compressHard = false |
||
) | const |
bool writePNGUncompressed | ( | Stream & | io_rStream | ) | const |
U32 byteSize |
U32 bytesPerPixel |
U32 height |
BitmapFormat internalFormat |
bool mForce16Bit |
U32 mipLevelOffsets[c_maxMipLevels] |
U32 numMipLevels |
U8* pBits |
GPalette* pPalette |
Note that this palette pointer is ALWAYS
owned by the bitmap, and will be deleted on exit, or written out on a write.
|
static |
U32 width |