aboutsummaryrefslogtreecommitdiff
path: root/src/camera/filter/mod.rs
blob: 93c6fc5a3f77d862e9d9d5ffbb6464ab8289f25d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use crate::vector::Vector2f;
use crate::Float;

pub trait Filter {
    fn eval(&self, point: &Vector2f) -> Float;
    fn radius(&self) -> Vector2f;
}

pub struct BoxFilter {
    radius: Vector2f,
}

// The same a no filter, and can give aliasing in final image
impl Filter for BoxFilter {
    fn eval(&self, _: &Vector2f) -> Float {
        1.0
    }

    fn radius(&self) -> Vector2f {
        self.radius
    }
}