Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CSurface Class Reference

Inheritance diagram for CSurface:

CTexture List of all members.

Public Member Functions

 CSurface ()
 CSurface (int w, int h, int d, int imgsize)
 CSurface (const CSurface &copy)
CSurfaceoperator= (const CSurface &rhs)
virtual ~CSurface ()
 operator char * ()
void create (int w, int h, int d, int imgsize)
void clear ()
int get_width ()
int get_height ()
int get_depth ()
int get_size ()
char * get_pixels ()

Protected Attributes

int width
int height
int depth
int size
char * pixels

Friends

class CTexture
class CDDSImage

Detailed Description

Definition at line 167 of file OSGDDSImageFileType.cpp.


Constructor & Destructor Documentation

CSurface::CSurface  ) 
 

Definition at line 1078 of file OSGDDSImageFileType.cpp.

01079   : width(0),
01080     height(0),
01081     depth(0),
01082     size(0),
01083     pixels(NULL)
01084 {
01085 }

CSurface::CSurface int  w,
int  h,
int  d,
int  imgsize
 

Definition at line 1089 of file OSGDDSImageFileType.cpp.

References create(), and pixels.

01090 {
01091     pixels = NULL;
01092     create(w, h, d, imgsize);
01093 }

CSurface::CSurface const CSurface copy  ) 
 

Definition at line 1097 of file OSGDDSImageFileType.cpp.

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

01098   : width(0),
01099     height(0),
01100     depth(0),
01101     size(0),
01102     pixels(NULL)
01103 {
01104 
01105     if (copy.pixels)
01106     {
01107         size = copy.size;
01108         width = copy.width;
01109         height = copy.height;
01110         depth = copy.depth;
01111         pixels = new char[size];
01112         memcpy(pixels, copy.pixels, copy.size);
01113     }
01114 }

CSurface::~CSurface  )  [virtual]
 

Definition at line 1141 of file OSGDDSImageFileType.cpp.

References clear().

01142 {
01143     clear();
01144 }


Member Function Documentation

CSurface & CSurface::operator= const CSurface rhs  ) 
 

Definition at line 1118 of file OSGDDSImageFileType.cpp.

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

Referenced by CTexture::operator=().

01119 {
01120     if (this != &rhs)
01121     {
01122         clear();
01123 
01124         if (rhs.pixels)
01125         {
01126             size = rhs.size;
01127             width = rhs.width;
01128             height = rhs.height;
01129             depth = rhs.depth;
01130 
01131             pixels = new char[size];
01132             memcpy(pixels, rhs.pixels, size);
01133         }
01134     }
01135 
01136     return *this;
01137 }

CSurface::operator char *  ) 
 

Definition at line 1148 of file OSGDDSImageFileType.cpp.

References pixels.

01149 { 
01150     return pixels; 
01151 }

void CSurface::create int  w,
int  h,
int  d,
int  imgsize
 

Definition at line 1155 of file OSGDDSImageFileType.cpp.

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

Referenced by CSurface().

01156 {
01157     clear();
01158 
01159     width = w;
01160     height = h;
01161     depth = d;
01162     size = imgsize;
01163     pixels = new char[imgsize];
01164 }

void CSurface::clear  ) 
 

Definition at line 1168 of file OSGDDSImageFileType.cpp.

References pixels.

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

01169 {
01170     delete [] pixels;
01171     pixels = NULL;
01172 }

int CSurface::get_width  )  [inline]
 

Definition at line 184 of file OSGDDSImageFileType.cpp.

References width.

00184 { return width; }

int CSurface::get_height  )  [inline]
 

Definition at line 185 of file OSGDDSImageFileType.cpp.

References height.

00185 { return height; }

int CSurface::get_depth  )  [inline]
 

Definition at line 186 of file OSGDDSImageFileType.cpp.

References depth.

00186 { return depth; }

int CSurface::get_size  )  [inline]
 

Definition at line 187 of file OSGDDSImageFileType.cpp.

References size.

00187 { return size; }

char* CSurface::get_pixels  )  [inline]
 

Definition at line 188 of file OSGDDSImageFileType.cpp.

References pixels.

00188 { return pixels; }


Friends And Related Function Documentation

friend class CTexture [friend]
 

Definition at line 169 of file OSGDDSImageFileType.cpp.

friend class CDDSImage [friend]
 

Reimplemented in CTexture.

Definition at line 170 of file OSGDDSImageFileType.cpp.


Member Data Documentation

int CSurface::width [protected]
 

Definition at line 191 of file OSGDDSImageFileType.cpp.

Referenced by CDDSImage::align_memory(), create(), CSurface(), get_width(), CDDSImage::load(), and operator=().

int CSurface::height [protected]
 

Definition at line 192 of file OSGDDSImageFileType.cpp.

Referenced by CDDSImage::align_memory(), create(), CSurface(), get_height(), and operator=().

int CSurface::depth [protected]
 

Definition at line 193 of file OSGDDSImageFileType.cpp.

Referenced by CDDSImage::align_memory(), create(), CSurface(), get_depth(), and operator=().

int CSurface::size [protected]
 

Definition at line 194 of file OSGDDSImageFileType.cpp.

Referenced by CDDSImage::align_memory(), create(), CSurface(), get_size(), CDDSImage::load(), and operator=().

char* CSurface::pixels [protected]
 

Definition at line 196 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 Thu Aug 25 04:12:25 2005 for OpenSG by  doxygen 1.4.3