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 170 of file OSGDDSImageFileType.cpp.


Constructor & Destructor Documentation

CSurface::CSurface (  ) 

Definition at line 1143 of file OSGDDSImageFileType.cpp.

01144   : width(0),
01145     height(0),
01146     depth(0),
01147     size(0),
01148     pixels(NULL)
01149 {
01150 }

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

Definition at line 1154 of file OSGDDSImageFileType.cpp.

References create(), and pixels.

01155 {
01156     pixels = NULL;
01157     create(w, h, d, imgsize);
01158 }

CSurface::CSurface ( const CSurface copy  ) 

Definition at line 1162 of file OSGDDSImageFileType.cpp.

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

01163   : width(0),
01164     height(0),
01165     depth(0),
01166     size(0),
01167     pixels(NULL)
01168 {
01169 
01170     if (copy.pixels)
01171     {
01172         size = copy.size;
01173         width = copy.width;
01174         height = copy.height;
01175         depth = copy.depth;
01176         pixels = new char[size];
01177         memcpy(pixels, copy.pixels, copy.size);
01178     }
01179 }

CSurface::~CSurface (  )  [virtual]

Definition at line 1206 of file OSGDDSImageFileType.cpp.

References clear().

01207 {
01208     clear();
01209 }


Member Function Documentation

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

Definition at line 1183 of file OSGDDSImageFileType.cpp.

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

Referenced by CTexture::operator=().

01184 {
01185     if (this != &rhs)
01186     {
01187         clear();
01188 
01189         if (rhs.pixels)
01190         {
01191             size = rhs.size;
01192             width = rhs.width;
01193             height = rhs.height;
01194             depth = rhs.depth;
01195 
01196             pixels = new char[size];
01197             memcpy(pixels, rhs.pixels, size);
01198         }
01199     }
01200 
01201     return *this;
01202 }

CSurface::operator char * (  ) 

Definition at line 1213 of file OSGDDSImageFileType.cpp.

References pixels.

01214 {
01215     return pixels;
01216 }

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

Definition at line 1220 of file OSGDDSImageFileType.cpp.

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

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

Definition at line 1233 of file OSGDDSImageFileType.cpp.

References pixels.

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

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

Int32 CSurface::get_width (  )  [inline]

Definition at line 187 of file OSGDDSImageFileType.cpp.

References width.

00187 { return width; }

Int32 CSurface::get_height (  )  [inline]

Definition at line 188 of file OSGDDSImageFileType.cpp.

References height.

00188 { return height; }

Int32 CSurface::get_depth (  )  [inline]

Definition at line 189 of file OSGDDSImageFileType.cpp.

References depth.

00189 { return depth; }

Int32 CSurface::get_size (  )  [inline]

Definition at line 190 of file OSGDDSImageFileType.cpp.

References size.

00190 { return size; }

char* CSurface::get_pixels (  )  [inline]

Definition at line 191 of file OSGDDSImageFileType.cpp.

References pixels.

00191 { return pixels; }


Friends And Related Function Documentation

friend class CTexture [friend]

Definition at line 172 of file OSGDDSImageFileType.cpp.

friend class CDDSImage [friend]

Reimplemented in CTexture.

Definition at line 173 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:

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