canvas.h Source File - ClanLib SDK
Description: canvas.h Source File

canvas.h
1/*
2** ClanLib SDK
3** Copyright (c) 1997-2020 The ClanLib Team
4**
5** This software is provided 'as-is', without any express or implied
6** warranty. In no event will the authors be held liable for any damages
7** arising from the use of this software.
8**
9** Permission is granted to anyone to use this software for any purpose,
10** including commercial applications, and to alter it and redistribute it
11** freely, subject to the following restrictions:
12**
13** 1. The origin of this software must not be misrepresented; you must not
14** claim that you wrote the original software. If you use this software
15** in a product, an acknowledgment in the product documentation would be
16** appreciated but is not required.
17** 2. Altered source versions must be plainly marked as such, and must not be
18** misrepresented as being the original software.
19** 3. This notice may not be removed or altered from any source distribution.
20**
21** Note: Some of the libraries ClanLib may link to may have additional
22** requirements or restrictions.
23**
24** File Author(s):
25**
26** Magnus Norddahl
27** Harry Storbacka
28** Kenneth Gangstoe
29** Mark Page
30*/
31
32#pragma once
33
34#include "../Render/graphic_context.h"
35
36namespace clan
37{
40
41 class Canvas_Impl;
42 class GraphicContext;
43 class PrimitivesArray;
44 class Sprite_Impl;
45 class Image;
46 class GlyphCache;
47 class Draw;
48 class RenderBatcher;
49 class Colorf;
50 class Pointf;
51 class Gradient;
52 class LineSegment2f;
53 class LineSegment2;
54 class Trianglef;
55 class Triangle;
56 class DisplayWindow;
57 class DisplayWindowDescription;
58 class Path;
59 class Pen;
60 class Brush;
61
63 enum class MapMode
64 {
65 _2d_upper_left,
66 _2d_lower_left,
67 _user_projection
68 };
69
71 class Canvas
72 {
73 public:
75 Canvas();
76
78 Canvas(Canvas &canvas, FrameBuffer &framebuffer);
79
81 explicit Canvas(DisplayWindow &window);
82
83 ~Canvas();
84
86 Canvas create();
87
89 bool is_null() const { return !impl; }
90 explicit operator bool() const { return bool(impl); }
91
93 void throw_if_null() const;
94
98 GraphicContext& get_gc() const;
99
101 const Mat4f &get_transform() const;
102
106 Mat4f &get_inverse_transform();
107
109 const Mat4f &get_projection() const;
110
111 operator GraphicContext&() const { return get_gc(); }
112
114 inline float get_width() const { return get_gc().get_dip_width(); }
115
117 inline float get_height() const { return get_gc().get_dip_height(); }
118
120 inline Sizef get_size() const { return get_gc().get_dip_size(); }
121
123 Rectf get_cliprect() const;
124
126 PixelBuffer get_pixeldata(const Rect& rect, TextureFormat texture_format = TextureFormat::rgba8, bool clamp = true);
127
129 PixelBuffer get_pixeldata(TextureFormat texture_format = TextureFormat::rgba8, bool clamp = true);
130
133 float get_pixel_ratio() const { return get_gc().get_pixel_ratio(); }
134
136 void set_rasterizer_state(const RasterizerState &state);
137
139 void set_blend_state(const BlendState &state, const Colorf &blend_color = StandardColorf::white(), unsigned int sample_mask = 0xffffffff);
140
142 void set_depth_stencil_state(const DepthStencilState &state, int stencil_ref = 0);
143
145 void reset_rasterizer_state();
146
148 void reset_blend_state();
149
151 void reset_depth_stencil_state();
152
154 void set_cliprect(const Rectf &rect);
155
157
160 void push_cliprect(const Rectf &rect);
161
163 void push_cliprect();
164
166 void pop_cliprect();
167
169 void reset_cliprect();
170
172 void clear(const Colorf &color = StandardColorf::black());
173
177 void clear_stencil(int value = 0);
178
182 void clear_depth(float value = 0);
183
185 void set_program_object(StandardProgram standard_program);
186
188 void set_map_mode(MapMode mode);
189
193 void set_viewport(const Rectf &viewport);
194
196 void set_projection(const Mat4f &matrix);
197
202 void set_batcher(RenderBatcher *batcher);
203
205 void set_transform(const Mat4f &matrix);
206
208 void mult_transform(const Mat4f &matrix);
209
211 void flush();
212
214 void draw_point(float x1, float y1, const Colorf &color);
215
221 void draw_point(const Pointf &point, const Colorf &color);
222
224 void draw_line(float x1, float y1, float x2, float y2, const Colorf &color = StandardColorf::white());
225
232 void draw_line(const Pointf &start, const Pointf &end, const Colorf &color = StandardColorf::white());
233
239 void draw_line(const LineSegment2f &line_segment, const Colorf &color = StandardColorf::white());
240
242 void draw_lines(const Vec2f *positions, int num_vertices, const Colorf &color = StandardColorf::white());
243
245 void draw_lines(const Vec2f *line_positions, const Vec2f *texture_positions, int num_vertices, const Texture2D &texture, const Colorf &line_color = StandardColorf::white());
246
248 void draw_line_strip(const Vec2f *positions, int num_vertices, const Colorf &color = StandardColorf::white());
249
251 void draw_box(float x1, float y1, float x2, float y2, const Colorf &color = StandardColorf::white());
252
259 void draw_box(const Pointf &start, const Pointf &end, const Colorf &color = StandardColorf::white());
260
266 void draw_box(const Rectf &rect, const Colorf &color);
267
269 void fill_rect(float x1, float y1, float x2, float y2, const Colorf &color = StandardColorf::white());
270
277 void fill_rect(const Pointf &start, const Pointf &end, const Colorf &color = StandardColorf::white());
278
284 void fill_rect(const Rectf &rect, const Colorf &color);
285
294 void fill_rect(float x1, float y1, float x2, float y2, const Gradient &color);
295
302 void fill_rect(const Pointf &start, const Pointf &end, const Gradient &gradient);
303
309 void fill_rect(const Rectf &rect, const Gradient &gradient);
310
312 void fill_circle(float center_x, float center_y, float radius, const Colorf &color = StandardColorf::white());
313
320 void fill_circle(const Pointf &center, float radius, const Colorf &color = StandardColorf::white());
321
328 void fill_circle(const Pointf &center, float radius, const Gradient &gradient);
329
337 void fill_circle(const Pointf &center, const Pointf &centergradient, float radius, const Gradient &gradient);
338
340 void fill_triangle(const Pointf &a, const Pointf &b, const Pointf &c, const Colorf &color = StandardColorf::white());
341
343 void fill_triangle(const Trianglef &dest_triangle, const Colorf &color = StandardColorf::white());
344
346 void fill_triangles(const Vec2f *triangle_positions, int num_vertices, const Colorf &color = StandardColorf::white());
347
349 void fill_triangles(const Vec2f *triangle_positions, int num_vertices, const Gradient &gradient);
350
352 void fill_triangles(const Vec2f *triangle_positions, const Colorf *colors, int num_vertices);
353
355 void fill_triangles(const std::vector<Vec2f> &triangles, const Colorf *colors);
356
358 void fill_triangles(const std::vector<Vec2f> &triangles, const Colorf &color = StandardColorf::white());
359
361 void fill_triangles(const std::vector<Vec2f> &triangles, const Gradient &gradient);
362
364 void fill_triangles(const Vec2f *positions, const Vec2f *texture_positions, int num_vertices, const Texture2D &texture, const Colorf &color = StandardColorf::white());
365
367 void fill_triangles(const Vec2f *positions, const Vec2f *texture_positions, int num_vertices, const Texture2D &texture, const Colorf *colors);
368
370 void fill_triangles(const std::vector<Vec2f> &positions, const std::vector<Vec2f> &texture_positions, const Texture2D &texture, const Colorf &color = StandardColorf::white());
371
373 void fill_triangles(const std::vector<Vec2f> &positions, const std::vector<Vec2f> &texture_positions, const Texture2D &texture, const std::vector<Colorf> &colors);
374
376 void fill_triangles(const std::vector<Vec2f> &positions, const Texture2D &texture, const Colorf &color = StandardColorf::white());
377
379 void fill_triangles(const std::vector<Vec2f> &positions, const Texture2D &texture, const Rect &texture_rect, const Colorf &color = StandardColorf::white());
380
382 void fill_triangles(const Vec2f *triangle_positions, int num_vertices, const Texture2D &texture, const Colorf &color = StandardColorf::white());
383
385 void fill_triangles(const Vec2f *triangle_positions, int num_vertices, const Texture2D &texture, const Rect &texture_rect, const Colorf &color = StandardColorf::white());
386
388 void fill_triangles(const std::vector<Vec2f> &positions, const Texture2D &texture, const Gradient &gradient);
389
391 void fill_triangles(const std::vector<Vec2f> &positions, const Texture2D &texture, const Rect &texture_rect, const Gradient &gradient);
392
394 void fill_triangles(const Vec2f *triangle_positions, int num_vertices, const Texture2D &texture, const Gradient &gradient);
395
397 void fill_triangles(const Vec2f *triangle_positions, int num_vertices, const Texture2D &texture, const Rect &texture_rect, const Gradient &gradient);
398
400 void fill_ellipse(const Pointf &center, float radius_x, float radius_y, const Colorf &color = StandardColorf::white());
401
403 void fill_ellipse(const Pointf &center, float radius_x, float radius_y, const Gradient &gradient);
404
406 Pointf grid_fit(const Pointf &pos);
407
408 private:
409 std::shared_ptr<Canvas_Impl> impl;
410
411 friend class Sprite_Impl;
412 friend class Image;
413 friend class Font_Impl;
414 friend class Font_DrawSubPixel;
415 friend class Font_DrawFlat;
416 friend class Font_DrawScaled;
417 friend class Path;
418 };
419
420 // Helper class to save the transform state for exception safety
421 class TransformState
422 {
423 public:
424 TransformState(Canvas *current_canvas) : matrix(current_canvas->get_transform()), canvas(current_canvas) {}
425 ~TransformState() { canvas->set_transform(matrix); }
426 const Mat4f matrix;
427 private:
428 Canvas *canvas;
429 };
430
431 // Helper class to save the clip rect state for exception safety
432 class ClipRectState
433 {
434 public:
435 ClipRectState(Canvas *current_canvas) : cliprect(current_canvas->get_cliprect()), canvas(current_canvas) {}
436 ~ClipRectState() { (Rectf(canvas->get_size()) == cliprect) ? canvas->reset_cliprect() : canvas->set_cliprect(cliprect); }
437 const Rectf cliprect;
438 private:
439 Canvas *canvas;
440 };
441
442 // Helper class to control the cliprect stack state for exception safety
443 class ClipRectStack
444 {
445 public:
446 ClipRectStack(Canvas *current_canvas) : canvas(current_canvas) {}
447 ~ClipRectStack() { for (; push_count > 0; --push_count) canvas->pop_cliprect(); }
448
449 void push_cliprect(const Rectf &rect) { push_count++; canvas->push_cliprect(rect); }
450 void push_cliprect() { push_count++; canvas->push_cliprect(); }
451 void pop_cliprect() { if (push_count) { --push_count; canvas->pop_cliprect(); } }
452 private:
453 unsigned int push_count = 0;
454 clan::Canvas *canvas;
455 };
456
458}
clan::BlendState
Blend state setup.
Definition blend_state.h:44
clan::Brush
Definition brush.h:71
clan::Canvas
2D Graphics Canvas
Definition canvas.h:72
clan::Canvas::fill_triangle
void fill_triangle(const Trianglef &dest_triangle, const Colorf &color=StandardColorf::white())
Draw a triangle.
clan::Canvas::Canvas
Canvas(DisplayWindow &window)
Constructs a Canvas.
clan::Canvas::set_viewport
void set_viewport(const Rectf &viewport)
clan::Canvas::fill_triangles
void fill_triangles(const std::vector< Vec2f > &positions, const Texture2D &texture, const Rect &texture_rect, const Gradient &gradient)
Draw triangles.
clan::Canvas::fill_rect
void fill_rect(float x1, float y1, float x2, float y2, const Gradient &color)
Gradient fill.
clan::Canvas::clear_stencil
void clear_stencil(int value=0)
Clear the stencil buffer.
clan::Canvas::fill_rect
void fill_rect(const Rectf &rect, const Colorf &color)
Fill.
clan::Canvas::set_rasterizer_state
void set_rasterizer_state(const RasterizerState &state)
Set active rasterizer state.
clan::Canvas::draw_box
void draw_box(const Pointf &start, const Pointf &end, const Colorf &color=StandardColorf::white())
Box.
clan::Canvas::push_cliprect
void push_cliprect(const Rectf &rect)
Push current clipping rectangle to stack.
clan::Canvas::fill_triangles
void fill_triangles(const std::vector< Vec2f > &positions, const Texture2D &texture, const Rect &texture_rect, const Colorf &color=StandardColorf::white())
Draw triangles.
clan::Canvas::grid_fit
Pointf grid_fit(const Pointf &pos)
Snaps the point to the nearest pixel corner.
clan::Canvas::set_batcher
void set_batcher(RenderBatcher *batcher)
Specifies which render batcher is to be currently active.
clan::Canvas::get_size
Sizef get_size() const
Returns the current size of the context.
Definition canvas.h:120
clan::Canvas::fill_circle
void fill_circle(float center_x, float center_y, float radius, const Colorf &color=StandardColorf::white())
Draw a circle.
clan::Canvas::Canvas
Canvas()
Constructs a null instance.
clan::Canvas::get_transform
const Mat4f & get_transform() const
Returns the current effective transform matrix.
clan::Canvas::get_projection
const Mat4f & get_projection() const
Returns the current effective projection matrix.
clan::Canvas::clear
void clear(const Colorf &color=StandardColorf::black())
Clears the whole context using the specified color.
clan::Canvas::fill_triangles
void fill_triangles(const Vec2f *triangle_positions, int num_vertices, const Gradient &gradient)
Draw triangles.
clan::Canvas::draw_point
void draw_point(float x1, float y1, const Colorf &color)
Draw a point.
clan::Canvas::Font_DrawScaled
friend class Font_DrawScaled
Definition canvas.h:416
clan::Canvas::get_pixeldata
PixelBuffer get_pixeldata(const Rect &rect, TextureFormat texture_format=TextureFormat::rgba8, bool clamp=true)
Return the content of the read buffer into a pixel buffer.
clan::Canvas::Font_Impl
friend class Font_Impl
Definition canvas.h:413
clan::Canvas::Path
friend class Path
Definition canvas.h:417
clan::Canvas::set_blend_state
void set_blend_state(const BlendState &state, const Colorf &blend_color=StandardColorf::white(), unsigned int sample_mask=0xffffffff)
Set active blend state.
clan::Canvas::get_pixel_ratio
float get_pixel_ratio() const
Definition canvas.h:133
clan::Canvas::mult_transform
void mult_transform(const Mat4f &matrix)
Multiplies the passed matrix onto the transform matrix.
clan::Canvas::fill_circle
void fill_circle(const Pointf &center, float radius, const Colorf &color=StandardColorf::white())
Circle.
clan::Canvas::fill_triangles
void fill_triangles(const Vec2f *triangle_positions, int num_vertices, const Texture2D &texture, const Rect &texture_rect, const Colorf &color=StandardColorf::white())
Draw triangles.
clan::Canvas::flush
void flush()
Flushes the render batcher currently active.
clan::Canvas::Image
friend class Image
Definition canvas.h:412
clan::Canvas::draw_box
void draw_box(const Rectf &rect, const Colorf &color)
Box.
clan::Canvas::reset_cliprect
void reset_cliprect()
Removes the set clipping rectangle and empties the cliprect stack.
clan::Canvas::throw_if_null
void throw_if_null() const
Throw an exception if this object is invalid.
clan::Canvas::draw_box
void draw_box(float x1, float y1, float x2, float y2, const Colorf &color=StandardColorf::white())
Draw a box / rectangle.
clan::Canvas::fill_triangles
void fill_triangles(const Vec2f *triangle_positions, const Colorf *colors, int num_vertices)
Draw triangles.
clan::Canvas::pop_cliprect
void pop_cliprect()
Pop current clipping rectangle from the stack.
clan::Canvas::draw_line
void draw_line(const Pointf &start, const Pointf &end, const Colorf &color=StandardColorf::white())
Line.
clan::Canvas::fill_rect
void fill_rect(const Rectf &rect, const Gradient &gradient)
Gradient fill.
clan::Canvas::draw_line
void draw_line(const LineSegment2f &line_segment, const Colorf &color=StandardColorf::white())
Line.
clan::Canvas::draw_line_strip
void draw_line_strip(const Vec2f *positions, int num_vertices, const Colorf &color=StandardColorf::white())
Line Strip.
clan::Canvas::set_program_object
void set_program_object(StandardProgram standard_program)
Set active program object to the standard program specified.
clan::Canvas::get_pixeldata
PixelBuffer get_pixeldata(TextureFormat texture_format=TextureFormat::rgba8, bool clamp=true)
Return the content of the read buffer into a pixel buffer.
clan::Canvas::reset_blend_state
void reset_blend_state()
Set active blend state.
clan::Canvas::draw_line
void draw_line(float x1, float y1, float x2, float y2, const Colorf &color=StandardColorf::white())
Draw a line.
clan::Canvas::fill_ellipse
void fill_ellipse(const Pointf &center, float radius_x, float radius_y, const Colorf &color=StandardColorf::white())
Draw a filled ellipse.
clan::Canvas::get_height
float get_height() const
Returns the current height of the context.
Definition canvas.h:117
clan::Canvas::is_null
bool is_null() const
Returns true if this object is invalid.
Definition canvas.h:89
clan::Canvas::set_transform
void set_transform(const Mat4f &matrix)
Sets the transform matrix to a new matrix.
clan::Canvas::fill_triangles
void fill_triangles(const Vec2f *triangle_positions, int num_vertices, const Texture2D &texture, const Rect &texture_rect, const Gradient &gradient)
Draw triangles.
clan::Canvas::push_cliprect
void push_cliprect()
Push cliprect.
clan::Canvas::fill_rect
void fill_rect(const Pointf &start, const Pointf &end, const Colorf &color=StandardColorf::white())
Fill.
clan::Canvas::fill_triangles
void fill_triangles(const std::vector< Vec2f > &triangles, const Gradient &gradient)
Draw triangles.
clan::Canvas::~Canvas
~Canvas()
clan::Canvas::reset_depth_stencil_state
void reset_depth_stencil_state()
Set active depth stencil state.
clan::Canvas::create
Canvas create()
Create a copy of a canvas.
clan::Canvas::get_gc
GraphicContext & get_gc() const
Get gc.
clan::Canvas::fill_triangles
void fill_triangles(const std::vector< Vec2f > &triangles, const Colorf *colors)
Draw triangles.
clan::Canvas::Font_DrawSubPixel
friend class Font_DrawSubPixel
Definition canvas.h:414
clan::Canvas::fill_triangles
void fill_triangles(const std::vector< Vec2f > &positions, const Texture2D &texture, const Colorf &color=StandardColorf::white())
Draw triangles.
clan::Canvas::Sprite_Impl
friend class Sprite_Impl
Definition canvas.h:411
clan::Canvas::fill_circle
void fill_circle(const Pointf &center, const Pointf &centergradient, float radius, const Gradient &gradient)
Gradient circle.
clan::Canvas::reset_rasterizer_state
void reset_rasterizer_state()
Set active rasterizer state.
clan::Canvas::get_cliprect
Rectf get_cliprect() const
Returns the current clipping rectangle.
clan::Canvas::fill_rect
void fill_rect(float x1, float y1, float x2, float y2, const Colorf &color=StandardColorf::white())
Draw a filled box / rectangle.
clan::Canvas::fill_rect
void fill_rect(const Pointf &start, const Pointf &end, const Gradient &gradient)
Gradient fill.
clan::Canvas::fill_triangles
void fill_triangles(const Vec2f *positions, const Vec2f *texture_positions, int num_vertices, const Texture2D &texture, const Colorf *colors)
Draw triangles.
clan::Canvas::fill_triangles
void fill_triangles(const Vec2f *triangle_positions, int num_vertices, const Texture2D &texture, const Gradient &gradient)
Draw triangles.
clan::Canvas::set_projection
void set_projection(const Mat4f &matrix)
Set the projection matrix to be used in user projection map mode.
clan::Canvas::Font_DrawFlat
friend class Font_DrawFlat
Definition canvas.h:415
clan::Canvas::fill_ellipse
void fill_ellipse(const Pointf &center, float radius_x, float radius_y, const Gradient &gradient)
Draw a gradient filled ellipse.
clan::Canvas::get_inverse_transform
Mat4f & get_inverse_transform()
Returns the inverse of the current effective transform matrix.
clan::Canvas::fill_triangles
void fill_triangles(const std::vector< Vec2f > &positions, const std::vector< Vec2f > &texture_positions, const Texture2D &texture, const std::vector< Colorf > &colors)
Draw triangles.
clan::Canvas::Canvas
Canvas(Canvas &canvas, FrameBuffer &framebuffer)
Constructs a Canvas based on a framebuffer. (based on the copy of the canvas).
clan::Canvas::set_depth_stencil_state
void set_depth_stencil_state(const DepthStencilState &state, int stencil_ref=0)
Set active depth stencil state.
clan::Canvas::get_width
float get_width() const
Returns the current width of the context.
Definition canvas.h:114
clan::Canvas::set_map_mode
void set_map_mode(MapMode mode)
Set the projection mapping mode.
clan::Canvas::draw_point
void draw_point(const Pointf &point, const Colorf &color)
Point.
clan::Canvas::fill_triangles
void fill_triangles(const Vec2f *triangle_positions, int num_vertices, const Texture2D &texture, const Colorf &color=StandardColorf::white())
Draw triangles.
clan::Canvas::set_cliprect
void set_cliprect(const Rectf &rect)
Set the current clipping rectangle.
clan::Canvas::fill_circle
void fill_circle(const Pointf &center, float radius, const Gradient &gradient)
Gradient circle.
clan::Canvas::draw_lines
void draw_lines(const Vec2f *positions, int num_vertices, const Colorf &color=StandardColorf::white())
Lines.
clan::Canvas::fill_triangles
void fill_triangles(const std::vector< Vec2f > &triangles, const Colorf &color=StandardColorf::white())
Draw triangles.
clan::Canvas::clear_depth
void clear_depth(float value=0)
Clear the depth buffer.
clan::Canvas::fill_triangles
void fill_triangles(const std::vector< Vec2f > &positions, const Texture2D &texture, const Gradient &gradient)
Draw triangles.
clan::Canvas::fill_triangles
void fill_triangles(const std::vector< Vec2f > &positions, const std::vector< Vec2f > &texture_positions, const Texture2D &texture, const Colorf &color=StandardColorf::white())
Draw triangles.
clan::Canvas::draw_lines
void draw_lines(const Vec2f *line_positions, const Vec2f *texture_positions, int num_vertices, const Texture2D &texture, const Colorf &line_color=StandardColorf::white())
Lines.
clan::Canvas::fill_triangles
void fill_triangles(const Vec2f *positions, const Vec2f *texture_positions, int num_vertices, const Texture2D &texture, const Colorf &color=StandardColorf::white())
Draw triangles.
clan::Canvas::fill_triangles
void fill_triangles(const Vec2f *triangle_positions, int num_vertices, const Colorf &color=StandardColorf::white())
Draw triangles.
clan::Canvas::fill_triangle
void fill_triangle(const Pointf &a, const Pointf &b, const Pointf &c, const Colorf &color=StandardColorf::white())
Draw a triangle.
clan::ClipRectStack::push_cliprect
void push_cliprect()
Definition canvas.h:450
clan::ClipRectStack::ClipRectStack
ClipRectStack(Canvas *current_canvas)
Definition canvas.h:446
clan::ClipRectStack::push_cliprect
void push_cliprect(const Rectf &rect)
Definition canvas.h:449
clan::ClipRectStack::pop_cliprect
void pop_cliprect()
Definition canvas.h:451
clan::ClipRectStack::~ClipRectStack
~ClipRectStack()
Definition canvas.h:447
clan::ClipRectState::ClipRectState
ClipRectState(Canvas *current_canvas)
Definition canvas.h:435
clan::ClipRectState::cliprect
const Rectf cliprect
Definition canvas.h:437
clan::ClipRectState::~ClipRectState
~ClipRectState()
Definition canvas.h:436
clan::Colorf
Floating point color description class (for float).
Definition color.h:799
clan::DepthStencilState
DepthStencil state setup.
Definition depth_stencil_state.h:44
clan::DisplayWindowDescription
Display window description class.
Definition display_window_description.h:50
clan::DisplayWindow
Top-level window class.
Definition display_window.h:101
clan::FrameBuffer
Frame-buffer object class.
Definition frame_buffer.h:72
clan::Gradient
Colorgradient description class.
Definition gradient.h:41
clan::GraphicContext
Interface to drawing graphics.
Definition graphic_context.h:257
clan::GraphicContext::get_dip_size
Sizef get_dip_size() const
Definition graphic_context.h:353
clan::GraphicContext::get_dip_height
float get_dip_height() const
Definition graphic_context.h:349
clan::GraphicContext::get_dip_width
float get_dip_width() const
Definition graphic_context.h:345
clan::GraphicContext::get_pixel_ratio
float get_pixel_ratio() const
clan::Image
Image class.
Definition image.h:59
clan::LineSegment2
2D line segment - Integer
Definition line_segment.h:177
clan::LineSegment2f
2D line segment - Float
Definition line_segment.h:188
clan::Path
Definition path.h:53
clan::Pen
Definition pen.h:37
clan::PixelBuffer
Pixel data container.
Definition pixel_buffer.h:68
clan::Pointf
2D (x,y) point structure - Float
Definition point.h:72
clan::PrimitivesArray
Primitives array description.
Definition primitives_array.h:68
clan::RasterizerState
Rasterizer state setup.
Definition rasterizer_state.h:44
clan::Rect
2D (left,top,right,bottom) rectangle structure - Integer
Definition rect.h:446
clan::Rectf
2D (left,top,right,bottom) rectangle structure - Float
Definition rect.h:460
clan::RenderBatcher
Render batching abstraction.
Definition render_batcher.h:45
clan::Sizef
2D (width,height) size structure - Float
Definition size.h:189
clan::StandardColorf::black
static Colorf black()
Definition color.h:1747
clan::StandardColorf::white
static Colorf white()
Definition color.h:1884
clan::Texture2D
2D texture object class.
Definition texture_2d.h:41
clan::TransformState::matrix
const Mat4f matrix
Definition canvas.h:426
clan::TransformState::~TransformState
~TransformState()
Definition canvas.h:425
clan::TransformState::TransformState
TransformState(Canvas *current_canvas)
Definition canvas.h:424
clan::Triangle
Triangles - Integer.
Definition triangle_math.h:72
clan::Trianglef
Triangles - Float.
Definition triangle_math.h:81
clan::Mat4f
Mat4< float > Mat4f
Definition mat4.h:521
clan::Vec2f
Vec2< float > Vec2f
Definition vec2.h:357
clan::clamp
C clamp(A val, B minval, C maxval)
Definition cl_math.h:97
clan::Origin::center
@ center
Definition origin.h:44
clan::TextureFormat
TextureFormat
Texture format.
Definition texture_format.h:39
clan::StandardProgram
StandardProgram
Standard Program.
Definition graphic_context.h:239
clan::MapMode
MapMode
Mapping modes.
Definition canvas.h:64
clan::TextureFormat::rgba8
@ rgba8
Definition texture_format.h:41
clan::PrimitivesType::triangles
@ triangles
Definition graphic_context.h:227
clan::FillMode::point
@ point
Definition graphic_context.h:78
clan::MapMode::_2d_lower_left
@ _2d_lower_left
Definition canvas.h:66
clan::MapMode::_2d_upper_left
@ _2d_upper_left
Definition canvas.h:65
clan::MapMode::_user_projection
@ _user_projection
Definition canvas.h:67
clan
Definition clanapp.h:36
clan::StyleValueType::color
@ color
value is an url
Definition style_value_type.h:43
clan::Key::a
@ a
Definition keys.h:81
clan::Key::c
@ c
Definition keys.h:83
clan::Key::end
@ end
Definition keys.h:57
clan::Key::b
@ b
Definition keys.h:82