struct Volume<'a> {
owned: Option<Vec<f64>>,
view: &'a [f64],
dims: (usize, usize, usize),
affine: [f64; 16],
}Expand description
One pyramid level: either a borrowed view of the caller’s data (level 0) or a decimated copy.
Fields§
§owned: Option<Vec<f64>>§view: &'a [f64]§dims: (usize, usize, usize)§affine: [f64; 16]Implementations§
Source§impl<'a> Volume<'a>
impl<'a> Volume<'a>
fn borrowed( data: &'a [f64], dims: (usize, usize, usize), affine: [f64; 16], ) -> Self
fn data(&self) -> &[f64]
Sourcefn halved(&self) -> Volume<'static>
fn halved(&self) -> Volume<'static>
Halve every axis: a 5-tap binomial blur per axis, then keep the even samples.
The blur is the anti-aliasing the decimation needs; the binomial [1 4 6 4 1]/16 kernel is
the usual pyramid choice and needs no sigma to tune (the crate’s box-filter Gaussian
collapses to a no-op at the σ≈1 this calls for). Keeping the even samples means coarse
voxel i sits exactly on fine voxel 2i, so the level’s affine is the fine affine with
its three direction columns doubled and its translation untouched — exact, no half-voxel
offset to get wrong.
Auto Trait Implementations§
impl<'a> Freeze for Volume<'a>
impl<'a> RefUnwindSafe for Volume<'a>
impl<'a> Send for Volume<'a>
impl<'a> Sync for Volume<'a>
impl<'a> Unpin for Volume<'a>
impl<'a> UnsafeUnpin for Volume<'a>
impl<'a> UnwindSafe for Volume<'a>
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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