pub struct Erased<M>(/* private fields */);Expand description
Stackable wrapper normalizing only the result type. It forwards identity, actual pixel views and operation controls. Typed callers keep their native result by omitting this wrapper. No Send/Sync bounds are added.
Implementations§
Trait Implementations§
Source§impl<M: PreparePlanarReference> DynPreparePlanarReference for Erased<M>where
M::Output: 'static,
impl<M: PreparePlanarReference> DynPreparePlanarReference for Erased<M>where
M::Output: 'static,
Source§fn prepare_planar(
&mut self,
reference: &PlanarView<'_>,
opts: EvalOpts<'_>,
) -> MetricResult<Box<dyn PlanarWarmReference<Output = ErasedEvaluation> + '_>>
fn prepare_planar( &mut self, reference: &PlanarView<'_>, opts: EvalOpts<'_>, ) -> MetricResult<Box<dyn PlanarWarmReference<Output = ErasedEvaluation> + '_>>
Prepare actual owned native work, with fresh per-candidate controls.
Source§impl<M: PrepareReference> DynPrepareReference for Erased<M>where
M::Output: 'static,
impl<M: PrepareReference> DynPrepareReference for Erased<M>where
M::Output: 'static,
Source§fn prepare(
&mut self,
r: &PixelView<'_>,
opts: EvalOpts<'_>,
) -> MetricResult<Box<dyn WarmReference<Output = ErasedEvaluation> + '_>>
fn prepare( &mut self, r: &PixelView<'_>, opts: EvalOpts<'_>, ) -> MetricResult<Box<dyn WarmReference<Output = ErasedEvaluation> + '_>>
Prepare checked reference work. Returned objects retain dimensions and
use fresh candidate controls, without retaining the preparation pulse.
Source§impl<M: Metric> Metric for Erased<M>where
M::Output: 'static,
impl<M: Metric> Metric for Erased<M>where
M::Output: 'static,
Source§impl<M: NoReferenceMetric> NoReferenceMetric for Erased<M>where
M::Output: 'static,
impl<M: NoReferenceMetric> NoReferenceMetric for Erased<M>where
M::Output: 'static,
Source§type Output = ErasedEvaluation
type Output = ErasedEvaluation
Complete native result, without mandatory boxing.
Source§fn evaluate_image(
&mut self,
image: &PixelView<'_>,
opts: EvalOpts<'_>,
) -> MetricResult<Self::Output>
fn evaluate_image( &mut self, image: &PixelView<'_>, opts: EvalOpts<'_>, ) -> MetricResult<Self::Output>
Score one image; use
crate::score_image for checked calls.Source§impl<M: PlanarMetric> PlanarMetric for Erased<M>where
M::Output: 'static,
impl<M: PlanarMetric> PlanarMetric for Erased<M>where
M::Output: 'static,
Source§fn evaluate_planar(
&mut self,
r: &PlanarView<'_>,
d: &PlanarView<'_>,
opts: EvalOpts<'_>,
) -> MetricResult<Self::Output>
fn evaluate_planar( &mut self, r: &PlanarView<'_>, d: &PlanarView<'_>, opts: EvalOpts<'_>, ) -> MetricResult<Self::Output>
Score complete color-described planes, preserving native output.
Source§impl<P: PlanarWarmReference> PlanarWarmReference for Erased<P>where
P::Output: 'static,
impl<P: PlanarWarmReference> PlanarWarmReference for Erased<P>where
P::Output: 'static,
Source§type Output = ErasedEvaluation
type Output = ErasedEvaluation
Complete owned native assessment.
Source§fn evaluate_planar(
&mut self,
d: &PlanarView<'_>,
opts: EvalOpts<'_>,
) -> MetricResult<Self::Output>
fn evaluate_planar( &mut self, d: &PlanarView<'_>, opts: EvalOpts<'_>, ) -> MetricResult<Self::Output>
Evaluate a candidate using actual prepared reference work.
Source§fn with_evaluation(
&mut self,
d: &PlanarView<'_>,
opts: EvalOpts<'_>,
consumer: &mut dyn FnMut(EvaluationRef<'_>),
) -> MetricResult<()>
fn with_evaluation( &mut self, d: &PlanarView<'_>, opts: EvalOpts<'_>, consumer: &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.Source§impl<M: PreparePlanarReference> PreparePlanarReference for Erased<M>where
M::Output: 'static,
impl<M: PreparePlanarReference> PreparePlanarReference for Erased<M>where
M::Output: 'static,
Source§type PlanarPrepared = Erased<<M as PreparePlanarReference>::PlanarPrepared>
type PlanarPrepared = Erased<<M as PreparePlanarReference>::PlanarPrepared>
Actual owned reference work, suitable for storage in an encoder callback.
Source§fn warm_planar_reference(
&mut self,
r: &PlanarView<'_>,
opts: EvalOpts<'_>,
) -> MetricResult<Self::PlanarPrepared>
fn warm_planar_reference( &mut self, r: &PlanarView<'_>, opts: EvalOpts<'_>, ) -> MetricResult<Self::PlanarPrepared>
Build native reference work. Subsequent calls use fresh controls.
Source§impl<M: PrepareReference> PrepareReference for Erased<M>where
M::Output: 'static,
impl<M: PrepareReference> PrepareReference for Erased<M>where
M::Output: 'static,
Source§type Prepared<'a> = Erased<<M as PrepareReference>::Prepared<'a>>
where
Self: 'a
type Prepared<'a> = Erased<<M as PrepareReference>::Prepared<'a>> where Self: 'a
Retained work may borrow the scorer, but not the input or preparation
pulse. Each subsequent evaluation receives fresh controls.
Source§fn warm_reference(
&mut self,
r: &PixelView<'_>,
opts: EvalOpts<'_>,
) -> MetricResult<Self::Prepared<'_>>
fn warm_reference( &mut self, r: &PixelView<'_>, opts: EvalOpts<'_>, ) -> MetricResult<Self::Prepared<'_>>
Prepare work preserving cold-result scalar bits.
Source§impl<P: WarmReference> WarmReference for Erased<P>where
P::Output: 'static,
impl<P: WarmReference> WarmReference for Erased<P>where
P::Output: 'static,
Auto Trait Implementations§
impl<M> Freeze for Erased<M>where
M: Freeze,
impl<M> RefUnwindSafe for Erased<M>where
M: RefUnwindSafe,
impl<M> Send for Erased<M>where
M: Send,
impl<M> Sync for Erased<M>where
M: Sync,
impl<M> Unpin for Erased<M>where
M: Unpin,
impl<M> UnsafeUnpin for Erased<M>where
M: UnsafeUnpin,
impl<M> UnwindSafe for Erased<M>where
M: 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