7#include "bezier_point.hpp"
8#include "bezier_curve.hpp"
9#include "exception.hpp"
10#include "geometry/axis_aligned_rectangle.hpp"
11#include "geometry/transform.hpp"
12#include "geometry/line_join_style.hpp"
13#include "rapid/sfloat_rgba16.hpp"
14#include "rapid/sdf_r8.hpp"
17namespace hi::inline v1 {
47 contourEndPoints.
clear();
48 layerEndContours.
clear();
57 [[nodiscard]]
ssize_t numberOfLayers() const noexcept;
61 [[nodiscard]]
bool allLayersHaveSameColor() const noexcept;
71 void tryRemoveLayers() noexcept;
97 [[nodiscard]]
color getColorOfLayer(
ssize_t layerNr) const noexcept;
99 void setColorOfLayer(
ssize_t layerNr,
color fill_color) noexcept;
103 [[nodiscard]]
bool isContourOpen() const noexcept;
108 void closeContour() noexcept;
112 [[nodiscard]]
bool hasLayers() const noexcept;
116 [[nodiscard]]
bool isLayerOpen() const noexcept;
121 void closeLayer(
color fill_color) noexcept;
126 void optimizeLayers() noexcept;
131 [[nodiscard]]
point2 currentPosition() const noexcept;
141 void moveRelativeTo(
vector2 direction) noexcept;
143 void lineTo(
point2 position) noexcept;
145 void lineRelativeTo(
vector2 direction) noexcept;
147 void quadraticCurveTo(
point2 controlPosition,
point2 position) noexcept;
153 void quadraticCurveRelativeTo(
vector2 controlDirection,
vector2 direction) noexcept;
155 void cubicCurveTo(
point2 controlPosition1,
point2 controlPosition2,
point2 position) noexcept;
175 void arcTo(
float radius,
point2 position) noexcept;
199 std::vector<bezier_point>::const_iterator
const &begin,
200 std::vector<bezier_point>::const_iterator
const &end)
noexcept;
217 hi::line_join_style line_join_style = line_join_style::miter,
218 float tolerance = 0.05f) noexcept;
232 float strokeWidth = 1.0f,
233 line_join_style line_join_style = line_join_style::miter,
234 float tolerance = 0.05f) const noexcept;
250 for (
auto &&point : rhs_.points) {
263void composit(pixel_map<sfloat_rgba16> &dst, hi::color color, graphic_path
const &mask)
noexcept;
270void composit(pixel_map<sfloat_rgba16> &dst, graphic_path
const &mask)
noexcept;
276void fill(pixel_map<sdf_r8> &dst, graphic_path
const &path)
noexcept;
Definition bezier_curve.hpp:28
Definition bezier_point.hpp:18
This is a RGBA floating point color.
Definition color.hpp:39
Class which represents an axis-aligned rectangle.
Definition axis_aligned_rectangle.hpp:20
Definition corner_radii.hpp:9
A rectangle / parallelogram in 3D space.
Definition rectangle.hpp:20
A path is a vector graphics object.
Definition graphic_path.hpp:29
void addCircle(point2 position, float radius) noexcept
Draw a circle.
std::vector< std::pair< ssize_t, color > > layerEndContours
An color and index into.
Definition graphic_path.hpp:40
void addPath(graphic_path const &path, color fill_color) noexcept
Add path and close layer.
void addContour(std::vector< bezier_point > const &contour) noexcept
Curve with the given bezier curve.
std::vector< ssize_t > contourEndPoints
An index into.
Definition graphic_path.hpp:36
std::vector< bezier_point > points
A set of all bezier points describing all bezier curves, contours and layers.
Definition graphic_path.hpp:32
void clear() noexcept
Clear the path.
Definition graphic_path.hpp:44
void addContour(std::vector< bezier_curve > const &contour) noexcept
Contour with the given bezier curves.
void addStroke(graphic_path const &path, color strokeColor, float strokeWidth, hi::line_join_style line_join_style=line_join_style::miter, float tolerance=0.05f) noexcept
Stroke a path and close layer.
ssize_t numberOfContours() const noexcept
Return the number of closed contours.
void addContour(std::vector< bezier_point >::const_iterator const &begin, std::vector< bezier_point >::const_iterator const &end) noexcept
Curve with the given bezier curve.
Definition transform.hpp:82