CTexture Class Reference

Inheritance diagram for CTexture:

CSurface List of all members.

Public Member Functions

 CTexture ()
 CTexture (Int32 w, Int32 h, Int32 d, Int32 imgSize)
 CTexture (const CTexture &copy)
CTextureoperator= (const CTexture &rhs)
 ~CTexture ()
CSurfaceget_mipmap (Int32 index)
int get_num_mipmaps ()
 operator char * ()
void create (Int32 w, Int32 h, Int32 d, Int32 imgsize)
void clear ()
Int32 get_width ()
Int32 get_height ()
Int32 get_depth ()
Int32 get_size ()
char * get_pixels ()

Protected Attributes

std::vector< CSurfacemipmaps
Int32 width
Int32 height
Int32 depth
Int32 size
char * pixels

Friends

class CDDSImage

Detailed Description

Definition at line 202 of file OSGDDSImageFileType.cpp.


Constructor & Destructor Documentation

CTexture::CTexture (  ) 

Definition at line 1128 of file OSGDDSImageFileType.cpp.

01129   : CSurface()  // initialize base class part
01130 {
01131 }

CTexture::CTexture ( Int32  w,
Int32  h,
Int32  d,
Int32  imgSize 
)

Definition at line 1135 of file OSGDDSImageFileType.cpp.

01136   : CSurface(w, h, d, imgSize)  // initialize base class part
01137 {
01138 }

CTexture::CTexture ( const CTexture copy  ) 

Definition at line 1142 of file OSGDDSImageFileType.cpp.

References mipmaps.

01143   : CSurface(copy)
01144 {
01145     for (UInt32 i = 0; i < copy.mipmaps.size(); i++)
01146         mipmaps.push_back(copy.mipmaps[i]);
01147 }

CTexture::~CTexture (  ) 

Definition at line 1169 of file OSGDDSImageFileType.cpp.

References mipmaps.

01170 {
01171     mipmaps.clear();
01172 }


Member Function Documentation

CTexture & CTexture::operator= ( const CTexture rhs  ) 

Definition at line 1151 of file OSGDDSImageFileType.cpp.

References mipmaps, and CSurface::operator=().

01152 {
01153     if (this != &rhs)
01154     {
01155         CSurface::operator = (rhs);
01156 
01157         mipmaps.clear();
01158         for (UInt32 i = 0; i < rhs.mipmaps.size(); i++)
01159         {
01160             mipmaps.push_back(rhs.mipmaps[i]);
01161         }
01162     }
01163 
01164     return *this;
01165 }

CSurface& CTexture::get_mipmap ( Int32  index  )  [inline]

Definition at line 214 of file OSGDDSImageFileType.cpp.

References mipmaps.

00215     { 
00216         assert(index < (Int32)mipmaps.size());
00217         return mipmaps[index]; 
00218     }

int CTexture::get_num_mipmaps (  )  [inline]

Definition at line 220 of file OSGDDSImageFileType.cpp.

References mipmaps.

00220 { return (Int32)mipmaps.size(); }

CSurface::operator char * (  )  [inherited]

Definition at line 1252 of file OSGDDSImageFileType.cpp.

References CSurface::pixels.

01253 { 
01254     return pixels; 
01255 }

void CSurface::create ( Int32  w,
Int32  h,
Int32  d,
Int32  imgsize 
) [inherited]

Definition at line 1260 of file OSGDDSImageFileType.cpp.

References CSurface::clear(), CSurface::depth, CSurface::height, CSurface::pixels, CSurface::size, and CSurface::width.

Referenced by CSurface::CSurface().

01261 {
01262     clear();
01263 
01264     width = w;
01265     height = h;
01266     depth = d;
01267     size = imgsize;
01268     pixels = new char[imgsize];
01269 }

void CSurface::clear (  )  [inherited]

Definition at line 1274 of file OSGDDSImageFileType.cpp.

References CSurface::pixels.

Referenced by CSurface::create(), CSurface::operator=(), and CSurface::~CSurface().

01275 {
01276     delete [] pixels;
01277     pixels = NULL;
01278 }

Int32 CSurface::get_width (  )  [inline, inherited]

Definition at line 186 of file OSGDDSImageFileType.cpp.

References CSurface::width.

00186 { return width; }

Int32 CSurface::get_height (  )  [inline, inherited]

Definition at line 187 of file OSGDDSImageFileType.cpp.

References CSurface::height.

00187 { return height; }

Int32 CSurface::get_depth (  )  [inline, inherited]

Definition at line 188 of file OSGDDSImageFileType.cpp.

References CSurface::depth.

00188 { return depth; }

Int32 CSurface::get_size (  )  [inline, inherited]

Definition at line 189 of file OSGDDSImageFileType.cpp.

References CSurface::size.

00189 { return size; }

char* CSurface::get_pixels (  )  [inline, inherited]

Definition at line 190 of file OSGDDSImageFileType.cpp.

References CSurface::pixels.

00190 { return pixels; }


Friends And Related Function Documentation

friend class CDDSImage [friend]

Reimplemented from CSurface.

Definition at line 204 of file OSGDDSImageFileType.cpp.


Member Data Documentation

std::vector<CSurface> CTexture::mipmaps [protected]

Definition at line 223 of file OSGDDSImageFileType.cpp.

Referenced by CTexture(), get_mipmap(), get_num_mipmaps(), operator=(), and ~CTexture().

Int32 CSurface::width [protected, inherited]

Int32 CSurface::height [protected, inherited]

Int32 CSurface::depth [protected, inherited]

Int32 CSurface::size [protected, inherited]

char* CSurface::pixels [protected, inherited]


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