Skip to main content

QGenericMatrix

Struct QGenericMatrix 

Source
pub struct QGenericMatrix<const N: usize, const M: usize> { /* private fields */ }
Expand description

The QGenericMatrix class is a template class that represents a NxM transformation matrix with N columns and M rows.

Note: CXX-Qt currently only supports QGenericMatrix of f32, while the C++ QGenericMatrix is generic over the contained type.

Qt Documentation: QGenericMatrix

Implementations§

Source§

impl<const N: usize, const M: usize> QGenericMatrix<N, M>

Source

pub const fn new(values: &[[f32; N]; M]) -> Self

Available on crate feature qt_gui only.

Constructs a matrix from floating-point values in row-major order.

Source

pub const fn data(&self) -> &[f32]

Available on crate feature qt_gui only.

Returns a reference to the raw data of this matrix.

Source

pub fn data_mut(&mut self) -> &mut [f32]

Available on crate feature qt_gui only.

Returns a mutable reference to the raw data of this matrix.

Source

pub fn copy_data_to(&self, values: &mut [f32])

Available on crate feature qt_gui only.

Retrieves the N * M items in this matrix and copies them to values in row-major order.

Source

pub fn fill(&mut self, value: f32)

Available on crate feature qt_gui only.

Fills all elements of this matrix with value.

Source

pub const fn filled(value: f32) -> Self

Available on crate feature qt_gui only.

Constructs a matrix with all values set to value.

Source

pub const fn identity() -> Self

Available on crate feature qt_gui only.

Constructs a NxM identity matrix.

Source

pub fn is_identity(&self) -> bool

Available on crate feature qt_gui only.

Returns true if this matrix is the identity; false otherwise.

Source

pub const fn rows(&self) -> [[f32; N]; M]

Available on crate feature qt_gui only.

Constructs a two-dimensional array from the matrix in row-major order.

Source

pub fn set_to_identity(&mut self)

Available on crate feature qt_gui only.

Sets this matrix to the identity.

Source

pub const fn transposed(&self) -> QGenericMatrix<M, N>

Available on crate feature qt_gui only.

Returns this matrix, transposed about its diagonal.

Trait Implementations§

Source§

impl<const N: usize, const M: usize> Add for QGenericMatrix<N, M>

Available on crate feature qt_gui only.
Source§

type Output = QGenericMatrix<N, M>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize, const M: usize> AddAssign for QGenericMatrix<N, M>

Available on crate feature qt_gui only.
Source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Source§

impl<const N: usize, const M: usize> Clone for QGenericMatrix<N, M>

Available on crate feature qt_gui only.
Source§

fn clone(&self) -> QGenericMatrix<N, M>

Returns a duplicate 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<const N: usize, const M: usize> Debug for QGenericMatrix<N, M>

Available on crate feature qt_gui only.
Source§

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

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

impl<const N: usize, const M: usize> Default for QGenericMatrix<N, M>

Available on crate feature qt_gui only.
Source§

fn default() -> Self

Constructs a NxM identity matrix.

Source§

impl<const N: usize, const M: usize> Div<f32> for QGenericMatrix<N, M>

Available on crate feature qt_gui only.
Source§

type Output = QGenericMatrix<N, M>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f32) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize, const M: usize> DivAssign<f32> for QGenericMatrix<N, M>

Available on crate feature qt_gui only.
Source§

fn div_assign(&mut self, rhs: f32)

Performs the /= operation. Read more
Source§

impl<const N: usize, const M: usize> From<&[[f32; N]; M]> for QGenericMatrix<N, M>

Available on crate feature qt_gui only.
Source§

fn from(values: &[[f32; N]; M]) -> Self

Constructs a matrix from the given N * M floating-point values in row-major order.

Source§

impl<const N: usize, const M: usize> From<&QGenericMatrix<N, M>> for [[f32; N]; M]

Available on crate feature qt_gui only.
Source§

fn from(value: &QGenericMatrix<N, M>) -> Self

Constructs a two-dimensional array from the matrix in row-major order.

Source§

impl<const N: usize, const M: usize> Index<(usize, usize)> for QGenericMatrix<N, M>

Available on crate feature qt_gui only.
Source§

fn index(&self, (row, column): (usize, usize)) -> &Self::Output

Returns a reference to the element at position (row, column) in this matrix.

Source§

type Output = f32

The returned type after indexing.
Source§

impl<const N: usize, const M: usize> IndexMut<(usize, usize)> for QGenericMatrix<N, M>

Available on crate feature qt_gui only.
Source§

fn index_mut(&mut self, (row, column): (usize, usize)) -> &mut Self::Output

Returns a mutable reference to the element at position (row, column) in this matrix.

Source§

impl<const N: usize, const M: usize> Mul<f32> for QGenericMatrix<N, M>

Available on crate feature qt_gui only.
Source§

type Output = QGenericMatrix<N, M>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f32) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize, const M: usize> MulAssign<f32> for QGenericMatrix<N, M>

Available on crate feature qt_gui only.
Source§

fn mul_assign(&mut self, rhs: f32)

Performs the *= operation. Read more
Source§

impl<const N: usize, const M: usize> Neg for QGenericMatrix<N, M>

Available on crate feature qt_gui only.
Source§

type Output = QGenericMatrix<N, M>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<const N: usize, const M: usize> PartialEq for QGenericMatrix<N, M>

Available on crate feature qt_gui only.
Source§

fn eq(&self, other: &QGenericMatrix<N, M>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.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<const N: usize, const M: usize> PartialOrd for QGenericMatrix<N, M>

Available on crate feature qt_gui only.
Source§

fn partial_cmp(&self, other: &QGenericMatrix<N, M>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<const N: usize, const M: usize> Sub for QGenericMatrix<N, M>

Available on crate feature qt_gui only.
Source§

type Output = QGenericMatrix<N, M>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize, const M: usize> SubAssign for QGenericMatrix<N, M>

Available on crate feature qt_gui only.
Source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
Source§

impl<const N: usize, const M: usize> TryFrom<&[f32]> for QGenericMatrix<N, M>

Available on crate feature qt_gui only.
Source§

fn try_from(values: &[f32]) -> Result<Self, Self::Error>

Constructs a matrix from the given N * M floating-point values. The contents of the array values is assumed to be in row-major order.

Source§

type Error = &'static str

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

impl<const N: usize, const M: usize> Copy for QGenericMatrix<N, M>

Available on crate feature qt_gui only.
Source§

impl<const N: usize, const M: usize> StructuralPartialEq for QGenericMatrix<N, M>

Available on crate feature qt_gui only.

Auto Trait Implementations§

§

impl<const N: usize, const M: usize> Freeze for QGenericMatrix<N, M>

§

impl<const N: usize, const M: usize> RefUnwindSafe for QGenericMatrix<N, M>

§

impl<const N: usize, const M: usize> Send for QGenericMatrix<N, M>

§

impl<const N: usize, const M: usize> Sync for QGenericMatrix<N, M>

§

impl<const N: usize, const M: usize> Unpin for QGenericMatrix<N, M>

§

impl<const N: usize, const M: usize> UnsafeUnpin for QGenericMatrix<N, M>

§

impl<const N: usize, const M: usize> UnwindSafe for QGenericMatrix<N, M>

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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 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> 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, 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, 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.