Geometrize  1.0
C++ library for geometrizing images into geometric primitives
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | Public Attributes | List of all members
geometrize::QuadraticBezier Class Reference

The QuadraticBezier class represents a quadratic bezier curve. More...

#include <quadraticbezier.h>

Inheritance diagram for geometrize::QuadraticBezier:
Inheritance graph
[legend]
Collaboration diagram for geometrize::QuadraticBezier:
Collaboration graph
[legend]

Public Member Functions

 QuadraticBezier ()=default
 
 QuadraticBezier (float cx, float cy, float x1, float y1, float x2, float y2)
 
virtual std::shared_ptr
< geometrize::Shape
clone () const override
 clone Clones the shape, a virtual copy constructor. More...
 
virtual geometrize::ShapeTypes getType () const override
 getType Gets the ShapeType of the shape. More...
 
- Public Member Functions inherited from geometrize::Shape
 Shape ()=default
 
virtual ~Shape ()=default
 
Shapeoperator= (const geometrize::Shape &other)=default
 
 Shape (const geometrize::Shape &other)=default
 

Public Attributes

float m_cx
 Control point x-coordinate. More...
 
float m_cy
 Control point y-coordinate. More...
 
float m_x1
 First x-coordinate. More...
 
float m_y1
 First y-coordinate. More...
 
float m_x2
 Second x-coordinate. More...
 
float m_y2
 Second y-coordinate. More...
 
- Public Attributes inherited from geometrize::Shape
std::function< void(geometrize::Shape &)> setup
 
std::function< void(geometrize::Shape &)> mutate
 
std::function< std::vector
< geometrize::Scanline >const
geometrize::Shape &)> 
rasterize
 

Detailed Description

The QuadraticBezier class represents a quadratic bezier curve.

Author
Sam Twidale (https://samcodes.co.uk/)

Constructor & Destructor Documentation

geometrize::QuadraticBezier::QuadraticBezier ( )
default
geometrize::QuadraticBezier::QuadraticBezier ( float  cx,
float  cy,
float  x1,
float  y1,
float  x2,
float  y2 
)
10  : Shape()
11 {
12  m_cx = cx;
13  m_cy = cy;
14  m_x1 = x1;
15  m_y1 = y1;
16  m_x2 = x2;
17  m_y2 = y2;
18 }
float m_x1
First x-coordinate.
Definition: quadraticbezier.h:26
float m_x2
Second x-coordinate.
Definition: quadraticbezier.h:28
float m_y1
First y-coordinate.
Definition: quadraticbezier.h:27
float m_cx
Control point x-coordinate.
Definition: quadraticbezier.h:24
float m_y2
Second y-coordinate.
Definition: quadraticbezier.h:29
float m_cy
Control point y-coordinate.
Definition: quadraticbezier.h:25

Member Function Documentation

std::shared_ptr< geometrize::Shape > geometrize::QuadraticBezier::clone ( ) const
overridevirtual

clone Clones the shape, a virtual copy constructor.

Returns
A clone of the shape.

Reimplemented from geometrize::Shape.

21 {
22  std::shared_ptr<geometrize::QuadraticBezier> bezier{std::make_shared<geometrize::QuadraticBezier>()};
23  bezier->m_x1 = m_x1;
24  bezier->m_y1 = m_y1;
25  bezier->m_cx = m_cx;
26  bezier->m_cy = m_cy;
27  bezier->m_x2 = m_x2;
28  bezier->m_y2 = m_y2;
29  bezier->setup = setup;
30  bezier->mutate = mutate;
31  bezier->rasterize = rasterize;
32  return bezier;
33 }
float m_x1
First x-coordinate.
Definition: quadraticbezier.h:26
float m_x2
Second x-coordinate.
Definition: quadraticbezier.h:28
float m_y1
First y-coordinate.
Definition: quadraticbezier.h:27
float m_cx
Control point x-coordinate.
Definition: quadraticbezier.h:24
float m_y2
Second y-coordinate.
Definition: quadraticbezier.h:29
std::function< void(geometrize::Shape &)> mutate
Definition: shape.h:26
std::function< std::vector< geometrize::Scanline >const geometrize::Shape &)> rasterize
Definition: shape.h:27
float m_cy
Control point y-coordinate.
Definition: quadraticbezier.h:25
std::function< void(geometrize::Shape &)> setup
Definition: shape.h:25
geometrize::ShapeTypes geometrize::QuadraticBezier::getType ( ) const
overridevirtual

getType Gets the ShapeType of the shape.

Returns
The ShapeType of the shape.

Reimplemented from geometrize::Shape.

36 {
38 }
Definition: shapetypes.h:25

Member Data Documentation

float geometrize::QuadraticBezier::m_cx

Control point x-coordinate.

float geometrize::QuadraticBezier::m_cy

Control point y-coordinate.

float geometrize::QuadraticBezier::m_x1

First x-coordinate.

float geometrize::QuadraticBezier::m_x2

Second x-coordinate.

float geometrize::QuadraticBezier::m_y1

First y-coordinate.

float geometrize::QuadraticBezier::m_y2

Second y-coordinate.


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