pub trait PaddingStrategy<T>where
T: Copy,{
// Required methods
fn pad(
&self,
image: ArrayView<'_, T, Ix3>,
padding: (usize, usize),
) -> ArrayBase<OwnedRepr<T>, Ix3>;
fn get_pixel(
&self,
image: ArrayView<'_, T, Ix3>,
index: (isize, isize),
) -> Option<Array1<T>>;
fn get_value(
&self,
image: ArrayView<'_, T, Ix3>,
index: (isize, isize, usize),
) -> Option<T>;
// Provided method
fn will_pad(&self, _coord: Option<(isize, isize)>) -> bool { ... }
}
Expand description
Defines a method for padding the data of an image applied directly to the ndarray type internally. Padding is symmetric
Required Methods§
Sourcefn pad(
&self,
image: ArrayView<'_, T, Ix3>,
padding: (usize, usize),
) -> ArrayBase<OwnedRepr<T>, Ix3>
fn pad( &self, image: ArrayView<'_, T, Ix3>, padding: (usize, usize), ) -> ArrayBase<OwnedRepr<T>, Ix3>
Taking in the image data and the margin to apply to rows and columns returns a padded image