Skip to content

Commit bfd5ada

Browse files
committed
Added new interpolation types for transformation functions
1 parent 689f3b8 commit bfd5ada

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/defines.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,18 @@ pub enum InterpType {
147147
BILINEAR= 2,
148148
/// Cubic interpolation method
149149
CUBIC = 3,
150+
/// Floor indexed
151+
LOWER = 4,
152+
/// Linear interpolation with cosine smoothing
153+
LINEAR_COSINE = 5,
154+
/// Bilinear interpolation with cosine smoothing
155+
BILINEAR_COSINE = 6,
156+
/// Bicubic interpolation
157+
BICUBIC = 7,
158+
/// Cubic interpolation with Catmull-Rom splines
159+
CUBIC_SPLINE = 8,
160+
/// Bicubic interpolation with Catmull-Rom splines
161+
BICUBIC_SPLINE = 9
150162
}
151163

152164
/// Helps determine how to pad kernels along borders

src/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl From<i32> for DType {
3939

4040
impl From<i32> for InterpType {
4141
fn from(t: i32) -> InterpType {
42-
assert!(InterpType::NEAREST as i32 <= t && t <= InterpType::CUBIC as i32);
42+
assert!(InterpType::NEAREST as i32 <= t && t <= InterpType::BICUBIC_SPLINE as i32);
4343
unsafe { mem::transmute(t) }
4444
}
4545
}

0 commit comments

Comments
 (0)