From a9bffb72221b43e49cdb60f0f6d663d973056011 Mon Sep 17 00:00:00 2001 From: Florian Sylvestre Date: Wed, 27 Jul 2022 10:40:49 +0200 Subject: ipa: rkisp1: Add support of Gamma Sensor Linearization control The GammaSensorLinearization algorithm linearizes the sensor output to compensate the sensor non-linearities by applying piecewise linear functions to the red, green and blue channels. Signed-off-by: Florian Sylvestre Reviewed-by: Laurent Pinchart Reviewed-by: Paul Elder Signed-off-by: Laurent Pinchart --- src/ipa/rkisp1/algorithms/gsl.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/ipa/rkisp1/algorithms/gsl.h (limited to 'src/ipa/rkisp1/algorithms/gsl.h') diff --git a/src/ipa/rkisp1/algorithms/gsl.h b/src/ipa/rkisp1/algorithms/gsl.h new file mode 100644 index 00000000..db287dc2 --- /dev/null +++ b/src/ipa/rkisp1/algorithms/gsl.h @@ -0,0 +1,34 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2021-2022, Ideas On Board + * + * gsl.h - RkISP1 Gamma Sensor Linearization control + */ + +#pragma once + +#include "algorithm.h" + +namespace libcamera { + +namespace ipa::rkisp1::algorithms { + +class GammaSensorLinearization : public Algorithm +{ +public: + GammaSensorLinearization(); + ~GammaSensorLinearization() = default; + + int init(IPAContext &context, const YamlObject &tuningData) override; + void prepare(IPAContext &context, rkisp1_params_cfg *params) override; + +private: + bool initialized_; + uint32_t gammaDx_[2]; + std::vector curveYr_; + std::vector curveYg_; + std::vector curveYb_; +}; + +} /* namespace ipa::rkisp1::algorithms */ +} /* namespace libcamera */ -- cgit v1.2.1