List of all members
clan::Canvas Class Reference
clanDisplay Display

2D Graphics Canvas More...

`#include <canvas.h>`

## Public Member Functions
Construction
| Canvas ()
| Constructs a null instance. More...
| Canvas (Canvas &canvas, FrameBuffer &framebuffer)
| Constructs a Canvas based on a framebuffer. (based on the copy of the canvas) More...
| Canvas (DisplayWindow &window)
| Constructs a Canvas. More...
| ~Canvas ()
Attributes
Canvas | create ()
| Create a copy of a canvas. More...
bool | is_null () const
| Returns true if this object is invalid. More...
void | throw_if_null () const
| Throw an exception if this object is invalid. More...
GraphicContext & | get_gc () const
| Get gc. More...
const Mat4f & | get_transform () const
| Returns the current effective transform matrix. More...
Mat4f & | get_inverse_transform ()
| Returns the inverse of the current effective transform matrix. More...
const Mat4f & | get_projection () const
| Returns the current effective projection matrix. More...
| operator GraphicContext & () const
float | get_width () const
| Returns the current width of the context. More...
float | get_height () const
| Returns the current height of the context. More...
Sizef | get_size () const
| Returns the current size of the context. More...
Rectf | get_cliprect () const
| Returns the current clipping rectangle. More...
PixelBuffer | get_pixeldata (const Rect &rect, TextureFormat texture_format=tf_rgba8, bool clamp=true)
| Return the content of the read buffer into a pixel buffer. More...
PixelBuffer | get_pixeldata (TextureFormat texture_format=tf_rgba8, bool clamp=true)
| Return the content of the read buffer into a pixel buffer. More...
float | get_pixel_ratio () const
Operations
void | set_rasterizer_state (const RasterizerState &state)
| Set active rasterizer state. More...
void | set_blend_state (const BlendState &state, const Colorf &blend_color=Colorf::white, unsigned int sample_mask=0xffffffff)
| Set active blend state. More...
void | set_depth_stencil_state (const DepthStencilState &state, int stencil_ref=0)
| Set active depth stencil state. More...
void | reset_rasterizer_state ()
| Set active rasterizer state. More...
void | reset_blend_state ()
| Set active blend state. More...
void | reset_depth_stencil_state ()
| Set active depth stencil state. More...
void | set_cliprect (const Rectf &rect)
| Set the current clipping rectangle. More...
void | push_cliprect (const Rectf &rect)
| Push current clipping rectangle to stack. More...
void | push_cliprect ()
| Push cliprect. More...
void | pop_cliprect ()
| Pop current clipping rectangle from the stack. More...
void | reset_cliprect ()
| Removes the set clipping rectangle and empties the cliprect stack. More...
void | clear (const Colorf &color=Colorf::black)
| Clears the whole context using the specified color. More...
void | clear_stencil (int value=0)
| Clear the stencil buffer. More...
void | clear_depth (float value=0)
| Clear the depth buffer. More...
void | set_program_object (StandardProgram standard_program)
| Set active program object to the standard program specified. More...
void | set_map_mode (MapMode mode)
| Set the projection mapping mode. More...
void | set_projection (const Mat4f &matrix)
| Set the projection matrix to be used in user projection map mode. More...
void | set_batcher (RenderBatcher *batcher)
| Specifies which render batcher is to be currently active. More...
void | set_transform (const Mat4f &matrix)
| Sets the transform matrix to a new matrix. More...
void | mult_transform (const Mat4f &matrix)
| Multiplies the passed matrix onto the transform matrix. More...
void | flush ()
| Flushes the render batcher currently active. More...
void | draw_point (float x1, float y1, const Colorf &color)
| Draw a point. More...
void | draw_point (const Pointf &point, const Colorf &color)
| Point. More...
void | draw_line (float x1, float y1, float x2, float y2, const Colorf &color=Colorf::white)
| Draw a line. More...
void | draw_line (const Pointf &start, const Pointf &end, const Colorf &color=Colorf::white)
| Line. More...
void | draw_line (const LineSegment2f &line_segment, const Colorf &color=Colorf::white)
| Line. More...
void | draw_lines (const Vec2f *positions, int num_vertices, const Colorf &color=Colorf::white)
| Lines. More...
void | draw_lines (const Vec2f *line_positions, const Vec2f *texture_positions, int num_vertices, const Texture2D &texture, const Colorf &line_color=Colorf::white)
| Lines. More...
void | draw_line_strip (const Vec2f *positions, int num_vertices, const Colorf &color=Colorf::white)
| Line Strip. More...
void | draw_box (float x1, float y1, float x2, float y2, const Colorf &color=Colorf::white)
| Draw a box / rectangle. More...
void | draw_box (const Pointf &start, const Pointf &end, const Colorf &color=Colorf::white)
| Box. More...
void | draw_box (const Rectf &rect, const Colorf &color)
| Box. More...
void | fill_rect (float x1, float y1, float x2, float y2, const Colorf &color=Colorf::white)
| Draw a filled box / rectangle. More...
void | fill_rect (const Pointf &start, const Pointf &end, const Colorf &color=Colorf::white)
| Fill. More...
void | fill_rect (const Rectf &rect, const Colorf &color)
| Fill. More...
void | fill_rect (float x1, float y1, float x2, float y2, const Gradient &color)
| Gradient fill. More...
void | fill_rect (const Pointf &start, const Pointf &end, const Gradient &gradient)
| Gradient fill. More...
void | fill_rect (const Rectf &rect, const Gradient &gradient)
| Gradient fill. More...
void | fill_circle (float center_x, float center_y, float radius, const Colorf &color=Colorf::white)
| Draw a circle. More...
void | fill_circle (const Pointf &center, float radius, const Colorf &color=Colorf::white)
| Circle. More...
void | fill_circle (const Pointf &center, float radius, const Gradient &gradient)
| Gradient circle. More...
void | fill_circle (const Pointf &center, const Pointf &centergradient, float radius, const Gradient &gradient)
| Gradient circle. More...
void | fill_triangle (const Pointf &a, const Pointf &b, const Pointf &c, const Colorf &color=Colorf::white)
| Draw a triangle. More...
void | fill_triangle (const Trianglef &dest_triangle, const Colorf &color=Colorf::white)
| Draw a triangle. More...
void | fill_triangles (const Vec2f *triangle_positions, int num_vertices, const Colorf &color=Colorf::white)
| Draw triangles. More...
void | fill_triangles (const Vec2f *triangle_positions, int num_vertices, const Gradient &gradient)
| Draw triangles. More...
void | fill_triangles (const Vec2f *triangle_positions, const Colorf *colors, int num_vertices)
| Draw triangles. More...
void | fill_triangles (const std::vector< Vec2f > &triangles, const Colorf *colors)
| Draw triangles. More...
void | fill_triangles (const std::vector< Vec2f > &triangles, const Colorf &color=Colorf::white)
| Draw triangles. More...
void | fill_triangles (const std::vector< Vec2f > &triangles, const Gradient &gradient)
| Draw triangles. More...
void | fill_triangles (const Vec2f *positions, const Vec2f *texture_positions, int num_vertices, const Texture2D &texture, const Colorf &color=Colorf::white)
| Draw triangles. More...
void | fill_triangles (const Vec2f *positions, const Vec2f *texture_positions, int num_vertices, const Texture2D &texture, const Colorf *colors)
| Draw triangles. More...
void | fill_triangles (const std::vector< Vec2f > &positions, const std::vector< Vec2f > &texture_positions, const Texture2D &texture, const Colorf &color=Colorf::white)
| Draw triangles. More...
void | fill_triangles (const std::vector< Vec2f > &positions, const std::vector< Vec2f > &texture_positions, const Texture2D &texture, const std::vector< Colorf > &colors)
| Draw triangles. More...
void | fill_triangles (const std::vector< Vec2f > &positions, const Texture2D &texture, const Colorf &color=Colorf::white)
| Draw triangles. More...
void | fill_triangles (const std::vector< Vec2f > &positions, const Texture2D &texture, const Rect &texture_rect, const Colorf &color=Colorf::white)
| Draw triangles. More...
void | fill_triangles (const Vec2f *triangle_positions, int num_vertices, const Texture2D &texture, const Colorf &color=Colorf::white)
| Draw triangles. More...
void | fill_triangles (const Vec2f *triangle_positions, int num_vertices, const Texture2D &texture, const Rect &texture_rect, const Colorf &color=Colorf::white)
| Draw triangles. More...
void | fill_triangles (const std::vector< Vec2f > &positions, const Texture2D &texture, const Gradient &gradient)
| Draw triangles. More...
void | fill_triangles (const std::vector< Vec2f > &positions, const Texture2D &texture, const Rect &texture_rect, const Gradient &gradient)
| Draw triangles. More...
void | fill_triangles (const Vec2f *triangle_positions, int num_vertices, const Texture2D &texture, const Gradient &gradient)
| Draw triangles. More...
void | fill_triangles (const Vec2f *triangle_positions, int num_vertices, const Texture2D &texture, const Rect &texture_rect, const Gradient &gradient)
| Draw triangles. More...
void | fill_ellipse (const Pointf &center, float radius_x, float radius_y, const Colorf &color=Colorf::white)
| Draw a filled ellipse. More...
void | fill_ellipse (const Pointf &center, float radius_x, float radius_y, const Gradient &gradient)
| Draw a gradient filled ellipse. More...
Pointf | grid_fit (const Pointf &pos)
| Snaps the point to the nearest pixel corner. More...

## Implementation
class | Sprite_Impl
class | Image
class | Font_Impl
class | Font_DrawSubPixel
class | Font_DrawFlat
class | Font_DrawScaled
class | Path

## Detailed Description

2D Graphics Canvas

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

- canvas.h