cam: Add Rectangle type parsing in capture script

This change is required for AfWindows control from capture script.
Parser expects array of arrays of parameters, so it is possible to
specify multiple rectangles.

Signed-off-by: Daniel Semkowicz <dse@thaumatec.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
Daniel Semkowicz 2022-06-27 14:28:05 +02:00 committed by Jacopo Mondi
parent 251f0534b7
commit f71c76ceff
2 changed files with 140 additions and 14 deletions

View file

@ -54,9 +54,12 @@ private:
int parseControl(EventPtr event, libcamera::ControlList &controls);
std::string parseScalar();
libcamera::ControlValue parseRectangles();
std::vector<std::vector<std::string>> parseArrays();
std::vector<std::string> parseSingleArray();
void unpackFailure(const libcamera::ControlId *id,
const std::string &repr);
libcamera::ControlValue unpackControl(const libcamera::ControlId *id,
const std::string &repr);
libcamera::ControlValue unpackControl(const libcamera::ControlId *id);
libcamera::Rectangle unpackRectangle(const std::vector<std::string> &strVec);
};