pub struct RegionLearner { /* private fields */ }Expand description
Layer-learning state for one run: accumulators plus the last informative native frame.
Implementations§
Source§impl RegionLearner
impl RegionLearner
Sourcepub fn new(width: usize, height: usize) -> RegionLearner
pub fn new(width: usize, height: usize) -> RegionLearner
A learner over a width × height analysis grid.
Sourcepub fn accumulators(&self) -> &Learner
pub fn accumulators(&self) -> &Learner
The accumulators, for hosts and tests that read them back.
Sourcepub fn add(
&mut self,
field: &Field<'_>,
prev: &[u8],
current: &[u8],
native: Option<(&[u8], &[u8], usize, usize)>,
) -> bool
pub fn add( &mut self, field: &Field<'_>, prev: &[u8], current: &[u8], native: Option<(&[u8], &[u8], usize, usize)>, ) -> bool
Accumulates one field (the learner applies its own informative gate). prev/current are analysis grays;
native is the pair of native RGBA frames with their shared size, when the host has both. When the field
was accumulated and native frames were given, current’s native frame becomes the appearance reference
finish samples. Returns whether the field was accumulated.
Sourcepub fn finish(
&self,
native_width: f64,
native_height: f64,
manual: &[ManualRegion],
factor: u32,
) -> Vec<RegionOut>
pub fn finish( &self, native_width: f64, native_height: f64, manual: &[ManualRegion], factor: u32, ) -> Vec<RegionOut>
Builds the run’s regions. With manual regions, those (in order, each excluding every later one and every
ignored one) plus an unassigned region when they leave native pixels uncovered; otherwise the automatic
layout from the accumulators. factor is the integer analysis factor.
Auto Trait Implementations§
impl Freeze for RegionLearner
impl RefUnwindSafe for RegionLearner
impl Send for RegionLearner
impl Sync for RegionLearner
impl Unpin for RegionLearner
impl UnsafeUnpin for RegionLearner
impl UnwindSafe for RegionLearner
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more