[−]Struct druid::piet::kurbo::QuadBez
A single quadratic Bézier segment.
Fields
p0: Point
p1: Point
p2: Point
Implementations
impl QuadBez
pub fn new<V>(p0: V, p1: V, p2: V) -> QuadBez where
V: Into<Point>,
V: Into<Point>,
Create a new quadratic Bézier segment.
pub fn raise(&self) -> CubicBez
Raise the order by 1.
Returns a cubic Bézier segment that exactly represents this quadratic.
Trait Implementations
impl Clone for QuadBez
pub fn clone(&self) -> QuadBez
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for QuadBez
impl Data for QuadBez
[src]
impl Debug for QuadBez
impl From<QuadBez> for PathSeg
impl Mul<QuadBez> for Affine
type Output = QuadBez
The resulting type after applying the *
operator.
pub fn mul(self, other: QuadBez) -> QuadBez
impl Mul<QuadBez> for TranslateScale
type Output = QuadBez
The resulting type after applying the *
operator.
pub fn mul(self, other: QuadBez) -> QuadBez
impl ParamCurve for QuadBez
pub fn eval(&self, t: f64) -> Point
pub fn start(&self) -> Point
pub fn end(&self) -> Point
pub fn subdivide(&self) -> (QuadBez, QuadBez)
Subdivide into halves, using de Casteljau.
pub fn subsegment(&self, range: Range<f64>) -> QuadBez
impl ParamCurveArclen for QuadBez
pub fn arclen(&self, _accuracy: f64) -> f64
Arclength of a quadratic Bézier segment.
This computation is based on an analytical formula. Since that formula suffers from numerical instability when the curve is very close to a straight line, we detect that case and fall back to Legendre-Gauss quadrature.
Accuracy should be better than 1e-13 over the entire range.
Adapted from http://www.malczak.linuxpl.com/blog/quadratic-bezier-curve-length/ with permission.
pub fn inv_arclen(&self, arclen: f64, accuracy: f64) -> f64
impl ParamCurveArea for QuadBez
pub fn signed_area(&self) -> f64
impl ParamCurveCurvature for QuadBez
impl ParamCurveDeriv for QuadBez
type DerivResult = Line
The parametric curve obtained by taking the derivative of this one.
pub fn deriv(&self) -> Line
pub fn gauss_arclen(&self, coeffs: &[(f64, f64)]) -> f64
impl ParamCurveExtrema for QuadBez
pub fn extrema(&self) -> ArrayVec<[f64; 4]>
pub fn extrema_ranges(&self) -> ArrayVec<[Range<f64>; 5]>
pub fn bounding_box(&self) -> Rect
impl ParamCurveNearest for QuadBez
pub fn nearest(&self, p: Point, _accuracy: f64) -> (f64, f64)
Find nearest point, using analytical algorithm based on cubic root finding.
impl PartialEq<QuadBez> for QuadBez
impl Shape for QuadBez
type PathElementsIter = QuadBezIter
The iterator returned by the path_elements
method. Read more
pub fn path_elements(&self, _tolerance: f64) -> QuadBezIterⓘNotable traits for QuadBezIter
impl Iterator for QuadBezIter type Item = PathEl;
Notable traits for QuadBezIter
impl Iterator for QuadBezIter type Item = PathEl;
pub fn area(&self) -> f64
pub fn perimeter(&self, accuracy: f64) -> f64
pub fn winding(&self, _pt: Point) -> i32
pub fn bounding_box(&self) -> Rect
pub fn to_path(&self, tolerance: f64) -> BezPath
pub fn into_path(self, tolerance: f64) -> BezPath
pub fn path_segments(&self, tolerance: f64) -> Segments<Self::PathElementsIter>ⓘ
pub fn contains(&self, pt: Point) -> bool
pub fn as_line(&self) -> Option<Line>
pub fn as_rect(&self) -> Option<Rect>
pub fn as_rounded_rect(&self) -> Option<RoundedRect>
pub fn as_circle(&self) -> Option<Circle>
pub fn as_path_slice(&self) -> Option<&[PathEl]>
impl StructuralPartialEq for QuadBez
Auto Trait Implementations
impl RefUnwindSafe for QuadBez
[src]
impl Send for QuadBez
[src]
impl Sync for QuadBez
[src]
impl Unpin for QuadBez
[src]
impl UnwindSafe for QuadBez
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> AnyEq for T where
T: PartialEq<T> + Any,
[src]
T: PartialEq<T> + Any,
pub fn equals(&self, other: &(dyn Any + 'static)) -> bool
[src]
pub fn as_any(&self) -> &(dyn Any + 'static)
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> RoundFrom<T> for T
pub fn round_from(x: T) -> T
impl<T, U> RoundInto<U> for T where
U: RoundFrom<T>,
U: RoundFrom<T>,
pub fn round_into(self) -> U
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,