#[repr(u8)]pub enum Transform {
Identity = 0,
Rotate90 = 1,
Rotate180 = 2,
Rotate270 = 3,
FlipHorizontal = 4,
FlipDiagonal = 5,
FlipVertical = 6,
FlipAntiDiagonal = 7,
}
Expand description
The eight transformations that can be applied to a 2D grid.
Variants§
Identity = 0
No transformation: (x, y) -> ( x, y)
Rotate90 = 1
Rotate 90 degrees clockwise: (x, y) -> ( y, -x)
Rotate180 = 2
One half turn: (x, y) -> (-x, -y)
Rotate270 = 3
Rotate 270 degrees clockwise: (x, y) -> (-y, x)
FlipHorizontal = 4
Flip around the vertical axis: (x, y) -> (-x, y)
FlipDiagonal = 5
Flip around the main diagonal: (x, y) -> ( y, x)
FlipVertical = 6
Flip around the horizontal axis: (x, y) -> ( x, -y)
FlipAntiDiagonal = 7
Flip around the anti-diagonal: (x, y) -> (-y, -x)
Implementations§
Trait Implementations§
Source§impl Mul<Transform> for Direction
impl Mul<Transform> for Direction
Source§impl MulAssign<Transform> for Direction
impl MulAssign<Transform> for Direction
Source§fn mul_assign(&mut self, rhs: Transform)
fn mul_assign(&mut self, rhs: Transform)
Applies a Transform
to the current Direction
.
Source§impl MulAssign for Transform
impl MulAssign for Transform
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*=
operation. Read moreSource§impl TryFromPrimitive for Transform
impl TryFromPrimitive for Transform
impl Copy for Transform
impl Eq for Transform
impl StructuralPartialEq for Transform
Auto Trait Implementations§
impl Freeze for Transform
impl RefUnwindSafe for Transform
impl Send for Transform
impl Sync for Transform
impl Unpin for Transform
impl UnwindSafe for Transform
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more