cam: Add color space support
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@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user