Struct libreda_db::layout::prelude::Matrix3dTransform [−][src]
pub struct Matrix3dTransform<T> where
T: CoordinateType, {
pub m11: T,
pub m12: T,
pub m21: T,
pub m22: T,
pub m31: T,
pub m32: T,
}
Expand description
Affine transformation represented as a 3x3 matrix like:
m11 m12 0
m21 m22 0
m31 m32 1
Fields
m11: T
m11
m12: T
m12
m21: T
m21
m22: T
m22
m31: T
m31. Used to express the x
component of the translation.
m32: T
m32. Used to express the y
component of the translation.
Implementations
Create a new transform based on the matrix elements.
Get the identity transform.
Create a translation by a vector.
Create a rotation by an integer multiple of 90 degrees.
Create a scaling by a factor.
Mirror at the x-axis.
Mirror at the y-axis.
Apply the transformation to a single point.
Return the 3x3 matrix describing this transformation.
Return the 2x2 matrix that describes this transformation without any translation.
Compute the determinant of the 3x3 matrix that describes this transformation.
Get the inverse transformation if it exists.
Return a new transformation that is equal to applying
first self
then t
.
Create a new transformation with an additional scaling.
Create a new transformation with an additional translation.
Create a new transformation with an additional rotation by a multiple of 90 degrees.
Create a new transformation with an additional mirroring at the x-axis.
Create a new transformation with an additional mirroring at the y-axis.
Get the translation part of this affine transformation.
Create a rotation by an arbitrary angle (in radians).
Create a new transformation with an additional rotation.
Trait Implementations
impl<'de, T> Deserialize<'de> for Matrix3dTransform<T> where
T: CoordinateType + Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Matrix3dTransform<T> where
T: CoordinateType + Deserialize<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Matrix3dTransform<T>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Matrix3dTransform<T>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
pub fn mul(
self,
rhs: Matrix3dTransform<T>
) -> <Matrix3dTransform<T> as Mul<Matrix3dTransform<T>>>::Output
pub fn mul(
self,
rhs: Matrix3dTransform<T>
) -> <Matrix3dTransform<T> as Mul<Matrix3dTransform<T>>>::Output
Shortcut for self.then(&rhs)
.
type Output = Matrix3dTransform<T>
type Output = Matrix3dTransform<T>
The resulting type after applying the *
operator.
impl<T> PartialEq<Matrix3dTransform<T>> for Matrix3dTransform<T> where
T: PartialEq<T> + CoordinateType,
impl<T> PartialEq<Matrix3dTransform<T>> for Matrix3dTransform<T> where
T: PartialEq<T> + CoordinateType,
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for Matrix3dTransform<T> where
T: RefUnwindSafe,
impl<T> Send for Matrix3dTransform<T> where
T: Send,
impl<T> Sync for Matrix3dTransform<T> where
T: Sync,
impl<T> Unpin for Matrix3dTransform<T> where
T: Unpin,
impl<T> UnwindSafe for Matrix3dTransform<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more