Enum rlifesrc_lib::Transform[][src]

pub enum Transform {
    Id,
    Rotate90,
    Rotate180,
    Rotate270,
    FlipRow,
    FlipCol,
    FlipDiag,
    FlipAntidiag,
}

Transformations (rotations and reflections) after the last generation in a period.

After the last generation in a period, the pattern will return to the first generation, applying this transformation first, and then the translation defined by dx and dy.

8 different values correspond to 8 elements of the dihedral group D8.

Id is the identity transformation.

R means rotations around the center of the world. The number after it is the counterclockwise rotation angle in degrees.

F means reflections (flips). The symbol after it is the axis of reflection.

Some of the transformations are only valid when the world is square. and some are only valid when the world has no diagonal width.

Variants

Id

Id.

Identity transformation.

Rotate90

R90.

90° rotation counterclockwise.

Requires the world to be square and have no diagonal width.

Rotate180

R180.

180° rotation counterclockwise.

Rotate270

R270.

270° rotation counterclockwise.

Requires the world to be square and have no diagonal width.

FlipRow

F-.

Reflection across the middle row.

Requires the world to have no diagonal width.

FlipCol

F|.

Reflection across the middle column.

Requires the world to have no diagonal width.

FlipDiag

F\.

Reflection across the diagonal.

Requires the world to be square.

FlipAntidiag

F/.

Reflection across the antidiagonal.

Requires the world to be square.

Implementations

impl Transform[src]

pub fn require_square_world(self) -> bool[src]

Whether this transformation requires the world to be square.

Returns true for R90, R270, F\ and F/.

pub fn require_no_diagonal_width(self) -> bool[src]

Whether this transformation requires the world to have no diagonal width.

Returns true for R90, R270, F- and F|.

pub fn inverse(self) -> Self[src]

The inverse of this transformation.

pub fn is_in(self, sym: Symmetry) -> bool[src]

Whether the transformation is a member of the symmetry group, i.e., whether patterns with this symmetry are invariant under this transformation.

pub fn act_on(self, coord: Coord, width: i32, height: i32) -> Coord[src]

Apply the transformation on a coordinate.

Trait Implementations

impl Clone for Transform[src]

impl Copy for Transform[src]

impl Debug for Transform[src]

impl Default for Transform[src]

impl<'de> Deserialize<'de> for Transform[src]

impl Display for Transform[src]

impl Eq for Transform[src]

impl FromStr for Transform[src]

type Err = String

The associated error which can be returned from parsing.

impl Hash for Transform[src]

impl Mul<Transform> for Transform[src]

type Output = Self

The resulting type after applying the * operator.

impl PartialEq<Transform> for Transform[src]

impl Serialize for Transform[src]

impl StructuralEq for Transform[src]

impl StructuralPartialEq for Transform[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,