29 lines
653 B
Rust
29 lines
653 B
Rust
use crate::{
|
|
Canvas, ImgSyn,
|
|
assist::{axial, polar},
|
|
};
|
|
|
|
#[derive(Clone, Copy)]
|
|
pub struct ImgSynAxial<Prev: ImgSyn>(pub(crate) Prev);
|
|
|
|
impl<Prev> ImgSyn for ImgSynAxial<Prev>
|
|
where
|
|
Prev: ImgSyn,
|
|
{
|
|
fn getpx(&self, meta: Canvas, x: f32, y: f32) -> crate::Pixel {
|
|
let (x, y) = axial(x, y, meta);
|
|
self.0.getpx(meta, x, y)
|
|
}
|
|
}
|
|
#[derive(Clone, Copy)]
|
|
pub struct ImgSynPolar<Prev: ImgSyn>(pub(crate) Prev);
|
|
|
|
impl<Prev> ImgSyn for ImgSynPolar<Prev>
|
|
where
|
|
Prev: ImgSyn,
|
|
{
|
|
fn getpx(&self, meta: Canvas, x: f32, y: f32) -> crate::Pixel {
|
|
let (x, y) = polar(x, y, meta);
|
|
self.0.getpx(meta, x, y)
|
|
}
|
|
}
|