[2/2] libcamera: software_isp: debayer_egl: Use Matrix::transpose()
diff mbox series

Message ID 20260913153105.2478177-3-laurent.pinchart@ideasonboard.com
State New
Headers show
Series
  • libcamera: Add and use Matrix::transpose()
Related show

Commit Message

Laurent Pinchart Sept. 13, 2026, 3:31 p.m. UTC
Replace the manual matrix transposition code with a call to
Matrix::transpose().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/libcamera/software_isp/debayer_egl.cpp | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

Patch
diff mbox series

diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp
index 3536b5c51ffa..4477c928342f 100644
--- a/src/libcamera/software_isp/debayer_egl.cpp
+++ b/src/libcamera/software_isp/debayer_egl.cpp
@@ -460,21 +460,10 @@  void DebayerEGL::setShaderVariableValues(eGLImage &eglImageIn, const DebayerPara
 			    << " textureUniformStep_.y " << Step[1]
 			    << " textureUniformStrideFactor_ " << Stride
 			    << " textureUniformProjMatrix_ " << textureUniformProjMatrix_;
-	/*
-	 * Pre-transpose matrix for GLES 2.0
-	 */
-	GLfloat ccm[9] = {
-		params.combinedMatrix[0][0],
-		params.combinedMatrix[1][0],
-		params.combinedMatrix[2][0],
-		params.combinedMatrix[0][1],
-		params.combinedMatrix[1][1],
-		params.combinedMatrix[2][1],
-		params.combinedMatrix[0][2],
-		params.combinedMatrix[1][2],
-		params.combinedMatrix[2][2],
-	};
-	glUniformMatrix3fv(ccmUniformDataIn_, 1, GL_FALSE, ccm);
+
+	/* Pre-transpose matrix for GLES 2.0. */
+	Matrix<float, 3, 3> ccm = params.combinedMatrix.transpose();
+	glUniformMatrix3fv(ccmUniformDataIn_, 1, GL_FALSE, ccm.data().data());
 	LOG(Debayer, Debug) << " ccmUniformDataIn_ " << ccmUniformDataIn_ << " data " << params.combinedMatrix;
 
 	/*