[−][src]Struct polyhorn_android::styles::Transform
Decomposition of a CSS transform into a constant 3D transform and a relative 2D translation (i.e. CSS percentage).
Fields
matrix: Transform3D<T>
This is the underlying, layout-independent 3D affine transformation matrix.
relative_translation: (T, T)
This is the underlying, layout-dependent relative translation (measured in percentage points). This translation should be applied after the layout-independent 3D affine transformation matrix.
Implementations
impl<T> Transform<T> where
T: Float,
[src]
T: Float,
pub fn with_transform(matrix: Transform3D<T>) -> Transform<T>
[src]
This function creates a new transform with the given coefficients.
pub fn with_matrix(matrix: [T; 6]) -> Transform<T>
[src]
This function creates a new homogeneous transform from the given coefficients.
pub fn with_matrix3d(matrix: [T; 16]) -> Transform<T>
[src]
This function creates a new homogeneous transform from the given coefficients.
pub fn with_perspective(d: T) -> Transform<T>
[src]
This function creates a new perspective transform with the given parameters.
pub fn with_rotation(rx: T, ry: T, rz: T, angle: Angle<T>) -> Transform<T> where
T: FloatConst,
[src]
T: FloatConst,
This function creates a new rotation transform with the given parameters.
pub fn with_scale(sx: T, sy: T, sz: T) -> Transform<T>
[src]
This function creates a new scale transform with the given parameters.
pub fn with_skew_x(sx: Angle<T>) -> Transform<T>
[src]
This function creates a new horizontal skew transform with the given angle.
pub fn with_skew_y(sy: Angle<T>) -> Transform<T>
[src]
This function creates a new vertical skew transform with the given angle.
pub fn with_translation(
tx: Dimension<T>,
ty: Dimension<T>,
tz: T
) -> Transform<T>
[src]
tx: Dimension<T>,
ty: Dimension<T>,
tz: T
) -> Transform<T>
This function creates a new translation transform with the given parameters. If one of the horizontal or vertical dimensions is relative (i.e. a percentage), this transform will need to be resolved before it can be applied.
pub fn is_resolved(&self) -> bool
[src]
This function returns a boolean that indicates if this transform is resolved, i.e. its relative translation is zero in both dimensions.
pub fn resolve(&self, size: Size<T>) -> Transform3D<T>
[src]
This function resolves a transform using the given size.
pub fn concat(&self, other: Transform<T>) -> Option<Transform<T>>
[src]
This function attempts to compress this transform and the given transform into a single transform, which will only work if the original transform is resolved (i.e. not relative to the unknown container size).
pub fn squash(transforms: [Transform<T>; 8], size: Size<T>) -> Transform3D<T>
[src]
This function folds the given transforms after resolving each with the given size.
Trait Implementations
impl<T> Clone for Transform<T> where
T: Clone + Float,
[src]
T: Clone + Float,
impl<T> Copy for Transform<T> where
T: Copy + Float,
[src]
T: Copy + Float,
impl<T> Debug for Transform<T> where
T: Debug + Float,
[src]
T: Debug + Float,
impl<T> Default for Transform<T> where
T: Float,
[src]
T: Float,
impl<T> PartialEq<Transform<T>> for Transform<T> where
T: PartialEq<T> + Float,
[src]
T: PartialEq<T> + Float,
pub fn eq(&self, other: &Transform<T>) -> bool
[src]
pub fn ne(&self, other: &Transform<T>) -> bool
[src]
impl<T> StructuralPartialEq for Transform<T> where
T: Float,
[src]
T: Float,
impl<T> ToTokens for Transform<T> where
T: ToTokens + Float,
[src]
T: ToTokens + Float,
pub fn to_tokens(&self, tokens: &mut TokenStream)
[src]
pub fn to_token_stream(&self) -> TokenStream
[src]
pub fn into_token_stream(self) -> TokenStream
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Transform<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Transform<T> where
T: Send,
T: Send,
impl<T> Sync for Transform<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Transform<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Transform<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
[src]
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
pub fn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
[src]
M: TransformMatrix<Swp, Dwp, T>,
pub fn adapt_into(self) -> D
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> AsAny for T where
T: Any,
[src]
T: Any,
pub fn as_any(&self) -> &(dyn Any + 'static)
[src]
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
pub fn type_name(&self) -> &'static str
[src]
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, U> ConvertInto<U> for T where
U: ConvertFrom<T>,
[src]
U: ConvertFrom<T>,
pub fn convert_into(self) -> U
[src]
pub fn convert_unclamped_into(self) -> U
[src]
pub fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
[src]
impl<'a, T> Desc<'a, T> for T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IsDefault for T where
T: PartialEq<T> + Default + Copy,
[src]
T: PartialEq<T> + Default + Copy,
pub fn is_default(&self) -> bool
[src]
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, 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>,