[libcamera-devel] [PATCH 6/6] cam: Add color space support
Umang Jain
umang.jain at ideasonboard.com
Wed Aug 24 01:26:57 CEST 2022
Hi Laurent
Thank you for the patch.
On 8/23/22 11:13 PM, Laurent Pinchart via libcamera-devel wrote:
> Add support for color space to the StreamKeyValueParser, allowing
> selection of a color space on the command line.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain at ideasonboard.com>
> ---
> src/cam/stream_options.cpp | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/src/cam/stream_options.cpp b/src/cam/stream_options.cpp
> index a68135a9ed88..3a5625f5f267 100644
> --- a/src/cam/stream_options.cpp
> +++ b/src/cam/stream_options.cpp
> @@ -8,6 +8,8 @@
>
> #include <iostream>
>
> +#include <libcamera/color_space.h>
> +
> using namespace libcamera;
>
> StreamKeyValueParser::StreamKeyValueParser()
> @@ -21,6 +23,8 @@ StreamKeyValueParser::StreamKeyValueParser()
> ArgumentRequired);
> addOption("pixelformat", OptionString, "Pixel format name",
> ArgumentRequired);
> + addOption("colorspace", OptionString, "Color space",
> + ArgumentRequired);
> }
>
> KeyValueParser::Options StreamKeyValueParser::parse(const char *arguments)
> @@ -96,6 +100,9 @@ int StreamKeyValueParser::updateConfiguration(CameraConfiguration *config,
>
> if (opts.isSet("pixelformat"))
> cfg.pixelFormat = PixelFormat::fromString(opts["pixelformat"].toString());
> +
> + if (opts.isSet("colorspace"))
> + cfg.colorSpace = ColorSpace::fromString(opts["colorspace"].toString());
> }
>
> return 0;
More information about the libcamera-devel
mailing list