CachedBezier
public final class CachedBezier<Bezier> where Bezier : BezierType
extension CachedBezier: BezierType
extension CachedBezier: Bezier2Type where Bezier: Bezier2Type
extension CachedBezier: BoundedBezier2Type where Bezier: BoundedBezier2Type
A wrapper object that caches information related to its underlying Bézier curve and queries made to it.
-
Declaration
Swift
private(set) public var bezier: Bezier { get }
-
Declaration
Swift
public init(bezier: Bezier)
-
Flushes all cached values, reducing memory usage but requiring recomputation on next invocations of cacheable accessors.
Declaration
Swift
public func flushCachedValues()
-
Convenience initializer for creating
CachedBezier
instances forCubicBezier
types.Declaration
Swift
public convenience init<Point: Bezier2PointType>( p0: Point, p1: Point, p2: Point, p3: Point ) where Bezier == CubicBezier<Point>
-
Convenience initializer for creating
CachedBezier
instances forLinearBezier
types.Declaration
Swift
public convenience init<Point: Bezier2PointType>( p0: Point, p1: Point ) where Bezier == LinearBezier<Point>
-
Convenience initializer for creating
CachedBezier
instances forQuadBezier
types.Declaration
Swift
public convenience init<Point: Bezier2PointType>( p0: Point, p1: Point, p2: Point ) where Bezier == QuadBezier<Point>
-
Declaration
Swift
public typealias Input = Bezier.Input
-
Declaration
Swift
public typealias Output = Bezier.Output
-
Declaration
Swift
public var startInput: Bezier.Input { get }
-
Declaration
Swift
public var endInput: Bezier.Input { get }
-
Declaration
Swift
public var pointCount: Int { get }
-
Declaration
Swift
public subscript(pointIndex: Int) -> Bezier.Output { get }
-
Declaration
Swift
public func computeSeries(steps: Int) -> [Bezier.Output]
-
Note
The result of this operation is cached and reused on next invocations with the same inputsteps
.Declaration
Swift
public func createLookupTable(steps: Int) -> BezierLookUpTable<Bezier>
-
Declaration
Swift
public func translated(by offset: Output) -> Self
-
Returns the approximate length of this quadratic Bézier.
Note
The result of this operation is cached.Declaration
Swift
public func length<Output>() -> Input where Bezier == QuadBezier<Output>, Output : BezierPointType, Output.Scalar == Double
-
Returns the approximate length of this cubic Bézier.
Note
The result of this operation is cached.Declaration
Swift
public func length<Output>() -> Input where Bezier == CubicBezier<Output>, Output : BezierPointType, Output.Scalar == Double
-
Declaration
Swift
public func rotated(by angleInRadians: Output.Scalar) -> Self
-
Declaration
Swift
public func aligned(along line: LinearBezier2<Output>) -> Self