@@ -97,7 +97,16 @@ CameraSession::CameraSession(CameraManager *cm,
std::string orientOpt = options_[OptOrientation].toString();
static const std::map<std::string, libcamera::Orientation> orientations{
{ "rot0", libcamera::Orientation::Rotate0 },
+ { "rot90", libcamera::Orientation::Rotate90 },
{ "rot180", libcamera::Orientation::Rotate180 },
+ { "rot270", libcamera::Orientation::Rotate270 },
+
+ { "rot0mirror", libcamera::Orientation::Rotate0Mirror },
+ { "rot90mirror", libcamera::Orientation::Rotate90Mirror },
+ { "rot180mirror", libcamera::Orientation::Rotate180Mirror },
+ { "rot270mirror", libcamera::Orientation::Rotate270Mirror },
+
+ /* Helpful aliases */
{ "mirror", libcamera::Orientation::Rotate0Mirror },
{ "flip", libcamera::Orientation::Rotate180Mirror },
};
@@ -146,7 +146,10 @@ int CamApp::parseOptions(int argc, char *argv[])
OptCamera);
parser.addOption(OptOrientation, OptionString,
- "Desired image orientation (rot0, rot180, mirror, flip)",
+ "Desired image orientation. Supported values:\n"
+ "- rot0, rot90, rot180, rot270,\n"
+ "- rot0mirror, rot90mirror, rot180mirror, rot270mirror,\n"
+ "- mirror (alias for rot0mirror), flip (alias for rot180mirror)",
"orientation", ArgumentRequired, "orientation", false,
OptCamera);
#ifdef HAVE_KMS
The Orientation control was implemented in commit 7e5f1e1cedf5 ("apps: cam: Add option to set stream orientation") but did not fully add all of the supported Orientation types. The upcoming dewarp support on RkISP1 will provide full rotation implementation options, including previously difficult '90' degree rotations. Extend the cam application to support setting any of the valid options. The existing 'mirror' and 'flip' options are not consistent with the rest of the option definitions, but maintain them as useful aliases to their corresponding type. Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> --- v2: - drop fixes tag --- src/apps/cam/camera_session.cpp | 9 +++++++++ src/apps/cam/main.cpp | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-)