Struct gegl::Matrix3

source ·
#[repr(transparent)]
pub struct Matrix3 { /* private fields */ }
Expand description

GLib type: Boxed type with copy-on-clone semantics.

Implementations§

source§

impl Matrix3

source

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

Return the inner pointer to the underlying C value.

source

pub unsafe fn from_glib_ptr_borrow(ptr: &*mut GeglMatrix3) -> &Self

Borrows the underlying C value.

source

pub unsafe fn from_glib_ptr_borrow_mut(ptr: &mut *mut GeglMatrix3) -> &mut Self

Borrows the underlying C value mutably.

source§

impl Matrix3

source

pub fn new() -> Matrix3

Returns

A newly allocated Matrix3

source

pub fn copy_into(&mut self, src: &Matrix3)

Copies the matrix in src into self.

src

a Matrix3

source

pub fn determinant(&self) -> f64

Returns the determinant for the matrix.

source

pub fn identity(&mut self)

Set the provided self to the identity matrix.

source

pub fn invert(&mut self)

Inverts self.

source

pub fn is_affine(&self) -> bool

Check if a matrix only does an affine transformation.

Returns TRUE if the matrix only does an affine transformation.

source

pub fn is_identity(&self) -> bool

Check if a matrix is the identity matrix.

Returns TRUE if the matrix is the identity matrix.

source

pub fn is_scale(&self) -> bool

Check if a matrix only does scaling.

Returns TRUE if the matrix only does scaling.

source

pub fn is_translate(&self) -> bool

Check if a matrix only does translation.

Returns TRUE if the matrix only does trasnlation.

source

pub fn multiply(&self, right: &Matrix3, product: &mut Matrix3)

Multiples product = self · right

a Matrix3

product

a Matrix3 to store the result in.

source

pub fn originate(&mut self, x: f64, y: f64)

Shift the origin of the transformation specified by self to (x, y). In other words, calculate the matrix that:

  1. Translates the input by (-x, -y).

  2. Transforms the result using the original self.

  3. Translates the result by (x, y).

x

x coordinate of new origin

y

y coordinate of new origin.

source

pub fn parse_string(&mut self, string: &str)

Parse a transofmation matrix from a string.

string

a string describing the matrix (right now a small subset of the transform strings allowed by SVG)

source

pub fn round_error(&mut self)

Rounds numerical errors in self to the nearest integer.

Trait Implementations§

source§

impl Clone for Matrix3

source§

fn clone(&self) -> Self

Copies the boxed type with the type-specific copy function.

1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Matrix3

source§

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

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

impl Default for Matrix3

source§

fn default() -> Self

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

impl From<Matrix3> for Value

source§

fn from(o: Matrix3) -> Self

Converts to this type from the input type.
source§

impl HasParamSpec for Matrix3

§

type ParamSpec = ParamSpecBoxed

§

type SetValue = Matrix3

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

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

source§

fn param_spec_builder() -> Self::BuilderFn

source§

impl StaticType for Matrix3

source§

fn static_type() -> Type

Returns the type identifier of Self.

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.

§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

§

unsafe fn from_glib_none_num_as_vec( ptr: *const GList, num: usize ) -> Vec<T, Global>

§

unsafe fn from_glib_container_num_as_vec( _: *const GList, _: usize ) -> Vec<T, Global>

§

unsafe fn from_glib_full_num_as_vec(_: *const GList, _: usize) -> Vec<T, Global>

§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

§

unsafe fn from_glib_none_num_as_vec( ptr: *const GPtrArray, num: usize ) -> Vec<T, Global>

§

unsafe fn from_glib_container_num_as_vec( _: *const GPtrArray, _: usize ) -> Vec<T, Global>

§

unsafe fn from_glib_full_num_as_vec( _: *const GPtrArray, _: usize ) -> Vec<T, Global>

§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

§

unsafe fn from_glib_none_num_as_vec( ptr: *const GSList, num: usize ) -> Vec<T, Global>

§

unsafe fn from_glib_container_num_as_vec( _: *const GSList, _: usize ) -> Vec<T, Global>

§

unsafe fn from_glib_full_num_as_vec( _: *const GSList, _: usize ) -> Vec<T, Global>

§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

§

unsafe fn from_glib_none_num_as_vec( ptr: *mut GList, num: usize ) -> Vec<T, Global>

§

unsafe fn from_glib_container_num_as_vec( ptr: *mut GList, num: usize ) -> Vec<T, Global>

§

unsafe fn from_glib_full_num_as_vec( ptr: *mut GList, num: usize ) -> Vec<T, Global>

§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

§

unsafe fn from_glib_none_num_as_vec( ptr: *mut GPtrArray, num: usize ) -> Vec<T, Global>

§

unsafe fn from_glib_container_num_as_vec( ptr: *mut GPtrArray, num: usize ) -> Vec<T, Global>

§

unsafe fn from_glib_full_num_as_vec( ptr: *mut GPtrArray, num: usize ) -> Vec<T, Global>

§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

§

unsafe fn from_glib_none_num_as_vec( ptr: *mut GSList, num: usize ) -> Vec<T, Global>

§

unsafe fn from_glib_container_num_as_vec( ptr: *mut GSList, num: usize ) -> Vec<T, Global>

§

unsafe fn from_glib_full_num_as_vec( ptr: *mut GSList, num: usize ) -> Vec<T, Global>

§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

§

unsafe fn from_glib_none_as_vec(ptr: *const GList) -> Vec<T, Global>

§

unsafe fn from_glib_container_as_vec(_: *const GList) -> Vec<T, Global>

§

unsafe fn from_glib_full_as_vec(_: *const GList) -> Vec<T, Global>

§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

§

unsafe fn from_glib_none_as_vec(ptr: *const GPtrArray) -> Vec<T, Global>

§

unsafe fn from_glib_container_as_vec(_: *const GPtrArray) -> Vec<T, Global>

§

unsafe fn from_glib_full_as_vec(_: *const GPtrArray) -> Vec<T, Global>

§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

§

unsafe fn from_glib_none_as_vec(ptr: *const GSList) -> Vec<T, Global>

§

unsafe fn from_glib_container_as_vec(_: *const GSList) -> Vec<T, Global>

§

unsafe fn from_glib_full_as_vec(_: *const GSList) -> Vec<T, Global>

§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

§

unsafe fn from_glib_none_as_vec(ptr: *mut GList) -> Vec<T, Global>

§

unsafe fn from_glib_container_as_vec(ptr: *mut GList) -> Vec<T, Global>

§

unsafe fn from_glib_full_as_vec(ptr: *mut GList) -> Vec<T, Global>

§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

§

unsafe fn from_glib_none_as_vec(ptr: *mut GPtrArray) -> Vec<T, Global>

§

unsafe fn from_glib_container_as_vec(ptr: *mut GPtrArray) -> Vec<T, Global>

§

unsafe fn from_glib_full_as_vec(ptr: *mut GPtrArray) -> Vec<T, Global>

§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

§

unsafe fn from_glib_none_as_vec(ptr: *mut GSList) -> Vec<T, Global>

§

unsafe fn from_glib_container_as_vec(ptr: *mut GSList) -> Vec<T, Global>

§

unsafe fn from_glib_full_as_vec(ptr: *mut GSList) -> Vec<T, Global>

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.

§

impl<T> IntoClosureReturnValue for Twhere T: Into<Value>,

§

impl<T> Property for Twhere T: HasParamSpec,

§

type Value = T

§

impl<T> PropertyGet for Twhere T: HasParamSpec,

§

type Value = T

§

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

§

impl<T> StaticTypeExt for Twhere T: StaticType,

§

fn ensure_type()

Ensures that the type has been registered with the type system.
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
§

impl<T> TransparentType for Twhere T: TransparentPtrType,

§

type GlibType = <T as GlibPtrDefault>::GlibType

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

impl<T> TryFromClosureReturnValue for Twhere T: for<'a> FromValue<'a> + StaticType + 'static,

§

fn try_from_closure_return_value(v: Option<Value>) -> Result<T, BoolError>

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

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