From 9d79a6b6c64e0b6281391c3277af68210d434460 Mon Sep 17 00:00:00 2001 From: Daniel Semkowicz via libcamera-devel Date: Wed, 13 Jul 2022 10:43:09 +0200 Subject: ipa: rkisp1: Add AF algorithm basing on common AfHillClimbing class Rockchip ISP AF block allows calculation of sharpness and luminance in up to three user defined windows. If no windows are set, there are some default settings applied for the first window and exposed through the driver. For each frame, use the sharpness value calculated for this default window and feed the hill climbing algorithm with them. Then set the lens position to value calculated by the algorithm. Signed-off-by: Daniel Semkowicz --- src/ipa/rkisp1/algorithms/af.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/ipa/rkisp1/algorithms/af.h (limited to 'src/ipa/rkisp1/algorithms/af.h') diff --git a/src/ipa/rkisp1/algorithms/af.h b/src/ipa/rkisp1/algorithms/af.h new file mode 100644 index 00000000..e9afbb98 --- /dev/null +++ b/src/ipa/rkisp1/algorithms/af.h @@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2022, Theobroma Systems + * + * af.h - RkISP1 AF hill climbing based control algorithm + */ + +#pragma once + +#include + +#include "libipa/algorithms/af_hill_climbing.h" +#include "module.h" + +namespace libcamera::ipa::rkisp1::algorithms { + +class Af : public ipa::common::algorithms::AfHillClimbing +{ +public: + Af() = default; + ~Af() = default; + + int configure(IPAContext &context, const IPACameraSensorInfo &configInfo) override; + void prepare(IPAContext &context, rkisp1_params_cfg *params) override; + void process(IPAContext &context, IPAFrameContext *frameCtx, + const rkisp1_stat_buffer *stats) override; + + void setMetering(controls::AfMeteringEnum metering) override; + void setWindows(Span windows) override; +}; + +} /* namespace libcamera::ipa::rkisp1::algorithms */ -- cgit v1.2.1