summaryrefslogtreecommitdiff
path: root/src/ipa/raspberrypi/controller/rpi/sdn.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipa/raspberrypi/controller/rpi/sdn.cpp')
-rw-r--r--src/ipa/raspberrypi/controller/rpi/sdn.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/ipa/raspberrypi/controller/rpi/sdn.cpp b/src/ipa/raspberrypi/controller/rpi/sdn.cpp
index aa82830b..0fad2550 100644
--- a/src/ipa/raspberrypi/controller/rpi/sdn.cpp
+++ b/src/ipa/raspberrypi/controller/rpi/sdn.cpp
@@ -5,12 +5,17 @@
* sdn.cpp - SDN (spatial denoise) control algorithm
*/
+#include "libcamera/internal/log.h"
+
#include "../noise_status.h"
#include "../sdn_status.h"
#include "sdn.hpp"
using namespace RPiController;
+using namespace libcamera;
+
+LOG_DEFINE_CATEGORY(RPiSdn)
// Calculate settings for the spatial denoise block using the noise profile in
// the image metadata.
@@ -40,19 +45,19 @@ void Sdn::Prepare(Metadata *image_metadata)
struct NoiseStatus noise_status = {};
noise_status.noise_slope = 3.0; // in case no metadata
if (image_metadata->Get("noise.status", noise_status) != 0)
- RPI_WARN("Sdn: no noise profile found");
- RPI_LOG("Noise profile: constant " << noise_status.noise_constant
- << " slope "
- << noise_status.noise_slope);
+ LOG(RPiSdn, Warning) << "no noise profile found";
+ LOG(RPiSdn, Debug)
+ << "Noise profile: constant " << noise_status.noise_constant
+ << " slope " << noise_status.noise_slope;
struct SdnStatus status;
status.noise_constant = noise_status.noise_constant * deviation_;
status.noise_slope = noise_status.noise_slope * deviation_;
status.strength = strength_;
image_metadata->Set("sdn.status", status);
- RPI_LOG("Sdn: programmed constant " << status.noise_constant
- << " slope " << status.noise_slope
- << " strength "
- << status.strength);
+ LOG(RPiSdn, Debug)
+ << "programmed constant " << status.noise_constant
+ << " slope " << status.noise_slope
+ << " strength " << status.strength;
}
// Register algorithm with the system.