From 754798b664888e55402bc5c5708e56fa461c0ba1 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Thu, 3 Apr 2025 17:49:12 +0200 Subject: 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 Signed-off-by: Stefan Klug Acked-by: Kieran Bingham Reviewed-by: Paul Elder --- src/libcamera/matrix.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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 operator*(const Matrix &m1, const Matrix &m2) + * \fn operator*(const Matrix &m1, const Matrix &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 -- cgit v1.2.1