7#include "bezier_point.hpp"
8#include "bezier_curve.hpp"
9#include "exception.hpp"
10#include "numeric_array.hpp"
12#include "geometry/transform.hpp"
13#include "color/sfloat_rgba16.hpp"
14#include "color/sdf_r8.hpp"
97 [[nodiscard]]
color getColorOfLayer(
ssize_t layerNr) const noexcept;
99 void setColorOfLayer(
ssize_t layerNr,
color fillColor) noexcept;
143 void lineTo(
point2 position) noexcept;
145 void lineRelativeTo(
vector2 direction) noexcept;
147 void quadraticCurveTo(
point2 controlPosition,
point2 position) noexcept;
155 void cubicCurveTo(
point2 controlPosition1,
point2 controlPosition2,
point2 position) noexcept;
199 std::vector<bezier_point>::const_iterator
const &begin,
200 std::vector<bezier_point>::const_iterator
const &end)
noexcept;
217 LineJoinStyle lineJoinStyle = LineJoinStyle::Miter,
218 float tolerance = 0.05f) noexcept;
232 float strokeWidth = 1.0f,
233 LineJoinStyle lineJoinStyle = LineJoinStyle::Miter,
234 float tolerance = 0.05f) const noexcept;
250 for (
auto &&point : rhs_.
points) {
263void composit(pixel_map<sfloat_rgba16> &dst, f32x4 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
A high-level geometric vector Part of the high-level vector, point, mat and color types.
Definition vector.hpp:20
A path is a vector graphics object.
Definition graphic_path.hpp:29
bool hasLayers() const noexcept
This path has layers.
void quadraticCurveRelativeTo(vector2 controlDirection, vector2 direction) noexcept
Draw curve from the current position to the new direction.
std::vector< std::pair< ssize_t, color > > layerEndContours
An color and index into.
Definition graphic_path.hpp:40
std::vector< bezier_point >::const_iterator beginContour(ssize_t contourNr) const noexcept
Return an iterator to the start point of a contour.
void optimizeLayers() noexcept
Optimize layers.
ssize_t numberOfLayers() const noexcept
Return the number of closed layers.
aarect boundingBox() const noexcept
Calculate bounding box.
void addContour(std::vector< bezier_point > const &contour) noexcept
Curve with the given bezier curve.
graphic_path toStroke(float strokeWidth=1.0f, LineJoinStyle lineJoinStyle=LineJoinStyle::Miter, float tolerance=0.05f) const noexcept
Convert path to stroke-path.
void addContour(std::vector< bezier_curve > const &contour) noexcept
Contour with the given bezier curves.
void closeLayer(color fillColor) noexcept
Close current contour.
void moveTo(point2 position) noexcept
Start a new contour at position.
void arcTo(float radius, point2 position) noexcept
Draw an circular arc.
bool isContourOpen() const noexcept
Return true if there is an open contour.
point2 currentPosition() const noexcept
Get the currentPosition of the open contour.
std::vector< ssize_t > contourEndPoints
An index into.
Definition graphic_path.hpp:36
void addCircle(point2 position, float radius) noexcept
Draw a circle.
void addPath(graphic_path const &path, color fillColor) noexcept
Add path and close layer.
void addStroke(graphic_path const &path, color strokeColor, float strokeWidth, LineJoinStyle lineJoinStyle=LineJoinStyle::Miter, float tolerance=0.05f) noexcept
Stroke a path and close layer.
graphic_path centerScale(f32x4 extent, float padding=0.0) const noexcept
Center and scale a path inside the extent with padding.
void addRectangle(aarect rectangle, f32x4 corners={0.0f, 0.0f, 0.0f, 0.0f}) noexcept
Draw a rectangle.
void closeContour() noexcept
Close current contour.
bool isLayerOpen() const noexcept
Return true if there is an open layer.
ssize_t numberOfContours() const noexcept
Return the number of closed contours.
void moveRelativeTo(vector2 direction) noexcept
Start a new contour relative to current position.
void tryRemoveLayers() noexcept
Try to move the layers in a path.
void clear() noexcept
Clear the path.
Definition graphic_path.hpp:44
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.
std::vector< bezier_point > points
A set of all bezier points describing all bezier curves, contours and layers.
Definition graphic_path.hpp:32
bool allLayersHaveSameColor() const noexcept
Check if all layers have the same color.
void cubicCurveRelativeTo(vector2 controlDirection1, vector2 controlDirection2, vector2 direction) noexcept
Draw curve from the current position to the new direction.
Definition transform.hpp:86