pub struct Kernel3D { /* private fields */ }Expand description
3D point-spread function stored as a (depth, height, width) f32 array.
Constructors copy data into standard layout and reject empty or non-finite
arrays. Use Kernel3D::normalized when the PSF should sum to 1.
Implementations§
Source§impl Kernel3D
impl Kernel3D
Sourcepub fn new(data: Array3<f32>) -> Result<Self>
pub fn new(data: Array3<f32>) -> Result<Self>
Build a 3D kernel from (depth, height, width) samples.
The data is copied into standard layout.
§Errors
Returns Error::InvalidPsf for empty arrays and
Error::NonFiniteInput for NaN or infinite samples.
Sourcepub fn into_inner(self) -> Array3<f32>
pub fn into_inner(self) -> Array3<f32>
Consume the kernel and return its owned array.
Sourcepub fn normalize(&mut self) -> Result<()>
pub fn normalize(&mut self) -> Result<()>
Normalize the kernel in place so its sum is 1.
§Errors
Returns Error::InvalidPsf when the kernel sum is non-finite or too
close to zero.
Sourcepub fn normalized(&self) -> Result<Self>
pub fn normalized(&self) -> Result<Self>
Return a normalized copy of this kernel.
§Errors
Returns Error::InvalidPsf when the kernel sum is non-finite or too
close to zero.
Trait Implementations§
impl StructuralPartialEq for Kernel3D
Auto Trait Implementations§
impl Freeze for Kernel3D
impl RefUnwindSafe for Kernel3D
impl Send for Kernel3D
impl Sync for Kernel3D
impl Unpin for Kernel3D
impl UnsafeUnpin for Kernel3D
impl UnwindSafe for Kernel3D
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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