feat: adding somme new transformation

* Rotate to rotate the image, !! Some point could be outside of the
  0-4096 range on x and y !!
  you should parameter a center and an angle. All the point will move
  around the center. The angle is un degre.
* Flip vertical: flip all the point verticaly. You should parameter an
  height where all point will flip
* Flip horizontaly. You should parameter an X corrodinate where all
  point will flip around.
This commit is contained in:
Lapin Raving 2023-06-08 22:34:03 +02:00
parent 5f03d74080
commit 08e78b9a88
4 changed files with 101 additions and 0 deletions

View file

@ -1,12 +1,18 @@
//pub mod common;
mod translate;
mod replicate;
mod rotate;
mod flip_horizontal;
mod flip_vertical;
use crate::point::Point;
// re-export transformers to be abe to use it directly from transformer::
pub use translate::Translate;
pub use replicate::Replicate;
pub use rotate::Rotate;
pub use flip_horizontal::FlipHorizontal;
pub use flip_vertical::FlipVertical;
pub trait Transformers {
fn apply(&self, point_list: &[Point]) -> Vec<Point>;