|
| Matrix () |
| Construct a zero matrix.
|
|
| Matrix (const std::array< T, Rows *Cols > &data) |
| Construct a matrix from supplied data.
|
|
const std::string | toString () const |
| Assemble and return a string describing the matrix.
|
|
Span< const T, Rows *Cols > | data () const |
| Access the matrix data as a linear array.
|
|
Span< const T, Cols > | operator[] (size_t i) const |
| Index to a row in the matrix.
|
|
Span< T, Cols > | operator[] (size_t i) |
|
template<typename U > |
Matrix< T, Rows, Cols > & | operator*= (U d) |
| Multiply the matrix by a scalar in-place.
|
|
template<typename T, unsigned int Rows, unsigned int Cols>
class libcamera::Matrix< T, Rows, Cols >
Matrix class.
- Template Parameters
-
T | Type of numerical values to be stored in the matrix |
Rows | Number of rows in the matrix |
Cols | Number of columns in the matrix |
template<typename T , unsigned int Rows, unsigned int Cols>
libcamera::Matrix< T, Rows, Cols >::Matrix |
( |
const std::array< T, Rows *Cols > & |
data | ) |
|
|
inline |
Construct a matrix from supplied data.
- Parameters
-
[in] | data | Data from which to construct a matrix |
data is a one-dimensional vector and will be turned into a matrix in row-major order. The size of data must be equal to the product of the number of rows and columns of the matrix (Rows x Cols).
template<typename T , unsigned int Rows, unsigned int Cols>
Access the matrix data as a linear array.
Access the contents of the matrix as a one-dimensional linear array of values in row-major order. The size of the array is equal to the product of the number of rows and columns of the matrix (Rows x Cols).
- Returns
- A span referencing the matrix data as a linear array
template<typename T , unsigned int Rows, unsigned int Cols>
Index to a row in the matrix.
- Parameters
-
[in] | i | Index of row to retrieve |
This operator[] returns a Span, which can then be indexed into again with another operator[], allowing a convenient m[i][j] to access elements of the matrix. Note that the lifetime of the Span returned by this first-level operator[] is bound to that of the Matrix itself, so it is not recommended to save the Span that is the result of this operator[].
- Returns
- Row i from the matrix, as a Span
template<typename T , unsigned int Rows, unsigned int Cols>
Span< const T, Cols > libcamera::Matrix< T, Rows, Cols >::operator[] |
( |
size_t |
i | ) |
const |
|
inline |
Index to a row in the matrix.
- Parameters
-
[in] | i | Index of row to retrieve |
This operator[] returns a Span, which can then be indexed into again with another operator[], allowing a convenient m[i][j] to access elements of the matrix. Note that the lifetime of the Span returned by this first-level operator[] is bound to that of the Matrix itself, so it is not recommended to save the Span that is the result of this operator[].
- Returns
- Row i from the matrix, as a Span