7#include "bezier_point.hpp"
8#include "bezier_curve.hpp"
9#include "utility/module.hpp"
10#include "geometry/module.hpp"
11#include "image/module.hpp"
14namespace hi::inline
v1 {
76 [[nodiscard]]
std::vector<
bezier_point>::const_iterator endContour(ssize_t contourNr) const noexcept;
80 [[nodiscard]] ssize_t beginLayer(ssize_t layerNr) const noexcept;
84 [[nodiscard]] ssize_t endLayer(ssize_t layerNr) const noexcept;
86 [[nodiscard]]
std::vector<
bezier_point> getbezier_pointsOfContour(ssize_t contourNr) const noexcept;
88 [[nodiscard]]
std::vector<
bezier_curve> getBeziersOfContour(ssize_t contourNr) const noexcept;
92 [[nodiscard]]
std::pair<
graphic_path, color> getLayer(ssize_t layerNr) const noexcept;
94 [[nodiscard]] color getColorOfLayer(ssize_t layerNr) const noexcept;
96 void setColorOfLayer(ssize_t layerNr, color fill_color) noexcept;
140 void lineTo(point2 position) noexcept;
142 void lineRelativeTo(vector2 direction) noexcept;
144 void quadraticCurveTo(point2 controlPosition, point2 position) noexcept;
152 void cubicCurveTo(point2 controlPosition1, point2 controlPosition2, point2 position) noexcept;
172 void arcTo(
float radius, point2 position) noexcept;
196 std::vector<bezier_point>::const_iterator
const &begin,
197 std::vector<bezier_point>::const_iterator
const &end)
noexcept;
215 float tolerance = 0.05f) noexcept;
229 float strokeWidth = 1.0f,
230 line_join_style line_join_style = line_join_style::miter,
231 float tolerance = 0.05f) const noexcept;
247 for (
auto &&point : rhs_.points) {
line_join_style
The way two lines should be joined.
Definition line_join_style.hpp:18
DOXYGEN BUG.
Definition algorithm.hpp:13
void composit(pixmap_span< sfloat_rgba16 > dst, hi::color color, graphic_path const &mask) noexcept
Composit color onto the destination image where the mask is solid.
void fill(pixmap_span< uint8_t > image, std::vector< bezier_curve > const &curves) noexcept
Fill a linear gray scale image by filling a curve with anti-aliasing.
Definition bezier_curve.hpp:22
Definition bezier_point.hpp:16
This is a RGBA floating point color.
Definition color.hpp:44
A rectangle / parallelogram in 3D space.
Definition rectangle.hpp:20
Definition graphic_path.hpp:18
A path is a vector graphics object.
Definition graphic_path.hpp:26
void moveRelativeTo(vector2 direction) noexcept
Start a new contour relative to current position.
void closeContour() noexcept
Close current contour.
void addCircle(point2 position, float radius) noexcept
Draw a circle.
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< std::pair< ssize_t, color > > layerEndContours
An color and index into.
Definition graphic_path.hpp:37
void addPath(graphic_path const &path, color fill_color) noexcept
Add path and close layer.
void arcTo(float radius, point2 position) noexcept
Draw an circular arc.
void optimizeLayers() noexcept
Optimize layers.
bool isLayerOpen() const noexcept
Return true if there is an open 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:33
bool allLayersHaveSameColor() const noexcept
Check if all layers have the same color.
void addRectangle(aarectangle rectangle, corner_radii corners=corner_radii{0.0f, 0.0f, 0.0f, 0.0f}) noexcept
Draw a rectangle.
ssize_t numberOfLayers() const noexcept
Return the number of closed layers.
void moveTo(point2 position) noexcept
Start a new contour at position.
std::vector< bezier_point > points
A set of all bezier points describing all bezier curves, contours and layers.
Definition graphic_path.hpp:29
void clear() noexcept
Clear the path.
Definition graphic_path.hpp:41
bool hasLayers() const noexcept
This path has layers.
graphic_path centerScale(extent2 extent, float padding=0.0) const noexcept
Center and scale a path inside the extent with padding.
void tryRemoveLayers() noexcept
Try to move the layers in a path.
graphic_path toStroke(float strokeWidth=1.0f, line_join_style line_join_style=line_join_style::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 fill_color) noexcept
Close current contour.
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.
std::vector< bezier_point >::const_iterator beginContour(ssize_t contourNr) const noexcept
Return an iterator to the start point of a contour.
ssize_t numberOfContours() const noexcept
Return the number of closed contours.
void cubicCurveRelativeTo(vector2 controlDirection1, vector2 controlDirection2, vector2 direction) noexcept
Draw curve from the current position to the new direction.
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.
void quadraticCurveRelativeTo(vector2 controlDirection, vector2 direction) noexcept
Draw curve from the current position to the new direction.
aarectangle boundingBox() const noexcept
Calculate bounding box.
Definition transform.hpp:84