32 #include "../../Core/Math/origin.h"
33 #include "../../Core/Math/color.h"
34 #include "../Image/image_import_description.h"
35 #include "UICore/Display/Render/texture.h"
47 typedef std::shared_ptr<Canvas>
CanvasPtr;
55 static std::shared_ptr<Image>
create(Texture2DPtr
texture,
const Rect &rect,
float pixel_ratio = 1.0
f);
57 static std::shared_ptr<Image>
create(
const CanvasPtr &canvas,
const PixelBufferPtr &pixelbuffer,
const Rect &rect,
float pixel_ratio = 1.0
f);
61 virtual float scale_x()
const = 0;
64 virtual float scale_y()
const = 0;
79 virtual float width()
const = 0;
82 virtual float height()
const = 0;
85 virtual std::shared_ptr<Image>
clone()
const = 0;
93 virtual void draw(
const CanvasPtr &canvas,
float x,
float y)
const = 0;
94 virtual void draw(
const CanvasPtr &canvas,
const Rectf &src,
const Rectf &dest)
const = 0;
95 virtual void draw(
const CanvasPtr &canvas,
const Rectf &dest)
const = 0;
96 virtual void draw(
const CanvasPtr &canvas,
const Rectf &src,
const Quadf &dest)
const = 0;
97 virtual void draw(
const CanvasPtr &canvas,
const Quadf &dest)
const = 0;
100 virtual void set_scale(
float x,
float y) = 0;
virtual Sizef size() const =0
Return the size of the image.
virtual void set_scale(float x, float y)=0
Set scale factors.
std::shared_ptr< Texture2D > Texture2DPtr
Definition: image.h:42
virtual Colorf color() const =0
Returns current color.
unsigned char get_green() const
Returns the green color component, in the range 0-255.
Definition: color.h:77
Image class.
Definition: image.h:51
virtual void set_wrap_mode(TextureWrapMode wrap_s, TextureWrapMode wrap_t)=0
Sets the wrapping mode to use.
Type x
Definition: vec4.h:74
Floating point color description class (for float).
Definition: color.h:630
Pixel data container.
Definition: pixel_buffer.h:52
Image Import Description Class.
Definition: image_import_description.h:45
unsigned char get_red() const
Returns the red color component, in the range 0-255.
Definition: color.h:74
Color description class.
Definition: color.h:42
virtual float width() const =0
Return the width of the image.
virtual void draw(const CanvasPtr &canvas, float x, float y) const =0
Draw image on graphic context.
unsigned char get_alpha() const
Returns the alpha color component, in the range 0-255.
Definition: color.h:71
2D Graphics Canvas
Definition: canvas.h:52
virtual void alignment(Origin &origin, float &x, float &y) const =0
Returns translation hot-spot.
2D (width,height) size structure - Float
Definition: size.h:180
2D (left,top,right,bottom) rectangle structure - Float
Definition: rect.h:505
2D quad structure - Float
Definition: quad.h:213
Type y
Definition: vec4.h:75
virtual void set_color(const Colorf &color)=0
Sets the color.
Type w
Definition: vec4.h:77
2D (left,top,right,bottom) rectangle structure - Integer
Definition: rect.h:491
std::shared_ptr< Image > ImagePtr
Definition: image.h:116
virtual float scale_x() const =0
Returns x scale.
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 filte...
void set_color(const Color &c)
Definition: image.h:104
unsigned char get_blue() const
Returns the blue color component, in the range 0-255.
Definition: color.h:80
std::shared_ptr< PixelBuffer > PixelBufferPtr
Definition: d3d_target.h:39
Type z
Definition: vec4.h:76
Origin
Alignment origins.
Definition: origin.h:35
TextureWrapMode
Texture coordinate wrapping modes.
Definition: texture.h:56
std::shared_ptr< Canvas > CanvasPtr
Definition: canvas.h:126
static std::shared_ptr< Image > create(Texture2DPtr texture, const Rect &rect, float pixel_ratio=1.0f)
Constructs an image.
virtual void set_alignment(Origin origin, float x=0, float y=0)=0
Sets translation hotspot.
Definition: Application/application.h:35
virtual std::shared_ptr< Image > clone() const =0
Copies all information from this image to another, excluding the graphics that remain shared...
virtual float scale_y() const =0
Returns y scale.
virtual float height() const =0
Return the height of the image.
Image position in a TextureGroup.
Definition: texture_group.h:44
2D texture object class.
Definition: texture_2d.h:39
virtual TextureGroupImage texture() const =0
Return the texture of the image.