graphene

Struct Matrix

source
pub struct Matrix { /* private fields */ }
Expand description

GLib type: Inline allocated boxed type with stack copy semantics.

Implementations§

source§

impl Matrix

source

pub fn as_ptr(&self) -> *mut graphene_matrix_t

source

pub unsafe fn from_glib_ptr_borrow<'a>( ptr: *const graphene_matrix_t, ) -> &'a Self

Borrows the underlying C value.

source

pub unsafe fn from_glib_ptr_borrow_mut<'a>( ptr: *mut graphene_matrix_t, ) -> &'a mut Self

Borrows the underlying C value mutably.

source§

impl Matrix

source

pub fn decompose(&self) -> Option<(Vec3, Vec3, Quaternion, Vec3, Vec4)>

source

pub fn determinant(&self) -> f32

source

pub fn equal_fast(&self, b: &Matrix) -> bool

source

pub fn row(&self, index_: u32) -> Vec4

source

pub fn value(&self, row: u32, col: u32) -> f32

source

pub fn x_scale(&self) -> f32

source

pub fn x_translation(&self) -> f32

source

pub fn y_scale(&self) -> f32

source

pub fn y_translation(&self) -> f32

source

pub fn z_scale(&self) -> f32

source

pub fn z_translation(&self) -> f32

source

pub fn interpolate(&self, b: &Matrix, factor: f64) -> Matrix

source

pub fn inverse(&self) -> Option<Matrix>

source

pub fn is_2d(&self) -> bool

source

pub fn is_backface_visible(&self) -> bool

source

pub fn is_identity(&self) -> bool

source

pub fn is_singular(&self) -> bool

source

pub fn multiply(&self, b: &Matrix) -> Matrix

source

pub fn near(&self, b: &Matrix, epsilon: f32) -> bool

source

pub fn normalize(&self) -> Matrix

source

pub fn perspective(&self, depth: f32) -> Matrix

source

pub fn print(&self)

source

pub fn project_point(&self, p: &Point) -> Point

source

pub fn project_rect(&self, r: &Rect) -> Quad

source

pub fn project_rect_bounds(&self, r: &Rect) -> Rect

source

pub fn rotate(&mut self, angle: f32, axis: &Vec3)

source

pub fn rotate_euler(&mut self, e: &Euler)

source

pub fn rotate_quaternion(&mut self, q: &Quaternion)

source

pub fn rotate_x(&mut self, angle: f32)

source

pub fn rotate_y(&mut self, angle: f32)

source

pub fn rotate_z(&mut self, angle: f32)

source

pub fn scale(&mut self, factor_x: f32, factor_y: f32, factor_z: f32)

source

pub fn skew_xy(&mut self, factor: f32)

source

pub fn skew_xz(&mut self, factor: f32)

source

pub fn skew_yz(&mut self, factor: f32)

source

pub fn to_2d(&self) -> Option<(f64, f64, f64, f64, f64, f64)>

source

pub fn transform_bounds(&self, r: &Rect) -> Rect

source

pub fn transform_box(&self, b: &Box) -> Box

source

pub fn transform_point(&self, p: &Point) -> Point

source

pub fn transform_point3d(&self, p: &Point3D) -> Point3D

source

pub fn transform_ray(&self, r: &Ray) -> Ray

source

pub fn transform_rect(&self, r: &Rect) -> Quad

source

pub fn transform_sphere(&self, s: &Sphere) -> Sphere

source

pub fn transform_vec3(&self, v: &Vec3) -> Vec3

source

pub fn transform_vec4(&self, v: &Vec4) -> Vec4

source

pub fn translate(&mut self, pos: &Point3D)

source

pub fn transpose(&self) -> Matrix

source

pub fn unproject_point3d(&self, modelview: &Matrix, point: &Point3D) -> Point3D

source

pub fn untransform_bounds(&self, r: &Rect, bounds: &Rect) -> Rect

source

pub fn untransform_point(&self, p: &Point, bounds: &Rect) -> Option<Point>

source§

impl Matrix

source

pub fn from_2d(xx: f64, yx: f64, xy: f64, yy: f64, x_0: f64, y_0: f64) -> Self

source

pub fn from_float(v: [f32; 16]) -> Self

source

pub fn from_vec4(v0: &Vec4, v1: &Vec4, v2: &Vec4, v3: &Vec4) -> Self

source

pub fn new_frustum( left: f32, right: f32, bottom: f32, top: f32, z_near: f32, z_far: f32, ) -> Self

source

pub fn new_identity() -> Self

source

pub fn new_look_at(eye: &Vec3, center: &Vec3, up: &Vec3) -> Self

source

pub fn new_ortho( left: f32, right: f32, top: f32, bottom: f32, z_near: f32, z_far: f32, ) -> Self

source

pub fn new_perspective(fovy: f32, aspect: f32, z_near: f32, z_far: f32) -> Self

source

pub fn new_rotate(angle: f32, axis: &Vec3) -> Self

source

pub fn new_scale(x: f32, y: f32, z: f32) -> Self

source

pub fn new_skew(x_skew: f32, y_skew: f32) -> Self

source

pub fn new_translate(p: &Point3D) -> Self

source

pub fn to_float(&self) -> [f32; 16]

source

pub fn values(&self) -> &[[f32; 4]; 4]

Trait Implementations§

source§

impl Clone for Matrix

source§

fn clone(&self) -> Self

Copies the inline boxed type by value with the type-specific copy function.

1.6.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Matrix

source§

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

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

impl Default for Matrix

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl HasParamSpec for Matrix

source§

type ParamSpec = ParamSpecBoxed

source§

type SetValue = Matrix

Preferred value to be used as setter for the associated ParamSpec.
source§

type BuilderFn = fn(_: &str) -> ParamSpecBoxedBuilder<'_, Matrix>

source§

fn param_spec_builder() -> Self::BuilderFn

source§

impl PartialEq for Matrix

source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.6.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StaticType for Matrix

source§

fn static_type() -> Type

Returns the type identifier of Self.
source§

impl Copy for Matrix

source§

impl Eq for Matrix

Auto Trait Implementations§

§

impl Freeze for Matrix

§

impl RefUnwindSafe for Matrix

§

impl Send for Matrix

§

impl Sync for Matrix

§

impl Unpin for Matrix

§

impl UnwindSafe for Matrix

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

source§

impl<T, U> Into<U> for T
where 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> IntoClosureReturnValue for T
where T: Into<Value>,

source§

impl<T> Property for T
where T: HasParamSpec,

source§

type Value = T

source§

impl<T> PropertyGet for T
where T: HasParamSpec,

source§

type Value = T

source§

fn get<R, F>(&self, f: F) -> R
where F: Fn(&<T as PropertyGet>::Value) -> R,

source§

impl<T> StaticTypeExt for T
where T: StaticType,

source§

fn ensure_type()

Ensures that the type has been registered with the type system.
source§

impl<T> ToOwned for T
where T: Clone,

source§

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> ToSendValue for T
where T: Send + ToValue + ?Sized,

source§

fn to_send_value(&self) -> SendValue

Returns a SendValue clone of self.
source§

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

source§

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> TryFromClosureReturnValue for T
where T: for<'a> FromValue<'a> + StaticType + 'static,

source§

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

source§

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.
source§

impl<'a, T, C, E> FromValueOptional<'a> for T
where T: FromValue<'a, Checker = C>, C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError<E>>, E: Error + Send + 'static,