pub struct FixedHistory { /* private fields */ }Expand description
Per-pixel run history of one fixed region, laid out over its floored rect.
Implementations§
Source§impl FixedHistory
impl FixedHistory
pub fn new(region: Rect) -> Self
Sourcepub fn first_frame(&self) -> Option<u32>
pub fn first_frame(&self) -> Option<u32>
The frame whose values FixedHistory::first starts from.
pub fn closed(&self) -> bool
Sourcepub fn frame0(&self) -> &[u32]
pub fn frame0(&self) -> &[u32]
The first frame’s values, packed RGBA over the region’s rect (0 where the region owns no pixel).
Sourcepub fn update(
&mut self,
rgba: &[u8],
labels: &[u8],
consistent: &[u8],
width: usize,
height: usize,
code: u8,
frame: u32,
limit: u32,
) -> usize
pub fn update( &mut self, rgba: &[u8], labels: &[u8], consistent: &[u8], width: usize, height: usize, code: u8, frame: u32, limit: u32, ) -> usize
Takes frame frame’s pixels (rgba, width × height, atlas labels, the region’s code, the region’s
consistency mask consistent): a pixel that moved beyond limit (the RGB difference sum the source noise
allows) from its current run ends that run. When the pixels that settled into a new value (consistent with a
neighbouring frame) are more than a pointer could cover, the region changed state and the first epoch ends
here. Returns that count of settled pixels.
Sourcepub fn close(&mut self, end: u32)
pub fn close(&mut self, end: u32)
Ends the first epoch before frame end: every current run is counted up to it, and later updates are
ignored.
Sourcepub fn first(&self, limit: u32) -> Vec<u32>
pub fn first(&self, limit: u32) -> Vec<u32>
The first frame’s pixels with its transients replaced (call after FixedHistory::close): where the value a
pixel held longest in the first epoch differs from the first frame by more than limit, inside a patch no
larger than a pointer, the longest-held value; elsewhere the first frame. Packed RGBA over the region’s rect;
0 where the region owns no pixel.
Auto Trait Implementations§
impl Freeze for FixedHistory
impl RefUnwindSafe for FixedHistory
impl Send for FixedHistory
impl Sync for FixedHistory
impl Unpin for FixedHistory
impl UnsafeUnpin for FixedHistory
impl UnwindSafe for FixedHistory
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