Main Page -
Class Hierarchy -
Class List -
File List -
Class Members -
Related Pages -

Information | Reference | SourceForge Project | Author
Muli3D

Reference: Muli3D: CMuli3DSurface Class Reference

CMuli3DSurface Class Reference

#include <m3dcore_surface.h>

Inheritance diagram for CMuli3DSurface:

IBase List of all members.

Detailed Description

CMuli3DSurface implements a 2-dimensional image.


Public Member Functions

result Clear (const vector4 &i_vColor, const m3drect *i_pRect)
result CopyToSurface (const m3drect *i_pSrcRect, CMuli3DSurface *i_pDestSurface, const m3drect *i_pDestRect, m3dtexturefilter i_Filter)
m3dformat fmtGetFormat ()
uint32 iGetFormatFloats ()
uint32 iGetHeight ()
uint32 iGetWidth ()
result LockRect (void **o_ppData, const m3drect *i_pRect)
CMuli3DDevicepGetDevice ()
void SampleLinear (vector4 &o_vColor, float32 i_fU, float32 i_fV)
void SamplePoint (vector4 &o_vColor, float32 i_fU, float32 i_fV)
result UnlockRect ()

Protected Member Functions

 CMuli3DSurface (class CMuli3DDevice *i_pParent)
result Create (uint32 i_iWidth, uint32 i_iHeight, m3dformat i_fmtFormat)
 ~CMuli3DSurface ()


Constructor & Destructor Documentation

CMuli3DSurface::~CMuli3DSurface  )  [protected]
 

Accessible by IBase. The destructor is called when the reference count reaches zero.

CMuli3DSurface::CMuli3DSurface class CMuli3DDevice i_pParent  )  [protected]
 

Accessible by CMuli3DDevice which is the only class that may create a surface.

Parameters:
[in] i_pParent a pointer to the parent CMuli3DDevice-object.


Member Function Documentation

result CMuli3DSurface::Clear const vector4 &  i_vColor,
const m3drect i_pRect
 

Clears the surface to a given color.

Parameters:
[in] i_vColor color to clear the surface to.
[in] i_pRect rectangle to restrict clearing to.
Returns:
s_ok if the function succeeds.

e_invalidparameters if the clear-rectangle exceeds the surface's dimensions.

result CMuli3DSurface::CopyToSurface const m3drect i_pSrcRect,
CMuli3DSurface i_pDestSurface,
const m3drect i_pDestRect,
m3dtexturefilter  i_Filter
 

Copies the contents of the surface to another surface using the specified filtering method.

Parameters:
[in] i_pSrcRect source rectangle to copy to the other surface. (Pass 0 to copy the entire surface.)
[in] i_pDestSurface destination surface.
[in] i_pDestRect destination-rectangle. (Pass 0 for the entire destination-surface.)
[in] i_Filter texture filter.
Returns:
s_ok if the function succeeds.

e_invalidparameters if one of the two rectangles is invalid or exceeds surface-dimensions.

e_invalidstate if the destination surface couldn't be locked.

result CMuli3DSurface::Create uint32  i_iWidth,
uint32  i_iHeight,
m3dformat  i_fmtFormat
[protected]
 

Accessible by CMuli3DDevice which is the only class that may create a surface.

Parameters:
[in] i_iWidth width of the surface to be created in pixels.
[in] i_iHeight height of the surface to be created in pixels.
[in] i_fmtFormat format of the surface to be created. Member of the enumeration m3dformat; m3dfmt_r32f, m3dfmt_r32g32f, m3dfmt_r32g32b32f or m3dfmt_r32g32b32a32f.
Returns:
s_ok if the function succeeds.

e_invalidparameters if one or more parameters were invalid.

e_outofmemory if memory allocation failed.

e_invalidformat if an invalid format was encountered.

m3dformat CMuli3DSurface::fmtGetFormat  ) 
 

Returns the format of the surface. Member of the enumeration m3dformat; m3dfmt_r32f, m3dfmt_r32g32f, m3dfmt_r32g32b32f or m3dfmt_r32g32b32a32f.

uint32 CMuli3DSurface::iGetFormatFloats  ) 
 

Returns the number of floats of the format, e [1,4].

uint32 CMuli3DSurface::iGetHeight  ) 
 

Returns the height of the surface in pixels.

uint32 CMuli3DSurface::iGetWidth  ) 
 

Returns the width of the surface in pixels.

result CMuli3DSurface::LockRect void **  o_ppData,
const m3drect i_pRect
 

Returns a pointer to the contents of the surface.

Parameters:
[out] o_ppData receives the pointer to the surface-data.
[in] i_pRect area that will be locked and accessible. (Pass in 0 to lock the entire surface.)
Returns:
s_ok if the function succeeds.

e_invalidparameters if one or more parameters were invalid.

e_invalidstate if the surface is already locked.

e_outofmemory if memory allocation failed.

Note:
Locking the entire surface is a lot faster than locking a sub-region, because no lock-buffer has to be created and the application may write to the surface directly.

class CMuli3DDevice* CMuli3DSurface::pGetDevice  ) 
 

Returns a pointer to the associated device. Calling this function will increase the internal reference count of the device. Failure to call Release() when finished using the pointer will result in a memory leak.

void CMuli3DSurface::SampleLinear vector4 &  o_vColor,
float32  i_fU,
float32  i_fV
 

Samples the surface using bi-linear filtering.

Parameters:
[out] o_vColor receives the color of the pixel to be looked up.
[in] i_fU u-component of the lookup-vector.
[in] i_fV v-component of the lookup-vector.

void CMuli3DSurface::SamplePoint vector4 &  o_vColor,
float32  i_fU,
float32  i_fV
 

Samples the surface using nearest point sampling.

Parameters:
[out] o_vColor receives the color of the pixel to be looked up.
[in] i_fU u-component of the lookup-vector.
[in] i_fV v-component of the lookup-vector.

result CMuli3DSurface::UnlockRect  ) 
 

Unlocks the surface; modifications to its contents will become active.

Returns:
s_ok if the function succeeds.

e_invalidstate if the surface is not locked.

Documentation created with doxygen SourceForge.net Logo