From patchwork Wed Aug 18 15:53:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Michel Hautbois X-Patchwork-Id: 13389 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 76D60C3241 for ; Wed, 18 Aug 2021 15:54:12 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A6313688A3; Wed, 18 Aug 2021 17:54:11 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="SBJpma6c"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4AEDD68890 for ; Wed, 18 Aug 2021 17:54:09 +0200 (CEST) Received: from tatooine.ideasonboard.com (unknown [IPv6:2a01:e0a:169:7140:946e:2bbb:370e:41e4]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B383EEE; Wed, 18 Aug 2021 17:54:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1629302048; bh=Z+UXjf6Idj7j65LOkAIaDNWuJS/dYp2ITP+yDqjiLr4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SBJpma6cf1AFAlxZ72ExAnQ25h67pjEavg9qjdTCaSh1kk/kW6lhlK7wsPAPLZ920 efn5nTkQAFu1IeK3P4xw2zs9hxX8T3RnhATAM++irk/6jgDheas1niD5ks1or2p6/o ZtvlQlYOY+bgwgOqdwv+/1a6n0ZA2fMfHVp2dVAg= From: Jean-Michel Hautbois To: libcamera-devel@lists.libcamera.org Date: Wed, 18 Aug 2021 17:53:55 +0200 Message-Id: <20210818155403.268694-2-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210818155403.268694-1-jeanmichel.hautbois@ideasonboard.com> References: <20210818155403.268694-1-jeanmichel.hautbois@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 1/9] ipa: move libipa::Algorithm to ipa/ipu3/algorithms X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The abstract Algorithm class was originally placed in libipa as an attempt to define a generic algorithm container. This was a little optimistic and pushed a bit far too early. Move the Algorithm class into the IPU3 which is the only user of the class, as we adapt it to support modular algorithm components for the IPU3. Not documenting the namespace may cause issues with Doxygen in libipa. The file libipa.cpp is thus created as an empty file for now, but we can leverage it in the future to add more global libipa documentation, and possibly code too. Signed-off-by: Jean-Michel Hautbois Reviewed-by: Kieran Bingham kieran.bingham@ideasonboard.com Reviewed-by: Laurent Pinchart --- .../{libipa => ipu3/algorithms}/algorithm.cpp | 17 ++++--------- src/ipa/ipu3/algorithms/algorithm.h | 24 +++++++++++++++++++ src/ipa/ipu3/algorithms/meson.build | 5 ++++ src/ipa/ipu3/ipu3_agc.h | 2 +- src/ipa/ipu3/ipu3_awb.h | 2 +- src/ipa/ipu3/meson.build | 4 ++++ src/ipa/libipa/algorithm.h | 24 ------------------- src/ipa/libipa/libipa.cpp | 22 +++++++++++++++++ src/ipa/libipa/meson.build | 5 ++-- 9 files changed, 63 insertions(+), 42 deletions(-) rename src/ipa/{libipa => ipu3/algorithms}/algorithm.cpp (55%) create mode 100644 src/ipa/ipu3/algorithms/algorithm.h create mode 100644 src/ipa/ipu3/algorithms/meson.build delete mode 100644 src/ipa/libipa/algorithm.h create mode 100644 src/ipa/libipa/libipa.cpp diff --git a/src/ipa/libipa/algorithm.cpp b/src/ipa/ipu3/algorithms/algorithm.cpp similarity index 55% rename from src/ipa/libipa/algorithm.cpp rename to src/ipa/ipu3/algorithms/algorithm.cpp index 930f9353..325d34f0 100644 --- a/src/ipa/libipa/algorithm.cpp +++ b/src/ipa/ipu3/algorithms/algorithm.cpp @@ -2,7 +2,7 @@ /* * Copyright (C) 2021, Ideas On Board * - * algorithm.cpp - ISP control algorithms + * algorithm.h - IPU3 control algorithm interface */ #include "algorithm.h" @@ -14,26 +14,17 @@ namespace libcamera { -/** - * \brief The IPA namespace - * - * The IPA namespace groups all types specific to IPA modules. It serves as the - * top-level namespace for the IPA library libipa, and also contains - * module-specific namespaces for IPA modules. - */ -namespace ipa { +namespace ipa::ipu3 { /** * \class Algorithm - * \brief The base class for all IPA algorithms + * \brief The base class for all IPU3 algorithms * * The Algorithm class defines a standard interface for IPA algorithms. By * abstracting algorithms, it makes possible the implementation of generic code * to manage algorithms regardless of their specific type. */ -Algorithm::~Algorithm() = default; - -} /* namespace ipa */ +} /* namespace ipa::ipu3 */ } /* namespace libcamera */ diff --git a/src/ipa/ipu3/algorithms/algorithm.h b/src/ipa/ipu3/algorithms/algorithm.h new file mode 100644 index 00000000..072f01c4 --- /dev/null +++ b/src/ipa/ipu3/algorithms/algorithm.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2021, Ideas On Board + * + * algorithm.h - IPU3 control algorithm interface + */ +#ifndef __LIBCAMERA_IPA_IPU3_ALGORITHM_H__ +#define __LIBCAMERA_IPA_IPU3_ALGORITHM_H__ + +namespace libcamera { + +namespace ipa::ipu3 { + +class Algorithm +{ +public: + virtual ~Algorithm() {} +}; + +} /* namespace ipa::ipu3 */ + +} /* namespace libcamera */ + +#endif /* __LIBCAMERA_IPA_IPU3_ALGORITHM_H__ */ diff --git a/src/ipa/ipu3/algorithms/meson.build b/src/ipa/ipu3/algorithms/meson.build new file mode 100644 index 00000000..dc538b79 --- /dev/null +++ b/src/ipa/ipu3/algorithms/meson.build @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: CC0-1.0 + +ipu3_ipa_algorithms = files([ + 'algorithm.cpp', +]) diff --git a/src/ipa/ipu3/ipu3_agc.h b/src/ipa/ipu3/ipu3_agc.h index 9f3d4257..f00b98d6 100644 --- a/src/ipa/ipu3/ipu3_agc.h +++ b/src/ipa/ipu3/ipu3_agc.h @@ -13,7 +13,7 @@ #include -#include "libipa/algorithm.h" +#include "algorithms/algorithm.h" namespace libcamera { diff --git a/src/ipa/ipu3/ipu3_awb.h b/src/ipa/ipu3/ipu3_awb.h index 122cf68c..ea2d4320 100644 --- a/src/ipa/ipu3/ipu3_awb.h +++ b/src/ipa/ipu3/ipu3_awb.h @@ -13,7 +13,7 @@ #include -#include "libipa/algorithm.h" +#include "algorithms/algorithm.h" namespace libcamera { diff --git a/src/ipa/ipu3/meson.build b/src/ipa/ipu3/meson.build index b6364190..fcb27d68 100644 --- a/src/ipa/ipu3/meson.build +++ b/src/ipa/ipu3/meson.build @@ -1,5 +1,7 @@ # SPDX-License-Identifier: CC0-1.0 +subdir('algorithms') + ipa_name = 'ipa_ipu3' ipu3_ipa_sources = files([ @@ -8,6 +10,8 @@ ipu3_ipa_sources = files([ 'ipu3_awb.cpp', ]) +ipu3_ipa_sources += ipu3_ipa_algorithms + mod = shared_module(ipa_name, [ipu3_ipa_sources, libcamera_generated_ipa_headers], name_prefix : '', diff --git a/src/ipa/libipa/algorithm.h b/src/ipa/libipa/algorithm.h deleted file mode 100644 index 89cee4c4..00000000 --- a/src/ipa/libipa/algorithm.h +++ /dev/null @@ -1,24 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-or-later */ -/* - * Copyright (C) 2021, Ideas On Board - * - * algorithm.h - ISP control algorithm interface - */ -#ifndef __LIBCAMERA_IPA_LIBIPA_ALGORITHM_H__ -#define __LIBCAMERA_IPA_LIBIPA_ALGORITHM_H__ - -namespace libcamera { - -namespace ipa { - -class Algorithm -{ -public: - virtual ~Algorithm(); -}; - -} /* namespace ipa */ - -} /* namespace libcamera */ - -#endif /* __LIBCAMERA_IPA_LIBIPA_ALGORITHM_H__ */ diff --git a/src/ipa/libipa/libipa.cpp b/src/ipa/libipa/libipa.cpp new file mode 100644 index 00000000..08bc3541 --- /dev/null +++ b/src/ipa/libipa/libipa.cpp @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2021, Ideas On Board + * + * libipa.cpp - libipa interface + */ + +namespace libcamera { + +/** + * \brief The IPA namespace + * + * The IPA namespace groups all types specific to IPA modules. It serves as the + * top-level namespace for the IPA library libipa, and also contains + * module-specific namespaces for IPA modules. + */ +namespace ipa { + +} /* namespace ipa */ + +} /* namespace libcamera */ + diff --git a/src/ipa/libipa/meson.build b/src/ipa/libipa/meson.build index 3fda7c00..4d073a03 100644 --- a/src/ipa/libipa/meson.build +++ b/src/ipa/libipa/meson.build @@ -1,15 +1,14 @@ # SPDX-License-Identifier: CC0-1.0 libipa_headers = files([ - 'algorithm.h', 'camera_sensor_helper.h', 'histogram.h' ]) libipa_sources = files([ - 'algorithm.cpp', 'camera_sensor_helper.cpp', - 'histogram.cpp' + 'histogram.cpp', + 'libipa.cpp', ]) libipa_includes = include_directories('..')