pub struct PreparedPlanarReference<P> { /* private fields */ }Expand description
Checked owned planar work, binding image geometry, per-plane extent and subsampling phase, plane interpretation, and color/luminance to preparation. Strides and phase-equivalent crop origins may differ for every candidate.
Implementations§
Source§impl<P: PlanarWarmReference> PreparedPlanarReference<P>
impl<P: PlanarWarmReference> PreparedPlanarReference<P>
Sourcepub fn score(
&mut self,
candidate: &PlanarView<'_>,
opts: EvalOpts<'_>,
) -> MetricResult<P::Output>
pub fn score( &mut self, candidate: &PlanarView<'_>, opts: EvalOpts<'_>, ) -> MetricResult<P::Output>
Produce a checked owned native assessment.
Sourcepub fn with_evaluation<T>(
&mut self,
candidate: &PlanarView<'_>,
opts: EvalOpts<'_>,
consume: impl FnOnce(EvaluationRef<'_>) -> MetricResult<T>,
) -> MetricResult<T>
pub fn with_evaluation<T>( &mut self, candidate: &PlanarView<'_>, opts: EvalOpts<'_>, consume: impl FnOnce(EvaluationRef<'_>) -> MetricResult<T>, ) -> MetricResult<T>
Consume a checked borrowed assessment before native scratch is recycled.
Returned T cannot borrow the temporary view. The callback is invoked
once at most; callers commit side effects only after this call succeeds.
Trait Implementations§
Source§impl<P: PlanarWarmReference> PlanarWarmReference for PreparedPlanarReference<P>
impl<P: PlanarWarmReference> PlanarWarmReference for PreparedPlanarReference<P>
Source§type Output = <P as PlanarWarmReference>::Output
type Output = <P as PlanarWarmReference>::Output
Complete owned native assessment.
Source§fn evaluate_planar(
&mut self,
candidate: &PlanarView<'_>,
opts: EvalOpts<'_>,
) -> MetricResult<Self::Output>
fn evaluate_planar( &mut self, candidate: &PlanarView<'_>, opts: EvalOpts<'_>, ) -> MetricResult<Self::Output>
Evaluate a candidate using actual prepared reference work.
Source§fn with_evaluation(
&mut self,
candidate: &PlanarView<'_>,
opts: EvalOpts<'_>,
consume: &mut dyn FnMut(EvaluationRef<'_>),
) -> MetricResult<()>
fn with_evaluation( &mut self, candidate: &PlanarView<'_>, opts: EvalOpts<'_>, consume: &mut dyn FnMut(EvaluationRef<'_>), ) -> MetricResult<()>
Invoke
consumer exactly once on success, while all borrowed native
arrays remain valid. The default borrows an owned result; an override
can lend scratch directly. A failed operation need not invoke it.Auto Trait Implementations§
impl<P> Freeze for PreparedPlanarReference<P>where
P: Freeze,
impl<P> RefUnwindSafe for PreparedPlanarReference<P>where
P: RefUnwindSafe,
impl<P> Send for PreparedPlanarReference<P>where
P: Send,
impl<P> Sync for PreparedPlanarReference<P>where
P: Sync,
impl<P> Unpin for PreparedPlanarReference<P>where
P: Unpin,
impl<P> UnsafeUnpin for PreparedPlanarReference<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for PreparedPlanarReference<P>where
P: UnwindSafe,
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