pub struct DecomposedTransform {
translate_x: f32,
translate_y: f32,
rotation: f32,
scale_x: f32,
scale_y: f32,
skew_x: f32,
skew_y: f32,
center_x: f32,
center_y: f32,
}Expand description
Fields§
§translate_x: f32§translate_y: f32§rotation: f32§scale_x: f32§scale_y: f32§skew_x: f32§skew_y: f32§center_x: f32§center_y: f32Implementations§
Source§impl DecomposedTransform
impl DecomposedTransform
pub fn translate_x(&self) -> f32
pub fn translate_y(&self) -> f32
pub fn rotation(&self) -> f32
pub fn scale_x(&self) -> f32
pub fn scale_y(&self) -> f32
pub fn skew_x(&self) -> f32
pub fn skew_y(&self) -> f32
pub fn center_x(&self) -> f32
pub fn center_y(&self) -> f32
pub fn set_translate_x(&mut self, value: f32)
pub fn set_translate_y(&mut self, value: f32)
pub fn set_rotation(&mut self, value: f32)
pub fn set_scale_x(&mut self, value: f32)
pub fn set_scale_y(&mut self, value: f32)
pub fn set_skew_x(&mut self, value: f32)
pub fn set_skew_y(&mut self, value: f32)
pub fn set_center_x(&mut self, value: f32)
pub fn set_center_y(&mut self, value: f32)
Sourcepub fn matrix(&self) -> Matrix<f32>
pub fn matrix(&self) -> Matrix<f32>
Convert decomposed form to 2x3 matrix form.
The first two values are x,y x-basis vector, the second 2 values are x,y y-basis vector, and the third 2 are translation.
In augmented matrix
form, if this method returns [a, b, c, d, e, f] that is taken as:
| a c e |
| b d f |
| 0 0 1 |References: FontTools Python implementation https://github.com/fonttools/fonttools/blob/5e6b12d12fa08abafbeb7570f47707fbedf69a45/Lib/fontTools/misc/transform.py#L484-L500
- Wikipedia affine transformation
Trait Implementations§
Source§impl Clone for DecomposedTransform
impl Clone for DecomposedTransform
Source§fn clone(&self) -> DecomposedTransform
fn clone(&self) -> DecomposedTransform
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for DecomposedTransform
impl Default for DecomposedTransform
impl Copy for DecomposedTransform
Auto Trait Implementations§
impl Freeze for DecomposedTransform
impl RefUnwindSafe for DecomposedTransform
impl Send for DecomposedTransform
impl Sync for DecomposedTransform
impl Unpin for DecomposedTransform
impl UnsafeUnpin for DecomposedTransform
impl UnwindSafe for DecomposedTransform
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more