[{"id":16040,"web_url":"https://patchwork.libcamera.org/comment/16040/","msgid":"<YGKOWnrcG7eDEaBa@pendragon.ideasonboard.com>","date":"2021-03-30T02:35:06","subject":"Re: [libcamera-devel] [PATCH v3 1/5] ipa: Add a common interface\n\tfor algorithm objects","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Mon, Mar 29, 2021 at 09:18:22PM +0200, Jean-Michel Hautbois wrote:\n> In order to instanciate and use algorithms (AWB, AGC, etc.)\n> there is a need for a common class to define mandatory methods.\n> \n> Instead of reinventing the wheel, reuse what Raspberry Pi has done and\n> adapt to the minimum requirements expected.\n> \n> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  src/ipa/libipa/algorithm.cpp | 39 ++++++++++++++++++++++++++++++++++++\n>  src/ipa/libipa/algorithm.h   | 24 ++++++++++++++++++++++\n>  src/ipa/libipa/meson.build   |  4 +++-\n>  3 files changed, 66 insertions(+), 1 deletion(-)\n>  create mode 100644 src/ipa/libipa/algorithm.cpp\n>  create mode 100644 src/ipa/libipa/algorithm.h\n> \n> diff --git a/src/ipa/libipa/algorithm.cpp b/src/ipa/libipa/algorithm.cpp\n> new file mode 100644\n> index 00000000..930f9353\n> --- /dev/null\n> +++ b/src/ipa/libipa/algorithm.cpp\n> @@ -0,0 +1,39 @@\n> +/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> +/*\n> + * Copyright (C) 2021, Ideas On Board\n> + *\n> + * algorithm.cpp - ISP control algorithms\n> + */\n> +\n> +#include \"algorithm.h\"\n> +\n> +/**\n> + * \\file algorithm.h\n> + * \\brief Algorithm common interface\n> + */\n> +\n> +namespace libcamera {\n> +\n> +/**\n> + * \\brief The IPA namespace\n> + *\n> + * The IPA namespace groups all types specific to IPA modules. It serves as the\n> + * top-level namespace for the IPA library libipa, and also contains\n> + * module-specific namespaces for IPA modules.\n> + */\n> +namespace ipa {\n> +\n> +/**\n> + * \\class Algorithm\n> + * \\brief The base class for all IPA algorithms\n> + *\n> + * The Algorithm class defines a standard interface for IPA algorithms. By\n> + * abstracting algorithms, it makes possible the implementation of generic code\n> + * to manage algorithms regardless of their specific type.\n> + */\n> +\n> +Algorithm::~Algorithm() = default;\n> +\n> +} /* namespace ipa */\n> +\n> +} /* namespace libcamera */\n> diff --git a/src/ipa/libipa/algorithm.h b/src/ipa/libipa/algorithm.h\n> new file mode 100644\n> index 00000000..89cee4c4\n> --- /dev/null\n> +++ b/src/ipa/libipa/algorithm.h\n> @@ -0,0 +1,24 @@\n> +/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> +/*\n> + * Copyright (C) 2021, Ideas On Board\n> + *\n> + * algorithm.h - ISP control algorithm interface\n> + */\n> +#ifndef __LIBCAMERA_IPA_LIBIPA_ALGORITHM_H__\n> +#define __LIBCAMERA_IPA_LIBIPA_ALGORITHM_H__\n> +\n> +namespace libcamera {\n> +\n> +namespace ipa {\n> +\n> +class Algorithm\n> +{\n> +public:\n> +\tvirtual ~Algorithm();\n> +};\n> +\n> +} /* namespace ipa */\n> +\n> +} /* namespace libcamera */\n> +\n> +#endif /* __LIBCAMERA_IPA_LIBIPA_ALGORITHM_H__ */\n> diff --git a/src/ipa/libipa/meson.build b/src/ipa/libipa/meson.build\n> index b29ef0f4..585d02a3 100644\n> --- a/src/ipa/libipa/meson.build\n> +++ b/src/ipa/libipa/meson.build\n> @@ -1,13 +1,15 @@\n>  # SPDX-License-Identifier: CC0-1.0\n>  \n>  libipa_headers = files([\n> +  'algorithm.h',\n\nThis should have 4 spaces.\n\n>  ])\n>  \n>  libipa_sources = files([\n> +    'algorithm.cpp',\n>  ])\n>  \n>  libipa_includes = include_directories('..')\n>  \n> -libipa = static_library('ipa', libipa_sources,\n> +libipa = static_library('ipa', [libipa_sources, libipa_headers],\n>                          include_directories : ipa_includes,\n>                          dependencies : libcamera_dep)","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id C90D2C32EA\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 Mar 2021 02:35:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 360C968782;\n\tTue, 30 Mar 2021 04:35:53 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7320E602D7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Mar 2021 04:35:51 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id BC7D8292;\n\tTue, 30 Mar 2021 04:35:50 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"D8o0NJ2b\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1617071751;\n\tbh=WXrEAJDZ9il3kX40csppLtZ6qu/J61JH/IMwpNrwF5Q=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=D8o0NJ2b0SWnyzMuHk+D/QFOMZcDMJXe39U6tLwbw3yw1pmBJuDhmwk0h0+dM+tyH\n\tF5TgFNu6glib+5EypDAnrJg7PiEAfoszLH/aN86gSXXSoGoJq2Td1kkIRC1OAvidNt\n\tttO7RUwLqWXYqKlWZ3InQQ2edNy/8fSp3lv16+hA=","Date":"Tue, 30 Mar 2021 05:35:06 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","Message-ID":"<YGKOWnrcG7eDEaBa@pendragon.ideasonboard.com>","References":"<20210329191826.77817-1-jeanmichel.hautbois@ideasonboard.com>\n\t<20210329191826.77817-2-jeanmichel.hautbois@ideasonboard.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210329191826.77817-2-jeanmichel.hautbois@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v3 1/5] ipa: Add a common interface\n\tfor algorithm objects","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]