libcamera: Add transpose() function to size

Add a transpose() function to size that applies the
Transformation::Transpose operation in the size. This is useful when
handling orientation adjustments.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Stefan Klug
2025-11-25 17:28:34 +01:00
parent 9df164fa42
commit a111bb6903
3 changed files with 21 additions and 0 deletions

View File

@@ -203,6 +203,11 @@ protected:
return TestFail;
}
if (Size(200, 50).transpose() != Size(50, 200)) {
cout << "Size::transpose() test failed" << endl;
return TestFail;
}
/* Aspect ratio tests */
if (Size(0, 0).boundedToAspectRatio(Size(4, 3)) != Size(0, 0) ||
Size(1920, 1440).boundedToAspectRatio(Size(16, 9)) != Size(1920, 1080) ||