pub struct ProjectiveTransform { /* private fields */ }Expand description
A row-major 3×3 homography acting on points [x, y, 1].
Implementations§
Source§impl ProjectiveTransform
impl ProjectiveTransform
pub const IDENTITY: Self
Sourcepub fn new(matrix: [[f64; 3]; 3]) -> Option<Self>
pub fn new(matrix: [[f64; 3]; 3]) -> Option<Self>
Create a transform from finite homogeneous coefficients.
pub fn coefficients(self) -> [[f64; 3]; 3]
Sourcepub fn camera_view(
pivot: [f64; 2],
translation: [f64; 2],
scale: [f64; 2],
rotation: [f64; 3],
camera_distance: f64,
) -> Option<Self>
pub fn camera_view( pivot: [f64; 2], translation: [f64; 2], scale: [f64; 2], rotation: [f64; 3], camera_distance: f64, ) -> Option<Self>
Project a view’s planar rotation using Skia’s camera-axis convention.
Angles are in degrees and camera_distance is in the same units as
the view coordinates. The caller supplies the platform camera distance.
Sourcepub fn then(self, local: Self) -> Option<Self>
pub fn then(self, local: Self) -> Option<Self>
Compose transforms so local is applied before self.
Sourcepub fn map(self, point: [f64; 2]) -> Option<[f64; 2]>
pub fn map(self, point: [f64; 2]) -> Option<[f64; 2]>
Map a point, returning None at the horizon or for non-finite results.
Trait Implementations§
Source§impl Clone for ProjectiveTransform
impl Clone for ProjectiveTransform
impl Copy for ProjectiveTransform
Source§impl Debug for ProjectiveTransform
impl Debug for ProjectiveTransform
Source§impl PartialEq for ProjectiveTransform
impl PartialEq for ProjectiveTransform
impl StructuralPartialEq for ProjectiveTransform
Auto Trait Implementations§
impl Forget for ProjectiveTransform
impl Freeze for ProjectiveTransform
impl Move for ProjectiveTransform
impl RefUnwindSafe for ProjectiveTransform
impl Send for ProjectiveTransform
impl Sync for ProjectiveTransform
impl Unpin for ProjectiveTransform
impl UnsafeUnpin for ProjectiveTransform
impl UnwindSafe for ProjectiveTransform
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