ipa: rkisp1: awb: Add support for RGB means

RkISP actually supports two modes for color means, RGB and YCbCr. The
variables where the means are stored are identically named regardless of
the color means mode that's been selected.

Since the gains are computed in RGB mode, a conversion needs to be done
when the mode is YCbCr, which is unnecessary when RGB mode is selected.

This adds support for RGB means mode too, by checking at runtime which
mode is selected at a given time. The default is still set to YCbCr mode
for now.

Cc: Quentin Schulz <foss+libcamera@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
Quentin Schulz 2022-05-12 10:42:43 +02:00 committed by Laurent Pinchart
parent ef38cbe9de
commit df7b9826d7
2 changed files with 86 additions and 48 deletions

View file

@ -16,7 +16,7 @@ namespace ipa::rkisp1::algorithms {
class Awb : public Algorithm
{
public:
Awb() = default;
Awb();
~Awb() = default;
int configure(IPAContext &context, const IPACameraSensorInfo &configInfo) override;
@ -32,6 +32,8 @@ public:
private:
uint32_t estimateCCT(double red, double green, double blue);
bool rgbMode_;
};
} /* namespace ipa::rkisp1::algorithms */