diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2025-04-03 17:49:12 +0200 |
---|---|---|
committer | Stefan Klug <stefan.klug@ideasonboard.com> | 2025-05-20 09:49:09 +0200 |
commit | 754798b664888e55402bc5c5708e56fa461c0ba1 (patch) | |
tree | 01a6c3df478b39f35536ecc8788cb8324ee39917 /src | |
parent | dacbcc7d7779e5faec243b51b1581d401954ddea (diff) |
libcamera: matrix: Extend multiplication operator to heterogenous types
It is useful to multiply matrices of heterogneous types, for instance
float and double. Extend the multiplication operator to support this,
avoiding the need to convert one of the matrices. The type of the
returned matrix is selected automatically to avoid loosing precision.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/libcamera/matrix.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libcamera/matrix.cpp b/src/libcamera/matrix.cpp index 68fc1b7b..ed22263b 100644 --- a/src/libcamera/matrix.cpp +++ b/src/libcamera/matrix.cpp @@ -138,11 +138,12 @@ LOG_DEFINE_CATEGORY(Matrix) */ /** - * \fn Matrix<T, R1, C2> operator*(const Matrix<T, R1, C1> &m1, const Matrix<T, R2, C2> &m2) + * \fn operator*(const Matrix<T1, R1, C1> &m1, const Matrix<T2, R2, C2> &m2) * \brief Matrix multiplication - * \tparam T Type of numerical values in the matrices + * \tparam T1 Type of numerical values in the first matrix * \tparam R1 Number of rows in the first matrix * \tparam C1 Number of columns in the first matrix + * \tparam T2 Type of numerical values in the secont matrix * \tparam R2 Number of rows in the second matrix * \tparam C2 Number of columns in the second matrix * \param m1 Multiplicand matrix |