diff options
author | Naushir Patuck <naush@raspberrypi.com> | 2021-02-08 15:07:37 +0000 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-02-09 13:23:39 +0200 |
commit | c9e1ef7bd277e4041f2f7a3ca6519b0c2606c989 (patch) | |
tree | fdc3928d87c0f68b0c3b250923bd87fcb1427b28 /src/ipa/raspberrypi/controller/rpi/sdn.cpp | |
parent | 44ea5b65c8b76c3596b80d6e72b1f28b52006f21 (diff) |
ipa: raspberrypi: Add a DenoiseAlgorithm class to the Controller
This denoise algorithm class will be used to pass in the user requested
denoise operating mode to the controller. The existing Denoise
controller will derive from this new DenoiseAlgorithm class.
Add a denoise mode field in the denoise status metadata object for the
IPA to use when configuring the ISP.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/ipa/raspberrypi/controller/rpi/sdn.cpp')
-rw-r--r-- | src/ipa/raspberrypi/controller/rpi/sdn.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/ipa/raspberrypi/controller/rpi/sdn.cpp b/src/ipa/raspberrypi/controller/rpi/sdn.cpp index 825f421f..959bc740 100644 --- a/src/ipa/raspberrypi/controller/rpi/sdn.cpp +++ b/src/ipa/raspberrypi/controller/rpi/sdn.cpp @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: BSD-2-Clause */ /* - * Copyright (C) 2019, Raspberry Pi (Trading) Limited + * Copyright (C) 2019-2021, Raspberry Pi (Trading) Limited * * sdn.cpp - SDN (spatial denoise) control algorithm */ @@ -23,7 +23,7 @@ LOG_DEFINE_CATEGORY(RPiSdn) #define NAME "rpi.sdn" Sdn::Sdn(Controller *controller) - : Algorithm(controller) + : DenoiseAlgorithm(controller), mode_(DenoiseMode::ColourOff) { } @@ -53,6 +53,7 @@ void Sdn::Prepare(Metadata *image_metadata) status.noise_constant = noise_status.noise_constant * deviation_; status.noise_slope = noise_status.noise_slope * deviation_; status.strength = strength_; + status.mode = static_cast<std::underlying_type_t<DenoiseMode>>(mode_); image_metadata->Set("denoise.status", status); LOG(RPiSdn, Debug) << "programmed constant " << status.noise_constant @@ -60,6 +61,12 @@ void Sdn::Prepare(Metadata *image_metadata) << " strength " << status.strength; } +void Sdn::SetMode(DenoiseMode mode) +{ + // We only distinguish between off and all other modes. + mode_ = mode; +} + // Register algorithm with the system. static Algorithm *Create(Controller *controller) { |