[][src]Struct polyhorn_android::styles::Transform

pub struct Transform<T> where
    T: Float
{ pub matrix: Transform3D<T>, pub relative_translation: (T, T), }

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]

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]

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]

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]

impl<T> Copy for Transform<T> where
    T: Copy + Float
[src]

impl<T> Debug for Transform<T> where
    T: Debug + Float
[src]

impl<T> Default for Transform<T> where
    T: Float
[src]

impl<T> PartialEq<Transform<T>> for Transform<T> where
    T: PartialEq<T> + Float
[src]

impl<T> StructuralPartialEq for Transform<T> where
    T: Float
[src]

impl<T> ToTokens for Transform<T> where
    T: ToTokens + Float
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Transform<T> where
    T: RefUnwindSafe

impl<T> Send for Transform<T> where
    T: Send

impl<T> Sync for Transform<T> where
    T: Sync

impl<T> Unpin for Transform<T> where
    T: Unpin

impl<T> UnwindSafe for Transform<T> where
    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]

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

impl<T> AsAny for T where
    T: Any
[src]

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

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

impl<T, U> ConvertInto<U> for T where
    U: ConvertFrom<T>, 
[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]

impl<T> IsDefault for T where
    T: PartialEq<T> + Default + Copy
[src]

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

type Owned = T

The resulting type after obtaining ownership.

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.