#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< Image > | clone () 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< Image > | create (Texture2DPtr texture, const Rect &rect, float pixel_ratio=1.0f) |
Constructs an image. More... | |
static std::shared_ptr< Image > | create (TextureGroupImage &sub_texture, float pixel_ratio=1.0f) |
static std::shared_ptr< Image > | create (const CanvasPtr &canvas, const PixelBufferPtr &pixelbuffer, const Rect &rect, float pixel_ratio=1.0f) |
static std::shared_ptr< Image > | create (const CanvasPtr &canvas, const std::string &filename, const ImageImportDescription &import_desc=ImageImportDescription(), float pixel_ratio=1.0f) |
Image class.
|
pure virtual |
Returns translation hot-spot.
|
pure virtual |
Copies all information from this image to another, excluding the graphics that remain shared.
|
pure virtual |
Returns current color.
Referenced by set_color().
|
static |
Constructs an image.
|
static |
|
static |
|
static |
|
pure virtual |
Draw image on graphic context.
canvas | Target canvas |
x,y | Anchor position of where to render image. Actual rendering position depends on the anchor and the alignment mode. |
src | Source rectangle to draw |
dest | Area to draw image in |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
Return the height of the image.
|
pure virtual |
Returns x scale.
|
pure virtual |
Returns y scale.
|
pure virtual |
Sets translation hotspot.
|
pure virtual |
Sets the color.
|
inline |
|
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.
|
pure virtual |
Set scale factors.
|
pure virtual |
Sets the wrapping mode to use.
|
pure virtual |
Return the size of the image.
|
pure virtual |
Return the texture of the image.
|
pure virtual |
Return the width of the image.