Struct pixman::FTransform

source ·
pub struct FTransform(/* private fields */);
Expand description

Floating-point transform

Implementations§

source§

impl FTransform

source

pub fn transform_bounds(&self, b: Box16) -> Option<Box16>

Transform the provided bounds

source

pub fn identity() -> Self

Initialize an identity transform

source

pub fn invert(&self) -> Option<Self>

Invert this transform

source

pub fn multiply(&self, other: &FTransform) -> Self

Multiply this transform with the provided transform

source

pub fn transform_point(&self, vector: FVector) -> Option<FVector>

Transform the given point

source

pub fn transform_point_3d(&self, vector: FVector) -> FVector

Transform the given point

source§

impl FTransform

source

pub fn new(m: [[f64; 3]; 3]) -> Self

Initialize a transform from the provided matrix

source

pub fn from_rotation(cos: f64, sin: f64) -> Self

Initialize a transform from a rotation

source

pub fn from_scale(sx: f64, sy: f64) -> Self

Initialize a transform from a scale

source

pub fn from_translation(tx: f64, ty: f64) -> Self

Initialize a transform from a translation

source

pub fn rotate(self, c: f64, s: f64, reverse: bool) -> Option<Self>

Add a rotation to this transform

source

pub fn scale(self, sx: f64, sy: f64, reverse: bool) -> Option<Self>

Add a scale to this transform

source

pub fn translate(self, tx: f64, ty: f64, reverse: bool) -> Option<Self>

Add a translation to this transform

source

pub fn matrix(&self) -> [[f64; 3]; 3]

Access the current transform matrix

Trait Implementations§

source§

impl Clone for FTransform

source§

fn clone(&self) -> FTransform

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FTransform

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<[[f64; 3]; 3]> for FTransform

source§

fn from(value: [[f64; 3]; 3]) -> Self

Converts to this type from the input type.
source§

impl From<FTransform> for pixman_f_transform_t

source§

fn from(value: FTransform) -> Self

Converts to this type from the input type.
source§

impl From<Transform> for FTransform

source§

fn from(value: Transform) -> Self

Converts to this type from the input type.
source§

impl From<pixman_f_transform> for FTransform

source§

fn from(value: pixman_f_transform_t) -> Self

Converts to this type from the input type.
source§

impl TryFrom<FTransform> for Transform

§

type Error = TransformConvertError

The type returned in the event of a conversion error.
source§

fn try_from(value: FTransform) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Copy for FTransform

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.