pub type LayoutFastTransform = FastTransform<LayoutPixel, LayoutPixel>;
Aliased Type§
enum LayoutFastTransform {
Offset(Vector2D<f32, LayoutPixel>),
Transform {
transform: Transform3D<f32, LayoutPixel, LayoutPixel>,
inverse: Option<Transform3D<f32, LayoutPixel, LayoutPixel>>,
is_2d: bool,
},
}
Variants§
Offset(Vector2D<f32, LayoutPixel>)
A simple offset, which can be used without doing any matrix math.
Transform
A 2D transformation with an inverse.
Fields
§
transform: Transform3D<f32, LayoutPixel, LayoutPixel>
§
inverse: Option<Transform3D<f32, LayoutPixel, LayoutPixel>>
Implementations
Source§impl<Src, Dst> FastTransform<Src, Dst>
impl<Src, Dst> FastTransform<Src, Dst>
pub fn identity() -> Self
pub fn with_vector(offset: Vector2D<f32, Src>) -> Self
pub fn with_scale_offset(scale_offset: ScaleOffset) -> Self
pub fn with_transform(transform: Transform3D<f32, Src, Dst>) -> Self
pub fn to_transform(&self) -> Cow<'_, Transform3D<f32, Src, Dst>>
Sourcepub fn is_identity(&self) -> bool
pub fn is_identity(&self) -> bool
Return true if this is an identity transform
pub fn then<NewDst>( &self, other: &FastTransform<Dst, NewDst>, ) -> FastTransform<Src, NewDst>
pub fn pre_transform<NewSrc>( &self, other: &FastTransform<NewSrc, Src>, ) -> FastTransform<NewSrc, Dst>
pub fn pre_translate(&self, other_offset: Vector2D<f32, Src>) -> Self
pub fn then_translate(&self, other_offset: Vector2D<f32, Dst>) -> Self
pub fn is_backface_visible(&self) -> bool
pub fn transform_point2d( &self, point: Point2D<f32, Src>, ) -> Option<Point2D<f32, Dst>>
pub fn project_point2d( &self, point: Point2D<f32, Src>, ) -> Option<Point2D<f32, Dst>>
pub fn inverse(&self) -> Option<FastTransform<Dst, Src>>
Trait Implementations
Source§impl<Src, Dst> Clone for FastTransform<Src, Dst>
impl<Src, Dst> Clone for FastTransform<Src, Dst>
Source§impl<Src, Dst> From<Transform3D<f32, Src, Dst>> for FastTransform<Src, Dst>
impl<Src, Dst> From<Transform3D<f32, Src, Dst>> for FastTransform<Src, Dst>
Source§fn from(transform: Transform3D<f32, Src, Dst>) -> Self
fn from(transform: Transform3D<f32, Src, Dst>) -> Self
Converts to this type from the input type.
Source§impl<Src, Dst> MallocSizeOf for FastTransform<Src, Dst>where
Src: MallocSizeOf,
Dst: MallocSizeOf,
impl<Src, Dst> MallocSizeOf for FastTransform<Src, Dst>where
Src: MallocSizeOf,
Dst: MallocSizeOf,
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.