CSurface Class Reference

Inheritance diagram for CSurface:

CTexture List of all members.

Public Member Functions

 CSurface ()
 CSurface (Int32 w, Int32 h, Int32 d, Int32 imgsize)
 CSurface (const CSurface &copy)
CSurfaceoperator= (const CSurface &rhs)
virtual ~CSurface ()
 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

Int32 width
Int32 height
Int32 depth
Int32 size
char * pixels

Friends

class CTexture
class CDDSImage

Detailed Description

Definition at line 168 of file OSGDDSImageFileType.cpp.


Constructor & Destructor Documentation

CSurface::CSurface (  ) 

Definition at line 1180 of file OSGDDSImageFileType.cpp.

01181   : width(0),
01182     height(0),
01183     depth(0),
01184     size(0),
01185     pixels(NULL)
01186 {
01187 }

CSurface::CSurface ( Int32  w,
Int32  h,
Int32  d,
Int32  imgsize 
)

Definition at line 1191 of file OSGDDSImageFileType.cpp.

References create(), and pixels.

01192 {
01193     pixels = NULL;
01194     create(w, h, d, imgsize);
01195 }

CSurface::CSurface ( const CSurface copy  ) 

Definition at line 1199 of file OSGDDSImageFileType.cpp.

References depth, height, pixels, size, and width.

01200   : width(0),
01201     height(0),
01202     depth(0),
01203     size(0),
01204     pixels(NULL)
01205 {
01206 
01207     if (copy.pixels)
01208     {
01209         size = copy.size;
01210         width = copy.width;
01211         height = copy.height;
01212         depth = copy.depth;
01213         pixels = new char[size];
01214         memcpy(pixels, copy.pixels, copy.size);
01215     }
01216 }

CSurface::~CSurface (  )  [virtual]

Definition at line 1244 of file OSGDDSImageFileType.cpp.

References clear().

01245 {
01246     clear();
01247 }


Member Function Documentation

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

Definition at line 1220 of file OSGDDSImageFileType.cpp.

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

Referenced by CTexture::operator=().

01221 {
01222     if (this != &rhs)
01223     {
01224         clear();
01225 
01226         if (rhs.pixels)
01227         {
01228             size = rhs.size;
01229             width = rhs.width;
01230             height = rhs.height;
01231             depth = rhs.depth;
01232 
01233             pixels = new char[size];
01234             memcpy(pixels, rhs.pixels, size);
01235         }
01236     }
01237 
01238     return *this;
01239 }

CSurface::operator char * (  ) 

Definition at line 1252 of file OSGDDSImageFileType.cpp.

References pixels.

01253 { 
01254     return pixels; 
01255 }

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

Definition at line 1260 of file OSGDDSImageFileType.cpp.

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

Referenced by 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 (  ) 

Definition at line 1274 of file OSGDDSImageFileType.cpp.

References pixels.

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

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

Int32 CSurface::get_width (  )  [inline]

Definition at line 186 of file OSGDDSImageFileType.cpp.

References width.

00186 { return width; }

Int32 CSurface::get_height (  )  [inline]

Definition at line 187 of file OSGDDSImageFileType.cpp.

References height.

00187 { return height; }

Int32 CSurface::get_depth (  )  [inline]

Definition at line 188 of file OSGDDSImageFileType.cpp.

References depth.

00188 { return depth; }

Int32 CSurface::get_size (  )  [inline]

Definition at line 189 of file OSGDDSImageFileType.cpp.

References size.

00189 { return size; }

char* CSurface::get_pixels (  )  [inline]

Definition at line 190 of file OSGDDSImageFileType.cpp.

References pixels.

00190 { return pixels; }


Friends And Related Function Documentation

friend class CTexture [friend]

Definition at line 170 of file OSGDDSImageFileType.cpp.

friend class CDDSImage [friend]

Reimplemented in CTexture.

Definition at line 171 of file OSGDDSImageFileType.cpp.


Member Data Documentation

Int32 CSurface::width [protected]

Int32 CSurface::height [protected]

Int32 CSurface::depth [protected]

Int32 CSurface::size [protected]

char* CSurface::pixels [protected]

Definition at line 199 of file OSGDDSImageFileType.cpp.

Referenced by clear(), create(), CSurface(), get_pixels(), operator char *(), and operator=().


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