pub struct ScanSession { /* private fields */ }Expand description
The scan pass of one run.
Implementations§
Source§impl ScanSession
impl ScanSession
Sourcepub fn new(width: usize, height: usize, factor: usize) -> ScanSession
pub fn new(width: usize, height: usize, factor: usize) -> ScanSession
A scan over width × height native frames analysed at the integer factor.
pub fn native_size(&self) -> (usize, usize)
pub fn analysis_size(&self) -> (usize, usize)
Sourcepub fn learner(&self) -> &RegionLearner
pub fn learner(&self) -> &RegionLearner
The layer-learning state, for hosts and tests that read the accumulators back.
Sourcepub fn frame_buffer(&mut self) -> &mut [u8] ⓘ
pub fn frame_buffer(&mut self) -> &mut [u8] ⓘ
The buffer the next frame’s native RGBA (width × height × 4 bytes) goes into. Asking again before push
returns the same buffer.
Sourcepub fn is_duplicate(&mut self) -> bool
pub fn is_duplicate(&mut self) -> bool
Whether the frame written into frame_buffer repeats the previous frame exactly (every RGBA byte). A
duplicate needs no analysis gray.
Sourcepub fn push(
&mut self,
meta: FrameMeta,
gray: Option<&[u8]>,
) -> Result<ScanStep, ScanError>
pub fn push( &mut self, meta: FrameMeta, gray: Option<&[u8]>, ) -> Result<ScanStep, ScanError>
Analyses the frame written into frame_buffer. gray is the host’s analysis gray for it (for example from
WebGPU), which must equal the box-filtered luma at the session’s factor; without one the session computes it.
Sourcepub fn finish(&self, manual: &[ManualRegion]) -> ScanRegions
pub fn finish(&self, manual: &[ManualRegion]) -> ScanRegions
Builds the run’s regions (none when no frame was analysed) from the learned evidence, or from manual when
the run has hand-placed regions, and the diagnostics about the resulting layout.
Auto Trait Implementations§
impl !Send for ScanSession
impl !Sync for ScanSession
impl Freeze for ScanSession
impl RefUnwindSafe for ScanSession
impl Unpin for ScanSession
impl UnsafeUnpin for ScanSession
impl UnwindSafe for ScanSession
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