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

Public Types

enum  Format {
  Format::JPG, Format::PNG, Format::TIFF, Format::WEBP,
  Format::PVR, Format::ETC, Format::S3TC, Format::ATITC,
  Format::TGA, Format::RAW_DATA, Format::UNKNOWN
}
 Supported formats for Image. More...
 

Public Member Functions

bool initWithImageData (const unsigned char *data, size_t dataLen)
 
bool initWithRawData (const unsigned char *data, size_t dataLen, int width, int height, int bitsPerComponent, bool preMulti=false)
 
bool saveToFile (const std::string &filename, bool isToRGB=true)
 
float getWidth ()
 
float getHeight ()
 
Texture2D::PixelFormat getRenderFormat ()
 
int getNumberOfMipmaps ()
 
const char * getFilePath () const
 
unsigned char * getData () const
 
int getDataLen () const
 
MipmapInfogetMipmaps ()
 
bool isCompressed () const
 
bool hasPremultipliedAlpha () const
 
- 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 Attributes

static bool supportsS3TC = false
 
static bool PNG_PREMULTIPLIED_ALPHA_ENABLED = true
 
static int MaxTextureSize = 1024 * 8
 

Protected Member Functions

bool isPng (const unsigned char *data, size_t dataLen)
 
bool isEtc (const unsigned char *data, size_t dataLen)
 
bool isS3TC (const unsigned char *data, size_t dataLen)
 
bool isATITC (const unsigned char *data, size_t dataLen)
 
bool isJpg (const unsigned char *data, size_t dataLen)
 
bool isTiff (const unsigned char *data, size_t dataLen)
 
bool isWebp (const unsigned char *data, size_t dataLen)
 
bool isPvr (const unsigned char *data, size_t dataLen)
 
Format detectFormat (const unsigned char *, size_t unpackedLen)
 
bool initWithJpgData (const unsigned char *unpackedData, size_t unpackedLen)
 
bool initWithPngData (const unsigned char *unpackedData, size_t unpackedLen)
 
bool initWithS3TCData (const unsigned char *unpackedData, size_t unpackedLen)
 
void premultipliedAlpha ()
 

Protected Attributes

Texture2D::PixelFormat _renderFormat
 
float _width
 
float _height
 
bool _hasPremultipliedAlpha
 
int _dataLen
 
unsigned char * _data
 
Format _fileType
 
int _numberOfMipmaps
 
MipmapInfo _mipmaps [MIPMAP_MAX]
 
- Protected Attributes inherited from ParaEngine::CRefCounted
int m_refcount
 

Static Protected Attributes

static const int MIPMAP_MAX = 16
 

Member Enumeration Documentation

§ Format

Supported formats for Image.

Enumerator
JPG 

JPEG.

PNG 

PNG.

TIFF 

TIFF.

WEBP 

WebP.

PVR 

PVR.

ETC 

ETC.

S3TC 

S3TC.

ATITC 

ATITC.

TGA 

TGA.

RAW_DATA 

Raw Data.

UNKNOWN 

Unknown format.


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