Geometrize  1.0
C++ library for geometrizing images into geometric primitives
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
shapemutator.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <cstdint>
4 
5 namespace geometrize
6 {
7 class Circle;
8 class Ellipse;
9 class Line;
10 class Polyline;
11 class QuadraticBezier;
12 class Rectangle;
13 class RotatedEllipse;
14 class RotatedRectangle;
15 class Shape;
16 class Triangle;
17 }
18 
19 namespace geometrize
20 {
21 
22 // Default implementations that perform initial setup on each type of shape
23 void setup(geometrize::Shape& s, std::int32_t xBound, std::int32_t yBound);
24 void setup(geometrize::Circle& s, std::int32_t xBound, std::int32_t yBound);
25 void setup(geometrize::Ellipse& s, std::int32_t xBound, std::int32_t yBound);
26 void setup(geometrize::Line& s, std::int32_t xBound, std::int32_t yBound);
27 void setup(geometrize::Polyline& s, std::int32_t xBound, std::int32_t yBound);
28 void setup(geometrize::QuadraticBezier& s, std::int32_t xBound, std::int32_t yBound);
29 void setup(geometrize::Rectangle& s, std::int32_t xBound, std::int32_t yBound);
30 void setup(geometrize::RotatedEllipse& s, std::int32_t xBound, std::int32_t yBound);
31 void setup(geometrize::RotatedRectangle& s, std::int32_t xBound, std::int32_t yBound);
32 void setup(geometrize::Triangle& s, std::int32_t xBound, std::int32_t yBound);
33 
34 // Default implementations that mutate each type of shape
35 void mutate(geometrize::Shape& s, std::int32_t xBound, std::int32_t yBound);
36 void mutate(geometrize::Circle& s, std::int32_t xBound, std::int32_t yBound);
37 void mutate(geometrize::Ellipse& s, std::int32_t xBound, std::int32_t yBound);
38 void mutate(geometrize::Line& s, std::int32_t xBound, std::int32_t yBound);
39 void mutate(geometrize::Polyline& s, std::int32_t xBound, std::int32_t yBound);
40 void mutate(geometrize::QuadraticBezier& s, std::int32_t xBound, std::int32_t yBound);
41 void mutate(geometrize::Rectangle& s, std::int32_t xBound, std::int32_t yBound);
42 void mutate(geometrize::RotatedEllipse& s, std::int32_t xBound, std::int32_t yBound);
43 void mutate(geometrize::RotatedRectangle& s, std::int32_t xBound, std::int32_t yBound);
44 void mutate(geometrize::Triangle& s, std::int32_t xBound, std::int32_t yBound);
45 
46 // Default implementations that translate each type of shape
47 void translate(geometrize::Shape& s, float x, float y);
48 void translate(geometrize::Circle& s, float x, float y);
49 void translate(geometrize::Ellipse& s, float x, float y);
50 void translate(geometrize::Line& s, float x, float y);
51 void translate(geometrize::Polyline& s, float x, float y);
52 void translate(geometrize::QuadraticBezier& s, float x, float y);
53 void translate(geometrize::Rectangle& s, float x, float y);
54 void translate(geometrize::RotatedEllipse& s, float x, float y);
55 void translate(geometrize::RotatedRectangle& s, float x, float y);
56 void translate(geometrize::Triangle& s, float x, float y);
57 
58 // Default implementations that scale each type of shape
59 void scale(geometrize::Shape& s, float scaleFactor);
60 void scale(geometrize::Circle& s, float scaleFactor);
61 void scale(geometrize::Ellipse& s, float scaleFactor);
62 void scale(geometrize::Line& s, float scaleFactor);
63 void scale(geometrize::Polyline& s, float scaleFactor);
64 void scale(geometrize::QuadraticBezier& s, float scaleFactor);
65 void scale(geometrize::Rectangle& s, float scaleFactor);
66 void scale(geometrize::RotatedEllipse& s, float scaleFactor);
67 void scale(geometrize::RotatedRectangle& s, float scaleFactor);
68 void scale(geometrize::Triangle& s, float scaleFactor);
69 
70 // Default implementations that rotate each type of shape through an angle (those which support rotation anyway)
71 void rotate(geometrize::Shape& s, float angle);
72 void rotate(geometrize::Line& s, float angle);
73 void rotate(geometrize::RotatedEllipse& s, float angle);
74 void rotate(geometrize::RotatedRectangle& s, float angle);
75 void rotate(geometrize::Triangle& s, float angle);
76 
77 }
The RotatedEllipse class represents a rotated ellipse.
Definition: rotatedellipse.h:15
The Circle class represents a circle.
Definition: circle.h:15
The Line class represents a simple line.
Definition: line.h:15
void translate(geometrize::Shape &s, const float x, const float y)
Definition: shapemutator.cpp:383
The Rectangle class represents a rectangle.
Definition: rectangle.h:15
The Ellipse class represents an ellipse.
Definition: ellipse.h:15
The Triangle class represents a triangle.
Definition: triangle.h:15
void rotate(geometrize::Shape &s, const float angle)
Definition: shapemutator.cpp:615
void setup(geometrize::Shape &s, const std::int32_t xBound, const std::int32_t yBound)
Definition: shapemutator.cpp:37
void mutate(geometrize::Shape &s, const std::int32_t xBound, const std::int32_t yBound)
Definition: shapemutator.cpp:155
The Polyline class represents a polyline.
Definition: polyline.h:17
void scale(geometrize::Shape &s, const float scaleFactor)
Definition: shapemutator.cpp:488
The RotatedRectangle class represents a rotated rectangle.
Definition: rotatedrectangle.h:15
Definition: shape.h:17
The QuadraticBezier class represents a quadratic bezier curve.
Definition: quadraticbezier.h:15