Enum rlifesrc_lib::Transform [−][src]
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
.
Identity transformation.
R90
.
90° rotation counterclockwise.
Requires the world to be square and have no diagonal width.
R180
.
180° rotation counterclockwise.
R270
.
270° rotation counterclockwise.
Requires the world to be square and have no diagonal width.
F-
.
Reflection across the middle row.
Requires the world to have no diagonal width.
F|
.
Reflection across the middle column.
Requires the world to have no diagonal width.
F\
.
Reflection across the diagonal.
Requires the world to be square.
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]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
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.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl Hash for Transform
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Mul<Transform> for Transform
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: Self) -> Self
[src]
impl PartialEq<Transform> for Transform
[src]
fn eq(&self, other: &Transform) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl Serialize for Transform
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for Transform
[src]
impl StructuralPartialEq for Transform
[src]
Auto Trait Implementations
impl RefUnwindSafe for Transform
[src]
impl Send for Transform
[src]
impl Sync for Transform
[src]
impl Unpin for Transform
[src]
impl UnwindSafe for Transform
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,