From patchwork Tue Mar 16 10:18:39 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: 11582 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 2B585BD80C for ; Tue, 16 Mar 2021 10:18:50 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 90EAC68D3F; Tue, 16 Mar 2021 11:18:49 +0100 (CET) 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="Y++BYvp/"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0781268D47 for ; Tue, 16 Mar 2021 11:18:46 +0100 (CET) Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:169:7140:f840:1816:ba68:a009]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id AD6C613CC; Tue, 16 Mar 2021 11:18:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1615889925; bh=jZrk5k22e9JNhGw2NKZ78BZohYFlK5c8a5TKKJMGkpA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y++BYvp/O4A3TTwzqeB/lerF3nXQ61pXkNTP7YqAEHUXckZZ5182Dwp0NDMngbGw1 zyGZf1Mh7EGzBJ8jZWChq2p2UOx/MHDF0gMGG4oDIz/eryq0x+A09KVzxoKlHg3ZgG iATUKl64s8A5F3gf/iZQgn9KETEQBOfr9jVk2shI= From: Jean-Michel Hautbois To: libcamera-devel@lists.libcamera.org Date: Tue, 16 Mar 2021 11:18:39 +0100 Message-Id: <20210316101842.18674-3-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210316101842.18674-1-jeanmichel.hautbois@ideasonboard.com> References: <20210316101842.18674-1-jeanmichel.hautbois@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v2 1/3] WIP: ipa: Add a common interface for algorithm objects 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" In order to instanciate and use algorithms (AWB, AGC, etc.) there is a need for a common class to define mandatory methods. Instead of reinventing the wheel, reuse what Raspberry Pi has done and adapt to the minimum requirements expected. Signed-off-by: Jean-Michel Hautbois --- src/ipa/libipa/algorithm.cpp | 25 +++++++++++++++++++++++++ src/ipa/libipa/algorithm.h | 29 +++++++++++++++++++++++++++++ src/ipa/libipa/meson.build | 4 +++- 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 src/ipa/libipa/algorithm.cpp create mode 100644 src/ipa/libipa/algorithm.h diff --git a/src/ipa/libipa/algorithm.cpp b/src/ipa/libipa/algorithm.cpp new file mode 100644 index 00000000..24cd0ae2 --- /dev/null +++ b/src/ipa/libipa/algorithm.cpp @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ +/* + * Copyright (C) 2019, Raspberry Pi (Trading) Limited + * + * algorithm.cpp - ISP control algorithms + */ + +#include "algorithm.h" + +/** + * \file algorithm.h + * \brief Algorithm common interface + */ + +namespace libcamera { + +namespace ipa { + +void Algorithm::initialise() {} + +void Algorithm::process() {} + +} /* namespace ipa */ + +} /* namespace libcamera */ diff --git a/src/ipa/libipa/algorithm.h b/src/ipa/libipa/algorithm.h new file mode 100644 index 00000000..56cd8172 --- /dev/null +++ b/src/ipa/libipa/algorithm.h @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2019, Raspberry Pi (Trading) Limited + * + * 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: + Algorithm() + { + } + virtual ~Algorithm() = default; + virtual void initialise(); + virtual void process(); +}; + +} /* namespace ipa */ + +} /* namespace libcamera */ + +#endif /* __LIBCAMERA_IPA_LIBIPA_ALGORITHM_H__ */ diff --git a/src/ipa/libipa/meson.build b/src/ipa/libipa/meson.build index b29ef0f4..585d02a3 100644 --- a/src/ipa/libipa/meson.build +++ b/src/ipa/libipa/meson.build @@ -1,13 +1,15 @@ # SPDX-License-Identifier: CC0-1.0 libipa_headers = files([ + 'algorithm.h', ]) libipa_sources = files([ + 'algorithm.cpp', ]) libipa_includes = include_directories('..') -libipa = static_library('ipa', libipa_sources, +libipa = static_library('ipa', [libipa_sources, libipa_headers], include_directories : ipa_includes, dependencies : libcamera_dep)