pub enum WindowShape {
Rectangular {
width: usize,
height: usize,
},
Circular {
radius: f64,
},
Custom {
mask: Vec<bool>,
width: usize,
height: usize,
},
}Expand description
Window shape for focal operations
Variants§
Rectangular
Rectangular window with given width and height (must be odd)
Circular
Circular window with given radius
Custom
Custom window defined by a binary mask (1 = include, 0 = exclude)
Implementations§
Source§impl WindowShape
impl WindowShape
Sourcepub fn rectangular(width: usize, height: usize) -> Result<Self>
pub fn rectangular(width: usize, height: usize) -> Result<Self>
Sourcepub fn dimensions(&self) -> (usize, usize)
pub fn dimensions(&self) -> (usize, usize)
Gets the window dimensions
Sourcepub fn includes(&self, dx: i64, dy: i64) -> bool
pub fn includes(&self, dx: i64, dy: i64) -> bool
Checks if a pixel at given offset is included in the window
Sourcepub fn cell_count(&self) -> usize
pub fn cell_count(&self) -> usize
Returns the number of cells in the window
Trait Implementations§
Source§impl Clone for WindowShape
impl Clone for WindowShape
Source§fn clone(&self) -> WindowShape
fn clone(&self) -> WindowShape
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 moreSource§impl Debug for WindowShape
impl Debug for WindowShape
Source§impl PartialEq for WindowShape
impl PartialEq for WindowShape
impl StructuralPartialEq for WindowShape
Auto Trait Implementations§
impl Freeze for WindowShape
impl RefUnwindSafe for WindowShape
impl Send for WindowShape
impl Sync for WindowShape
impl Unpin for WindowShape
impl UnsafeUnpin for WindowShape
impl UnwindSafe for WindowShape
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