Skip to main content

CaptureScratch

Struct CaptureScratch 

Source
pub struct CaptureScratch<'a> { /* private fields */ }
Expand description

Reusable caller-owned or budget-borrowed f64 scratch workspace for PlanarCapturePlan::execute.

Use CaptureScratch::from_f64_slice with a caller-allocated or StorageBudget-backed slice for zero-heap capture on native conversion routes (a custom external CmsTransform invoked inside Stage 1 may still allocate unless its CmsQuote::apply_scratch_bytes is Some(0)), or CaptureScratch::owned to reuse one fallibly allocated buffer across frames.

Implementations§

Source§

impl<'a> CaptureScratch<'a>

Source

pub fn from_f64_slice(slice: &'a mut [f64]) -> Self

Borrow a caller-provided &mut [f64] workspace (never heap-allocates; fails with ConvertError::DimensionMismatch if shorter than PlanarCapturePlan::required_scratch_f64s).

Source

pub fn len_f64s(&self) -> usize

Number of f64 elements currently available without reallocating.

Source§

impl CaptureScratch<'static>

Source

pub const fn owned() -> Self

Create an empty owned scratch buffer that grows fallibly on first use and reuses capacity.

Source

pub fn with_capacity_f64s(len_f64s: usize) -> Result<Self, At<ConvertError>>

Pre-allocate an owned scratch buffer for at least len_f64s f64 elements.

Trait Implementations§

Source§

impl<'a> Debug for CaptureScratch<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CaptureScratch<'static>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a> !UnwindSafe for CaptureScratch<'a>

§

impl<'a> Freeze for CaptureScratch<'a>

§

impl<'a> RefUnwindSafe for CaptureScratch<'a>

§

impl<'a> Send for CaptureScratch<'a>

§

impl<'a> Sync for CaptureScratch<'a>

§

impl<'a> Unpin for CaptureScratch<'a>

§

impl<'a> UnsafeUnpin for CaptureScratch<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.