Image class. More...

#include <image.h>

Public Member Functions

virtual void alignment (Origin &origin, float &x, float &y) const =0
 Returns translation hot-spot. More...
 
virtual std::shared_ptr< Imageclone () const =0
 Copies all information from this image to another, excluding the graphics that remain shared. More...
 
virtual Colorf color () const =0
 Returns current color. More...
 
virtual void draw (const CanvasPtr &canvas, float x, float y) const =0
 Draw image on graphic context. More...
 
virtual void draw (const CanvasPtr &canvas, const Rectf &src, const Rectf &dest) const =0
 
virtual void draw (const CanvasPtr &canvas, const Rectf &dest) const =0
 
virtual void draw (const CanvasPtr &canvas, const Rectf &src, const Quadf &dest) const =0
 
virtual void draw (const CanvasPtr &canvas, const Quadf &dest) const =0
 
virtual float height () const =0
 Return the height of the image. More...
 
virtual float scale_x () const =0
 Returns x scale. More...
 
virtual float scale_y () const =0
 Returns y scale. More...
 
virtual void set_alignment (Origin origin, float x=0, float y=0)=0
 Sets translation hotspot. More...
 
virtual void set_color (const Colorf &color)=0
 Sets the color. More...
 
void set_color (const Color &c)
 
virtual void set_linear_filter (bool linear_filter=true)=0
 Set to true if a linear filter should be used for scaling up and down, false if a nearest-point filter should be used. More...
 
virtual void set_scale (float x, float y)=0
 Set scale factors. More...
 
virtual void set_wrap_mode (TextureWrapMode wrap_s, TextureWrapMode wrap_t)=0
 Sets the wrapping mode to use. More...
 
virtual Sizef size () const =0
 Return the size of the image. More...
 
virtual TextureGroupImage texture () const =0
 Return the texture of the image. More...
 
virtual float width () const =0
 Return the width of the image. More...
 

Static Public Member Functions

static std::shared_ptr< Imagecreate (Texture2DPtr texture, const Rect &rect, float pixel_ratio=1.0f)
 Constructs an image. More...
 
static std::shared_ptr< Imagecreate (TextureGroupImage &sub_texture, float pixel_ratio=1.0f)
 
static std::shared_ptr< Imagecreate (const CanvasPtr &canvas, const PixelBufferPtr &pixelbuffer, const Rect &rect, float pixel_ratio=1.0f)
 
static std::shared_ptr< Imagecreate (const CanvasPtr &canvas, const std::string &filename, const ImageImportDescription &import_desc=ImageImportDescription(), float pixel_ratio=1.0f)
 

Detailed Description

Image class.

Member Function Documentation

virtual void uicore::Image::alignment ( Origin origin,
float &  x,
float &  y 
) const
pure virtual

Returns translation hot-spot.

virtual std::shared_ptr<Image> uicore::Image::clone ( ) const
pure virtual

Copies all information from this image to another, excluding the graphics that remain shared.

virtual Colorf uicore::Image::color ( ) const
pure virtual

Returns current color.

Referenced by set_color().

static std::shared_ptr<Image> uicore::Image::create ( Texture2DPtr  texture,
const Rect rect,
float  pixel_ratio = 1.0f 
)
static

Constructs an image.

static std::shared_ptr<Image> uicore::Image::create ( TextureGroupImage sub_texture,
float  pixel_ratio = 1.0f 
)
static
static std::shared_ptr<Image> uicore::Image::create ( const CanvasPtr canvas,
const PixelBufferPtr pixelbuffer,
const Rect rect,
float  pixel_ratio = 1.0f 
)
static
static std::shared_ptr<Image> uicore::Image::create ( const CanvasPtr canvas,
const std::string filename,
const ImageImportDescription import_desc = ImageImportDescription(),
float  pixel_ratio = 1.0f 
)
static
virtual void uicore::Image::draw ( const CanvasPtr canvas,
float  x,
float  y 
) const
pure virtual

Draw image on graphic context.

Parameters
canvasTarget canvas
x,yAnchor position of where to render image. Actual rendering position depends on the anchor and the alignment mode.
srcSource rectangle to draw
destArea to draw image in
virtual void uicore::Image::draw ( const CanvasPtr canvas,
const Rectf src,
const Rectf dest 
) const
pure virtual
virtual void uicore::Image::draw ( const CanvasPtr canvas,
const Rectf dest 
) const
pure virtual
virtual void uicore::Image::draw ( const CanvasPtr canvas,
const Rectf src,
const Quadf dest 
) const
pure virtual
virtual void uicore::Image::draw ( const CanvasPtr canvas,
const Quadf dest 
) const
pure virtual
virtual float uicore::Image::height ( ) const
pure virtual

Return the height of the image.

virtual float uicore::Image::scale_x ( ) const
pure virtual

Returns x scale.

virtual float uicore::Image::scale_y ( ) const
pure virtual

Returns y scale.

virtual void uicore::Image::set_alignment ( Origin  origin,
float  x = 0,
float  y = 0 
)
pure virtual

Sets translation hotspot.

virtual void uicore::Image::set_color ( const Colorf color)
pure virtual

Sets the color.

virtual void uicore::Image::set_linear_filter ( bool  linear_filter = true)
pure virtual

Set to true if a linear filter should be used for scaling up and down, false if a nearest-point filter should be used.

virtual void uicore::Image::set_scale ( float  x,
float  y 
)
pure virtual

Set scale factors.

virtual void uicore::Image::set_wrap_mode ( TextureWrapMode  wrap_s,
TextureWrapMode  wrap_t 
)
pure virtual

Sets the wrapping mode to use.

virtual Sizef uicore::Image::size ( ) const
pure virtual

Return the size of the image.

virtual TextureGroupImage uicore::Image::texture ( ) const
pure virtual

Return the texture of the image.

virtual float uicore::Image::width ( ) const
pure virtual

Return the width of the image.


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