ClanLib
2.3.7
|
Texture object class. More...
#include <texture.h>
Public Member Functions | |
Construction | |
CL_Texture () | |
Constructs a null instance. More... | |
CL_Texture (CL_GraphicContext &context, CL_TextureDimensions texture_dimensions) | |
Constructs a Texture. More... | |
CL_Texture (CL_GraphicContext &context, int width, int height, CL_TextureFormat internal_format=cl_rgba) | |
Constructs a Texture. More... | |
CL_Texture (CL_GraphicContext &context, int width, int height, int depth, CL_TextureFormat internal_format=cl_rgba) | |
Constructs a 3D Texture. More... | |
CL_Texture (CL_GraphicContext &context, const CL_Size &size, CL_TextureFormat internal_format=cl_rgba) | |
Constructs a Texture. More... | |
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. More... | |
virtual | ~CL_Texture () |
Operators | |
bool | operator== (const CL_Texture &other) const |
Equality operator. More... | |
bool | operator!= (const CL_Texture &other) const |
Inequality operator. More... | |
bool | operator< (const CL_Texture &other) const |
Less than operator. More... | |
Attributes | |
bool | is_null () const |
Returns true if this object is invalid. More... | |
void | throw_if_null () const |
Throw an exception if this object is invalid. More... | |
int | get_width () const |
Get the texture width. More... | |
int | get_height () const |
Get the texture height. More... | |
CL_Size | get_size () const |
Get the texture size. More... | |
int | get_depth () const |
Get the texture depth. More... | |
CL_PixelBuffer | get_pixeldata (int level=0) const |
Retrieve image data from texture. More... | |
CL_PixelBuffer | get_pixeldata (CL_TextureFormat sized_format, int level=0) const |
Get pixeldata. More... | |
float | get_min_lod () const |
Get the minimum level of detail. More... | |
float | get_max_lod () const |
Get the maximum level of detail. More... | |
float | get_lod_bias () const |
Get the level of detail bias constant. More... | |
int | get_base_level () const |
Get the texture base level. More... | |
int | get_max_level () const |
Get the texture max level. More... | |
CL_TextureWrapMode | get_wrap_mode_s () const |
Get the texture wrap mode for the s coordinate. More... | |
CL_TextureWrapMode | get_wrap_mode_t () const |
Get the texture wrap mode for the t coordinate. More... | |
CL_TextureWrapMode | get_wrap_mode_r () const |
Get the texture wrap mode for the r coordinate. More... | |
CL_TextureFilter | get_min_filter () const |
Get the texture minification filter. More... | |
CL_TextureFilter | get_mag_filter () const |
Get the texture magnification filter. More... | |
bool | is_resident () const |
Returns true if texture is resident in texture memory. More... | |
CL_TextureCompareMode | get_compare_mode () const |
Get the texture compare mode. More... | |
CL_CompareFunction | get_compare_function () const |
Get the texture compare function. More... | |
CL_TextureProvider * | get_provider () const |
Get Provider. More... | |
CL_WeakPtr< CL_Texture_Impl > | get_impl () const |
Get the implementation weakptr. More... | |
Operations | |
void | generate_mipmap () |
Generate the mipmap. More... | |
void | set_image (CL_PixelBuffer &image, int level=0) |
Upload image to texture. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
void | set_max_lod (float max_lod) |
Set the maximum level of detail texture parameter. More... | |
void | set_lod_bias (float lod_bias) |
Sets the level of detail bias constant. More... | |
void | set_base_level (int base_level) |
Sets the texture base level texture parameter. More... | |
void | set_max_level (int max_level) |
Sets the texture max level texture parameter. More... | |
void | set_wrap_mode (CL_TextureWrapMode wrap_s, CL_TextureWrapMode wrap_t, CL_TextureWrapMode wrap_r) |
Set the texture wrapping mode. More... | |
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. More... | |
void | set_mag_filter (CL_TextureFilter filter) |
Set the magnification filter. More... | |
void | set_max_anisotropy (float max_anisotropy) |
Set the maximum degree of anisotropy. More... | |
void | set_texture_compare (CL_TextureCompareMode mode, CL_CompareFunction func) |
Sets the texture compare mode and compare function texture parameters. More... | |
Texture object class.
CL_Texture::CL_Texture | ( | ) |
Constructs a null instance.
CL_Texture::CL_Texture | ( | CL_GraphicContext & | context, |
CL_TextureDimensions | texture_dimensions | ||
) |
Constructs a Texture.
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.
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.
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.
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.
impl | = The implementation |
|
virtual |
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.
format | = Pixel Format |
level | = value |
CL_TextureProvider* CL_Texture::get_provider | ( | ) | const |
Get 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.
|
inline |
Returns true if this object is invalid.
bool CL_Texture::is_resident | ( | ) | const |
Returns true if texture is resident in texture memory.
|
inline |
Inequality operator.
|
inline |
Less than operator.
|
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.
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.
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, |
CL_TextureWrapMode | wrap_t | ||
) |
void CL_Texture::set_wrap_mode | ( | CL_TextureWrapMode | wrap_s) |
void CL_Texture::throw_if_null | ( | ) | const |
Throw an exception if this object is invalid.