pub struct PyramidLevel {
pub data: Vec<u8>,
pub width: usize,
pub height: usize,
pub stride: usize,
pub scale: usize,
}Expand description
A single level of the image pyramid.
Fields§
§data: Vec<u8>Pixel data.
width: usizeWidth in pixels.
height: usizeHeight in pixels.
stride: usizeStride (bytes per row).
scale: usizeScale factor from original (1, 2, 4, …).
Implementations§
Source§impl PyramidLevel
impl PyramidLevel
Sourcepub fn from_data(
data: Vec<u8>,
width: usize,
height: usize,
scale: usize,
) -> Self
pub fn from_data( data: Vec<u8>, width: usize, height: usize, scale: usize, ) -> Self
Creates a pyramid level from existing data.
Sourcepub fn downsample_from(&mut self, src: &PyramidLevel)
pub fn downsample_from(&mut self, src: &PyramidLevel)
Downsamples from another level (2:1).
Trait Implementations§
Source§impl Clone for PyramidLevel
impl Clone for PyramidLevel
Source§fn clone(&self) -> PyramidLevel
fn clone(&self) -> PyramidLevel
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PyramidLevel
impl RefUnwindSafe for PyramidLevel
impl Send for PyramidLevel
impl Sync for PyramidLevel
impl Unpin for PyramidLevel
impl UnsafeUnpin for PyramidLevel
impl UnwindSafe for PyramidLevel
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