From 09b4822f7f4ee2b02e2ddf7af1fe769b77765182 Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Thu, 14 Jul 2022 17:59:49 +0200 Subject: ipa: algorithms: af: Do not inherit from Algorithm The AfAlgorithm class defines the pure virtual interface for the Auto-focus algorithms and it is not meant to be instantiated. In the same way the AfHillClimbing class cannot be directly instantiated as it contains two pure virtual members. The platform-specific implementation is instead the class that will be registered to the AlgorithmFactory, and it's the only one that needs to inherit from Algorithm for this reason. Remove the Module template argument from the class hierarchy and have the platform specific class inherit from Algorithm. Signed-off-by: Jacopo Mondi --- src/ipa/libipa/algorithms/af_algorithm.h | 3 +-- src/ipa/libipa/algorithms/af_hill_climbing.h | 3 +-- src/ipa/rkisp1/algorithms/af.h | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/ipa/libipa/algorithms/af_algorithm.h b/src/ipa/libipa/algorithms/af_algorithm.h index 2862042b..53d4adbf 100644 --- a/src/ipa/libipa/algorithms/af_algorithm.h +++ b/src/ipa/libipa/algorithms/af_algorithm.h @@ -13,8 +13,7 @@ namespace libcamera::ipa::common::algorithms { -template -class AfAlgorithm : public Algorithm +class AfAlgorithm { public: AfAlgorithm() = default; diff --git a/src/ipa/libipa/algorithms/af_hill_climbing.h b/src/ipa/libipa/algorithms/af_hill_climbing.h index e251f3eb..33e2348c 100644 --- a/src/ipa/libipa/algorithms/af_hill_climbing.h +++ b/src/ipa/libipa/algorithms/af_hill_climbing.h @@ -19,8 +19,7 @@ LOG_DECLARE_CATEGORY(Af) namespace ipa::common::algorithms { -template -class AfHillClimbing : public AfAlgorithm +class AfHillClimbing : public AfAlgorithm { public: AfHillClimbing() diff --git a/src/ipa/rkisp1/algorithms/af.h b/src/ipa/rkisp1/algorithms/af.h index b2da4890..d27b5da7 100644 --- a/src/ipa/rkisp1/algorithms/af.h +++ b/src/ipa/rkisp1/algorithms/af.h @@ -10,11 +10,11 @@ #include #include "libipa/algorithms/af_hill_climbing.h" -#include "module.h" +#include "algorithm.h" namespace libcamera::ipa::rkisp1::algorithms { -class Af : public ipa::common::algorithms::AfHillClimbing +class Af : public ipa::common::algorithms::AfHillClimbing, public Algorithm { public: Af() = default; -- cgit v1.2.1