summaryrefslogtreecommitdiff
path: root/src/ipa/raspberrypi/controller/rpi/focus.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipa/raspberrypi/controller/rpi/focus.cpp')
-rw-r--r--src/ipa/raspberrypi/controller/rpi/focus.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/ipa/raspberrypi/controller/rpi/focus.cpp b/src/ipa/raspberrypi/controller/rpi/focus.cpp
index 1e2b6491..ffe44362 100644
--- a/src/ipa/raspberrypi/controller/rpi/focus.cpp
+++ b/src/ipa/raspberrypi/controller/rpi/focus.cpp
@@ -6,11 +6,15 @@
*/
#include <stdint.h>
+#include "libcamera/internal/log.h"
+
#include "../focus_status.h"
-#include "../logging.hpp"
#include "focus.hpp"
using namespace RPi;
+using namespace libcamera;
+
+LOG_DEFINE_CATEGORY(RPiFocus)
#define NAME "rpi.focus"
@@ -24,11 +28,6 @@ char const *Focus::Name() const
return NAME;
}
-void Focus::Read(boost::property_tree::ptree const &params)
-{
- print_ = params.get<int>("print", 0);
-}
-
void Focus::Process(StatisticsPtr &stats, Metadata *image_metadata)
{
FocusStatus status;
@@ -37,10 +36,10 @@ void Focus::Process(StatisticsPtr &stats, Metadata *image_metadata)
status.focus_measures[i] = stats->focus_stats[i].contrast_val[1][1] / 1000;
status.num = i;
image_metadata->Set("focus.status", status);
- if (print_) {
- uint32_t value = (status.focus_measures[5] + status.focus_measures[6]) / 10;
- RPI_LOG("Focus contrast measure: " << value);
- }
+
+ LOG(RPiFocus, Debug)
+ << "Focus contrast measure: "
+ << (status.focus_measures[5] + status.focus_measures[6]) / 10;
}
/* Register algorithm with the system. */