Enum runa_orbiter::utils::geometry::Transform
source · pub enum Transform {
Normal,
_90,
_180,
_270,
Flipped,
Flipped90,
Flipped180,
Flipped270,
}
Expand description
Possible transformations to two-dimensional planes
Variants§
Normal
Identity transformation (plane is unaltered when applied)
_90
Plane is rotated by 90 degrees
_180
Plane is rotated by 180 degrees
_270
Plane is rotated by 270 degrees
Flipped
Plane is flipped vertically
Flipped90
Plane is flipped vertically and rotated by 90 degrees
Flipped180
Plane is flipped vertically and rotated by 180 degrees
Flipped270
Plane is flipped vertically and rotated by 270 degrees
Implementations§
source§impl Transform
impl Transform
Coordinate system is irrelevant to other types, but it does affect how transformations are performed. Here we define the coordinate system to be X to the left, Y down, origin at top left.
sourcepub fn transform_point_in<N: Sub<Output = N> + Copy, Kind: CoordinateSpace>(
&self,
point: Point<N, Kind>,
area: &Extent<N, Kind>
) -> Point<N, Kind>
pub fn transform_point_in<N: Sub<Output = N> + Copy, Kind: CoordinateSpace>( &self, point: Point<N, Kind>, area: &Extent<N, Kind> ) -> Point<N, Kind>
Get the coordinates of a point inside an extent, after applying the transformation to the extent. The Extent is placed at (0, 0) to (w, h), and transformation is applied so that the upper-left corner of the resulting extent is at (0, 0).
sourcepub fn transform_size<N: Sign + Copy, Kind: CoordinateSpace>(
&self,
size: Extent<N, Kind>
) -> Extent<N, Kind>
pub fn transform_size<N: Sign + Copy, Kind: CoordinateSpace>( &self, size: Extent<N, Kind> ) -> Extent<N, Kind>
Transformed size after applying this transformation.
sourcepub fn transform_rect_in<N: Sub<Output = N> + Sign + Copy + Debug, Kind: CoordinateSpace>(
&self,
rect: Rectangle<N, Kind>,
area: &Extent<N, Kind>
) -> Rectangle<N, Kind>
pub fn transform_rect_in<N: Sub<Output = N> + Sign + Copy + Debug, Kind: CoordinateSpace>( &self, rect: Rectangle<N, Kind>, area: &Extent<N, Kind> ) -> Rectangle<N, Kind>
Transforms a rectangle inside an area of a given size by applying this transformation.
Trait Implementations§
source§impl PartialEq<Transform> for Transform
impl PartialEq<Transform> for Transform
impl Copy for Transform
impl Eq for Transform
impl StructuralEq for Transform
impl StructuralPartialEq for Transform
Auto Trait Implementations§
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> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.