Struct lyon_path::Path [−][src]
pub struct Path { /* fields omitted */ }
Expand description
A simple path data structure.
Custom attributes
Paths can store a fixed number of extra f32
values per endpoint, called
“custom attributes” or “interpolated attributes” through the documentation.
These can be handy to represent arbitrary attributes such as variable colors,
line width, etc.
See also:
Representation
Paths contain two buffers:
- a buffer of commands (Begin, Line, Quadratic, Cubic, Close or End),
- and a buffer of pairs of floats that can be endpoints control points or custom attributes.
The order of storage for points is determined by the sequence of commands. Custom attributes (if any) always directly follow endpoints. If there is an odd number of attributes, the last float of the each attribute sequence is set to zero and is not used.
__________________________
| | | |
| Begin | Line |Quadratic| ...
|_______|______|_________|_
__________________________________________________________________________
| | | | | | | |
|start x,y|attributes| to x, y |attributes|ctrl x,y | to x, y |attributes| ...
|_________|__________|_________|__________|_________|_________|__________|_
Implementations
Creates a BuilderWithAttributes to build a path with custom attributes.
Creates an WithSvg to build a path with a rich set of commands.
Returns a slice over an endpoint’s custom attributes.
Iterates over the entire Path
.
Iterates over the endpoint and control point ids of the Path
.
pub fn iter_with_attributes(&self) -> IterWithAttributes<'_>ⓘ
Applies a transform to all endpoints and control points of this path and Returns the result.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Path
impl UnwindSafe for Path
Blanket Implementations
Mutably borrows from an owned value. Read more