pub enum PixelData {
U8(Array3<u8>),
U16(Array3<u16>),
I16(Array3<i16>),
U32(Array3<u32>),
I32(Array3<i32>),
F32(Array3<f32>),
F64(Array3<f64>),
}Expand description
Decoded pixel buffer in (bands, height, width) planar layout.
Reading, warping, and mosaic reduction retain this planar layout. Renderers interleave selected channels when producing encoded image bytes.
Variants§
U8(Array3<u8>)
Unsigned 8-bit samples in (bands, height, width) order.
U16(Array3<u16>)
Unsigned 16-bit samples in (bands, height, width) order.
I16(Array3<i16>)
Signed 16-bit samples in (bands, height, width) order.
U32(Array3<u32>)
Unsigned 32-bit samples in (bands, height, width) order.
I32(Array3<i32>)
Signed 32-bit samples in (bands, height, width) order.
F32(Array3<f32>)
32-bit floating-point samples in (bands, height, width) order.
F64(Array3<f64>)
64-bit floating-point samples in (bands, height, width) order.
Implementations§
Source§impl PixelData
impl PixelData
Sourcepub fn to_f64(&self) -> Array3<f64>
pub fn to_f64(&self) -> Array3<f64>
View every pixel as f64 — used by the render hot path. Allocates one f64 array; caller should cache if iterating.
Sourcepub fn band_to_f64(&self, b: usize) -> Array2<f64>
pub fn band_to_f64(&self, b: usize) -> Array2<f64>
Convert a single band b to an owned Array2<f64>. Cheaper than
to_f64 when only a few of many bands are rendered: it
touches one band, not the whole (bands, H, W) cube. Panics if b is
out of range — callers validate bidx first.
Sourcepub fn as_f64(&self) -> Cow<'_, Array3<f64>>
pub fn as_f64(&self) -> Cow<'_, Array3<f64>>
Like to_f64 but borrows the buffer for the
already-f64 case (Cow::Borrowed) instead of cloning a full
bands×H×W array. The scalar cross-CRS warp only reads the
promoted array, so f64 COGs pay zero extra allocation.
Sourcepub fn into_f64(self) -> Array3<f64>
pub fn into_f64(self) -> Array3<f64>
Consume the pixels, reusing the allocation when already F64.
Sourcepub fn split_off_band(self, b: usize) -> Option<(Self, Array2<bool>)>
pub fn split_off_band(self, b: usize) -> Option<(Self, Array2<bool>)>
Split off band b as an Array2<bool> (truthy = non-zero) and
return the remaining planar (bands-1, H, W) buffer. Used by the
CogReader to promote an ExtraSamples=Alpha band to a validity
mask after stitching, mirroring rio-tiler’s alpha-band priority.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PixelData
impl RefUnwindSafe for PixelData
impl Send for PixelData
impl Sync for PixelData
impl Unpin for PixelData
impl UnsafeUnpin for PixelData
impl UnwindSafe for PixelData
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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