CL_Texture Class Reference
[clanDisplay Display]

Texture object class. More...

#include <texture.h>

List of all members.

Public Member Functions

Construction

 CL_Texture ()
 Constructs a null instance.
 CL_Texture (CL_GraphicContext &context, CL_TextureDimensions texture_dimensions)
 Constructs a Texture.
 CL_Texture (CL_GraphicContext &context, int width, int height, CL_TextureFormat internal_format=cl_rgba)
 Constructs a Texture.
 CL_Texture (CL_GraphicContext &context, int width, int height, int depth, CL_TextureFormat internal_format=cl_rgba)
 Constructs a 3D Texture.
 CL_Texture (CL_GraphicContext &context, const CL_Size &size, CL_TextureFormat internal_format=cl_rgba)
 Constructs a Texture.
 CL_Texture (CL_GraphicContext &context, const CL_StringRef &fullname, const CL_ImageImportDescription &import_desc=CL_ImageImportDescription())
 CL_Texture (CL_GraphicContext &context, const CL_StringRef &filename, const CL_VirtualDirectory &directory, const CL_ImageImportDescription &import_desc=CL_ImageImportDescription())
 CL_Texture (CL_GraphicContext &context, CL_IODevice &file, const CL_String &image_type, const CL_ImageImportDescription &import_desc=CL_ImageImportDescription())
 CL_Texture (CL_GraphicContext &gc, const CL_StringRef &resource_id, CL_ResourceManager *resources, const CL_ImageImportDescription &import_desc=CL_ImageImportDescription())
 CL_Texture (CL_SharedPtr< CL_Texture_Impl > &impl)
 Constructs a texture from an implementation.
virtual ~CL_Texture ()
Operators

bool operator== (const CL_Texture &other) const
 Equality operator.
bool operator!= (const CL_Texture &other) const
 Inequality operator.
bool operator< (const CL_Texture &other) const
 Less than operator.
Attributes

bool is_null () const
 Returns true if this object is invalid.
void throw_if_null () const
 Throw an exception if this object is invalid.
int get_width () const
 Get the texture width.
int get_height () const
 Get the texture height.
CL_Size get_size () const
 Get the texture size.
int get_depth () const
 Get the texture depth.
CL_PixelBuffer get_pixeldata (int level=0) const
 Retrieve image data from texture.
CL_PixelBuffer get_pixeldata (CL_TextureFormat sized_format, int level=0) const
 Get pixeldata.
float get_min_lod () const
 Get the minimum level of detail.
float get_max_lod () const
 Get the maximum level of detail.
float get_lod_bias () const
 Get the level of detail bias constant.
int get_base_level () const
 Get the texture base level.
int get_max_level () const
 Get the texture max level.
CL_TextureWrapMode get_wrap_mode_s () const
 Get the texture wrap mode for the s coordinate.
CL_TextureWrapMode get_wrap_mode_t () const
 Get the texture wrap mode for the t coordinate.
CL_TextureWrapMode get_wrap_mode_r () const
 Get the texture wrap mode for the r coordinate.
CL_TextureFilter get_min_filter () const
 Get the texture minification filter.
CL_TextureFilter get_mag_filter () const
 Get the texture magnification filter.
bool is_resident () const
 Returns true if texture is resident in texture memory.
CL_TextureCompareMode get_compare_mode () const
 Get the texture compare mode.
CL_CompareFunction get_compare_function () const
 Get the texture compare function.
CL_TextureProviderget_provider () const
 Get Provider.
CL_WeakPtr< CL_Texture_Impl > get_impl () const
 Get the implementation weakptr.
Operations

void generate_mipmap ()
 Generate the mipmap.
void set_image (CL_PixelBuffer &image, int level=0)
 Upload image to texture.
void set_cube_map (CL_PixelBuffer &cube_map_positive_x, CL_PixelBuffer &cube_map_negative_x, CL_PixelBuffer &cube_map_positive_y, CL_PixelBuffer &cube_map_negative_y, CL_PixelBuffer &cube_map_positive_z, CL_PixelBuffer &cube_map_negative_z, int level=0)
 Upload cube map.
void set_compressed_image (int level, CL_TextureFormat internal_format, int width, int height, CL_DataBuffer &image)
void set_subimage (int x, int y, const CL_PixelBuffer &image, const CL_Rect &src_rect, int level=0)
 Upload image to sub texture.
void set_subimage (const CL_Point &point, const CL_PixelBuffer &image, const CL_Rect &src_rect, int level=0)
void copy_image_from (CL_GraphicContext &context, int level, CL_TextureFormat internal_format=cl_rgba)
 Copy image data from a graphic context.
void copy_image_from (CL_GraphicContext &context, int x, int y, int width, int height, int level=0, CL_TextureFormat internal_format=cl_rgba)
void copy_image_from (CL_GraphicContext &context, const CL_Rect &pos, int level=0, CL_TextureFormat internal_format=cl_rgba)
void copy_subimage_from (CL_GraphicContext &context, int offset_x, int offset_y, int x, int y, int width, int height, int level=0)
 Copy sub image data from a graphic context.
void copy_subimage_from (CL_GraphicContext &context, const CL_Point &offset, const CL_Rect &pos, int level=0)
void set_min_lod (float min_lod)
 Set the minimum level of detail texture parameter.
void set_max_lod (float max_lod)
 Set the maximum level of detail texture parameter.
void set_lod_bias (float lod_bias)
 Sets the level of detail bias constant.
void set_base_level (int base_level)
 Sets the texture base level texture parameter.
void set_max_level (int max_level)
 Sets the texture max level texture parameter.
void set_wrap_mode (CL_TextureWrapMode wrap_s, CL_TextureWrapMode wrap_t, CL_TextureWrapMode wrap_r)
 Set the texture wrapping mode.
void set_wrap_mode (CL_TextureWrapMode wrap_s, CL_TextureWrapMode wrap_t)
void set_wrap_mode (CL_TextureWrapMode wrap_s)
void set_min_filter (CL_TextureFilter filter)
 Set the minification filter.
void set_mag_filter (CL_TextureFilter filter)
 Set the magnification filter.
void set_max_anisotropy (float max_anisotropy)
 Set the maximum degree of anisotropy.
void set_texture_compare (CL_TextureCompareMode mode, CL_CompareFunction func)
 Sets the texture compare mode and compare function texture parameters.

Detailed Description

Texture object class.


Constructor & Destructor Documentation

CL_Texture::CL_Texture (  ) 

Constructs a null instance.

CL_Texture::CL_Texture ( CL_GraphicContext context,
CL_TextureDimensions  texture_dimensions 
)

Constructs a Texture.

Parameters:
context = Graphic Context
texture_dimensions = Texture Dimensions
CL_Texture::CL_Texture ( CL_GraphicContext context,
int  width,
int  height,
CL_TextureFormat  internal_format = cl_rgba 
)

Constructs a Texture.

Parameters:
context = Graphic Context
width = value
height = value
internal_format = Texture Format
CL_Texture::CL_Texture ( CL_GraphicContext context,
int  width,
int  height,
int  depth,
CL_TextureFormat  internal_format = cl_rgba 
)

Constructs a 3D Texture.

Parameters:
context = Graphic Context
width = value
height = value
depth = value
internal_format = Texture Format
CL_Texture::CL_Texture ( CL_GraphicContext context,
const CL_Size size,
CL_TextureFormat  internal_format = cl_rgba 
)

Constructs a Texture.

Parameters:
context = Graphic Context
size = Size
internal_format = Texture Format
CL_Texture::CL_Texture ( CL_GraphicContext context,
const CL_StringRef fullname,
const CL_ImageImportDescription import_desc = CL_ImageImportDescription() 
)
CL_Texture::CL_Texture ( CL_GraphicContext context,
const CL_StringRef filename,
const CL_VirtualDirectory directory,
const CL_ImageImportDescription import_desc = CL_ImageImportDescription() 
)
CL_Texture::CL_Texture ( CL_GraphicContext context,
CL_IODevice file,
const CL_String image_type,
const CL_ImageImportDescription import_desc = CL_ImageImportDescription() 
)
CL_Texture::CL_Texture ( CL_GraphicContext gc,
const CL_StringRef resource_id,
CL_ResourceManager resources,
const CL_ImageImportDescription import_desc = CL_ImageImportDescription() 
)
CL_Texture::CL_Texture ( CL_SharedPtr< CL_Texture_Impl > &  impl  ) 

Constructs a texture from an implementation.

Parameters:
impl = The implementation
virtual CL_Texture::~CL_Texture (  )  [virtual]

Member Function Documentation

void CL_Texture::copy_image_from ( CL_GraphicContext context,
int  level,
CL_TextureFormat  internal_format = cl_rgba 
)

Copy image data from a graphic context.

void CL_Texture::copy_image_from ( CL_GraphicContext context,
int  x,
int  y,
int  width,
int  height,
int  level = 0,
CL_TextureFormat  internal_format = cl_rgba 
)
void CL_Texture::copy_image_from ( CL_GraphicContext context,
const CL_Rect pos,
int  level = 0,
CL_TextureFormat  internal_format = cl_rgba 
)
void CL_Texture::copy_subimage_from ( CL_GraphicContext context,
int  offset_x,
int  offset_y,
int  x,
int  y,
int  width,
int  height,
int  level = 0 
)

Copy sub image data from a graphic context.

void CL_Texture::copy_subimage_from ( CL_GraphicContext context,
const CL_Point offset,
const CL_Rect pos,
int  level = 0 
)
void CL_Texture::generate_mipmap (  ) 

Generate the mipmap.

int CL_Texture::get_base_level (  )  const

Get the texture base level.

CL_CompareFunction CL_Texture::get_compare_function (  )  const

Get the texture compare function.

CL_TextureCompareMode CL_Texture::get_compare_mode (  )  const

Get the texture compare mode.

int CL_Texture::get_depth (  )  const

Get the texture depth.

int CL_Texture::get_height (  )  const

Get the texture height.

CL_WeakPtr<CL_Texture_Impl> CL_Texture::get_impl (  )  const

Get the implementation weakptr.

This is used to assist is creating CL_Texture caches internally within clanlib

float CL_Texture::get_lod_bias (  )  const

Get the level of detail bias constant.

CL_TextureFilter CL_Texture::get_mag_filter (  )  const

Get the texture magnification filter.

int CL_Texture::get_max_level (  )  const

Get the texture max level.

float CL_Texture::get_max_lod (  )  const

Get the maximum level of detail.

CL_TextureFilter CL_Texture::get_min_filter (  )  const

Get the texture minification filter.

float CL_Texture::get_min_lod (  )  const

Get the minimum level of detail.

CL_PixelBuffer CL_Texture::get_pixeldata ( int  level = 0  )  const

Retrieve image data from texture.

CL_PixelBuffer CL_Texture::get_pixeldata ( CL_TextureFormat  sized_format,
int  level = 0 
) const

Get pixeldata.

Parameters:
format = Pixel Format
level = value
Returns:
Pixel Buffer
CL_TextureProvider* CL_Texture::get_provider (  )  const

Get Provider.

Returns:
provider
CL_Size CL_Texture::get_size (  )  const

Get the texture size.

int CL_Texture::get_width (  )  const

Get the texture width.

CL_TextureWrapMode CL_Texture::get_wrap_mode_r (  )  const

Get the texture wrap mode for the r coordinate.

CL_TextureWrapMode CL_Texture::get_wrap_mode_s (  )  const

Get the texture wrap mode for the s coordinate.

CL_TextureWrapMode CL_Texture::get_wrap_mode_t (  )  const

Get the texture wrap mode for the t coordinate.

bool CL_Texture::is_null (  )  const [inline]

Returns true if this object is invalid.

bool CL_Texture::is_resident (  )  const

Returns true if texture is resident in texture memory.

bool CL_Texture::operator!= ( const CL_Texture other  )  const [inline]

Inequality operator.

bool CL_Texture::operator< ( const CL_Texture other  )  const [inline]

Less than operator.

bool CL_Texture::operator== ( const CL_Texture other  )  const [inline]

Equality operator.

void CL_Texture::set_base_level ( int  base_level  ) 

Sets the texture base level texture parameter.

void CL_Texture::set_compressed_image ( int  level,
CL_TextureFormat  internal_format,
int  width,
int  height,
CL_DataBuffer image 
)
void CL_Texture::set_cube_map ( CL_PixelBuffer cube_map_positive_x,
CL_PixelBuffer cube_map_negative_x,
CL_PixelBuffer cube_map_positive_y,
CL_PixelBuffer cube_map_negative_y,
CL_PixelBuffer cube_map_positive_z,
CL_PixelBuffer cube_map_negative_z,
int  level = 0 
)

Upload cube map.

void CL_Texture::set_image ( CL_PixelBuffer image,
int  level = 0 
)

Upload image to texture.

Parameters:
image Image to upload.
level Mipmap level-of-detail number.
void CL_Texture::set_lod_bias ( float  lod_bias  ) 

Sets the level of detail bias constant.

void CL_Texture::set_mag_filter ( CL_TextureFilter  filter  ) 

Set the magnification filter.

void CL_Texture::set_max_anisotropy ( float  max_anisotropy  ) 

Set the maximum degree of anisotropy.

void CL_Texture::set_max_level ( int  max_level  ) 

Sets the texture max level texture parameter.

void CL_Texture::set_max_lod ( float  max_lod  ) 

Set the maximum level of detail texture parameter.

void CL_Texture::set_min_filter ( CL_TextureFilter  filter  ) 

Set the minification filter.

void CL_Texture::set_min_lod ( float  min_lod  ) 

Set the minimum level of detail texture parameter.

void CL_Texture::set_subimage ( int  x,
int  y,
const CL_PixelBuffer image,
const CL_Rect src_rect,
int  level = 0 
)

Upload image to sub texture.

Parameters:
image Image to upload.
level Mipmap level-of-detail number.
void CL_Texture::set_subimage ( const CL_Point point,
const CL_PixelBuffer image,
const CL_Rect src_rect,
int  level = 0 
)
void CL_Texture::set_texture_compare ( CL_TextureCompareMode  mode,
CL_CompareFunction  func 
)

Sets the texture compare mode and compare function texture parameters.

void CL_Texture::set_wrap_mode ( CL_TextureWrapMode  wrap_s,
CL_TextureWrapMode  wrap_t,
CL_TextureWrapMode  wrap_r 
)

Set the texture wrapping mode.

void CL_Texture::set_wrap_mode ( CL_TextureWrapMode  wrap_s  ) 
void CL_Texture::set_wrap_mode ( CL_TextureWrapMode  wrap_s,
CL_TextureWrapMode  wrap_t 
)
void CL_Texture::throw_if_null (  )  const

Throw an exception if this object is invalid.


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