pub struct BlockReduction {
pub factor: usize,
pub source_width: usize,
pub source_height: usize,
}Available on crate feature
encoder only.Expand description
The thinning a source’s Downsample asks for, fixed to one file’s grid:
every factor x factor block of the (source_height, source_width)
plane becomes its maximum. Never serialized: the bundle’s grid is the
thinned one.
Mirrors BlockReduction in xuebuild/grid.py.
Fields§
§factor: usize§source_width: usize§source_height: usizeImplementations§
Source§impl BlockReduction
impl BlockReduction
pub fn source_shape(&self) -> (usize, usize)
Sourcepub fn take(&self, plane: &[f64]) -> Result<Vec<f64>>
pub fn take(&self, plane: &[f64]) -> Result<Vec<f64>>
The block maximum of one (source_height, source_width) plane. A NaN
anywhere in a block is the block’s value, as numpy’s max has it, so
a broken record still fails the completeness check downstream instead
of vanishing into a maximum (f64::max would drop it).
Trait Implementations§
Source§impl Clone for BlockReduction
impl Clone for BlockReduction
impl Copy for BlockReduction
Source§impl Debug for BlockReduction
impl Debug for BlockReduction
Source§impl PartialEq for BlockReduction
impl PartialEq for BlockReduction
impl StructuralPartialEq for BlockReduction
Auto Trait Implementations§
impl Forget for BlockReduction
impl Freeze for BlockReduction
impl Move for BlockReduction
impl RefUnwindSafe for BlockReduction
impl Send for BlockReduction
impl Sync for BlockReduction
impl Unpin for BlockReduction
impl UnsafeUnpin for BlockReduction
impl UnwindSafe for BlockReduction
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
Converts
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> ⓘ
Converts
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