My Project
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
ParaEngine::Texture2D Class Reference
Inheritance diagram for ParaEngine::Texture2D:
ParaEngine::CRefCountedOne ParaEngine::CRefCounted

Classes

struct  _TexParams
 
struct  PixelFormatInfo
 

Public Types

enum  PixelFormat {
  PixelFormat::AUTO, PixelFormat::BGRA8888, PixelFormat::RGBA8888, PixelFormat::RGB888,
  PixelFormat::RGB565, PixelFormat::A8, PixelFormat::I8, PixelFormat::AI88,
  PixelFormat::RGBA4444, PixelFormat::RGB5A1, PixelFormat::PVRTC4, PixelFormat::PVRTC4A,
  PixelFormat::PVRTC2, PixelFormat::PVRTC2A, PixelFormat::ETC, PixelFormat::S3TC_DXT1,
  PixelFormat::S3TC_DXT3, PixelFormat::S3TC_DXT5, PixelFormat::ATC_RGB, PixelFormat::ATC_EXPLICIT_ALPHA,
  PixelFormat::ATC_INTERPOLATED_ALPHA, PixelFormat::DEFAULT = AUTO, NONE = -1
}
 
typedef std::map< Texture2D::PixelFormat, const PixelFormatInfoPixelFormatInfoMap
 
typedef struct ParaEngine::Texture2D::_TexParams TexParams
 

Public Member Functions

bool initWithImage (Image *image)
 
bool initWithImage (Image *image, PixelFormat format)
 
int getNumberOfMipmaps ()
 
int getPixelsWide () const
 Gets the width of the texture in pixels. More...
 
int getPixelsHigh () const
 Gets the height of the texture in pixels. More...
 
bool initWithData (const void *data, size_t dataLen, Texture2D::PixelFormat pixelFormat, int pixelsWide, int pixelsHigh, const Size &contentSize)
 
bool updateWithData (const void *data, int offsetX, int offsetY, int width, int height)
 
GLuint getName () const
 
void setTexParameters (const TexParams &texParams)
 
void setAliasTexParameters ()
 
void setAntiAliasTexParameters ()
 
- Public Member Functions inherited from ParaEngine::CRefCounted
void addref () const
 add reference count of the object. More...
 
bool delref () const
 decrease reference count of the object. More...
 
int GetRefCount () const
 get the reference count
 
virtual int Release ()
 
CRefCountedAddToAutoReleasePool ()
 addref and releases the ownership sometime soon automatically (usually at the end of the current frame). More...
 

Static Public Member Functions

static const PixelFormatInfoMap & getPixelFormatInfoMap ()
 

Additional Inherited Members

- Protected Attributes inherited from ParaEngine::CRefCounted
int m_refcount
 

Member Enumeration Documentation

§ PixelFormat

Enumerator
AUTO 

auto detect the type

BGRA8888 

32-bit texture: BGRA8888

RGBA8888 

32-bit texture: RGBA8888

RGB888 

24-bit texture: RGBA888

RGB565 

16-bit texture without Alpha channel

A8 

8-bit textures used as masks

I8 

8-bit intensity texture

AI88 

16-bit textures used as masks

RGBA4444 

16-bit textures: RGBA4444

RGB5A1 

16-bit textures: RGB5A1

PVRTC4 

4-bit PVRTC-compressed texture: PVRTC4

PVRTC4A 

4-bit PVRTC-compressed texture: PVRTC4 (has alpha channel)

PVRTC2 

2-bit PVRTC-compressed texture: PVRTC2

PVRTC2A 

2-bit PVRTC-compressed texture: PVRTC2 (has alpha channel)

ETC 

ETC-compressed texture: ETC.

S3TC_DXT1 

S3TC-compressed texture: S3TC_Dxt1.

S3TC_DXT3 

S3TC-compressed texture: S3TC_Dxt3.

S3TC_DXT5 

S3TC-compressed texture: S3TC_Dxt5.

ATC_RGB 

ATITC-compressed texture: ATC_RGB.

ATC_EXPLICIT_ALPHA 

ATITC-compressed texture: ATC_EXPLICIT_ALPHA.

ATC_INTERPOLATED_ALPHA 

ATITC-compressed texture: ATC_INTERPOLATED_ALPHA.

DEFAULT 

Default texture format: AUTO.

Member Function Documentation

§ getPixelsHigh()

int Texture2D::getPixelsHigh ( ) const

Gets the height of the texture in pixels.

§ getPixelsWide()

int Texture2D::getPixelsWide ( ) const

Gets the width of the texture in pixels.


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