#include <image.h>
Public Member Functions | |
| Image () | |
| Constructs a null instance. | |
| Image (Canvas &canvas, const PixelBuffer &pixelbuffer, const Rect &rect) | |
| Constructs a Image from a pixelbuffer. | |
| Image (Canvas &canvas, const std::string &filename, const FileSystem &fs, const ImageImportDescription &import_desc=ImageImportDescription()) | |
| Constructs a Image. | |
| Image (Canvas &canvas, const std::string &filename, const ImageImportDescription &import_desc=ImageImportDescription()) | |
| Constructs a Image. | |
| Image (Subtexture &sub_texture) | |
| Constructs an image from a subtexture. | |
| Image (Texture2D texture, const Rect &rect) | |
| Constructs an image from a texture. | |
| virtual | ~Image () |
| Image | clone () const |
| Copies all information from this image to another, excluding the graphics that remain shared. | |
| void | draw (Canvas &canvas, const Quadf &dest) const |
| Draw image on graphic context. | |
| void | draw (Canvas &canvas, const Rectf &dest) const |
| Draw image on graphic context. | |
| void | draw (Canvas &canvas, const Rectf &src, const Quadf &dest) const |
| Draw image on graphic context. | |
| void | draw (Canvas &canvas, const Rectf &src, const Rectf &dest) const |
| Draw image on graphic context. | |
| void | draw (Canvas &canvas, float x, float y) const |
| Draw image on graphic context. | |
| void | get_alignment (Origin &origin, float &x, float &y) const |
| Returns translation hot-spot. | |
| float | get_alpha () const |
| Returns current alpha. | |
| Colorf | get_color () const |
| Returns current color. | |
| float | get_height () const |
| Return the height of the image. | |
| float | get_scale_x () const |
| Returns x scale. | |
| float | get_scale_y () const |
| Returns y scale. | |
| Sizef | get_size () const |
| Return the size of the image. | |
| Subtexture | get_texture () const |
| Return the texture of the image. | |
| float | get_width () const |
| Return the width of the image. | |
| bool | is_null () const |
| Returns true if this object is invalid. | |
| operator bool () const | |
| bool | operator!= (const Image &other) const |
| Inequality operator. | |
| bool | operator< (const Image &other) const |
| Less than operator. | |
| bool | operator== (const Image &other) const |
| Equality operator. | |
| void | set_alignment (Origin origin, float x=0, float y=0) |
| Sets translation hotspot. | |
| void | set_alpha (float alpha) |
| Sets transparency. | |
| void | set_color (const Color &c) |
| Set color. | |
| void | set_color (const Colorf &color) |
| Sets the color. | |
| 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 filter should be used. | |
| void | set_scale (float x, float y) |
| Set scale for x and y directions individually. | |
| void | set_subimage (Canvas &canvas, int x, int y, const PixelBuffer &image, const Rect &src_rect, int level=0) |
| void | set_wrap_mode (TextureWrapMode wrap_s, TextureWrapMode wrap_t) |
| void | throw_if_null () const |
| Throw an exception if this object is invalid. | |
Static Public Member Functions | |
| static Image | load (Canvas &canvas, const std::string &id, const XMLResourceDocument &doc) |
| Loads a Sprite from a XML resource definition. | |
| static Resource< Image > | resource (Canvas &canvas, const std::string &id, const ResourceManager &resources) |
| Retrieves a Sprite resource from the resource manager. | |
Image class.
| clan::Image::Image | ( | ) |
Constructs a null instance.
Constructs an image from a texture.
| texture | = Texture to get image data from |
| rect | = Position and size in texture to get image data from |
| clan::Image::Image | ( | Subtexture & | sub_texture | ) |
Constructs an image from a subtexture.
| sub_texture | = Subtexture to get image data from |
| clan::Image::Image | ( | Canvas & | canvas, |
| const PixelBuffer & | pixelbuffer, | ||
| const Rect & | rect ) |
| clan::Image::Image | ( | Canvas & | canvas, |
| const std::string & | filename, | ||
| const ImageImportDescription & | import_desc = ImageImportDescription() ) |
| clan::Image::Image | ( | Canvas & | canvas, |
| const std::string & | filename, | ||
| const FileSystem & | fs, | ||
| const ImageImportDescription & | import_desc = ImageImportDescription() ) |
|
virtual |
| Image clan::Image::clone | ( | ) | const |
Copies all information from this image to another, excluding the graphics that remain shared.
Draw image on graphic context.
| gc | Graphic context on which to render upon. |
| dest | Quad to draw image in. |
Draw image on graphic context.
| gc | Graphic context on which to render upon. |
| dest | Rectangle to draw image in. |
Draw image on graphic context.
| gc | Graphic context on which to render upon. |
| src | Source rectangle to draw. Use this is draw only part of the image. |
| dest | Quad to draw image in. |
Draw image on graphic context.
| gc | Graphic context on which to render upon. |
| src | Source rectangle to draw. Use this is draw only part of the image. |
| dest | Rectangle to draw image in. |
| void clan::Image::draw | ( | Canvas & | canvas, |
| float | x, | ||
| float | y ) const |
Draw image on graphic context.
| x,y | Anchor position of where to render image. Actual rendering position depends on the anchor and the alignment mode. |
| gc | Graphic context on which to render upon. |
| void clan::Image::get_alignment | ( | Origin & | origin, |
| float & | x, | ||
| float & | y ) const |
Returns translation hot-spot.
| float clan::Image::get_alpha | ( | ) | const |
Returns current alpha.
Alpha 0.0f is full transparency, and 1.0f is full visibility (solid).
| Colorf clan::Image::get_color | ( | ) | const |
Returns current color.
Alpha 0.0f is full transparency, and 1.0f is full visibility (solid).
| float clan::Image::get_height | ( | ) | const |
Return the height of the image.
| float clan::Image::get_scale_x | ( | ) | const |
Returns x scale.
1.0f is normal scale, 2.0f is twice the size, etc.
| float clan::Image::get_scale_y | ( | ) | const |
Returns y scale.
1.0f is normal scale, 2.0f is twice the size, etc.
| Sizef clan::Image::get_size | ( | ) | const |
Return the size of the image.
| Subtexture clan::Image::get_texture | ( | ) | const |
Return the texture of the image.
| float clan::Image::get_width | ( | ) | const |
Return the width of the image.
|
inline |
Returns true if this object is invalid.
|
static |
Loads a Sprite from a XML resource definition.
|
inlineexplicit |
|
inline |
Inequality operator.
|
inline |
Less than operator.
|
inline |
Equality operator.
|
static |
| void clan::Image::set_alignment | ( | Origin | origin, |
| float | x = 0, | ||
| float | y = 0 ) |
Sets translation hotspot.
| void clan::Image::set_alpha | ( | float | alpha | ) |
Sets transparency.
Alpha 0.0f is full transparency, and 1.0f is full visibility (solid).
|
inline |
Set color.
| c | = Color |
References clan::c, clan::color, clan::Vec4< Type >::r, and set_color().
Referenced by set_color().
| void clan::Image::set_color | ( | const Colorf & | color | ) |
Sets the color.
Alpha 0.0f is full transparency, and 1.0f is full visibility (solid).
| void clan::Image::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 filter should be used.
| void clan::Image::set_scale | ( | float | x, |
| float | y ) |
Set scale for x and y directions individually.
1.0f is normal scale, 2.0f is twice the size, etc.
| void clan::Image::set_subimage | ( | Canvas & | canvas, |
| int | x, | ||
| int | y, | ||
| const PixelBuffer & | image, | ||
| const Rect & | src_rect, | ||
| int | level = 0 ) |
| void clan::Image::set_wrap_mode | ( | TextureWrapMode | wrap_s, |
| TextureWrapMode | wrap_t ) |
| void clan::Image::throw_if_null | ( | ) | const |
Throw an exception if this object is invalid.