pub enum BitPackingRead<Norm> {
Fail,
PassThrough,
Norm(Norm),
}Expand description
Full re-export of zenpixels core types (zero module name collisions!).
Policy controlling how read-only row visiting (PixelView::visit_rows_with_packing,
PixelBuf::visit_rows_with_packing) handles non-BitPacking::Full layouts.
When layout.packing == BitPacking::Full, all variants borrow rows zero-copy with zero
allocation and zero closure overhead.
Variants§
Fail
Refuse non-BitPacking::Full layouts with BufferError::IncompatibleLayout.
PassThrough
Hand zero-copy raw container words to the visitor as-is (still enforcing S::SAMPLE_TYPE).
Norm(Norm)
For non-BitPacking::Full layouts, copy each row into a reusable single-row scratch
buffer, run norm(packing, &mut scratch), and hand &scratch to the visitor.
Implementations§
Source§impl<S> BitPackingRead<fn(BitPacking, &mut [S])>where
S: StorageSample,
impl<S> BitPackingRead<fn(BitPacking, &mut [S])>where
S: StorageSample,
Sourcepub const fn fail() -> BitPackingRead<fn(BitPacking, &mut [S])>
pub const fn fail() -> BitPackingRead<fn(BitPacking, &mut [S])>
Construct BitPackingRead::Fail without needing a closure type annotation.
Sourcepub const fn pass_through() -> BitPackingRead<fn(BitPacking, &mut [S])>
pub const fn pass_through() -> BitPackingRead<fn(BitPacking, &mut [S])>
Construct BitPackingRead::PassThrough without needing a closure type annotation.
Source§impl<Norm> BitPackingRead<Norm>
impl<Norm> BitPackingRead<Norm>
Sourcepub const fn norm(norm: Norm) -> BitPackingRead<Norm>
pub const fn norm(norm: Norm) -> BitPackingRead<Norm>
Construct BitPackingRead::Norm with an explicit normalization lambda.
Trait Implementations§
Source§impl<Norm> Clone for BitPackingRead<Norm>where
Norm: Clone,
impl<Norm> Clone for BitPackingRead<Norm>where
Norm: Clone,
Source§fn clone(&self) -> BitPackingRead<Norm>
fn clone(&self) -> BitPackingRead<Norm>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more