pub struct CurveData {
pub cx: Box<[f64]>,
pub cy: Box<[f64]>,
pub c_next: Box<[i32]>,
}Expand description
Stack storage for the De Casteljau subdivision loop.
Lazy-allocated (via Option<Box<CurveData>>) because it is ~25 KB —
only needed for paths containing Bezier curves.
§Array sizing
MAX_CURVE_SPLITS = 1024, so the slot count is n = 1025.
cx/cy: lengthn * 3 = 3075. The maximum slot index used ismax_u = 1024, giving a maximum array index of1024 * 3 + 2 = 3074, which is within bounds (no off-by-one).c_next: lengthn = 1025. The maximum index used ismax_u = 1024, which is also within bounds.
Fields§
§cx: Box<[f64]>X coordinates: 3 control points per slot, indexed by slot * 3 + {0,1,2}.
cy: Box<[f64]>Y coordinates: same layout as cx.
c_next: Box<[i32]>cNext[p1] = index of the next segment’s first slot after p1.
Implementations§
Auto Trait Implementations§
impl Freeze for CurveData
impl RefUnwindSafe for CurveData
impl Send for CurveData
impl Sync for CurveData
impl Unpin for CurveData
impl UnsafeUnpin for CurveData
impl UnwindSafe for CurveData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more