{"id":13839,"url":"https://patchwork.libcamera.org/api/1.1/patches/13839/?format=json","web_url":"https://patchwork.libcamera.org/patch/13839/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210913145810.66515-12-jeanmichel.hautbois@ideasonboard.com>","date":"2021-09-13T14:58:10","name":"[libcamera-devel,11/11] ipa: ipu3: tonemapping: Add the documentation for ToneMapping","commit_ref":null,"pull_url":null,"state":"changes-requested","archived":false,"hash":"962fe404f1ac500681a5012ab20669eb7b80710a","submitter":{"id":75,"url":"https://patchwork.libcamera.org/api/1.1/people/75/?format=json","name":"Jean-Michel Hautbois","email":"jeanmichel.hautbois@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/13839/mbox/","series":[{"id":2523,"url":"https://patchwork.libcamera.org/api/1.1/series/2523/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2523","date":"2021-09-13T14:57:59","name":"Document all the IPU3 IPA classes","version":1,"mbox":"https://patchwork.libcamera.org/series/2523/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/13839/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/13839/checks/","tags":{},"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 26E78BDB1D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 13 Sep 2021 14:58:26 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CE1F3691AE;\n\tMon, 13 Sep 2021 16:58:25 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 35E8969194\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 13 Sep 2021 16:58:16 +0200 (CEST)","from tatooine.ideasonboard.com (unknown\n\t[IPv6:2a01:e0a:169:7140:edc5:688b:2ede:8b4b])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E17C2510;\n\tMon, 13 Sep 2021 16:58:15 +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=\"XTY9uERZ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1631545096;\n\tbh=LFh8BNmwrDEmjBPspaawQKvWN2mk1Rd89f6qorKcmug=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=XTY9uERZVQqZBhXMjegzM0Do2W0XsSDsbOlTaydEeIDCEhf5KYBP+9jPry/2gP/oX\n\tHvMJWYg+c01KNmMkIvh0Ma9L1YIVPR77zUJ0+vGJUo9Zqf6TvGLlWwIWf0nooghIam\n\tM99gqBV0I/g476a3yd7MhTnew8rh/11PlrjFiv50=","From":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 13 Sep 2021 16:58:10 +0200","Message-Id":"<20210913145810.66515-12-jeanmichel.hautbois@ideasonboard.com>","X-Mailer":"git-send-email 2.30.2","In-Reply-To":"<20210913145810.66515-1-jeanmichel.hautbois@ideasonboard.com>","References":"<20210913145810.66515-1-jeanmichel.hautbois@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 11/11] ipa: ipu3: tonemapping: Add the\n\tdocumentation for ToneMapping","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The Tonemapping algorithm is currently undocumented.\n\nProvide an introduction and overview to the implementation as the class\ndefinition and document how the algorithm operates in the process and\nprepare methods.\n\nSigned-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/ipa/ipu3/algorithms/tone_mapping.cpp | 35 +++++++++++++++++++++++-\n 1 file changed, 34 insertions(+), 1 deletion(-)","diff":"diff --git a/src/ipa/ipu3/algorithms/tone_mapping.cpp b/src/ipa/ipu3/algorithms/tone_mapping.cpp\nindex 40337f9d..15e9ab3f 100644\n--- a/src/ipa/ipu3/algorithms/tone_mapping.cpp\n+++ b/src/ipa/ipu3/algorithms/tone_mapping.cpp\n@@ -10,15 +10,40 @@\n #include <cmath>\n #include <string.h>\n \n+/**\n+ * \\file tone_mapping.h\n+ */\n+\n namespace libcamera {\n \n namespace ipa::ipu3::algorithms {\n \n+/**\n+ * \\class ToneMapping\n+ * \\brief A class to handle tone mapping based on gamma\n+ *\n+ * This algorithm improves the image dynamic using a look-up table which is\n+ * generated based on a gamma parameter.\n+ *\n+ * Gamma values less than one have the effect of compressing the image histogram\n+ * while values over 1 will expand it.\n+ *\n+ * Expanding the histogram has the effect of providing better overall contrast.\n+ */\n+\n ToneMapping::ToneMapping()\n \t: gamma_(1.0)\n {\n }\n \n+/**\n+ * \\brief Fill in the parameter structure, and enable gamma control\n+ * \\param context The shared IPA context\n+ * \\param params The IPU3 parameters\n+ *\n+ * Populate the IPU3 parameter structure with our gamma correction table, and\n+ * enable the gamma control module in the accelerator cluster.\n+ */\n void ToneMapping::prepare([[maybe_unused]] IPAContext &context,\n \t\t\t  ipu3_uapi_params *params)\n {\n@@ -33,7 +58,15 @@ void ToneMapping::prepare([[maybe_unused]] IPAContext &context,\n \tparams->acc_param.gamma.gc_ctrl.enable = 1;\n }\n \n-void ToneMapping::process([[maybe_unused]] IPAContext &context,\n+/**\n+ * \\brief Calculate the Gamma curve\n+ * \\param context The shared IPA context\n+ * \\param stats The IPU3 statistics and ISP results\n+ *\n+ * The gamma correction look up table is generated as an inverse power curve\n+ * from our gamma setting.\n+ */\n+void ToneMapping::process(IPAContext &context,\n \t\t\t  [[maybe_unused]] const ipu3_uapi_stats_3a *stats)\n {\n \t/*\n","prefixes":["libcamera-devel","11/11"]}