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)
Int32 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 1091 of file OSGDDSImageFileType.cpp.

01092   : CSurface()  // initialize base class part
01093 {
01094 }

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

Definition at line 1098 of file OSGDDSImageFileType.cpp.

01099   : CSurface(w, h, d, imgSize)  // initialize base class part
01100 {
01101 }

CTexture::CTexture ( const CTexture copy  ) 

Definition at line 1105 of file OSGDDSImageFileType.cpp.

References mipmaps.

01106   : CSurface(copy)
01107 {
01108     for (UInt32 i = 0; i < copy.mipmaps.size(); i++)
01109         mipmaps.push_back(copy.mipmaps[i]);
01110 }

CTexture::~CTexture (  ) 

Definition at line 1132 of file OSGDDSImageFileType.cpp.

References mipmaps.

01133 {
01134     mipmaps.clear();
01135 }


Member Function Documentation

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

Definition at line 1114 of file OSGDDSImageFileType.cpp.

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

01115 {
01116     if (this != &rhs)
01117     {
01118         CSurface::operator = (rhs);
01119 
01120         mipmaps.clear();
01121         for (UInt32 i = 0; i < rhs.mipmaps.size(); i++)
01122         {
01123             mipmaps.push_back(rhs.mipmaps[i]);
01124         }
01125     }
01126 
01127     return *this;
01128 }

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

Definition at line 213 of file OSGDDSImageFileType.cpp.

References mipmaps.

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

Int32 CTexture::get_num_mipmaps (  )  [inline]

Definition at line 219 of file OSGDDSImageFileType.cpp.

References mipmaps.

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

CSurface::operator char * (  )  [inherited]

Definition at line 1213 of file OSGDDSImageFileType.cpp.

References CSurface::pixels.

01214 {
01215     return pixels;
01216 }

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

Definition at line 1220 of file OSGDDSImageFileType.cpp.

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

Referenced by CSurface::CSurface().

01221 {
01222     clear();
01223 
01224     width = w;
01225     height = h;
01226     depth = d;
01227     size = imgsize;
01228     pixels = new char[imgsize];
01229 }

void CSurface::clear ( void   )  [inherited]

Definition at line 1233 of file OSGDDSImageFileType.cpp.

References CSurface::pixels.

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

01234 {
01235     delete [] pixels;
01236     pixels = NULL;
01237 }

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

Definition at line 187 of file OSGDDSImageFileType.cpp.

References CSurface::width.

00187 { return width; }

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

Definition at line 188 of file OSGDDSImageFileType.cpp.

References CSurface::height.

00188 { return height; }

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

Definition at line 189 of file OSGDDSImageFileType.cpp.

References CSurface::depth.

00189 { return depth; }

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

Definition at line 190 of file OSGDDSImageFileType.cpp.

References CSurface::size.

00190 { return size; }

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

Definition at line 191 of file OSGDDSImageFileType.cpp.

References CSurface::pixels.

00191 { 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]

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:

Generated on Mon Mar 17 12:02:58 2008 for OpenSG by  doxygen 1.5.5