[{"id":24172,"web_url":"https://patchwork.libcamera.org/comment/24172/","msgid":"<YuCe1cQ6Q5/pIzD/@pendragon.ideasonboard.com>","date":"2022-07-27T02:11:33","subject":"Re: [libcamera-devel] [PATCH 08/17] DNI: ipa: raspberrypi: Code\n\trefactoring to match style guidelines","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Naush,\n\nThank you for the patch.\n\nOn Tue, Jul 26, 2022 at 01:45:40PM +0100, Naushir Patuck wrote:\n> Refactor the source files src/ipa/raspberrypi/controller/rps/[b|c|d]* to match the\n> recommended formatting guidelines for the libcamera project. The vast majority\n> of changes in this commit comprise of switching from snake_case to CamelCase,\n> and starting class member functions with a lower case character.\n> \n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  .../controller/black_level_status.h           |   6 +-\n>  src/ipa/raspberrypi/controller/rpi/agc.cpp    |   2 +-\n>  .../controller/rpi/black_level.cpp            |  34 ++---\n>  .../controller/rpi/black_level.hpp            |  12 +-\n>  src/ipa/raspberrypi/controller/rpi/ccm.cpp    |  84 +++++++------\n>  src/ipa/raspberrypi/controller/rpi/ccm.hpp    |  12 +-\n>  .../raspberrypi/controller/rpi/contrast.cpp   | 118 +++++++++---------\n>  .../raspberrypi/controller/rpi/contrast.hpp   |  30 ++---\n>  src/ipa/raspberrypi/controller/rpi/dpc.cpp    |  18 +--\n>  src/ipa/raspberrypi/controller/rpi/dpc.hpp    |   6 +-\n>  10 files changed, 160 insertions(+), 162 deletions(-)\n\n[snip]\n\n> diff --git a/src/ipa/raspberrypi/controller/rpi/black_level.cpp b/src/ipa/raspberrypi/controller/rpi/black_level.cpp\n> index 6b3497f13c19..101b5ea92cf5 100644\n> --- a/src/ipa/raspberrypi/controller/rpi/black_level.cpp\n> +++ b/src/ipa/raspberrypi/controller/rpi/black_level.cpp\n> @@ -26,38 +26,38 @@ BlackLevel::BlackLevel(Controller *controller)\n>  {\n>  }\n>  \n> -char const *BlackLevel::Name() const\n> +char const *BlackLevel::name() const\n>  {\n>  \treturn NAME;\n>  }\n>  \n> -void BlackLevel::Read(boost::property_tree::ptree const &params)\n> +void BlackLevel::read(boost::property_tree::ptree const &params)\n>  {\n> -\tuint16_t black_level = params.get<uint16_t>(\n> +\tuint16_t blackLevel = params.get<uint16_t>(\n>  \t\t\"black_level\", 4096); // 64 in 10 bits scaled to 16 bits\n> -\tblack_level_r_ = params.get<uint16_t>(\"black_level_r\", black_level);\n> -\tblack_level_g_ = params.get<uint16_t>(\"black_level_g\", black_level);\n> -\tblack_level_b_ = params.get<uint16_t>(\"black_level_b\", black_level);\n> +\tblackLevelR_ = params.get<uint16_t>(\"blackLevelR\", blackLevel);\n> +\tblackLevelG_ = params.get<uint16_t>(\"blackLevelG\", blackLevel);\n> +\tblackLevelB_ = params.get<uint16_t>(\"blackLevelB\", blackLevel);\n\nThe JSON strings should stay in snake_case.\n\n>  \tLOG(RPiBlackLevel, Debug)\n> -\t\t<< \" Read black levels red \" << black_level_r_\n> -\t\t<< \" green \" << black_level_g_\n> -\t\t<< \" blue \" << black_level_b_;\n> +\t\t<< \" Read black levels red \" << blackLevelR_\n> +\t\t<< \" green \" << blackLevelG_\n> +\t\t<< \" blue \" << blackLevelB_;\n>  }\n>  \n> -void BlackLevel::Prepare(Metadata *image_metadata)\n> +void BlackLevel::prepare(Metadata *imageMetadata)\n>  {\n> -\t// Possibly we should think about doing this in a switch_mode or\n> +\t// Possibly we should think about doing this in a switchMode or\n>  \t// something?\n>  \tstruct BlackLevelStatus status;\n> -\tstatus.black_level_r = black_level_r_;\n> -\tstatus.black_level_g = black_level_g_;\n> -\tstatus.black_level_b = black_level_b_;\n> -\timage_metadata->Set(\"black_level.status\", status);\n> +\tstatus.blackLevelR = blackLevelR_;\n> +\tstatus.blackLevelG = blackLevelG_;\n> +\tstatus.blackLevelB = blackLevelB_;\n> +\timageMetadata->set(\"black_level.status\", status);\n>  }\n>  \n>  // Register algorithm with the system.\n> -static Algorithm *Create(Controller *controller)\n> +static Algorithm *create(Controller *controller)\n>  {\n>  \treturn new BlackLevel(controller);\n>  }\n> -static RegisterAlgorithm reg(NAME, &Create);\n> +static RegisterAlgorithm reg(NAME, &create);\n\n[snip]","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 C5FBBC3275\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 27 Jul 2022 02:11:36 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1305363312;\n\tWed, 27 Jul 2022 04:11:36 +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 0782C603E8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Jul 2022 04:11:35 +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 7017556D;\n\tWed, 27 Jul 2022 04:11:34 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1658887896;\n\tbh=d8f1bx5qSUAv1Vi+4a+lZHnvSGGSuKPI5eoFSRf92qI=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=r4J7bUYYR5kPl/99hbOoes8wc55tFtmEb2/PKRjYGN26jzClVEecQ9bZ8VKlHjw5X\n\trIhX2PBcfQJCai9Eng8z5gX37gkGvM3thx37+4WlCuJBcdfYTROwGxFC/r37mHFFqN\n\tR4qfAy7VANkvsP5K0myHAnKQWKx2EFZZ/llACBUgC7n6OFLm/NaXEZOnQv1d3bgJMu\n\tAcmb19dcXIZcGuJw7SBUsGD/6yetuEr/rhNZQ6UV/BuJ+XDgjJJvPo3RJV1W7GntRy\n\t7BVyj1mho/ELXnc3I4jikiU6Xhhp3J2iOIYg3wceZyygwjEHu2de3GDgD+/71M1M5d\n\tmYxbb8J1e0rjw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1658887894;\n\tbh=d8f1bx5qSUAv1Vi+4a+lZHnvSGGSuKPI5eoFSRf92qI=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=swDnWi0GHq0XNBJqZBAurjo6XE1J6zW1EDRc6BBjtRG1DT6+5o3rItAkEOhUyQG0O\n\tAnmcJdh7lSRowFg9RWMwj7v667vpCyrMdTfAtgztnGD5ZmG8TdX6Fefcn8PvBXveI3\n\tf0vFQi+arsTXVfMuwbrJySqOo5pdx9w4O6er1GNo="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"swDnWi0G\"; dkim-atps=neutral","Date":"Wed, 27 Jul 2022 05:11:33 +0300","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<YuCe1cQ6Q5/pIzD/@pendragon.ideasonboard.com>","References":"<20220726124549.1646-1-naush@raspberrypi.com>\n\t<20220726124549.1646-9-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220726124549.1646-9-naush@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH 08/17] DNI: ipa: raspberrypi: Code\n\trefactoring to match style guidelines","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]