HDK
|
#include <vecparam.h>
Public Member Functions | |
template<typename M , OIIO_ENABLE_IF(has_double_subscript_RC< M, T, Size, Size >::value) > | |
OIIO_HOSTDEVICE constexpr | MatrixParam (const M &m) noexcept |
const T * | data () const noexcept |
Return a pointer to the contiguous values comprising the matrix. More... | |
Static Public Attributes | |
static constexpr int | Size = S |
MatrixParam is a helper template that lets us create an interface that takes a proxy for a T[S][S]
analogue for use as a public API function parameter type to pass a square matrix, in order to not expose the underlying matrix types. The common cases are given handy aliases: M33fParam and M33fParam for 3x3 and 4x4 float matrices, respectively (MatrixParam<float,3>
and MatrixParam<float,4>
are the long names).
For example, suppose we have a public function like this:
void foo(M33fParam v);
Then any of the following calls will work:
float array[3][3]; foo(array); foo(Imath::M33f(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1));
Definition at line 320 of file vecparam.h.
|
inlinenoexcept |
We can construct a MatrixParam out of anything that has the size of a T[S][S]
and presents a [][]
subscript operator.
Definition at line 328 of file vecparam.h.
|
inlinenoexcept |
Return a pointer to the contiguous values comprising the matrix.
Definition at line 376 of file vecparam.h.
|
static |
Definition at line 322 of file vecparam.h.