Show a patch.

GET /api/patches/16760/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 16760,
    "url": "https://patchwork.libcamera.org/api/patches/16760/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/16760/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20220725134639.4572-9-naush@raspberrypi.com>",
    "date": "2022-07-25T13:46:32",
    "name": "[libcamera-devel,08/15] DNI: ipa: raspberrypi: Code refactoring to match style guidelines",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "d9daa18b2e3e82beed438ea46931b3122a49817b",
    "submitter": {
        "id": 34,
        "url": "https://patchwork.libcamera.org/api/people/34/?format=api",
        "name": "Naushir Patuck",
        "email": "naush@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/16760/mbox/",
    "series": [
        {
            "id": 3323,
            "url": "https://patchwork.libcamera.org/api/series/3323/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3323",
            "date": "2022-07-25T13:46:24",
            "name": "Raspberry Pi IPA code refactor",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3323/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/16760/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/16760/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 8A4FCC3275\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 25 Jul 2022 13:46:56 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4243E63330;\n\tMon, 25 Jul 2022 15:46:56 +0200 (CEST)",
            "from mail-wr1-x429.google.com (mail-wr1-x429.google.com\n\t[IPv6:2a00:1450:4864:20::429])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 513CB63313\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 25 Jul 2022 15:46:50 +0200 (CEST)",
            "by mail-wr1-x429.google.com with SMTP id u5so16045893wrm.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 25 Jul 2022 06:46:50 -0700 (PDT)",
            "from naush-laptop.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\ta20-20020a05600c225400b003a32167b8d4sm18054320wmm.13.2022.07.25.06.46.48\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 25 Jul 2022 06:46:48 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1658756816;\n\tbh=pXSwhZGprdXB9KdOExJ8lSQl05a52dfCQvtSQuAvAmQ=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=bjFW1HdkKTSbnNPNTDxdzg+S0q/ih9Nm/l8KvDkwkQkoXURF7T2ErUCwMDI096yyj\n\twk15XZG3eAZAP6c4T5XvJr+JpX+iOX08f5ce+6RBq57VtStH7NGAVlOYSeXfTsX88Y\n\ts4FGevBn0Uuzchsjk+ibDyrsLHDOgns6QMIdc4baEhp9YJ6pmIGAAJeGPo9izvnrd1\n\tjoMU8FLbuWoWMoi465Oy+d7WK32zRgFAPffFnHUL12qCLyqg4Tij2vNJsqIFPjEO49\n\tGuRfHz48lREcHxwY4WQGnOwiHAgQrz1absLllTE713GY6EsNXub9tWWJZGMs3T+gng\n\tRxzGT2UtIx1GQ==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=W6u/ATJ6yiLSf3ATDzNuZopNLKM5bCUNGBjENPMY07w=;\n\tb=SDlnia/ohrY4Zkxm2iRqo62yHliXqDBmuPR+IlTLE0UTifJTOKtI1DwD6gBnAkGRYV\n\tdUfqsAGkCBlj8AU38iSMjOMSWKbwKxrNYDq1pYos+rUD3EfvvUap8PrsPVROhwkYopm0\n\tnj68tN4S6F0qyfoqzGxVgdDxoVCJ8x5vlX/ngLYDOyVm4XXEeXzcedQ8YB3uM7hAhRMQ\n\t0cHfi2HlA2/vH54BgJ4LEiGODvCrWaekLcbTZX40BwSjM062IJbGjHy+cHeY7nah38h2\n\teyocQ3zlIdZgzhs+lUuSLpKYoowM4LHQmZgPHRaf+tuAdznHj4ErWYpFqu5ZAHaJ1KBF\n\tIJAQ=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"SDlnia/o\"; dkim-atps=neutral",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=W6u/ATJ6yiLSf3ATDzNuZopNLKM5bCUNGBjENPMY07w=;\n\tb=6KN6bw0tHgzMVXgGYj9ZeMVdhSWuv0ocrwg0KmclI8gifOSgjEx44omKnpe5djZ6Q3\n\t8WK3TK+Aa+CTPPMbEj0XuggenF/hybUJ7fcY+KjD514s6y3E5nndzv6K2mhPpR1yJ1Ry\n\tY1Zr5YPqtHz/9F6v6yEC70Icyho2/8BvORGUPQR1hLPBBIwvNMyA2SVw4i5RjGi8RcJ6\n\tEDhUDo9g67MJMH9nFAuPXBRZd5mhqlbIzg52hob9aI79r7oKMogBonJ5EzVNzcKTFgJY\n\trS27WwmK3ACf3r8RvWdrdwkPCG/qS6oEn2rMsmXlbnzD3QQ6s1F2wMnmgD4NDtjjpp6Q\n\tYd7g==",
        "X-Gm-Message-State": "AJIora+gmYXPLC97XlSD3MPB2/Pejhla+iSguWuijecyrFAPJa6IrT2w\n\tBMavFTi4SQBzDLJ3CZ1UvGybzM3JPNx0hA==",
        "X-Google-Smtp-Source": "AGRyM1u5tyCFVtkhrG97w2F8vPFlHoWh7nshpMl7DRmA+yNQSx/engIm56G3oGg4Z4diaR7jRevaAw==",
        "X-Received": "by 2002:a5d:6c6f:0:b0:21d:cb1b:5776 with SMTP id\n\tr15-20020a5d6c6f000000b0021dcb1b5776mr7619108wrz.44.1658756809350; \n\tMon, 25 Jul 2022 06:46:49 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon, 25 Jul 2022 14:46:32 +0100",
        "Message-Id": "<20220725134639.4572-9-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220725134639.4572-1-naush@raspberrypi.com>",
        "References": "<20220725134639.4572-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 08/15] 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": "Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Naushir Patuck <naush@raspberrypi.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Refactor the source files src/ipa/raspberrypi/controller/rps/[b|c|d]* to match the\nrecommended formatting guidelines for the libcamera project. The vast majority\nof changes in this commit comprise of switching from snake_case to CamelCase,\nand starting class member functions with a lower case character.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n .../controller/rpi/black_level.cpp            |  32 ++---\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 8 files changed, 155 insertions(+), 157 deletions(-)",
    "diff": "diff --git a/src/ipa/raspberrypi/controller/rpi/black_level.cpp b/src/ipa/raspberrypi/controller/rpi/black_level.cpp\nindex 6b3497f13c19..695b3129dd93 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>(\"black_level_r\", blackLevel);\n+\tblackLevelG_ = params.get<uint16_t>(\"black_level_g\", blackLevel);\n+\tblackLevelB_ = params.get<uint16_t>(\"black_level_b\", blackLevel);\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// 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.black_level_r = blackLevelR_;\n+\tstatus.black_level_g = blackLevelG_;\n+\tstatus.black_level_b = 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);\ndiff --git a/src/ipa/raspberrypi/controller/rpi/black_level.hpp b/src/ipa/raspberrypi/controller/rpi/black_level.hpp\nindex 65ec4d0ed26c..0d74f6a4c49b 100644\n--- a/src/ipa/raspberrypi/controller/rpi/black_level.hpp\n+++ b/src/ipa/raspberrypi/controller/rpi/black_level.hpp\n@@ -17,14 +17,14 @@ class BlackLevel : public Algorithm\n {\n public:\n \tBlackLevel(Controller *controller);\n-\tchar const *Name() const override;\n-\tvoid Read(boost::property_tree::ptree const &params) override;\n-\tvoid Prepare(Metadata *image_metadata) override;\n+\tchar const *name() const override;\n+\tvoid read(boost::property_tree::ptree const &params) override;\n+\tvoid prepare(Metadata *imageMetadata) override;\n \n private:\n-\tdouble black_level_r_;\n-\tdouble black_level_g_;\n-\tdouble black_level_b_;\n+\tdouble blackLevelR_;\n+\tdouble blackLevelG_;\n+\tdouble blackLevelB_;\n };\n \n } // namespace RPiController\ndiff --git a/src/ipa/raspberrypi/controller/rpi/ccm.cpp b/src/ipa/raspberrypi/controller/rpi/ccm.cpp\nindex 821a4c7c98c5..24d8e5bd1fd8 100644\n--- a/src/ipa/raspberrypi/controller/rpi/ccm.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/ccm.cpp\n@@ -37,7 +37,7 @@ Matrix::Matrix(double m0, double m1, double m2, double m3, double m4, double m5,\n \tm[0][0] = m0, m[0][1] = m1, m[0][2] = m2, m[1][0] = m3, m[1][1] = m4,\n \tm[1][2] = m5, m[2][0] = m6, m[2][1] = m7, m[2][2] = m8;\n }\n-void Matrix::Read(boost::property_tree::ptree const &params)\n+void Matrix::read(boost::property_tree::ptree const &params)\n {\n \tdouble *ptr = (double *)m;\n \tint n = 0;\n@@ -53,47 +53,49 @@ void Matrix::Read(boost::property_tree::ptree const &params)\n Ccm::Ccm(Controller *controller)\n \t: CcmAlgorithm(controller), saturation_(1.0) {}\n \n-char const *Ccm::Name() const\n+char const *Ccm::name() const\n {\n \treturn NAME;\n }\n \n-void Ccm::Read(boost::property_tree::ptree const &params)\n+void Ccm::read(boost::property_tree::ptree const &params)\n {\n \tif (params.get_child_optional(\"saturation\"))\n-\t\tconfig_.saturation.Read(params.get_child(\"saturation\"));\n+\t\tconfig_.saturation.read(params.get_child(\"saturation\"));\n \tfor (auto &p : params.get_child(\"ccms\")) {\n-\t\tCtCcm ct_ccm;\n-\t\tct_ccm.ct = p.second.get<double>(\"ct\");\n-\t\tct_ccm.ccm.Read(p.second.get_child(\"ccm\"));\n+\t\tCtCcm ctCcm;\n+\t\tctCcm.ct = p.second.get<double>(\"ct\");\n+\t\tctCcm.ccm.read(p.second.get_child(\"ccm\"));\n \t\tif (!config_.ccms.empty() &&\n-\t\t    ct_ccm.ct <= config_.ccms.back().ct)\n+\t\t    ctCcm.ct <= config_.ccms.back().ct)\n \t\t\tthrow std::runtime_error(\n \t\t\t\t\"Ccm: CCM not in increasing colour temperature order\");\n-\t\tconfig_.ccms.push_back(std::move(ct_ccm));\n+\t\tconfig_.ccms.push_back(std::move(ctCcm));\n \t}\n \tif (config_.ccms.empty())\n \t\tthrow std::runtime_error(\"Ccm: no CCMs specified\");\n }\n \n-void Ccm::SetSaturation(double saturation)\n+void Ccm::setSaturation(double saturation)\n {\n \tsaturation_ = saturation;\n }\n \n-void Ccm::Initialise() {}\n+void Ccm::initialise()\n+{\n+}\n \n template<typename T>\n-static bool get_locked(Metadata *metadata, std::string const &tag, T &value)\n+static bool getLocked(Metadata *metadata, std::string const &tag, T &value)\n {\n-\tT *ptr = metadata->GetLocked<T>(tag);\n+\tT *ptr = metadata->getLocked<T>(tag);\n \tif (ptr == nullptr)\n \t\treturn false;\n \tvalue = *ptr;\n \treturn true;\n }\n \n-Matrix calculate_ccm(std::vector<CtCcm> const &ccms, double ct)\n+Matrix calculateCcm(std::vector<CtCcm> const &ccms, double ct)\n {\n \tif (ct <= ccms.front().ct)\n \t\treturn ccms.front().ccm;\n@@ -109,7 +111,7 @@ Matrix calculate_ccm(std::vector<CtCcm> const &ccms, double ct)\n \t}\n }\n \n-Matrix apply_saturation(Matrix const &ccm, double saturation)\n+Matrix applySaturation(Matrix const &ccm, double saturation)\n {\n \tMatrix RGB2Y(0.299, 0.587, 0.114, -0.169, -0.331, 0.500, 0.500, -0.419,\n \t\t     -0.081);\n@@ -119,51 +121,51 @@ Matrix apply_saturation(Matrix const &ccm, double saturation)\n \treturn Y2RGB * S * RGB2Y * ccm;\n }\n \n-void Ccm::Prepare(Metadata *image_metadata)\n+void Ccm::prepare(Metadata *imageMetadata)\n {\n-\tbool awb_ok = false, lux_ok = false;\n+\tbool awbOk = false, luxOk = false;\n \tstruct AwbStatus awb = {};\n-\tawb.temperature_K = 4000; // in case no metadata\n+\tawb.temperatureK = 4000; // in case no metadata\n \tstruct LuxStatus lux = {};\n \tlux.lux = 400; // in case no metadata\n \t{\n \t\t// grab mutex just once to get everything\n-\t\tstd::lock_guard<Metadata> lock(*image_metadata);\n-\t\tawb_ok = get_locked(image_metadata, \"awb.status\", awb);\n-\t\tlux_ok = get_locked(image_metadata, \"lux.status\", lux);\n+\t\tstd::lock_guard<Metadata> lock(*imageMetadata);\n+\t\tawbOk = getLocked(imageMetadata, \"awb.status\", awb);\n+\t\tluxOk = getLocked(imageMetadata, \"lux.status\", lux);\n \t}\n-\tif (!awb_ok)\n+\tif (!awbOk)\n \t\tLOG(RPiCcm, Warning) << \"no colour temperature found\";\n-\tif (!lux_ok)\n+\tif (!luxOk)\n \t\tLOG(RPiCcm, Warning) << \"no lux value found\";\n-\tMatrix ccm = calculate_ccm(config_.ccms, awb.temperature_K);\n+\tMatrix ccm = calculateCcm(config_.ccms, awb.temperatureK);\n \tdouble saturation = saturation_;\n-\tstruct CcmStatus ccm_status;\n-\tccm_status.saturation = saturation;\n-\tif (!config_.saturation.Empty())\n-\t\tsaturation *= config_.saturation.Eval(\n-\t\t\tconfig_.saturation.Domain().Clip(lux.lux));\n-\tccm = apply_saturation(ccm, saturation);\n+\tstruct CcmStatus ccmStatus;\n+\tccmStatus.saturation = saturation;\n+\tif (!config_.saturation.empty())\n+\t\tsaturation *= config_.saturation.eval(\n+\t\t\tconfig_.saturation.domain().clip(lux.lux));\n+\tccm = applySaturation(ccm, saturation);\n \tfor (int j = 0; j < 3; j++)\n \t\tfor (int i = 0; i < 3; i++)\n-\t\t\tccm_status.matrix[j * 3 + i] =\n+\t\t\tccmStatus.matrix[j * 3 + i] =\n \t\t\t\tstd::max(-8.0, std::min(7.9999, ccm.m[j][i]));\n \tLOG(RPiCcm, Debug)\n-\t\t<< \"colour temperature \" << awb.temperature_K << \"K\";\n+\t\t<< \"colour temperature \" << awb.temperatureK << \"K\";\n \tLOG(RPiCcm, Debug)\n-\t\t<< \"CCM: \" << ccm_status.matrix[0] << \" \" << ccm_status.matrix[1]\n-\t\t<< \" \" << ccm_status.matrix[2] << \"     \"\n-\t\t<< ccm_status.matrix[3] << \" \" << ccm_status.matrix[4]\n-\t\t<< \" \" << ccm_status.matrix[5] << \"     \"\n-\t\t<< ccm_status.matrix[6] << \" \" << ccm_status.matrix[7]\n-\t\t<< \" \" << ccm_status.matrix[8];\n-\timage_metadata->Set(\"ccm.status\", ccm_status);\n+\t\t<< \"CCM: \" << ccmStatus.matrix[0] << \" \" << ccmStatus.matrix[1]\n+\t\t<< \" \" << ccmStatus.matrix[2] << \"     \"\n+\t\t<< ccmStatus.matrix[3] << \" \" << ccmStatus.matrix[4]\n+\t\t<< \" \" << ccmStatus.matrix[5] << \"     \"\n+\t\t<< ccmStatus.matrix[6] << \" \" << ccmStatus.matrix[7]\n+\t\t<< \" \" << ccmStatus.matrix[8];\n+\timageMetadata->set(\"ccm.status\", ccmStatus);\n }\n \n // Register algorithm with the system.\n-static Algorithm *Create(Controller *controller)\n+static Algorithm *create(Controller *controller)\n {\n \treturn (Algorithm *)new Ccm(controller);\n \t;\n }\n-static RegisterAlgorithm reg(NAME, &Create);\n+static RegisterAlgorithm reg(NAME, &create);\ndiff --git a/src/ipa/raspberrypi/controller/rpi/ccm.hpp b/src/ipa/raspberrypi/controller/rpi/ccm.hpp\nindex 330ed51fe398..4c4807b8a942 100644\n--- a/src/ipa/raspberrypi/controller/rpi/ccm.hpp\n+++ b/src/ipa/raspberrypi/controller/rpi/ccm.hpp\n@@ -20,7 +20,7 @@ struct Matrix {\n \t       double m6, double m7, double m8);\n \tMatrix();\n \tdouble m[3][3];\n-\tvoid Read(boost::property_tree::ptree const &params);\n+\tvoid read(boost::property_tree::ptree const &params);\n };\n static inline Matrix operator*(double d, Matrix const &m)\n {\n@@ -61,11 +61,11 @@ class Ccm : public CcmAlgorithm\n {\n public:\n \tCcm(Controller *controller = NULL);\n-\tchar const *Name() const override;\n-\tvoid Read(boost::property_tree::ptree const &params) override;\n-\tvoid SetSaturation(double saturation) override;\n-\tvoid Initialise() override;\n-\tvoid Prepare(Metadata *image_metadata) override;\n+\tchar const *name() const override;\n+\tvoid read(boost::property_tree::ptree const &params) override;\n+\tvoid setSaturation(double saturation) override;\n+\tvoid initialise() override;\n+\tvoid prepare(Metadata *imageMetadata) override;\n \n private:\n \tCcmConfig config_;\ndiff --git a/src/ipa/raspberrypi/controller/rpi/contrast.cpp b/src/ipa/raspberrypi/controller/rpi/contrast.cpp\nindex ae55aad56739..169837576678 100644\n--- a/src/ipa/raspberrypi/controller/rpi/contrast.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/contrast.cpp\n@@ -31,40 +31,40 @@ Contrast::Contrast(Controller *controller)\n {\n }\n \n-char const *Contrast::Name() const\n+char const *Contrast::name() const\n {\n \treturn NAME;\n }\n \n-void Contrast::Read(boost::property_tree::ptree const &params)\n+void Contrast::read(boost::property_tree::ptree const &params)\n {\n \t// enable adaptive enhancement by default\n-\tconfig_.ce_enable = params.get<int>(\"ce_enable\", 1);\n+\tconfig_.ceEnable = params.get<int>(\"ce_enable\", 1);\n \t// the point near the bottom of the histogram to move\n-\tconfig_.lo_histogram = params.get<double>(\"lo_histogram\", 0.01);\n+\tconfig_.loHistogram = params.get<double>(\"lo_histogram\", 0.01);\n \t// where in the range to try and move it to\n-\tconfig_.lo_level = params.get<double>(\"lo_level\", 0.015);\n+\tconfig_.loLevel = params.get<double>(\"lo_level\", 0.015);\n \t// but don't move by more than this\n-\tconfig_.lo_max = params.get<double>(\"lo_max\", 500);\n+\tconfig_.loMax = params.get<double>(\"lo_max\", 500);\n \t// equivalent values for the top of the histogram...\n-\tconfig_.hi_histogram = params.get<double>(\"hi_histogram\", 0.95);\n-\tconfig_.hi_level = params.get<double>(\"hi_level\", 0.95);\n-\tconfig_.hi_max = params.get<double>(\"hi_max\", 2000);\n-\tconfig_.gamma_curve.Read(params.get_child(\"gamma_curve\"));\n+\tconfig_.hiHistogram = params.get<double>(\"hi_histogram\", 0.95);\n+\tconfig_.hiLevel = params.get<double>(\"hi_level\", 0.95);\n+\tconfig_.hiMax = params.get<double>(\"hi_max\", 2000);\n+\tconfig_.gammaCurve.read(params.get_child(\"gamma_curve\"));\n }\n \n-void Contrast::SetBrightness(double brightness)\n+void Contrast::setBrightness(double brightness)\n {\n \tbrightness_ = brightness;\n }\n \n-void Contrast::SetContrast(double contrast)\n+void Contrast::setContrast(double contrast)\n {\n \tcontrast_ = contrast;\n }\n \n-static void fill_in_status(ContrastStatus &status, double brightness,\n-\t\t\t   double contrast, Pwl &gamma_curve)\n+static void fillInStatus(ContrastStatus &status, double brightness,\n+\t\t\t double contrast, Pwl &gammaCurve)\n {\n \tstatus.brightness = brightness;\n \tstatus.contrast = contrast;\n@@ -73,104 +73,100 @@ static void fill_in_status(ContrastStatus &status, double brightness,\n \t\t\t       : (i < 24 ? (i - 16) * 2048 + 16384\n \t\t\t\t\t : (i - 24) * 4096 + 32768);\n \t\tstatus.points[i].x = x;\n-\t\tstatus.points[i].y = std::min(65535.0, gamma_curve.Eval(x));\n+\t\tstatus.points[i].y = std::min(65535.0, gammaCurve.eval(x));\n \t}\n \tstatus.points[CONTRAST_NUM_POINTS - 1].x = 65535;\n \tstatus.points[CONTRAST_NUM_POINTS - 1].y = 65535;\n }\n \n-void Contrast::Initialise()\n+void Contrast::initialise()\n {\n \t// Fill in some default values as Prepare will run before Process gets\n \t// called.\n-\tfill_in_status(status_, brightness_, contrast_, config_.gamma_curve);\n+\tfillInStatus(status_, brightness_, contrast_, config_.gammaCurve);\n }\n \n-void Contrast::Prepare(Metadata *image_metadata)\n+void Contrast::prepare(Metadata *imageMetadata)\n {\n \tstd::unique_lock<std::mutex> lock(mutex_);\n-\timage_metadata->Set(\"contrast.status\", status_);\n+\timageMetadata->set(\"contrast.status\", status_);\n }\n \n-Pwl compute_stretch_curve(Histogram const &histogram,\n-\t\t\t  ContrastConfig const &config)\n+Pwl computeStretchCurve(Histogram const &histogram,\n+\t\t\tContrastConfig const &config)\n {\n \tPwl enhance;\n-\tenhance.Append(0, 0);\n+\tenhance.append(0, 0);\n \t// If the start of the histogram is rather empty, try to pull it down a\n \t// bit.\n-\tdouble hist_lo = histogram.Quantile(config.lo_histogram) *\n-\t\t\t (65536 / NUM_HISTOGRAM_BINS);\n-\tdouble level_lo = config.lo_level * 65536;\n+\tdouble histLo = histogram.quantile(config.loHistogram) *\n+\t\t\t(65536 / NUM_HISTOGRAM_BINS);\n+\tdouble levelLo = config.loLevel * 65536;\n \tLOG(RPiContrast, Debug)\n-\t\t<< \"Move histogram point \" << hist_lo << \" to \" << level_lo;\n-\thist_lo = std::max(\n-\t\tlevel_lo,\n-\t\tstd::min(65535.0, std::min(hist_lo, level_lo + config.lo_max)));\n+\t\t<< \"Move histogram point \" << histLo << \" to \" << levelLo;\n+\thistLo = std::max(levelLo,\n+\t\t\t  std::min(65535.0, std::min(histLo, levelLo + config.loMax)));\n \tLOG(RPiContrast, Debug)\n-\t\t<< \"Final values \" << hist_lo << \" -> \" << level_lo;\n-\tenhance.Append(hist_lo, level_lo);\n+\t\t<< \"Final values \" << histLo << \" -> \" << levelLo;\n+\tenhance.append(histLo, levelLo);\n \t// Keep the mid-point (median) in the same place, though, to limit the\n \t// apparent amount of global brightness shift.\n-\tdouble mid = histogram.Quantile(0.5) * (65536 / NUM_HISTOGRAM_BINS);\n-\tenhance.Append(mid, mid);\n+\tdouble mid = histogram.quantile(0.5) * (65536 / NUM_HISTOGRAM_BINS);\n+\tenhance.append(mid, mid);\n \n \t// If the top to the histogram is empty, try to pull the pixel values\n \t// there up.\n-\tdouble hist_hi = histogram.Quantile(config.hi_histogram) *\n-\t\t\t (65536 / NUM_HISTOGRAM_BINS);\n-\tdouble level_hi = config.hi_level * 65536;\n+\tdouble histHi = histogram.quantile(config.hiHistogram) *\n+\t\t\t(65536 / NUM_HISTOGRAM_BINS);\n+\tdouble levelHi = config.hiLevel * 65536;\n \tLOG(RPiContrast, Debug)\n-\t\t<< \"Move histogram point \" << hist_hi << \" to \" << level_hi;\n-\thist_hi = std::min(\n-\t\tlevel_hi,\n-\t\tstd::max(0.0, std::max(hist_hi, level_hi - config.hi_max)));\n+\t\t<< \"Move histogram point \" << histHi << \" to \" << levelHi;\n+\thistHi = std::min(levelHi,\n+\t\t\t  std::max(0.0, std::max(histHi, levelHi - config.hiMax)));\n \tLOG(RPiContrast, Debug)\n-\t\t<< \"Final values \" << hist_hi << \" -> \" << level_hi;\n-\tenhance.Append(hist_hi, level_hi);\n-\tenhance.Append(65535, 65535);\n+\t\t<< \"Final values \" << histHi << \" -> \" << levelHi;\n+\tenhance.append(histHi, levelHi);\n+\tenhance.append(65535, 65535);\n \treturn enhance;\n }\n \n-Pwl apply_manual_contrast(Pwl const &gamma_curve, double brightness,\n-\t\t\t  double contrast)\n+Pwl applyManualContrast(Pwl const &gammaCurve, double brightness,\n+\t\t\tdouble contrast)\n {\n-\tPwl new_gamma_curve;\n+\tPwl newGammaCurve;\n \tLOG(RPiContrast, Debug)\n \t\t<< \"Manual brightness \" << brightness << \" contrast \" << contrast;\n-\tgamma_curve.Map([&](double x, double y) {\n-\t\tnew_gamma_curve.Append(\n+\tgammaCurve.map([&](double x, double y) {\n+\t\tnewGammaCurve.append(\n \t\t\tx, std::max(0.0, std::min(65535.0,\n \t\t\t\t\t\t  (y - 32768) * contrast +\n \t\t\t\t\t\t\t  32768 + brightness)));\n \t});\n-\treturn new_gamma_curve;\n+\treturn newGammaCurve;\n }\n \n-void Contrast::Process(StatisticsPtr &stats,\n-\t\t       [[maybe_unused]] Metadata *image_metadata)\n+void Contrast::process(StatisticsPtr &stats,\n+\t\t       [[maybe_unused]] Metadata *imageMetadata)\n {\n \tHistogram histogram(stats->hist[0].g_hist, NUM_HISTOGRAM_BINS);\n \t// We look at the histogram and adjust the gamma curve in the following\n \t// ways: 1. Adjust the gamma curve so as to pull the start of the\n \t// histogram down, and possibly push the end up.\n-\tPwl gamma_curve = config_.gamma_curve;\n-\tif (config_.ce_enable) {\n-\t\tif (config_.lo_max != 0 || config_.hi_max != 0)\n-\t\t\tgamma_curve = compute_stretch_curve(histogram, config_)\n-\t\t\t\t\t      .Compose(gamma_curve);\n+\tPwl gammaCurve = config_.gammaCurve;\n+\tif (config_.ceEnable) {\n+\t\tif (config_.loMax != 0 || config_.hiMax != 0)\n+\t\t\tgammaCurve = computeStretchCurve(histogram, config_).compose(gammaCurve);\n \t\t// We could apply other adjustments (e.g. partial equalisation)\n \t\t// based on the histogram...?\n \t}\n \t// 2. Finally apply any manually selected brightness/contrast\n \t// adjustment.\n \tif (brightness_ != 0 || contrast_ != 1.0)\n-\t\tgamma_curve = apply_manual_contrast(gamma_curve, brightness_,\n-\t\t\t\t\t\t    contrast_);\n+\t\tgammaCurve = applyManualContrast(gammaCurve, brightness_, contrast_);\n \t// And fill in the status for output. Use more points towards the bottom\n \t// of the curve.\n \tContrastStatus status;\n-\tfill_in_status(status, brightness_, contrast_, gamma_curve);\n+\tfillInStatus(status, brightness_, contrast_, gammaCurve);\n \t{\n \t\tstd::unique_lock<std::mutex> lock(mutex_);\n \t\tstatus_ = status;\n@@ -178,8 +174,8 @@ void Contrast::Process(StatisticsPtr &stats,\n }\n \n // Register algorithm with the system.\n-static Algorithm *Create(Controller *controller)\n+static Algorithm *create(Controller *controller)\n {\n \treturn (Algorithm *)new Contrast(controller);\n }\n-static RegisterAlgorithm reg(NAME, &Create);\n+static RegisterAlgorithm reg(NAME, &create);\ndiff --git a/src/ipa/raspberrypi/controller/rpi/contrast.hpp b/src/ipa/raspberrypi/controller/rpi/contrast.hpp\nindex 85624539a1da..5a6d530f63fd 100644\n--- a/src/ipa/raspberrypi/controller/rpi/contrast.hpp\n+++ b/src/ipa/raspberrypi/controller/rpi/contrast.hpp\n@@ -17,27 +17,27 @@ namespace RPiController {\n // Back End AWB.\n \n struct ContrastConfig {\n-\tbool ce_enable;\n-\tdouble lo_histogram;\n-\tdouble lo_level;\n-\tdouble lo_max;\n-\tdouble hi_histogram;\n-\tdouble hi_level;\n-\tdouble hi_max;\n-\tPwl gamma_curve;\n+\tbool ceEnable;\n+\tdouble loHistogram;\n+\tdouble loLevel;\n+\tdouble loMax;\n+\tdouble hiHistogram;\n+\tdouble hiLevel;\n+\tdouble hiMax;\n+\tPwl gammaCurve;\n };\n \n class Contrast : public ContrastAlgorithm\n {\n public:\n \tContrast(Controller *controller = NULL);\n-\tchar const *Name() const override;\n-\tvoid Read(boost::property_tree::ptree const &params) override;\n-\tvoid SetBrightness(double brightness) override;\n-\tvoid SetContrast(double contrast) override;\n-\tvoid Initialise() override;\n-\tvoid Prepare(Metadata *image_metadata) override;\n-\tvoid Process(StatisticsPtr &stats, Metadata *image_metadata) override;\n+\tchar const *name() const override;\n+\tvoid read(boost::property_tree::ptree const &params) override;\n+\tvoid setBrightness(double brightness) override;\n+\tvoid setContrast(double contrast) override;\n+\tvoid initialise() override;\n+\tvoid prepare(Metadata *imageMetadata) override;\n+\tvoid process(StatisticsPtr &stats, Metadata *imageMetadata) override;\n \n private:\n \tContrastConfig config_;\ndiff --git a/src/ipa/raspberrypi/controller/rpi/dpc.cpp b/src/ipa/raspberrypi/controller/rpi/dpc.cpp\nindex 110f50560e76..42154cf300b8 100644\n--- a/src/ipa/raspberrypi/controller/rpi/dpc.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/dpc.cpp\n@@ -24,30 +24,30 @@ Dpc::Dpc(Controller *controller)\n {\n }\n \n-char const *Dpc::Name() const\n+char const *Dpc::name() const\n {\n \treturn NAME;\n }\n \n-void Dpc::Read(boost::property_tree::ptree const &params)\n+void Dpc::read(boost::property_tree::ptree const &params)\n {\n \tconfig_.strength = params.get<int>(\"strength\", 1);\n \tif (config_.strength < 0 || config_.strength > 2)\n \t\tthrow std::runtime_error(\"Dpc: bad strength value\");\n }\n \n-void Dpc::Prepare(Metadata *image_metadata)\n+void Dpc::prepare(Metadata *imageMetadata)\n {\n-\tDpcStatus dpc_status = {};\n+\tDpcStatus dpcStatus = {};\n \t// Should we vary this with lux level or analogue gain? TBD.\n-\tdpc_status.strength = config_.strength;\n-\tLOG(RPiDpc, Debug) << \"strength \" << dpc_status.strength;\n-\timage_metadata->Set(\"dpc.status\", dpc_status);\n+\tdpcStatus.strength = config_.strength;\n+\tLOG(RPiDpc, Debug) << \"strength \" << dpcStatus.strength;\n+\timageMetadata->set(\"dpc.status\", dpcStatus);\n }\n \n // Register algorithm with the system.\n-static Algorithm *Create(Controller *controller)\n+static Algorithm *create(Controller *controller)\n {\n \treturn (Algorithm *)new Dpc(controller);\n }\n-static RegisterAlgorithm reg(NAME, &Create);\n+static RegisterAlgorithm reg(NAME, &create);\ndiff --git a/src/ipa/raspberrypi/controller/rpi/dpc.hpp b/src/ipa/raspberrypi/controller/rpi/dpc.hpp\nindex d90285c4eb56..039310cc8d05 100644\n--- a/src/ipa/raspberrypi/controller/rpi/dpc.hpp\n+++ b/src/ipa/raspberrypi/controller/rpi/dpc.hpp\n@@ -21,9 +21,9 @@ class Dpc : public Algorithm\n {\n public:\n \tDpc(Controller *controller);\n-\tchar const *Name() const override;\n-\tvoid Read(boost::property_tree::ptree const &params) override;\n-\tvoid Prepare(Metadata *image_metadata) override;\n+\tchar const *name() const override;\n+\tvoid read(boost::property_tree::ptree const &params) override;\n+\tvoid prepare(Metadata *imageMetadata) override;\n \n private:\n \tDpcConfig config_;\n",
    "prefixes": [
        "libcamera-devel",
        "08/15"
    ]
}