Kochol Game Engine  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
kge::gfx::Image Class Reference

#include <Image.h>

Inheritance diagram for kge::gfx::Image:
kge::Resource kge::KgeUnknown

Public Member Functions

 Image (const u32 Handle, const char *FileName, const char *Name, void *ExtraParam)
 Constructor don't use this but use ImageManager And call add from there.
 Image (const char *Name)
 Constructor for creating images later.
 ~Image ()
 Destructor.
bool CreateImage (int Width, int Height, int Depth=1, int BytesPerPixel=4, ImageFormat imgFormat=EIF_BGRA, void *Data=NULL)
 Creates an Image and store it.
u8GetData (u32 MipMapLevel=0)
 Returns the image data.
u32 GetPixels (int XOff, int YOff, int ZOff, int Width, int Height, int Depth, ImageFormat imgFormat, u8 *OutData, u32 MipMapLevel=0)
 copies a region of the image to the OutData. Note: the OutData have not to be NULL
u32 SetData (u8 *pData)
 Sets the image data.
void SetPixels (int XOff, int YOff, int ZOff, int Width, int Height, int Depth, ImageFormat imgFormat, u8 *OutData, u32 MipMapLevel=0)
 Changes the image data.
u32 Scale (u32 Width, u32 Height, u32 Depth, u32 MipMapLevel=0)
 Scales the image or current mipmap.
u8 BuildMipMaps ()
 Build MipMap for this Image.
bool BuildTileMipMap (int NumCols, int NumRows)
 Building the mipmap for a tile based image.
int GetWidth ()
 Returns the image width.
int GetHeight ()
 Returns the image height.
u8GetCompressData (CompressType ct, u32 &Size)
 Returns the compressed data.
int GetBytePerPixel ()
ImageFormat GetFormat ()
- Public Member Functions inherited from kge::Resource
 Resource (const u32 Handle, const char *FileName, const char *Name, void *ExtraParam)
 Constructor.
virtual ~Resource ()
 Destructor.
virtual const char * GetFileName ()
 Return resource file name.
virtual const char * GetName ()
 Return resource name.
virtual u32 GetHandle ()
 Return resource handle.
- Public Member Functions inherited from kge::KgeUnknown
 KgeUnknown ()
 Constructor.
virtual ~KgeUnknown ()
 Destructor.
virtual void AddRef ()
 Add a reference to the object.
virtual void DecRef ()
 Decrease a reference from the object. if its reference count get 0 then the object will destroy.
u32 GetRefCount ()
 Return resource reference count.
const char * GetDebugText ()
 returns the instance debug text.

Protected Member Functions

bool LoadImageFromFile ()
 Loads an image from a file.
void CheckDevilErrors (const char *TextureName)

Protected Attributes

u32 m_iImgID
int m_iWidth
int m_iHeight
int m_ibpp
int m_iBpp
ImageFormat m_eFmt
- Protected Attributes inherited from kge::Resource
char * m_pFileName
char * m_pName
void * m_pExtraParam
u32 m_iHandle
void * m_pMyMgr
 Resource manager pointer.

Detailed Description

Definition at line 27 of file Image.h.

Constructor & Destructor Documentation

kge::gfx::Image::Image ( const u32  Handle,
const char *  FileName,
const char *  Name,
void *  ExtraParam 
)

Constructor don't use this but use ImageManager And call add from there.

kge::gfx::Image::Image ( const char *  Name)

Constructor for creating images later.

kge::gfx::Image::~Image ( )

Destructor.

Member Function Documentation

u8 kge::gfx::Image::BuildMipMaps ( )

Build MipMap for this Image.

bool kge::gfx::Image::BuildTileMipMap ( int  NumCols,
int  NumRows 
)

Building the mipmap for a tile based image.

void kge::gfx::Image::CheckDevilErrors ( const char *  TextureName)
protected
bool kge::gfx::Image::CreateImage ( int  Width,
int  Height,
int  Depth = 1,
int  BytesPerPixel = 4,
ImageFormat  imgFormat = EIF_BGRA,
void *  Data = NULL 
)

Creates an Image and store it.

int kge::gfx::Image::GetBytePerPixel ( )
inline

Definition at line 76 of file Image.h.

u8* kge::gfx::Image::GetCompressData ( CompressType  ct,
u32 Size 
)

Returns the compressed data.

u8* kge::gfx::Image::GetData ( u32  MipMapLevel = 0)

Returns the image data.

ImageFormat kge::gfx::Image::GetFormat ( )
inline

Definition at line 77 of file Image.h.

int kge::gfx::Image::GetHeight ( )
inline

Returns the image height.

Definition at line 71 of file Image.h.

u32 kge::gfx::Image::GetPixels ( int  XOff,
int  YOff,
int  ZOff,
int  Width,
int  Height,
int  Depth,
ImageFormat  imgFormat,
u8 OutData,
u32  MipMapLevel = 0 
)

copies a region of the image to the OutData. Note: the OutData have not to be NULL

int kge::gfx::Image::GetWidth ( )
inline

Returns the image width.

Definition at line 68 of file Image.h.

bool kge::gfx::Image::LoadImageFromFile ( )
protected

Loads an image from a file.

u32 kge::gfx::Image::Scale ( u32  Width,
u32  Height,
u32  Depth,
u32  MipMapLevel = 0 
)

Scales the image or current mipmap.

u32 kge::gfx::Image::SetData ( u8 pData)

Sets the image data.

void kge::gfx::Image::SetPixels ( int  XOff,
int  YOff,
int  ZOff,
int  Width,
int  Height,
int  Depth,
ImageFormat  imgFormat,
u8 OutData,
u32  MipMapLevel = 0 
)

Changes the image data.

Member Data Documentation

ImageFormat kge::gfx::Image::m_eFmt
protected

Definition at line 86 of file Image.h.

int kge::gfx::Image::m_ibpp
protected

Definition at line 82 of file Image.h.

int kge::gfx::Image::m_iBpp
protected

Definition at line 82 of file Image.h.

int kge::gfx::Image::m_iHeight
protected

Definition at line 82 of file Image.h.

u32 kge::gfx::Image::m_iImgID
protected

Definition at line 81 of file Image.h.

int kge::gfx::Image::m_iWidth
protected

Definition at line 82 of file Image.h.


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