pub struct BandSetView<'a, T>where
T: Sample,{ /* private fields */ }Expand description
Borrowed, dimension-checked view of a multi-band raster.
Implementations§
Source§impl<'a, T> BandSetView<'a, T>where
T: Sample,
impl<'a, T> BandSetView<'a, T>where
T: Sample,
Sourcepub fn new(
width: u32,
height: u32,
depth: u32,
band_count: usize,
layout: BandLayout,
data: &'a [T],
) -> Result<BandSetView<'a, T>, Error>
pub fn new( width: u32, height: u32, depth: u32, band_count: usize, layout: BandLayout, data: &'a [T], ) -> Result<BandSetView<'a, T>, Error>
Creates a band-set view over interleaved or band-sequential samples.
§Errors
Returns an error for zero bands or depth, overflowing dimensions, or a sample slice whose length does not match the declared shape.
Sourcepub fn band_count(self) -> usize
pub fn band_count(self) -> usize
Returns the number of bands.
Sourcepub fn layout(self) -> BandLayout
pub fn layout(self) -> BandLayout
Returns the memory layout of the supplied samples.
Sourcepub fn pixel_count(self) -> Result<usize, Error>
pub fn pixel_count(self) -> Result<usize, Error>
Returns the checked pixel count cached at construction.
Sourcepub fn band_sample_count(self) -> Result<usize, Error>
pub fn band_sample_count(self) -> Result<usize, Error>
Returns the sample count of one band.
Sourcepub fn value_count(self) -> Result<usize, Error>
pub fn value_count(self) -> Result<usize, Error>
Returns the total number of samples across every band.
Trait Implementations§
Source§impl<'a, T> Clone for BandSetView<'a, T>
impl<'a, T> Clone for BandSetView<'a, T>
Source§fn clone(&self) -> BandSetView<'a, T>
fn clone(&self) -> BandSetView<'a, T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a, T> Copy for BandSetView<'a, T>
Source§impl<'a, T> Debug for BandSetView<'a, T>
impl<'a, T> Debug for BandSetView<'a, T>
Source§impl<'a, T> PartialEq for BandSetView<'a, T>
impl<'a, T> PartialEq for BandSetView<'a, T>
impl<'a, T> StructuralPartialEq for BandSetView<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for BandSetView<'a, T>
impl<'a, T> RefUnwindSafe for BandSetView<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for BandSetView<'a, T>where
T: Sync,
impl<'a, T> Sync for BandSetView<'a, T>where
T: Sync,
impl<'a, T> Unpin for BandSetView<'a, T>
impl<'a, T> UnsafeUnpin for BandSetView<'a, T>
impl<'a, T> UnwindSafe for BandSetView<'a, T>where
T: RefUnwindSafe,
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