[{"id":5312,"web_url":"https://patchwork.libcamera.org/comment/5312/","msgid":"<20200622023846.GG25355@pendragon.ideasonboard.com>","date":"2020-06-22T02:38:46","subject":"Re: [libcamera-devel] [PATCH 3/3] libcamera: raspberrypi: plumb the\n\tlibcamera sharpness control through to the Raspberry Pi\n\timplementation","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi David,\n\nThank you for the patch.\n\nOn Fri, Jun 19, 2020 at 10:27:25AM +0100, David Plowman wrote:\n> This simply wires up the libcamera sharpness control in the Raspberry\n> Pi IPAs so that it controls the strength of the Raspberry Pi sharpness\n> control algorithm.\n> \n> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> ---\n>  include/libcamera/ipa/raspberrypi.h |  1 +\n>  src/ipa/raspberrypi/raspberrypi.cpp | 12 ++++++++++++\n>  2 files changed, 13 insertions(+)\n> \n> diff --git a/include/libcamera/ipa/raspberrypi.h b/include/libcamera/ipa/raspberrypi.h\n> index c109469..a18ce9a 100644\n> --- a/include/libcamera/ipa/raspberrypi.h\n> +++ b/include/libcamera/ipa/raspberrypi.h\n> @@ -51,6 +51,7 @@ static const ControlInfoMap RPiControls = {\n>  \t{ &controls::Brightness, ControlInfo(-1.0f, 1.0f) },\n>  \t{ &controls::Contrast, ControlInfo(0.0f, 32.0f) },\n>  \t{ &controls::Saturation, ControlInfo(0.0f, 32.0f) },\n> +\t{ &controls::Sharpness, ControlInfo(0.0f, 16.0f, 1.0f) },\n\nIn patch 2/3, status.threshold is computed with a division by the user\nstrength. Dividing by 0 doesn't seem like a very good idea. That's\nsomething to be fixed in 2/3 though. For this patch,\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  };\n>  \n>  } /* namespace libcamera */\n> diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\n> index 9669f21..2f2550e 100644\n> --- a/src/ipa/raspberrypi/raspberrypi.cpp\n> +++ b/src/ipa/raspberrypi/raspberrypi.cpp\n> @@ -47,6 +47,7 @@\n>  #include \"metadata.hpp\"\n>  #include \"noise_status.h\"\n>  #include \"sdn_status.h\"\n> +#include \"sharpen_algorithm.hpp\"\n>  #include \"sharpen_status.h\"\n>  \n>  namespace libcamera {\n> @@ -631,6 +632,17 @@ void IPARPi::queueRequest(const ControlList &controls)\n>  \t\t\tbreak;\n>  \t\t}\n>  \n> +\t\tcase controls::SHARPNESS: {\n> +\t\t\tRPi::SharpenAlgorithm *sharpen = dynamic_cast<RPi::SharpenAlgorithm *>(\n> +\t\t\t\tcontroller_.GetAlgorithm(\"sharpen\"));\n> +\t\t\tASSERT(sharpen);\n> +\n> +\t\t\tsharpen->SetStrength(ctrl.second.get<float>());\n> +\t\t\tlibcameraMetadata_.set(controls::Sharpness,\n> +\t\t\t\t\t       ctrl.second.get<float>());\n> +\t\t\tbreak;\n> +\t\t}\n> +\n>  \t\tdefault:\n>  \t\t\tLOG(IPARPI, Warning)\n>  \t\t\t\t<< \"Ctrl \" << controls::controls.at(ctrl.first)->name()","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["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 F26C2609A3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 22 Jun 2020 04:39:10 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 636E630D;\n\tMon, 22 Jun 2020 04:39:10 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"jKAACdhG\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1592793550;\n\tbh=2KfjRgq+IgylshmWsIZRG68pev6fkRZ+BiDk7O9oySo=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=jKAACdhGJiBehG9uy1JzJcIsXr6IuAwWDB6jLEjJP7EwWqZS9wKpaDKqM5/DElwaK\n\tIWOi93JcbKSTxrfAtrO4gV2NtACRuBBw1+Wn7aWZ3D3J61FKif0KkhDnljcIqSQcY0\n\tN8DCYDCmp6hjY0A9OAatr1oVgVHX+iZMNrq5VKNA=","Date":"Mon, 22 Jun 2020 05:38:46 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"David Plowman <david.plowman@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200622023846.GG25355@pendragon.ideasonboard.com>","References":"<20200619092725.19109-1-david.plowman@raspberrypi.com>\n\t<20200619092725.19109-4-david.plowman@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20200619092725.19109-4-david.plowman@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH 3/3] libcamera: raspberrypi: plumb the\n\tlibcamera sharpness control through to the Raspberry Pi\n\timplementation","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>","X-List-Received-Date":"Mon, 22 Jun 2020 02:39:11 -0000"}}]