33 #include "../../Core/Math/origin.h"
34 #include "../../Core/Resources/resource.h"
36 #include "../Image/image_import_description.h"
37 #include "../Render/texture.h"
53 class ResourceManager;
54 class XMLResourceDocument;
165 return impl==other.impl;
171 return impl!=other.impl;
177 return impl < other.impl;
204 const Rectf &dest)
const;
212 const Rectf &dest)
const;
222 const Quadf &dest)
const;
230 const Quadf &dest)
const;
264 std::shared_ptr<Image_Impl> impl;
Image(Texture2D texture, const Rect &rect)
Constructs an image from a texture.
Image clone() const
Copies all information from this image to another, excluding the graphics that remain shared.
TextureWrapMode
Texture coordinate wrapping modes.
Definition: texture.h:66
bool is_null() const
Returns true if this object is invalid.
Definition: image.h:122
void set_alpha(float alpha)
Sets transparency.
Subtexture get_texture() const
Return the texture of the image.
Resource manager.
Definition: resource_manager.h:45
float get_height() const
Return the height of the image.
void set_color(const Colorf &color)
Sets the color.
void draw(Canvas &canvas, const Rectf &dest) const
Draw image on graphic context.
2D (left,top,right,bottom) rectangle structure - Integer
Definition: rect.h:471
void set_linear_filter(bool linear_filter=true)
Set to true if a linear filter should be used for scaling up and down, false if a nearest-point filte...
Image(Subtexture &sub_texture)
Constructs an image from a subtexture.
Image Import Description Class.
Definition: image_import_description.h:49
void set_alignment(Origin origin, float x=0, float y=0)
Sets translation hotspot.
void draw(Canvas &canvas, float x, float y) const
Draw image on graphic context.
void set_color(const Color &c)
Set color.
Definition: image.h:247
2D (left,top,right,bottom) rectangle structure - Float
Definition: rect.h:485
Image(Canvas &canvas, const PixelBuffer &pixelbuffer, const Rect &rect)
Constructs a Image from a pixelbuffer.
static Image load(Canvas &canvas, const std::string &id, const XMLResourceDocument &doc)
Loads a Sprite from a XML resource definition.
Floating point color description class (for float).
Definition: color.h:661
2D quad structure - Float
Definition: quad.h:213
Origin
Alignment origins.
Definition: origin.h:41
2D texture object class.
Definition: texture_2d.h:42
float get_alpha() const
Returns current alpha.
Image()
Constructs a null instance.
void get_alignment(Origin &origin, float &x, float &y) const
Returns translation hot-spot.
2D Graphics Canvas
Definition: canvas.h:73
Color description class.
Definition: color.h:47
bool operator<(const Image &other) const
Less than operator.
Definition: image.h:175
Colorf get_color() const
Returns current color.
float get_width() const
Return the width of the image.
float get_scale_x() const
Returns x scale.
Image(Canvas &canvas, const std::string &filename, const ImageImportDescription &import_desc=ImageImportDescription())
Constructs a Image.
void throw_if_null() const
Throw an exception if this object is invalid.
void draw(Canvas &canvas, const Quadf &dest) const
Draw image on graphic context.
Virtual File System (VFS).
Definition: file_system.h:48
XML Resource Document.
Definition: xml_resource_document.h:49
Image class.
Definition: image.h:60
Pixel data container.
Definition: pixel_buffer.h:69
bool operator==(const Image &other) const
Equality operator.
Definition: image.h:163
void draw(Canvas &canvas, const Rectf &src, const Rectf &dest) const
Draw image on graphic context.
void set_wrap_mode(TextureWrapMode wrap_s, TextureWrapMode wrap_t)
Image(Canvas &canvas, const std::string &filename, const FileSystem &fs, const ImageImportDescription &import_desc=ImageImportDescription())
Constructs a Image.
void set_scale(float x, float y)
Set scale for x and y directions individually.
void draw(Canvas &canvas, const Rectf &src, const Quadf &dest) const
Draw image on graphic context.
Resource proxy of a specific type.
Definition: resource.h:59
Sizef get_size() const
Return the size of the image.
Sub-texture description.
Definition: subtexture.h:46
float get_scale_y() const
Returns y scale.
2D (width,height) size structure - Float
Definition: size.h:170
bool operator!=(const Image &other) const
Inequality operator.
Definition: image.h:169
static Resource< Image > resource(Canvas &canvas, const std::string &id, const ResourceManager &resources)
Retrieves a Sprite resource from the resource manager.