Skip to content

Commit 245df40

Browse files
committed
Started thinking about padding
1 parent f229d59 commit 245df40

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/processing/conv.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,23 @@ use num_traits::{Num, NumAssignOps};
66
use std::marker::PhantomData;
77
use std::marker::Sized;
88

9+
pub struct NoPadding;
10+
pub struct ZeroPadding;
11+
pub struct ExtendPadding;
12+
13+
pub trait ImagePadder where Self: Sized + Copy {
14+
type Data;
15+
16+
fn pad(&self, pad_size: (usize, usize)) -> Self;
17+
}
18+
19+
20+
impl<T> ImagePadder<T> for NoPadding {
21+
fn pad(&self, pad_size: (usize, usize)) -> Self {
22+
*self
23+
}
24+
}
25+
926
/// Perform image convolutions
1027
pub trait ConvolutionExt
1128
where

0 commit comments

Comments
 (0)