uicore::Texture2D Class Referenceabstract

2D texture object class. More...

#include <texture_2d.h>

+ Inheritance diagram for uicore::Texture2D:

Public Member Functions

virtual void copy_image_from (const GraphicContextPtr &context, int level, TextureFormat texture_format=tf_rgba8)=0
 Copy image data from a graphic context. More...
 
virtual void copy_image_from (const GraphicContextPtr &context, int x, int y, int width, int height, int level=0, TextureFormat texture_format=tf_rgba8)=0
 
void copy_image_from (const GraphicContextPtr &context, const Rect &pos, int level=0, TextureFormat texture_format=tf_rgba8)
 
virtual void copy_subimage_from (const GraphicContextPtr &context, int offset_x, int offset_y, int x, int y, int width, int height, int level=0)=0
 Copy sub image data from a graphic context. More...
 
virtual void copy_subimage_from (const GraphicContextPtr &context, const Point &offset, const Rect &pos, int level=0)
 
virtual int height () const =0
 Retrieves the actual height of the texture in the display. More...
 
virtual PixelBufferPtr pixeldata (const GraphicContextPtr &gc, int level=0) const =0
 
virtual PixelBufferPtr pixeldata (const GraphicContextPtr &gc, TextureFormat texture_format, int level=0) const =0
 
virtual void set_image (const GraphicContextPtr &context, const PixelBufferPtr &image, int level=0)=0
 
virtual void set_subimage (const GraphicContextPtr &context, int x, int y, const PixelBufferPtr &image, const Rect &src_rect, int level=0)=0
 
void set_subimage (const GraphicContextPtr &context, const Point &point, const PixelBufferPtr &image, const Rect &src_rect, int level=0)
 
virtual void set_wrap_mode (TextureWrapMode wrap_s, TextureWrapMode wrap_t)=0
 
Size size () const
 Retrieves the actual size of the texture. More...
 
virtual int width () const =0
 Retrieves the actual width of the texture in the display. More...
 
virtual TextureWrapMode wrap_mode_s () const =0
 Get the texture wrap mode for the s coordinate. More...
 
virtual TextureWrapMode wrap_mode_t () const =0
 Get the texture wrap mode for the t coordinate. More...
 
- Public Member Functions inherited from uicore::Texture
virtual int base_level () const =0
 Get the texture base level. More...
 
virtual CompareFunction compare_function () const =0
 Get the texture compare function. More...
 
virtual TextureCompareMode compare_mode () const =0
 Get the texture compare mode. More...
 
virtual void generate_mipmap ()=0
 Generate mipmap textures. More...
 
virtual float lod_bias () const =0
 Get the level of detail bias constant. More...
 
virtual TextureFilter mag_filter () const =0
 Get the texture magnification filter. More...
 
virtual int max_level () const =0
 Get the texture max level. More...
 
virtual float max_lod () const =0
 Get the maximum level of detail. More...
 
virtual TextureFilter min_filter () const =0
 Get the texture minification filter. More...
 
virtual float min_lod () const =0
 Get the minimum level of detail. More...
 
virtual void set_base_level (int base_level)=0
 Sets the texture base level texture parameter. More...
 
virtual void set_lod_bias (float lod_bias)=0
 Sets the level of detail bias constant. More...
 
virtual void set_mag_filter (TextureFilter filter)=0
 Set the magnification filter. More...
 
virtual void set_max_anisotropy (float max_anisotropy)=0
 Set the maximum degree of anisotropy. More...
 
virtual void set_max_level (int max_level)=0
 Sets the texture max level texture parameter. More...
 
virtual void set_max_lod (float max_lod)=0
 Set the maximum level of detail texture parameter. More...
 
virtual void set_min_filter (TextureFilter filter)=0
 Set the minification filter. More...
 
virtual void set_min_lod (float min_lod)=0
 Set the minimum level of detail texture parameter. More...
 
virtual void set_texture_compare (TextureCompareMode mode, CompareFunction func)=0
 Sets the texture compare mode and compare function texture parameters. More...
 
virtual TextureObject * texture_object ()=0
 

Static Public Member Functions

static std::shared_ptr< Texture2Dcreate (const GraphicContextPtr &context, int width, int height, TextureFormat format=tf_rgba8, int levels=1)
 
static std::shared_ptr< Texture2Dcreate (const GraphicContextPtr &context, const Size &size, TextureFormat texture_format=tf_rgba8, int levels=1)
 
static std::shared_ptr< Texture2Dcreate (const GraphicContextPtr &context, const std::string &filename, const ImageImportDescription &import_desc={})
 
static std::shared_ptr< Texture2Dcreate (const GraphicContextPtr &context, const IODevicePtr &file, const std::string &image_type, const ImageImportDescription &import_desc={})
 
static std::shared_ptr< Texture2Dcreate (const GraphicContextPtr &context, const PixelBufferPtr &image, bool is_srgb=false)
 
static std::shared_ptr< Texture2Dcreate (const GraphicContextPtr &context, const PixelBufferPtr &image, const Rect &src_rect, bool is_srgb=false)
 
- Static Public Member Functions inherited from uicore::Texture
static std::shared_ptr< Texturecreate (const GraphicContextPtr &gc, PixelBufferSetPtr pixelbuffer_set)
 Constructs a texture as described by a pixelbuffer set. More...
 

Detailed Description

2D texture object class.

Member Function Documentation

virtual void uicore::Texture2D::copy_image_from ( const GraphicContextPtr context,
int  level,
TextureFormat  texture_format = tf_rgba8 
)
pure virtual

Copy image data from a graphic context.

Referenced by copy_image_from().

virtual void uicore::Texture2D::copy_image_from ( const GraphicContextPtr context,
int  x,
int  y,
int  width,
int  height,
int  level = 0,
TextureFormat  texture_format = tf_rgba8 
)
pure virtual
void uicore::Texture2D::copy_image_from ( const GraphicContextPtr context,
const Rect pos,
int  level = 0,
TextureFormat  texture_format = tf_rgba8 
)
inline
virtual void uicore::Texture2D::copy_subimage_from ( const GraphicContextPtr context,
int  offset_x,
int  offset_y,
int  x,
int  y,
int  width,
int  height,
int  level = 0 
)
pure virtual

Copy sub image data from a graphic context.

Referenced by copy_subimage_from().

virtual void uicore::Texture2D::copy_subimage_from ( const GraphicContextPtr context,
const Point offset,
const Rect pos,
int  level = 0 
)
inlinevirtual
static std::shared_ptr<Texture2D> uicore::Texture2D::create ( const GraphicContextPtr context,
int  width,
int  height,
TextureFormat  format = tf_rgba8,
int  levels = 1 
)
static

Constructs a new 2D texture.

Parameters
contextGraphic context to construct the texture on.
widthWidth of the new texture.
heightHeight of the new texture.
formatData format of the new texture.
levelsNumber of mipmap levels for the new texture. Setting this to 0 enables all levels.
static std::shared_ptr<Texture2D> uicore::Texture2D::create ( const GraphicContextPtr context,
const Size size,
TextureFormat  texture_format = tf_rgba8,
int  levels = 1 
)
static
static std::shared_ptr<Texture2D> uicore::Texture2D::create ( const GraphicContextPtr context,
const std::string filename,
const ImageImportDescription import_desc = {} 
)
static
static std::shared_ptr<Texture2D> uicore::Texture2D::create ( const GraphicContextPtr context,
const IODevicePtr file,
const std::string image_type,
const ImageImportDescription import_desc = {} 
)
static
static std::shared_ptr<Texture2D> uicore::Texture2D::create ( const GraphicContextPtr context,
const PixelBufferPtr image,
bool  is_srgb = false 
)
static
static std::shared_ptr<Texture2D> uicore::Texture2D::create ( const GraphicContextPtr context,
const PixelBufferPtr image,
const Rect src_rect,
bool  is_srgb = false 
)
static
virtual int uicore::Texture2D::height ( ) const
pure virtual

Retrieves the actual height of the texture in the display.

Referenced by size().

virtual PixelBufferPtr uicore::Texture2D::pixeldata ( const GraphicContextPtr gc,
int  level = 0 
) const
pure virtual

Retrieve image data from this texture.

Parameters
formatOutput data format.
levelMipmap level of the texture to retrieve data from.
virtual PixelBufferPtr uicore::Texture2D::pixeldata ( const GraphicContextPtr gc,
TextureFormat  texture_format,
int  level = 0 
) const
pure virtual
virtual void uicore::Texture2D::set_image ( const GraphicContextPtr context,
const PixelBufferPtr image,
int  level = 0 
)
pure virtual

Upload image to this texture.

Parameters
contextGraphic context to use for the request.
imageImage to upload.
levelMipmap level-of-detail number.
virtual void uicore::Texture2D::set_subimage ( const GraphicContextPtr context,
int  x,
int  y,
const PixelBufferPtr image,
const Rect src_rect,
int  level = 0 
)
pure virtual

Upload image to sub-texture.

Parameters
contextGraphic context to use for the request.
xThe horizontal point in the texture to write the new sub-texture image onto.
yThe vertical point in the texture to write the new sub-texture image onto.
pointPoint in the texture to write the new sub-texture image onto.
imageImage to upload.
levelMipmap level-of-detail number.

Referenced by set_subimage().

void uicore::Texture2D::set_subimage ( const GraphicContextPtr context,
const Point point,
const PixelBufferPtr image,
const Rect src_rect,
int  level = 0 
)
inline

Upload image to sub-texture.

Parameters
contextGraphic context to use for the request.
imageImage to upload.
levelMipmap level-of-detail number.

References set_subimage(), uicore::Vec2< Type >::x, and uicore::Vec2< Type >::y.

virtual void uicore::Texture2D::set_wrap_mode ( TextureWrapMode  wrap_s,
TextureWrapMode  wrap_t 
)
pure virtual
Size uicore::Texture2D::size ( ) const
inline

Retrieves the actual size of the texture.

References height(), and width().

virtual int uicore::Texture2D::width ( ) const
pure virtual

Retrieves the actual width of the texture in the display.

Referenced by size().

virtual TextureWrapMode uicore::Texture2D::wrap_mode_s ( ) const
pure virtual

Get the texture wrap mode for the s coordinate.

virtual TextureWrapMode uicore::Texture2D::wrap_mode_t ( ) const
pure virtual

Get the texture wrap mode for the t coordinate.


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