Euphoria
image_canvas.h
Go to the documentation of this file.
1 #pragma once
2 
3 
4 
5 #include "base/rgb.h"
6 #include "base/vec2.h"
7 #include "base/mat3.h"
8 
9 namespace eu::core
10 {
11  struct Image;
12 
15  struct Canvas
16  {
21  std::vector<vec2f> path;
22 
23  Canvas(Image* i);
24 
25  void translate(float x, float y);
26  void rotate(float r);
27  void begin_path();
28  void close_path();
29  void move_to(float x, float y);
30 
32  void draw_line_to(float dx, float dy);
33 
34  [[nodiscard]] vec2f transform_position(const vec2f& v) const;
35  void fill_rect(int x, int y, int w, int h) const;
36 
37  void fill() const;
38  };
39 }
40 
Definition: rgb.h:26
hacky layer between something that looks like the html 'canvas rendering context 2d' and the euphoria...
Definition: image_canvas.h:16
std::vector< vec2f > path
Definition: image_canvas.h:21
vec2f transform_position(const vec2f &v) const
Definition: image_canvas.cc:18
void translate(float x, float y)
Definition: image_canvas.cc:54
void fill() const
void move_to(float x, float y)
Definition: image_canvas.cc:82
void rotate(float r)
Definition: image_canvas.cc:61
void draw_line_to(float dx, float dy)
should be named line_to but that name is horrible
Definition: image_canvas.cc:90
Image * target_image
Definition: image_canvas.h:18
void fill_rect(int x, int y, int w, int h) const
Definition: image_canvas.cc:37
Canvas(Image *i)
Definition: image_canvas.cc:28
Definition: mat3.h:12
Definition: vec2.h:33