Skip to content

File include/brisk/graphics/Path.hpp


RasterizedPath class

RasterizedPath

Represents a rasterized path with a sprite and bounding rectangle.

sprite variable (RasterizedPath::sprite)

RC<SpriteResource> sprite

The sprite resource associated with the rasterized path.

bounds variable (RasterizedPath::bounds)

Rectangle bounds

The bounding rectangle of the rasterized path.


noClipRect variable

const inline Rectangle noClipRect

A constant rectangle that represents no clipping area.


FillRule enum

enum class FillRule : uint8_t

Enum representing the fill rules for paths.

EvenOdd enumerator (FillRule::EvenOdd)

Even-Odd fill rule.

Winding enumerator (FillRule::Winding)

Winding fill rule.


JoinStyle enum

enum class JoinStyle : uint8_t

Enum representing different join styles for strokes.

Miter enumerator (JoinStyle::Miter)

Miter join style.

Bevel enumerator (JoinStyle::Bevel)

Bevel join style.

Round enumerator (JoinStyle::Round)

Round join style.


CapStyle enum

enum class CapStyle : uint8_t

Enum representing different cap styles for strokes.

Flat enumerator (CapStyle::Flat)

Flat cap style.

Square enumerator (CapStyle::Square)

Square cap style.

Round enumerator (CapStyle::Round)

Round cap style.


StrokeParams class

StrokeParams

Structure representing stroke parameters.

joinStyle variable (StrokeParams::joinStyle)

JoinStyle joinStyle

The join style of the stroke.

capStyle variable (StrokeParams::capStyle)

CapStyle capStyle

The cap style of the stroke.

strokeWidth variable (StrokeParams::strokeWidth)

float strokeWidth

The width of the stroke.

miterLimit variable (StrokeParams::miterLimit)

float miterLimit

The limit for miter joins.


FillParams class

FillParams

Structure representing fill parameters.

fillRule variable (FillParams::fillRule)

FillRule fillRule

The fill rule to be used.


FillOrStrokeParams typedef

FillOrStrokeParams = std::variant<FillParams, StrokeParams>

A type alias for fill or stroke parameters, using std::variant.


Path class

Path

Represents a geometric path that can be rasterized for rendering.


rasterizePath function (Internal::rasterizePath)

RasterizedPath
rasterizePath(Path path, const FillOrStrokeParams &params,
              Rectangle clipRect)

Rasterizes the given path with specified parameters and clipping rectangle.
Param path The path to rasterize.
Param params The fill or stroke parameters.
Param clipRect The clipping rectangle. Use noClipRect to disable clipping.
Returns RasterizedPath The resulting rasterized path.


Path class

Path

Represents a geometric path that can be rasterized for rendering.

CCW enumerator (Path::Direction::CCW)

Enum for the direction of the path.

CW enumerator (Path::Direction::CW)

Enum for the direction of the path.

MoveTo enumerator (Path::Element::MoveTo)

Enum for the elements of the path.

LineTo enumerator (Path::Element::LineTo)

Enum for the elements of the path.

CubicTo enumerator (Path::Element::CubicTo)

Enum for the elements of the path.

Close enumerator (Path::Element::Close)

Enum for the elements of the path.

empty function (Path::empty)

bool empty() const

Checks if the path is empty.
Returns true if the path is empty, false otherwise.

moveTo function (Path::moveTo)

void moveTo(PointF p)

Moves the current point to a specified point.
Param p The point to move to.

void moveTo(float x, float y)

Moves the current point to specified coordinates.
Param x The x-coordinate to move to.
Param y The y-coordinate to move to.

lineTo function (Path::lineTo)

void lineTo(PointF p)

Draws a line to a specified point.
Param p The point to draw to.

void lineTo(float x, float y)

Draws a line to specified coordinates.
Param x The x-coordinate to draw to.
Param y The y-coordinate to draw to.

quadraticTo function (Path::quadraticTo)

void quadraticTo(PointF c1, PointF e)

Draws a quadratic Bézier curve to a specified endpoint using a control point.
Param c1 The control point.
Param e The endpoint.

void quadraticTo(float c1x, float c1y, float ex, float ey)

Draws a quadratic Bézier curve to specified coordinates using control point coordinates.
Param c1x The x-coordinate of the control point.
Param c1y The y-coordinate of the control point.
Param ex The x-coordinate of the endpoint.
Param ey The y-coordinate of the endpoint.

cubicTo function (Path::cubicTo)

void cubicTo(PointF c1, PointF c2, PointF e)

Draws a cubic Bézier curve to a specified endpoint using two control points.
Param c1 The first control point.
Param c2 The second control point.
Param e The endpoint.

void cubicTo(float c1x, float c1y, float c2x, float c2y,
             float ex, float ey)

Draws a cubic Bézier curve to specified coordinates using two control point coordinates.
Param c1x The x-coordinate of the first control point.
Param c1y The y-coordinate of the first control point.
Param c2x The x-coordinate of the second control point.
Param c2y The y-coordinate of the second control point.
Param ex The x-coordinate of the endpoint.
Param ey The y-coordinate of the endpoint.

arcTo function (Path::arcTo)

void arcTo(RectangleF rect, float startAngle,
           float sweepLength, bool forceMoveTo)

Draws an arc to a specified rectangle defined by its start angle and sweep length.
Param rect The rectangle defining the arc.
Param startAngle The starting angle of the arc.
Param sweepLength The angle of the arc's sweep.
Param forceMoveTo If true, moves to the endpoint of the arc.

close function (Path::close)

void close()

Closes the current sub-path by drawing a line back to the starting point.

reset function (Path::reset)

void reset()

Resets the path to an empty state.

addCircle function (Path::addCircle)

void addCircle(float cx, float cy, float radius,
               Direction dir = Direction::CW)

Adds a circle to the path.
Param cx The x-coordinate of the center of the circle.
Param cy The y-coordinate of the center of the circle.
Param radius The radius of the circle.
Param dir The direction in which the circle is added (default is clockwise).

addEllipse function (Path::addEllipse)

void addEllipse(RectangleF rect,
                Direction dir = Direction::CW)

Adds an ellipse to the path.
Param rect The rectangle that bounds the ellipse.
Param dir The direction in which the ellipse is added (default is clockwise).

addRoundRect function (Path::addRoundRect)

void addRoundRect(RectangleF rect, float rx, float ry,
                  Direction dir = Direction::CW)

Adds a rounded rectangle to the path.
Param rect The rectangle that defines the bounds of the rounded rectangle.
Param rx The radius of the horizontal corners.
Param ry The radius of the vertical corners.
Param dir The direction in which the rectangle is added (default is clockwise).

void addRoundRect(RectangleF rect, float roundness,
                  Direction dir = Direction::CW)

Adds a rounded rectangle to the path with uniform corner rounding.
Param rect The rectangle that defines the bounds of the rounded rectangle.
Param roundness The uniform rounding radius for all corners.
Param dir The direction in which the rectangle is added (default is clockwise).

addRect function (Path::addRect)

void addRect(RectangleF rect, Direction dir = Direction::CW)

Adds a rectangle to the path.
Param rect The rectangle to add.
Param dir The direction in which the rectangle is added (default is clockwise).

addPolystar function (Path::addPolystar)

void addPolystar(float points, float innerRadius,
                 float outerRadius, float innerRoundness,
                 float outerRoundness, float startAngle,
                 float cx, float cy,
                 Direction dir = Direction::CW)

Adds a polystar shape to the path.
Param points The number of points in the star.
Param innerRadius The inner radius of the star.
Param outerRadius The outer radius of the star.
Param innerRoundness The roundness of the inner points.
Param outerRoundness The roundness of the outer points.
Param startAngle The starting angle for the star.
Param cx The x-coordinate of the center of the star.
Param cy The y-coordinate of the center of the star.
Param dir The direction in which the polystar is added (default is clockwise).

addPolygon function (Path::addPolygon)

void addPolygon(float points, float radius, float roundness,
                float startAngle, float cx, float cy,
                Direction dir = Direction::CW)

Adds a polygon to the path.
Param points The number of points in the polygon.
Param radius The radius of the polygon.
Param roundness The roundness of the corners.
Param startAngle The starting angle for the polygon.
Param cx The x-coordinate of the center of the polygon.
Param cy The y-coordinate of the center of the polygon.
Param dir The direction in which the polygon is added (default is clockwise).

addPath function (Path::addPath)

void addPath(const Path &path)

Adds another path to this path.
Param path The path to add.

void addPath(const Path &path, const Matrix &m)

Adds another path to this path with a transformation matrix.
Param path The path to add.
Param m The transformation matrix to apply.

transform function (Path::transform)

void transform(const Matrix &m)

Transforms the path using a transformation matrix.
Param m The transformation matrix to apply to the path.

transformed function (Path::transformed)

Path transformed(const Matrix &m) const

Returns a new path that is a transformed version of this path.
Param m The transformation matrix to apply.
Returns Path The transformed path.

length function (Path::length)

float length() const

Calculates the length of the path.
Returns float The length of the path.

dashed function (Path::dashed)

Path dashed(std::span<const float> pattern,
            float offset) const

Creates a dashed version of the path based on a pattern.
Param pattern A span of floats defining the dash pattern.
Param offset The starting offset into the pattern.
Returns Path The dashed path.

clone function (Path::clone)

Path clone() const

Creates a copy of this path.
Returns Path A clone of the current path.

boundingBoxApprox function (Path::boundingBoxApprox)

RectangleF boundingBoxApprox() const

Calculates an approximate bounding box of the path.
Returns RectangleF The approximate bounding box.

rasterize function (Path::rasterize)

RasterizedPath rasterize(const FillParams &fill,
                         Rectangle clipRect)

Rasterizes the path for filling.
Param fill Fill parameters.
Param clipRect Clipping rectangle. Pass noClipRect to disable clipping.

RasterizedPath rasterize(const StrokeParams &stroke,
                         Rectangle clipRect)

Rasterizes the path for stroking.
Param stroke Stroke parameters.
Param clipRect Clipping rectangle. Pass noClipRect to disable clipping.

impl variable (Path::impl)

void *impl

Pointer to implementation details.


Auto-generated from sources, Revision , https://github.com/brisklib/brisk/blob//include/brisk/