Show a patch.

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

{
    "id": 16845,
    "url": "https://patchwork.libcamera.org/api/patches/16845/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/16845/",
    "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": "<20220727085524.13290-2-naush@raspberrypi.com>",
    "date": "2022-07-27T08:55:17",
    "name": "[libcamera-devel,v3,1/8] ipa: raspberrypi: Code refactoring to match style guidelines",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "31245c38f8fc253e76b46ff8d801f5106e915f8c",
    "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/16845/mbox/",
    "series": [
        {
            "id": 3335,
            "url": "https://patchwork.libcamera.org/api/series/3335/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3335",
            "date": "2022-07-27T08:55:16",
            "name": "[libcamera-devel,v3,1/8] ipa: raspberrypi: Code refactoring to match style guidelines",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/3335/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/16845/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/16845/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 3A562BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 27 Jul 2022 12:28:07 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EB7AF63311;\n\tWed, 27 Jul 2022 14:28:06 +0200 (CEST)",
            "from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com\n\t[IPv6:2a00:1450:4864:20::42e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 791B7603EC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Jul 2022 10:55:34 +0200 (CEST)",
            "by mail-wr1-x42e.google.com with SMTP id q18so12822280wrx.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Jul 2022 01:55:34 -0700 (PDT)",
            "from naush-laptop.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tv3-20020a1cac03000000b003a0375c4f73sm1559408wme.44.2022.07.27.01.55.31\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 27 Jul 2022 01:55:31 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1658924887;\n\tbh=biB9/LcNpIiGN0tsNfhaNIg+bZUlX52bKxi10oC3DQc=;\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=NTIMSxR10RJtl1Sv6jpDP6zCptwpjd7O3cyqF3JUSmK1/RoQKG4F1fPxJEGw1MaOA\n\tm1e1lXse7gxFgTr+dpVRpugpFs7NSvMgsxcBax+7wDZCQGlQhoOSI8Syz5+eUlbeqg\n\tdVA220mCxdGOduT/QT1QotkgQh2BVCfLA0DPngsxPF0f7eShAp8TsHx6fw9Wn6Rerl\n\tsOarIPhqP/VdkxRFL8SQM3aCF0XuOjkrU6T6Anc2tj5RHFmHmlfGz5tyrYTgUsXC3m\n\tKXNRUBlKvTBxv3Ctv1GSYXGXCXZ2+6mhzt9IqPG3rNvPbFZvOfgJCn+1UajRJp0RNP\n\t2/T7jPXnkNiWw==",
            "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=R4MXrcglX35R5g7Tusdudkox2vb9gak96NB5Lgo0NO8=;\n\tb=IILt6E9wzh3XF6PmYeRaEei8+X9RDgSG9Mf8BguRM1Y0wsso6jilkYP6TCkEY6PwgZ\n\tuM3wMsWtoc5R62UUjpHTjYsOfhful54Ip/Bt/ZrciI7LChLgGoLUJt6+LlaB6WOb3lKl\n\tPi/VOgzIIlesqxGOkUyX0KTfjnHngSgVXaVALr8BZHyFHbcQm8bcoHCa5GgpKZri1Ki0\n\tvcJAcpNOwLan3qk+ogwulY6TiWA2afXCfMvpo/G0Kxj/xTebnF9JASzYUYLr0+AVOpRc\n\tkdF7B4FdUga2nh9VDA51mFqU/L7SDehd9RpppNeWbMX7PIb7tbR9WACQXUbg36lujJgZ\n\th76Q=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"IILt6E9w\"; 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=R4MXrcglX35R5g7Tusdudkox2vb9gak96NB5Lgo0NO8=;\n\tb=iPjy49cEYeqlP/B5ojKTlQ41ocjrD1kBDE4g4l60cFbTKA2RqMfg3idaByY1IcYkUD\n\tgHTFnqrpkoyiBdazMpOLc2qgtT6PI9ML1ZEE/ncZZpz1mONzCOV3lkvmFLI+y+6dA39X\n\tfXP15jjs0pnSb1+jXVEX7g/hLY9MQVhvu/dWo8zr316KVydKtguJY9M8/TEAFlOQYRqV\n\tExKDmZp7AgdN+3KOkLvMPRvOO3SFGFTZpxFghmym8I7REm98LYnK8Dn3t3N0rVxZ8+sd\n\tuM2TYWix6lpt53noo/gRdwk1pXDk7j6EoeLRpIkpPDsPRzzIkw/l9gts/+3uQKpWvW8c\n\t9Dsw==",
        "X-Gm-Message-State": "AJIora989z09BA/WrAjD47wsI2w5FrGdnviovykeolU3dYtAYUO+mB4d\n\t0eLvRaQeeICj2D3KXEeHmB5ojwYO0v1zfA==",
        "X-Google-Smtp-Source": "AGRyM1u5bkIMH12URtoSwDZX/kxAMvTNChlbaiZoBl/bzaKsl8oqgDjkVl1gGmFtVKSb0byVsLlAiQ==",
        "X-Received": "by 2002:adf:e187:0:b0:21d:64c6:74f0 with SMTP id\n\taz7-20020adfe187000000b0021d64c674f0mr12672194wrb.221.1658912132222; \n\tWed, 27 Jul 2022 01:55:32 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 27 Jul 2022 09:55:17 +0100",
        "Message-Id": "<20220727085524.13290-2-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220727085524.13290-1-naush@raspberrypi.com>",
        "References": "<20220727085524.13290-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Mailman-Approved-At": "Wed, 27 Jul 2022 14:28:06 +0200",
        "Subject": "[libcamera-devel] [PATCH v3 1/8] ipa: raspberrypi: Code refactoring\n\tto 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 all the source files in src/ipa/raspberrypi/ to match the recommended\nformatting guidelines for the libcamera project. The vast majority of changes\nin this commit comprise of switching from snake_case to CamelCase, and starting\nclass member functions with a lower case character.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/ipa/raspberrypi/cam_helper.cpp            |  88 +--\n src/ipa/raspberrypi/cam_helper.hpp            |  40 +-\n src/ipa/raspberrypi/cam_helper_imx219.cpp     |  34 +-\n src/ipa/raspberrypi/cam_helper_imx290.cpp     |  32 +-\n src/ipa/raspberrypi/cam_helper_imx296.cpp     |  24 +-\n src/ipa/raspberrypi/cam_helper_imx477.cpp     |  72 +-\n src/ipa/raspberrypi/cam_helper_imx519.cpp     |  70 +-\n src/ipa/raspberrypi/cam_helper_ov5647.cpp     |  44 +-\n src/ipa/raspberrypi/cam_helper_ov9281.cpp     |  28 +-\n .../raspberrypi/controller/agc_algorithm.hpp  |  19 +-\n src/ipa/raspberrypi/controller/agc_status.h   |  24 +-\n src/ipa/raspberrypi/controller/algorithm.cpp  |  20 +-\n src/ipa/raspberrypi/controller/algorithm.hpp  |  26 +-\n .../raspberrypi/controller/awb_algorithm.hpp  |   6 +-\n src/ipa/raspberrypi/controller/awb_status.h   |   8 +-\n .../controller/black_level_status.h           |   6 +-\n src/ipa/raspberrypi/controller/camera_mode.h  |  16 +-\n .../raspberrypi/controller/ccm_algorithm.hpp  |   2 +-\n .../controller/contrast_algorithm.hpp         |   4 +-\n src/ipa/raspberrypi/controller/controller.cpp |  74 +-\n src/ipa/raspberrypi/controller/controller.hpp |  22 +-\n .../controller/denoise_algorithm.hpp          |   2 +-\n .../raspberrypi/controller/denoise_status.h   |   4 +-\n .../raspberrypi/controller/device_status.cpp  |  18 +-\n .../raspberrypi/controller/device_status.h    |  16 +-\n src/ipa/raspberrypi/controller/focus_status.h |   2 +-\n src/ipa/raspberrypi/controller/histogram.cpp  |  34 +-\n src/ipa/raspberrypi/controller/histogram.hpp  |  10 +-\n src/ipa/raspberrypi/controller/metadata.hpp   |  16 +-\n src/ipa/raspberrypi/controller/noise_status.h |   4 +-\n src/ipa/raspberrypi/controller/pwl.cpp        | 130 ++--\n src/ipa/raspberrypi/controller/pwl.hpp        |  48 +-\n src/ipa/raspberrypi/controller/rpi/agc.cpp    | 732 +++++++++---------\n src/ipa/raspberrypi/controller/rpi/agc.hpp    | 130 ++--\n src/ipa/raspberrypi/controller/rpi/alsc.cpp   | 641 ++++++++-------\n src/ipa/raspberrypi/controller/rpi/alsc.hpp   |  86 +-\n src/ipa/raspberrypi/controller/rpi/awb.cpp    | 564 +++++++-------\n src/ipa/raspberrypi/controller/rpi/awb.hpp    | 110 +--\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 src/ipa/raspberrypi/controller/rpi/focus.cpp  |  14 +-\n src/ipa/raspberrypi/controller/rpi/focus.hpp  |   4 +-\n src/ipa/raspberrypi/controller/rpi/geq.cpp    |  48 +-\n src/ipa/raspberrypi/controller/rpi/geq.hpp    |   6 +-\n src/ipa/raspberrypi/controller/rpi/lux.cpp    |  70 +-\n src/ipa/raspberrypi/controller/rpi/lux.hpp    |  22 +-\n src/ipa/raspberrypi/controller/rpi/noise.cpp  |  38 +-\n src/ipa/raspberrypi/controller/rpi/noise.hpp  |  14 +-\n src/ipa/raspberrypi/controller/rpi/sdn.cpp    |  36 +-\n src/ipa/raspberrypi/controller/rpi/sdn.hpp    |  10 +-\n .../raspberrypi/controller/rpi/sharpen.cpp    |  42 +-\n .../raspberrypi/controller/rpi/sharpen.hpp    |  14 +-\n .../controller/sharpen_algorithm.hpp          |   2 +-\n .../raspberrypi/controller/sharpen_status.h   |   2 +-\n src/ipa/raspberrypi/md_parser.hpp             |  44 +-\n src/ipa/raspberrypi/md_parser_smia.cpp        | 108 +--\n src/ipa/raspberrypi/raspberrypi.cpp           | 272 +++----\n 63 files changed, 2099 insertions(+), 2167 deletions(-)",
    "diff": "diff --git a/src/ipa/raspberrypi/cam_helper.cpp b/src/ipa/raspberrypi/cam_helper.cpp\nindex 3f81d4187d4d..45db39506937 100644\n--- a/src/ipa/raspberrypi/cam_helper.cpp\n+++ b/src/ipa/raspberrypi/cam_helper.cpp\n@@ -24,16 +24,16 @@ namespace libcamera {\n LOG_DECLARE_CATEGORY(IPARPI)\n }\n \n-static std::map<std::string, CamHelperCreateFunc> cam_helpers;\n+static std::map<std::string, CamHelperCreateFunc> camHelpers;\n \n-CamHelper *CamHelper::Create(std::string const &cam_name)\n+CamHelper *CamHelper::create(std::string const &camName)\n {\n \t/*\n \t * CamHelpers get registered by static RegisterCamHelper\n \t * initialisers.\n \t */\n-\tfor (auto &p : cam_helpers) {\n-\t\tif (cam_name.find(p.first) != std::string::npos)\n+\tfor (auto &p : camHelpers) {\n+\t\tif (camName.find(p.first) != std::string::npos)\n \t\t\treturn p.second();\n \t}\n \n@@ -50,35 +50,35 @@ CamHelper::~CamHelper()\n {\n }\n \n-void CamHelper::Prepare(Span<const uint8_t> buffer,\n+void CamHelper::prepare(Span<const uint8_t> buffer,\n \t\t\tMetadata &metadata)\n {\n \tparseEmbeddedData(buffer, metadata);\n }\n \n-void CamHelper::Process([[maybe_unused]] StatisticsPtr &stats,\n+void CamHelper::process([[maybe_unused]] StatisticsPtr &stats,\n \t\t\t[[maybe_unused]] Metadata &metadata)\n {\n }\n \n-uint32_t CamHelper::ExposureLines(const Duration exposure) const\n+uint32_t CamHelper::exposureLines(const Duration exposure) const\n {\n \tassert(initialized_);\n-\treturn exposure / mode_.line_length;\n+\treturn exposure / mode_.lineLength;\n }\n \n-Duration CamHelper::Exposure(uint32_t exposure_lines) const\n+Duration CamHelper::exposure(uint32_t exposureLines) const\n {\n \tassert(initialized_);\n-\treturn exposure_lines * mode_.line_length;\n+\treturn exposureLines * mode_.lineLength;\n }\n \n-uint32_t CamHelper::GetVBlanking(Duration &exposure,\n+uint32_t CamHelper::getVBlanking(Duration &exposure,\n \t\t\t\t Duration minFrameDuration,\n \t\t\t\t Duration maxFrameDuration) const\n {\n \tuint32_t frameLengthMin, frameLengthMax, vblank;\n-\tuint32_t exposureLines = ExposureLines(exposure);\n+\tuint32_t exposureLines = CamHelper::exposureLines(exposure);\n \n \tassert(initialized_);\n \n@@ -86,15 +86,15 @@ uint32_t CamHelper::GetVBlanking(Duration &exposure,\n \t * minFrameDuration and maxFrameDuration are clamped by the caller\n \t * based on the limits for the active sensor mode.\n \t */\n-\tframeLengthMin = minFrameDuration / mode_.line_length;\n-\tframeLengthMax = maxFrameDuration / mode_.line_length;\n+\tframeLengthMin = minFrameDuration / mode_.lineLength;\n+\tframeLengthMax = maxFrameDuration / mode_.lineLength;\n \n \t/*\n \t * Limit the exposure to the maximum frame duration requested, and\n \t * re-calculate if it has been clipped.\n \t */\n \texposureLines = std::min(frameLengthMax - frameIntegrationDiff_, exposureLines);\n-\texposure = Exposure(exposureLines);\n+\texposure = CamHelper::exposure(exposureLines);\n \n \t/* Limit the vblank to the range allowed by the frame length limits. */\n \tvblank = std::clamp(exposureLines + frameIntegrationDiff_,\n@@ -102,34 +102,34 @@ uint32_t CamHelper::GetVBlanking(Duration &exposure,\n \treturn vblank;\n }\n \n-void CamHelper::SetCameraMode(const CameraMode &mode)\n+void CamHelper::setCameraMode(const CameraMode &mode)\n {\n \tmode_ = mode;\n \tif (parser_) {\n-\t\tparser_->SetBitsPerPixel(mode.bitdepth);\n-\t\tparser_->SetLineLengthBytes(0); /* We use SetBufferSize. */\n+\t\tparser_->setBitsPerPixel(mode.bitdepth);\n+\t\tparser_->setLineLengthBytes(0); /* We use SetBufferSize. */\n \t}\n \tinitialized_ = true;\n }\n \n-void CamHelper::GetDelays(int &exposure_delay, int &gain_delay,\n-\t\t\t  int &vblank_delay) const\n+void CamHelper::getDelays(int &exposureDelay, int &gainDelay,\n+\t\t\t  int &vblankDelay) const\n {\n \t/*\n \t * These values are correct for many sensors. Other sensors will\n \t * need to over-ride this function.\n \t */\n-\texposure_delay = 2;\n-\tgain_delay = 1;\n-\tvblank_delay = 2;\n+\texposureDelay = 2;\n+\tgainDelay = 1;\n+\tvblankDelay = 2;\n }\n \n-bool CamHelper::SensorEmbeddedDataPresent() const\n+bool CamHelper::sensorEmbeddedDataPresent() const\n {\n \treturn false;\n }\n \n-double CamHelper::GetModeSensitivity([[maybe_unused]] const CameraMode &mode) const\n+double CamHelper::getModeSensitivity([[maybe_unused]] const CameraMode &mode) const\n {\n \t/*\n \t * Most sensors have the same sensitivity in every mode, but this\n@@ -140,7 +140,7 @@ double CamHelper::GetModeSensitivity([[maybe_unused]] const CameraMode &mode) co\n \treturn 1.0;\n }\n \n-unsigned int CamHelper::HideFramesStartup() const\n+unsigned int CamHelper::hideFramesStartup() const\n {\n \t/*\n \t * The number of frames when a camera first starts that shouldn't be\n@@ -149,19 +149,19 @@ unsigned int CamHelper::HideFramesStartup() const\n \treturn 0;\n }\n \n-unsigned int CamHelper::HideFramesModeSwitch() const\n+unsigned int CamHelper::hideFramesModeSwitch() const\n {\n \t/* After a mode switch, many sensors return valid frames immediately. */\n \treturn 0;\n }\n \n-unsigned int CamHelper::MistrustFramesStartup() const\n+unsigned int CamHelper::mistrustFramesStartup() const\n {\n \t/* Many sensors return a single bad frame on start-up. */\n \treturn 1;\n }\n \n-unsigned int CamHelper::MistrustFramesModeSwitch() const\n+unsigned int CamHelper::mistrustFramesModeSwitch() const\n {\n \t/* Many sensors return valid metadata immediately. */\n \treturn 0;\n@@ -176,13 +176,13 @@ void CamHelper::parseEmbeddedData(Span<const uint8_t> buffer,\n \tif (buffer.empty())\n \t\treturn;\n \n-\tif (parser_->Parse(buffer, registers) != MdParser::Status::OK) {\n+\tif (parser_->parse(buffer, registers) != MdParser::Status::OK) {\n \t\tLOG(IPARPI, Error) << \"Embedded data buffer parsing failed\";\n \t\treturn;\n \t}\n \n-\tPopulateMetadata(registers, parsedMetadata);\n-\tmetadata.Merge(parsedMetadata);\n+\tpopulateMetadata(registers, parsedMetadata);\n+\tmetadata.merge(parsedMetadata);\n \n \t/*\n \t * Overwrite the exposure/gain, frame length and sensor temperature values\n@@ -190,30 +190,30 @@ void CamHelper::parseEmbeddedData(Span<const uint8_t> buffer,\n \t * Fetch it first in case any other fields were set meaningfully.\n \t */\n \tDeviceStatus deviceStatus, parsedDeviceStatus;\n-\tif (metadata.Get(\"device.status\", deviceStatus) ||\n-\t    parsedMetadata.Get(\"device.status\", parsedDeviceStatus)) {\n+\tif (metadata.get(\"device.status\", deviceStatus) ||\n+\t    parsedMetadata.get(\"device.status\", parsedDeviceStatus)) {\n \t\tLOG(IPARPI, Error) << \"DeviceStatus not found\";\n \t\treturn;\n \t}\n \n-\tdeviceStatus.shutter_speed = parsedDeviceStatus.shutter_speed;\n-\tdeviceStatus.analogue_gain = parsedDeviceStatus.analogue_gain;\n-\tdeviceStatus.frame_length = parsedDeviceStatus.frame_length;\n-\tif (parsedDeviceStatus.sensor_temperature)\n-\t\tdeviceStatus.sensor_temperature = parsedDeviceStatus.sensor_temperature;\n+\tdeviceStatus.shutterSpeed = parsedDeviceStatus.shutterSpeed;\n+\tdeviceStatus.analogueGain = parsedDeviceStatus.analogueGain;\n+\tdeviceStatus.frameLength = parsedDeviceStatus.frameLength;\n+\tif (parsedDeviceStatus.sensorTemperature)\n+\t\tdeviceStatus.sensorTemperature = parsedDeviceStatus.sensorTemperature;\n \n \tLOG(IPARPI, Debug) << \"Metadata updated - \" << deviceStatus;\n \n-\tmetadata.Set(\"device.status\", deviceStatus);\n+\tmetadata.set(\"device.status\", deviceStatus);\n }\n \n-void CamHelper::PopulateMetadata([[maybe_unused]] const MdParser::RegisterMap &registers,\n+void CamHelper::populateMetadata([[maybe_unused]] const MdParser::RegisterMap &registers,\n \t\t\t\t [[maybe_unused]] Metadata &metadata) const\n {\n }\n \n-RegisterCamHelper::RegisterCamHelper(char const *cam_name,\n-\t\t\t\t     CamHelperCreateFunc create_func)\n+RegisterCamHelper::RegisterCamHelper(char const *camName,\n+\t\t\t\t     CamHelperCreateFunc createFunc)\n {\n-\tcam_helpers[std::string(cam_name)] = create_func;\n+\tcamHelpers[std::string(camName)] = createFunc;\n }\ndiff --git a/src/ipa/raspberrypi/cam_helper.hpp b/src/ipa/raspberrypi/cam_helper.hpp\nindex 300f8f8a2d3b..0cd718c4bc4e 100644\n--- a/src/ipa/raspberrypi/cam_helper.hpp\n+++ b/src/ipa/raspberrypi/cam_helper.hpp\n@@ -69,33 +69,33 @@ namespace RPiController {\n class CamHelper\n {\n public:\n-\tstatic CamHelper *Create(std::string const &cam_name);\n+\tstatic CamHelper *create(std::string const &camName);\n \tCamHelper(std::unique_ptr<MdParser> parser, unsigned int frameIntegrationDiff);\n \tvirtual ~CamHelper();\n-\tvoid SetCameraMode(const CameraMode &mode);\n-\tvirtual void Prepare(libcamera::Span<const uint8_t> buffer,\n+\tvoid setCameraMode(const CameraMode &mode);\n+\tvirtual void prepare(libcamera::Span<const uint8_t> buffer,\n \t\t\t     Metadata &metadata);\n-\tvirtual void Process(StatisticsPtr &stats, Metadata &metadata);\n-\tvirtual uint32_t ExposureLines(libcamera::utils::Duration exposure) const;\n-\tvirtual libcamera::utils::Duration Exposure(uint32_t exposure_lines) const;\n-\tvirtual uint32_t GetVBlanking(libcamera::utils::Duration &exposure,\n+\tvirtual void process(StatisticsPtr &stats, Metadata &metadata);\n+\tvirtual uint32_t exposureLines(libcamera::utils::Duration exposure) const;\n+\tvirtual libcamera::utils::Duration exposure(uint32_t exposureLines) const;\n+\tvirtual uint32_t getVBlanking(libcamera::utils::Duration &exposure,\n \t\t\t\t      libcamera::utils::Duration minFrameDuration,\n \t\t\t\t      libcamera::utils::Duration maxFrameDuration) const;\n-\tvirtual uint32_t GainCode(double gain) const = 0;\n-\tvirtual double Gain(uint32_t gain_code) const = 0;\n-\tvirtual void GetDelays(int &exposure_delay, int &gain_delay,\n-\t\t\t       int &vblank_delay) const;\n-\tvirtual bool SensorEmbeddedDataPresent() const;\n-\tvirtual double GetModeSensitivity(const CameraMode &mode) const;\n-\tvirtual unsigned int HideFramesStartup() const;\n-\tvirtual unsigned int HideFramesModeSwitch() const;\n-\tvirtual unsigned int MistrustFramesStartup() const;\n-\tvirtual unsigned int MistrustFramesModeSwitch() const;\n+\tvirtual uint32_t gainCode(double gain) const = 0;\n+\tvirtual double gain(uint32_t gainCode) const = 0;\n+\tvirtual void getDelays(int &exposureDelay, int &gainDelay,\n+\t\t\t       int &vblankDelay) const;\n+\tvirtual bool sensorEmbeddedDataPresent() const;\n+\tvirtual double getModeSensitivity(const CameraMode &mode) const;\n+\tvirtual unsigned int hideFramesStartup() const;\n+\tvirtual unsigned int hideFramesModeSwitch() const;\n+\tvirtual unsigned int mistrustFramesStartup() const;\n+\tvirtual unsigned int mistrustFramesModeSwitch() const;\n \n protected:\n \tvoid parseEmbeddedData(libcamera::Span<const uint8_t> buffer,\n \t\t\t       Metadata &metadata);\n-\tvirtual void PopulateMetadata(const MdParser::RegisterMap &registers,\n+\tvirtual void populateMetadata(const MdParser::RegisterMap &registers,\n \t\t\t\t      Metadata &metadata) const;\n \n \tstd::unique_ptr<MdParser> parser_;\n@@ -116,8 +116,8 @@ private:\n typedef CamHelper *(*CamHelperCreateFunc)();\n struct RegisterCamHelper\n {\n-\tRegisterCamHelper(char const *cam_name,\n-\t\t\t  CamHelperCreateFunc create_func);\n+\tRegisterCamHelper(char const *camName,\n+\t\t\t  CamHelperCreateFunc createFunc);\n };\n \n } // namespace RPi\ndiff --git a/src/ipa/raspberrypi/cam_helper_imx219.cpp b/src/ipa/raspberrypi/cam_helper_imx219.cpp\nindex a3caab714602..17c35143923a 100644\n--- a/src/ipa/raspberrypi/cam_helper_imx219.cpp\n+++ b/src/ipa/raspberrypi/cam_helper_imx219.cpp\n@@ -39,10 +39,10 @@ class CamHelperImx219 : public CamHelper\n {\n public:\n \tCamHelperImx219();\n-\tuint32_t GainCode(double gain) const override;\n-\tdouble Gain(uint32_t gain_code) const override;\n-\tunsigned int MistrustFramesModeSwitch() const override;\n-\tbool SensorEmbeddedDataPresent() const override;\n+\tuint32_t gainCode(double gain) const override;\n+\tdouble gain(uint32_t gainCode) const override;\n+\tunsigned int mistrustFramesModeSwitch() const override;\n+\tbool sensorEmbeddedDataPresent() const override;\n \n private:\n \t/*\n@@ -51,7 +51,7 @@ private:\n \t */\n \tstatic constexpr int frameIntegrationDiff = 4;\n \n-\tvoid PopulateMetadata(const MdParser::RegisterMap &registers,\n+\tvoid populateMetadata(const MdParser::RegisterMap &registers,\n \t\t\t      Metadata &metadata) const override;\n };\n \n@@ -64,17 +64,17 @@ CamHelperImx219::CamHelperImx219()\n {\n }\n \n-uint32_t CamHelperImx219::GainCode(double gain) const\n+uint32_t CamHelperImx219::gainCode(double gain) const\n {\n \treturn (uint32_t)(256 - 256 / gain);\n }\n \n-double CamHelperImx219::Gain(uint32_t gain_code) const\n+double CamHelperImx219::gain(uint32_t gainCode) const\n {\n-\treturn 256.0 / (256 - gain_code);\n+\treturn 256.0 / (256 - gainCode);\n }\n \n-unsigned int CamHelperImx219::MistrustFramesModeSwitch() const\n+unsigned int CamHelperImx219::mistrustFramesModeSwitch() const\n {\n \t/*\n \t * For reasons unknown, we do occasionally get a bogus metadata frame\n@@ -84,26 +84,26 @@ unsigned int CamHelperImx219::MistrustFramesModeSwitch() const\n \treturn 1;\n }\n \n-bool CamHelperImx219::SensorEmbeddedDataPresent() const\n+bool CamHelperImx219::sensorEmbeddedDataPresent() const\n {\n \treturn ENABLE_EMBEDDED_DATA;\n }\n \n-void CamHelperImx219::PopulateMetadata(const MdParser::RegisterMap &registers,\n+void CamHelperImx219::populateMetadata(const MdParser::RegisterMap &registers,\n \t\t\t\t       Metadata &metadata) const\n {\n \tDeviceStatus deviceStatus;\n \n-\tdeviceStatus.shutter_speed = Exposure(registers.at(expHiReg) * 256 + registers.at(expLoReg));\n-\tdeviceStatus.analogue_gain = Gain(registers.at(gainReg));\n-\tdeviceStatus.frame_length = registers.at(frameLengthHiReg) * 256 + registers.at(frameLengthLoReg);\n+\tdeviceStatus.shutterSpeed = exposure(registers.at(expHiReg) * 256 + registers.at(expLoReg));\n+\tdeviceStatus.analogueGain = gain(registers.at(gainReg));\n+\tdeviceStatus.frameLength = registers.at(frameLengthHiReg) * 256 + registers.at(frameLengthLoReg);\n \n-\tmetadata.Set(\"device.status\", deviceStatus);\n+\tmetadata.set(\"device.status\", deviceStatus);\n }\n \n-static CamHelper *Create()\n+static CamHelper *create()\n {\n \treturn new CamHelperImx219();\n }\n \n-static RegisterCamHelper reg(\"imx219\", &Create);\n+static RegisterCamHelper reg(\"imx219\", &create);\ndiff --git a/src/ipa/raspberrypi/cam_helper_imx290.cpp b/src/ipa/raspberrypi/cam_helper_imx290.cpp\nindex 871c1f8eaec4..0d9a94d8d3f6 100644\n--- a/src/ipa/raspberrypi/cam_helper_imx290.cpp\n+++ b/src/ipa/raspberrypi/cam_helper_imx290.cpp\n@@ -15,11 +15,11 @@ class CamHelperImx290 : public CamHelper\n {\n public:\n \tCamHelperImx290();\n-\tuint32_t GainCode(double gain) const override;\n-\tdouble Gain(uint32_t gain_code) const override;\n-\tvoid GetDelays(int &exposure_delay, int &gain_delay,\n-\t\t       int &vblank_delay) const override;\n-\tunsigned int HideFramesModeSwitch() const override;\n+\tuint32_t gainCode(double gain) const override;\n+\tdouble gain(uint32_t gainCode) const override;\n+\tvoid getDelays(int &exposureDelay, int &gainDelay,\n+\t\t       int &vblankDelay) const override;\n+\tunsigned int hideFramesModeSwitch() const override;\n \n private:\n \t/*\n@@ -34,34 +34,34 @@ CamHelperImx290::CamHelperImx290()\n {\n }\n \n-uint32_t CamHelperImx290::GainCode(double gain) const\n+uint32_t CamHelperImx290::gainCode(double gain) const\n {\n \tint code = 66.6667 * log10(gain);\n \treturn std::max(0, std::min(code, 0xf0));\n }\n \n-double CamHelperImx290::Gain(uint32_t gain_code) const\n+double CamHelperImx290::gain(uint32_t gainCode) const\n {\n-\treturn pow(10, 0.015 * gain_code);\n+\treturn pow(10, 0.015 * gainCode);\n }\n \n-void CamHelperImx290::GetDelays(int &exposure_delay, int &gain_delay,\n-\t\t\t\tint &vblank_delay) const\n+void CamHelperImx290::getDelays(int &exposureDelay, int &gainDelay,\n+\t\t\t\tint &vblankDelay) const\n {\n-\texposure_delay = 2;\n-\tgain_delay = 2;\n-\tvblank_delay = 2;\n+\texposureDelay = 2;\n+\tgainDelay = 2;\n+\tvblankDelay = 2;\n }\n \n-unsigned int CamHelperImx290::HideFramesModeSwitch() const\n+unsigned int CamHelperImx290::hideFramesModeSwitch() const\n {\n \t/* After a mode switch, we seem to get 1 bad frame. */\n \treturn 1;\n }\n \n-static CamHelper *Create()\n+static CamHelper *create()\n {\n \treturn new CamHelperImx290();\n }\n \n-static RegisterCamHelper reg(\"imx290\", &Create);\n+static RegisterCamHelper reg(\"imx290\", &create);\ndiff --git a/src/ipa/raspberrypi/cam_helper_imx296.cpp b/src/ipa/raspberrypi/cam_helper_imx296.cpp\nindex a1a771cb96d5..15674335fa75 100644\n--- a/src/ipa/raspberrypi/cam_helper_imx296.cpp\n+++ b/src/ipa/raspberrypi/cam_helper_imx296.cpp\n@@ -19,10 +19,10 @@ class CamHelperImx296 : public CamHelper\n {\n public:\n \tCamHelperImx296();\n-\tuint32_t GainCode(double gain) const override;\n-\tdouble Gain(uint32_t gain_code) const override;\n-\tuint32_t ExposureLines(Duration exposure) const override;\n-\tDuration Exposure(uint32_t exposure_lines) const override;\n+\tuint32_t gainCode(double gain) const override;\n+\tdouble gain(uint32_t gainCode) const override;\n+\tuint32_t exposureLines(Duration exposure) const override;\n+\tDuration exposure(uint32_t exposureLines) const override;\n \n private:\n \tstatic constexpr uint32_t maxGainCode = 239;\n@@ -40,30 +40,30 @@ CamHelperImx296::CamHelperImx296()\n {\n }\n \n-uint32_t CamHelperImx296::GainCode(double gain) const\n+uint32_t CamHelperImx296::gainCode(double gain) const\n {\n \tuint32_t code = 20 * std::log10(gain) * 10;\n \treturn std::min(code, maxGainCode);\n }\n \n-double CamHelperImx296::Gain(uint32_t gain_code) const\n+double CamHelperImx296::gain(uint32_t gainCode) const\n {\n-\treturn std::pow(10.0, gain_code / 200.0);\n+\treturn std::pow(10.0, gainCode / 200.0);\n }\n \n-uint32_t CamHelperImx296::ExposureLines(Duration exposure) const\n+uint32_t CamHelperImx296::exposureLines(Duration exposure) const\n {\n \treturn (exposure - 14.26us) / timePerLine;\n }\n \n-Duration CamHelperImx296::Exposure(uint32_t exposure_lines) const\n+Duration CamHelperImx296::exposure(uint32_t exposureLines) const\n {\n-\treturn exposure_lines * timePerLine + 14.26us;\n+\treturn exposureLines * timePerLine + 14.26us;\n }\n \n-static CamHelper *Create()\n+static CamHelper *create()\n {\n \treturn new CamHelperImx296();\n }\n \n-static RegisterCamHelper reg(\"imx296\", &Create);\n+static RegisterCamHelper reg(\"imx296\", &create);\ndiff --git a/src/ipa/raspberrypi/cam_helper_imx477.cpp b/src/ipa/raspberrypi/cam_helper_imx477.cpp\nindex 0e1c0dbd142f..0767a5e1dcc5 100644\n--- a/src/ipa/raspberrypi/cam_helper_imx477.cpp\n+++ b/src/ipa/raspberrypi/cam_helper_imx477.cpp\n@@ -43,14 +43,14 @@ class CamHelperImx477 : public CamHelper\n {\n public:\n \tCamHelperImx477();\n-\tuint32_t GainCode(double gain) const override;\n-\tdouble Gain(uint32_t gain_code) const override;\n-\tvoid Prepare(libcamera::Span<const uint8_t> buffer, Metadata &metadata) override;\n-\tuint32_t GetVBlanking(Duration &exposure, Duration minFrameDuration,\n+\tuint32_t gainCode(double gain) const override;\n+\tdouble gain(uint32_t gainCode) const override;\n+\tvoid prepare(libcamera::Span<const uint8_t> buffer, Metadata &metadata) override;\n+\tuint32_t getVBlanking(Duration &exposure, Duration minFrameDuration,\n \t\t\t      Duration maxFrameDuration) const override;\n-\tvoid GetDelays(int &exposure_delay, int &gain_delay,\n-\t\t       int &vblank_delay) const override;\n-\tbool SensorEmbeddedDataPresent() const override;\n+\tvoid getDelays(int &exposureDelay, int &gainDelay,\n+\t\t       int &vblankDelay) const override;\n+\tbool sensorEmbeddedDataPresent() const override;\n \n private:\n \t/*\n@@ -63,7 +63,7 @@ private:\n \t/* Largest long exposure scale factor given as a left shift on the frame length. */\n \tstatic constexpr int longExposureShiftMax = 7;\n \n-\tvoid PopulateMetadata(const MdParser::RegisterMap &registers,\n+\tvoid populateMetadata(const MdParser::RegisterMap &registers,\n \t\t\t      Metadata &metadata) const override;\n };\n \n@@ -72,22 +72,22 @@ CamHelperImx477::CamHelperImx477()\n {\n }\n \n-uint32_t CamHelperImx477::GainCode(double gain) const\n+uint32_t CamHelperImx477::gainCode(double gain) const\n {\n \treturn static_cast<uint32_t>(1024 - 1024 / gain);\n }\n \n-double CamHelperImx477::Gain(uint32_t gain_code) const\n+double CamHelperImx477::gain(uint32_t gainCode) const\n {\n-\treturn 1024.0 / (1024 - gain_code);\n+\treturn 1024.0 / (1024 - gainCode);\n }\n \n-void CamHelperImx477::Prepare(libcamera::Span<const uint8_t> buffer, Metadata &metadata)\n+void CamHelperImx477::prepare(libcamera::Span<const uint8_t> buffer, Metadata &metadata)\n {\n \tMdParser::RegisterMap registers;\n \tDeviceStatus deviceStatus;\n \n-\tif (metadata.Get(\"device.status\", deviceStatus)) {\n+\tif (metadata.get(\"device.status\", deviceStatus)) {\n \t\tLOG(IPARPI, Error) << \"DeviceStatus not found from DelayedControls\";\n \t\treturn;\n \t}\n@@ -105,27 +105,27 @@ void CamHelperImx477::Prepare(libcamera::Span<const uint8_t> buffer, Metadata &m\n \t * Otherwise, all values are updated with what is reported in the\n \t * embedded data.\n \t */\n-\tif (deviceStatus.frame_length > frameLengthMax) {\n+\tif (deviceStatus.frameLength > frameLengthMax) {\n \t\tDeviceStatus parsedDeviceStatus;\n \n-\t\tmetadata.Get(\"device.status\", parsedDeviceStatus);\n-\t\tparsedDeviceStatus.shutter_speed = deviceStatus.shutter_speed;\n-\t\tparsedDeviceStatus.frame_length = deviceStatus.frame_length;\n-\t\tmetadata.Set(\"device.status\", parsedDeviceStatus);\n+\t\tmetadata.get(\"device.status\", parsedDeviceStatus);\n+\t\tparsedDeviceStatus.shutterSpeed = deviceStatus.shutterSpeed;\n+\t\tparsedDeviceStatus.frameLength = deviceStatus.frameLength;\n+\t\tmetadata.set(\"device.status\", parsedDeviceStatus);\n \n \t\tLOG(IPARPI, Debug) << \"Metadata updated for long exposure: \"\n \t\t\t\t   << parsedDeviceStatus;\n \t}\n }\n \n-uint32_t CamHelperImx477::GetVBlanking(Duration &exposure,\n+uint32_t CamHelperImx477::getVBlanking(Duration &exposure,\n \t\t\t\t       Duration minFrameDuration,\n \t\t\t\t       Duration maxFrameDuration) const\n {\n \tuint32_t frameLength, exposureLines;\n \tunsigned int shift = 0;\n \n-\tframeLength = mode_.height + CamHelper::GetVBlanking(exposure, minFrameDuration,\n+\tframeLength = mode_.height + CamHelper::getVBlanking(exposure, minFrameDuration,\n \t\t\t\t\t\t\t     maxFrameDuration);\n \t/*\n \t * Check if the frame length calculated needs to be setup for long\n@@ -144,43 +144,43 @@ uint32_t CamHelperImx477::GetVBlanking(Duration &exposure,\n \tif (shift) {\n \t\t/* Account for any rounding in the scaled frame length value. */\n \t\tframeLength <<= shift;\n-\t\texposureLines = ExposureLines(exposure);\n+\t\texposureLines = CamHelperImx477::exposureLines(exposure);\n \t\texposureLines = std::min(exposureLines, frameLength - frameIntegrationDiff);\n-\t\texposure = Exposure(exposureLines);\n+\t\texposure = CamHelperImx477::exposure(exposureLines);\n \t}\n \n \treturn frameLength - mode_.height;\n }\n \n-void CamHelperImx477::GetDelays(int &exposure_delay, int &gain_delay,\n-\t\t\t\tint &vblank_delay) const\n+void CamHelperImx477::getDelays(int &exposureDelay, int &gainDelay,\n+\t\t\t\tint &vblankDelay) const\n {\n-\texposure_delay = 2;\n-\tgain_delay = 2;\n-\tvblank_delay = 3;\n+\texposureDelay = 2;\n+\tgainDelay = 2;\n+\tvblankDelay = 3;\n }\n \n-bool CamHelperImx477::SensorEmbeddedDataPresent() const\n+bool CamHelperImx477::sensorEmbeddedDataPresent() const\n {\n \treturn true;\n }\n \n-void CamHelperImx477::PopulateMetadata(const MdParser::RegisterMap &registers,\n+void CamHelperImx477::populateMetadata(const MdParser::RegisterMap &registers,\n \t\t\t\t       Metadata &metadata) const\n {\n \tDeviceStatus deviceStatus;\n \n-\tdeviceStatus.shutter_speed = Exposure(registers.at(expHiReg) * 256 + registers.at(expLoReg));\n-\tdeviceStatus.analogue_gain = Gain(registers.at(gainHiReg) * 256 + registers.at(gainLoReg));\n-\tdeviceStatus.frame_length = registers.at(frameLengthHiReg) * 256 + registers.at(frameLengthLoReg);\n-\tdeviceStatus.sensor_temperature = std::clamp<int8_t>(registers.at(temperatureReg), -20, 80);\n+\tdeviceStatus.shutterSpeed = exposure(registers.at(expHiReg) * 256 + registers.at(expLoReg));\n+\tdeviceStatus.analogueGain = gain(registers.at(gainHiReg) * 256 + registers.at(gainLoReg));\n+\tdeviceStatus.frameLength = registers.at(frameLengthHiReg) * 256 + registers.at(frameLengthLoReg);\n+\tdeviceStatus.sensorTemperature = std::clamp<int8_t>(registers.at(temperatureReg), -20, 80);\n \n-\tmetadata.Set(\"device.status\", deviceStatus);\n+\tmetadata.set(\"device.status\", deviceStatus);\n }\n \n-static CamHelper *Create()\n+static CamHelper *create()\n {\n \treturn new CamHelperImx477();\n }\n \n-static RegisterCamHelper reg(\"imx477\", &Create);\n+static RegisterCamHelper reg(\"imx477\", &create);\ndiff --git a/src/ipa/raspberrypi/cam_helper_imx519.cpp b/src/ipa/raspberrypi/cam_helper_imx519.cpp\nindex eaf24982b37f..1752760e64a2 100644\n--- a/src/ipa/raspberrypi/cam_helper_imx519.cpp\n+++ b/src/ipa/raspberrypi/cam_helper_imx519.cpp\n@@ -43,14 +43,14 @@ class CamHelperImx519 : public CamHelper\n {\n public:\n \tCamHelperImx519();\n-\tuint32_t GainCode(double gain) const override;\n-\tdouble Gain(uint32_t gain_code) const override;\n-\tvoid Prepare(libcamera::Span<const uint8_t> buffer, Metadata &metadata) override;\n-\tuint32_t GetVBlanking(Duration &exposure, Duration minFrameDuration,\n+\tuint32_t gainCode(double gain) const override;\n+\tdouble gain(uint32_t gainCode) const override;\n+\tvoid prepare(libcamera::Span<const uint8_t> buffer, Metadata &metadata) override;\n+\tuint32_t getVBlanking(Duration &exposure, Duration minFrameDuration,\n \t\t\t      Duration maxFrameDuration) const override;\n-\tvoid GetDelays(int &exposure_delay, int &gain_delay,\n-\t\t       int &vblank_delay) const override;\n-\tbool SensorEmbeddedDataPresent() const override;\n+\tvoid getDelays(int &exposureDelay, int &gainDelay,\n+\t\t       int &vblankDelay) const override;\n+\tbool sensorEmbeddedDataPresent() const override;\n \n private:\n \t/*\n@@ -63,7 +63,7 @@ private:\n \t/* Largest long exposure scale factor given as a left shift on the frame length. */\n \tstatic constexpr int longExposureShiftMax = 7;\n \n-\tvoid PopulateMetadata(const MdParser::RegisterMap &registers,\n+\tvoid populateMetadata(const MdParser::RegisterMap &registers,\n \t\t\t      Metadata &metadata) const override;\n };\n \n@@ -72,22 +72,22 @@ CamHelperImx519::CamHelperImx519()\n {\n }\n \n-uint32_t CamHelperImx519::GainCode(double gain) const\n+uint32_t CamHelperImx519::gainCode(double gain) const\n {\n \treturn static_cast<uint32_t>(1024 - 1024 / gain);\n }\n \n-double CamHelperImx519::Gain(uint32_t gain_code) const\n+double CamHelperImx519::gain(uint32_t gainCode) const\n {\n-\treturn 1024.0 / (1024 - gain_code);\n+\treturn 1024.0 / (1024 - gainCode);\n }\n \n-void CamHelperImx519::Prepare(libcamera::Span<const uint8_t> buffer, Metadata &metadata)\n+void CamHelperImx519::prepare(libcamera::Span<const uint8_t> buffer, Metadata &metadata)\n {\n \tMdParser::RegisterMap registers;\n \tDeviceStatus deviceStatus;\n \n-\tif (metadata.Get(\"device.status\", deviceStatus)) {\n+\tif (metadata.get(\"device.status\", deviceStatus)) {\n \t\tLOG(IPARPI, Error) << \"DeviceStatus not found from DelayedControls\";\n \t\treturn;\n \t}\n@@ -105,27 +105,27 @@ void CamHelperImx519::Prepare(libcamera::Span<const uint8_t> buffer, Metadata &m\n \t * Otherwise, all values are updated with what is reported in the\n \t * embedded data.\n \t */\n-\tif (deviceStatus.frame_length > frameLengthMax) {\n+\tif (deviceStatus.frameLength > frameLengthMax) {\n \t\tDeviceStatus parsedDeviceStatus;\n \n-\t\tmetadata.Get(\"device.status\", parsedDeviceStatus);\n-\t\tparsedDeviceStatus.shutter_speed = deviceStatus.shutter_speed;\n-\t\tparsedDeviceStatus.frame_length = deviceStatus.frame_length;\n-\t\tmetadata.Set(\"device.status\", parsedDeviceStatus);\n+\t\tmetadata.get(\"device.status\", parsedDeviceStatus);\n+\t\tparsedDeviceStatus.shutterSpeed = deviceStatus.shutterSpeed;\n+\t\tparsedDeviceStatus.frameLength = deviceStatus.frameLength;\n+\t\tmetadata.set(\"device.status\", parsedDeviceStatus);\n \n \t\tLOG(IPARPI, Debug) << \"Metadata updated for long exposure: \"\n \t\t\t\t   << parsedDeviceStatus;\n \t}\n }\n \n-uint32_t CamHelperImx519::GetVBlanking(Duration &exposure,\n+uint32_t CamHelperImx519::getVBlanking(Duration &exposure,\n \t\t\t\t       Duration minFrameDuration,\n \t\t\t\t       Duration maxFrameDuration) const\n {\n \tuint32_t frameLength, exposureLines;\n \tunsigned int shift = 0;\n \n-\tframeLength = mode_.height + CamHelper::GetVBlanking(exposure, minFrameDuration,\n+\tframeLength = mode_.height + CamHelper::getVBlanking(exposure, minFrameDuration,\n \t\t\t\t\t\t\t     maxFrameDuration);\n \t/*\n \t * Check if the frame length calculated needs to be setup for long\n@@ -144,42 +144,42 @@ uint32_t CamHelperImx519::GetVBlanking(Duration &exposure,\n \tif (shift) {\n \t\t/* Account for any rounding in the scaled frame length value. */\n \t\tframeLength <<= shift;\n-\t\texposureLines = ExposureLines(exposure);\n+\t\texposureLines = CamHelperImx519::exposureLines(exposure);\n \t\texposureLines = std::min(exposureLines, frameLength - frameIntegrationDiff);\n-\t\texposure = Exposure(exposureLines);\n+\t\texposure = CamHelperImx519::exposure(exposureLines);\n \t}\n \n \treturn frameLength - mode_.height;\n }\n \n-void CamHelperImx519::GetDelays(int &exposure_delay, int &gain_delay,\n-\t\t\t\tint &vblank_delay) const\n+void CamHelperImx519::getDelays(int &exposureDelay, int &gainDelay,\n+\t\t\t\tint &vblankDelay) const\n {\n-\texposure_delay = 2;\n-\tgain_delay = 2;\n-\tvblank_delay = 3;\n+\texposureDelay = 2;\n+\tgainDelay = 2;\n+\tvblankDelay = 3;\n }\n \n-bool CamHelperImx519::SensorEmbeddedDataPresent() const\n+bool CamHelperImx519::sensorEmbeddedDataPresent() const\n {\n \treturn true;\n }\n \n-void CamHelperImx519::PopulateMetadata(const MdParser::RegisterMap &registers,\n+void CamHelperImx519::populateMetadata(const MdParser::RegisterMap &registers,\n \t\t\t\t       Metadata &metadata) const\n {\n \tDeviceStatus deviceStatus;\n \n-\tdeviceStatus.shutter_speed = Exposure(registers.at(expHiReg) * 256 + registers.at(expLoReg));\n-\tdeviceStatus.analogue_gain = Gain(registers.at(gainHiReg) * 256 + registers.at(gainLoReg));\n-\tdeviceStatus.frame_length = registers.at(frameLengthHiReg) * 256 + registers.at(frameLengthLoReg);\n+\tdeviceStatus.shutterSpeed = exposure(registers.at(expHiReg) * 256 + registers.at(expLoReg));\n+\tdeviceStatus.analogueGain = gain(registers.at(gainHiReg) * 256 + registers.at(gainLoReg));\n+\tdeviceStatus.frameLength = registers.at(frameLengthHiReg) * 256 + registers.at(frameLengthLoReg);\n \n-\tmetadata.Set(\"device.status\", deviceStatus);\n+\tmetadata.set(\"device.status\", deviceStatus);\n }\n \n-static CamHelper *Create()\n+static CamHelper *create()\n {\n \treturn new CamHelperImx519();\n }\n \n-static RegisterCamHelper reg(\"imx519\", &Create);\n+static RegisterCamHelper reg(\"imx519\", &create);\ndiff --git a/src/ipa/raspberrypi/cam_helper_ov5647.cpp b/src/ipa/raspberrypi/cam_helper_ov5647.cpp\nindex 702c2d07f73a..9dc3fc44e5e8 100644\n--- a/src/ipa/raspberrypi/cam_helper_ov5647.cpp\n+++ b/src/ipa/raspberrypi/cam_helper_ov5647.cpp\n@@ -15,14 +15,14 @@ class CamHelperOv5647 : public CamHelper\n {\n public:\n \tCamHelperOv5647();\n-\tuint32_t GainCode(double gain) const override;\n-\tdouble Gain(uint32_t gain_code) const override;\n-\tvoid GetDelays(int &exposure_delay, int &gain_delay,\n-\t\t       int &vblank_delay) const override;\n-\tunsigned int HideFramesStartup() const override;\n-\tunsigned int HideFramesModeSwitch() const override;\n-\tunsigned int MistrustFramesStartup() const override;\n-\tunsigned int MistrustFramesModeSwitch() const override;\n+\tuint32_t gainCode(double gain) const override;\n+\tdouble gain(uint32_t gainCode) const override;\n+\tvoid getDelays(int &exposureDelay, int &gainDelay,\n+\t\t       int &vblankDelay) const override;\n+\tunsigned int hideFramesStartup() const override;\n+\tunsigned int hideFramesModeSwitch() const override;\n+\tunsigned int mistrustFramesStartup() const override;\n+\tunsigned int mistrustFramesModeSwitch() const override;\n \n private:\n \t/*\n@@ -42,29 +42,29 @@ CamHelperOv5647::CamHelperOv5647()\n {\n }\n \n-uint32_t CamHelperOv5647::GainCode(double gain) const\n+uint32_t CamHelperOv5647::gainCode(double gain) const\n {\n \treturn static_cast<uint32_t>(gain * 16.0);\n }\n \n-double CamHelperOv5647::Gain(uint32_t gain_code) const\n+double CamHelperOv5647::gain(uint32_t gainCode) const\n {\n-\treturn static_cast<double>(gain_code) / 16.0;\n+\treturn static_cast<double>(gainCode) / 16.0;\n }\n \n-void CamHelperOv5647::GetDelays(int &exposure_delay, int &gain_delay,\n-\t\t\t\tint &vblank_delay) const\n+void CamHelperOv5647::getDelays(int &exposureDelay, int &gainDelay,\n+\t\t\t\tint &vblankDelay) const\n {\n \t/*\n \t * We run this sensor in a mode where the gain delay is bumped up to\n \t * 2. It seems to be the only way to make the delays \"predictable\".\n \t */\n-\texposure_delay = 2;\n-\tgain_delay = 2;\n-\tvblank_delay = 2;\n+\texposureDelay = 2;\n+\tgainDelay = 2;\n+\tvblankDelay = 2;\n }\n \n-unsigned int CamHelperOv5647::HideFramesStartup() const\n+unsigned int CamHelperOv5647::hideFramesStartup() const\n {\n \t/*\n \t * On startup, we get a couple of under-exposed frames which\n@@ -73,7 +73,7 @@ unsigned int CamHelperOv5647::HideFramesStartup() const\n \treturn 2;\n }\n \n-unsigned int CamHelperOv5647::HideFramesModeSwitch() const\n+unsigned int CamHelperOv5647::hideFramesModeSwitch() const\n {\n \t/*\n \t * After a mode switch, we get a couple of under-exposed frames which\n@@ -82,7 +82,7 @@ unsigned int CamHelperOv5647::HideFramesModeSwitch() const\n \treturn 2;\n }\n \n-unsigned int CamHelperOv5647::MistrustFramesStartup() const\n+unsigned int CamHelperOv5647::mistrustFramesStartup() const\n {\n \t/*\n \t * First couple of frames are under-exposed and are no good for control\n@@ -91,7 +91,7 @@ unsigned int CamHelperOv5647::MistrustFramesStartup() const\n \treturn 2;\n }\n \n-unsigned int CamHelperOv5647::MistrustFramesModeSwitch() const\n+unsigned int CamHelperOv5647::mistrustFramesModeSwitch() const\n {\n \t/*\n \t * First couple of frames are under-exposed even after a simple\n@@ -100,9 +100,9 @@ unsigned int CamHelperOv5647::MistrustFramesModeSwitch() const\n \treturn 2;\n }\n \n-static CamHelper *Create()\n+static CamHelper *create()\n {\n \treturn new CamHelperOv5647();\n }\n \n-static RegisterCamHelper reg(\"ov5647\", &Create);\n+static RegisterCamHelper reg(\"ov5647\", &create);\ndiff --git a/src/ipa/raspberrypi/cam_helper_ov9281.cpp b/src/ipa/raspberrypi/cam_helper_ov9281.cpp\nindex 9de868c31dc0..130450afefc7 100644\n--- a/src/ipa/raspberrypi/cam_helper_ov9281.cpp\n+++ b/src/ipa/raspberrypi/cam_helper_ov9281.cpp\n@@ -15,10 +15,10 @@ class CamHelperOv9281 : public CamHelper\n {\n public:\n \tCamHelperOv9281();\n-\tuint32_t GainCode(double gain) const override;\n-\tdouble Gain(uint32_t gain_code) const override;\n-\tvoid GetDelays(int &exposure_delay, int &gain_delay,\n-\t\t       int &vblank_delay) const override;\n+\tuint32_t gainCode(double gain) const override;\n+\tdouble gain(uint32_t gainCode) const override;\n+\tvoid getDelays(int &exposureDelay, int &gainDelay,\n+\t\t       int &vblankDelay) const override;\n \n private:\n \t/*\n@@ -38,28 +38,28 @@ CamHelperOv9281::CamHelperOv9281()\n {\n }\n \n-uint32_t CamHelperOv9281::GainCode(double gain) const\n+uint32_t CamHelperOv9281::gainCode(double gain) const\n {\n \treturn static_cast<uint32_t>(gain * 16.0);\n }\n \n-double CamHelperOv9281::Gain(uint32_t gain_code) const\n+double CamHelperOv9281::gain(uint32_t gainCode) const\n {\n-\treturn static_cast<double>(gain_code) / 16.0;\n+\treturn static_cast<double>(gainCode) / 16.0;\n }\n \n-void CamHelperOv9281::GetDelays(int &exposure_delay, int &gain_delay,\n-\t\t\t\tint &vblank_delay) const\n+void CamHelperOv9281::getDelays(int &exposureDelay, int &gainDelay,\n+\t\t\t\tint &vblankDelay) const\n {\n \t/* The driver appears to behave as follows: */\n-\texposure_delay = 2;\n-\tgain_delay = 2;\n-\tvblank_delay = 2;\n+\texposureDelay = 2;\n+\tgainDelay = 2;\n+\tvblankDelay = 2;\n }\n \n-static CamHelper *Create()\n+static CamHelper *create()\n {\n \treturn new CamHelperOv9281();\n }\n \n-static RegisterCamHelper reg(\"ov9281\", &Create);\n+static RegisterCamHelper reg(\"ov9281\", &create);\ndiff --git a/src/ipa/raspberrypi/controller/agc_algorithm.hpp b/src/ipa/raspberrypi/controller/agc_algorithm.hpp\nindex 61595ea2b006..51900b687778 100644\n--- a/src/ipa/raspberrypi/controller/agc_algorithm.hpp\n+++ b/src/ipa/raspberrypi/controller/agc_algorithm.hpp\n@@ -17,16 +17,15 @@ class AgcAlgorithm : public Algorithm\n public:\n \tAgcAlgorithm(Controller *controller) : Algorithm(controller) {}\n \t// An AGC algorithm must provide the following:\n-\tvirtual unsigned int GetConvergenceFrames() const = 0;\n-\tvirtual void SetEv(double ev) = 0;\n-\tvirtual void SetFlickerPeriod(libcamera::utils::Duration flicker_period) = 0;\n-\tvirtual void SetFixedShutter(libcamera::utils::Duration fixed_shutter) = 0;\n-\tvirtual void SetMaxShutter(libcamera::utils::Duration max_shutter) = 0;\n-\tvirtual void SetFixedAnalogueGain(double fixed_analogue_gain) = 0;\n-\tvirtual void SetMeteringMode(std::string const &metering_mode_name) = 0;\n-\tvirtual void SetExposureMode(std::string const &exposure_mode_name) = 0;\n-\tvirtual void\n-\tSetConstraintMode(std::string const &contraint_mode_name) = 0;\n+\tvirtual unsigned int getConvergenceFrames() const = 0;\n+\tvirtual void setEv(double ev) = 0;\n+\tvirtual void setFlickerPeriod(libcamera::utils::Duration flickerPeriod) = 0;\n+\tvirtual void setFixedShutter(libcamera::utils::Duration fixedShutter) = 0;\n+\tvirtual void setMaxShutter(libcamera::utils::Duration maxShutter) = 0;\n+\tvirtual void setFixedAnalogueGain(double fixedAnalogueGain) = 0;\n+\tvirtual void setMeteringMode(std::string const &meteringModeName) = 0;\n+\tvirtual void setExposureMode(std::string const &exposureModeName) = 0;\n+\tvirtual void setConstraintMode(std::string const &contraintModeName) = 0;\n };\n \n } // namespace RPiController\ndiff --git a/src/ipa/raspberrypi/controller/agc_status.h b/src/ipa/raspberrypi/controller/agc_status.h\nindex 20cb1b624b33..d36b40d841db 100644\n--- a/src/ipa/raspberrypi/controller/agc_status.h\n+++ b/src/ipa/raspberrypi/controller/agc_status.h\n@@ -20,19 +20,19 @@ extern \"C\" {\n // ignored until then.\n \n struct AgcStatus {\n-\tlibcamera::utils::Duration total_exposure_value; // value for all exposure and gain for this image\n-\tlibcamera::utils::Duration target_exposure_value; // (unfiltered) target total exposure AGC is aiming for\n-\tlibcamera::utils::Duration shutter_time;\n-\tdouble analogue_gain;\n-\tchar exposure_mode[32];\n-\tchar constraint_mode[32];\n-\tchar metering_mode[32];\n+\tlibcamera::utils::Duration totalExposureValue; // value for all exposure and gain for this image\n+\tlibcamera::utils::Duration targetExposureValue; // (unfiltered) target total exposure AGC is aiming for\n+\tlibcamera::utils::Duration shutterTime;\n+\tdouble analogueGain;\n+\tchar exposureMode[32];\n+\tchar constraintMode[32];\n+\tchar meteringMode[32];\n \tdouble ev;\n-\tlibcamera::utils::Duration flicker_period;\n-\tint floating_region_enable;\n-\tlibcamera::utils::Duration fixed_shutter;\n-\tdouble fixed_analogue_gain;\n-\tdouble digital_gain;\n+\tlibcamera::utils::Duration flickerPeriod;\n+\tint floatingRegionEnable;\n+\tlibcamera::utils::Duration fixedShutter;\n+\tdouble fixedAnalogueGain;\n+\tdouble digitalGain;\n \tint locked;\n };\n \ndiff --git a/src/ipa/raspberrypi/controller/algorithm.cpp b/src/ipa/raspberrypi/controller/algorithm.cpp\nindex 43ad0a2be222..cfcd18a96c93 100644\n--- a/src/ipa/raspberrypi/controller/algorithm.cpp\n+++ b/src/ipa/raspberrypi/controller/algorithm.cpp\n@@ -9,36 +9,38 @@\n \n using namespace RPiController;\n \n-void Algorithm::Read([[maybe_unused]] boost::property_tree::ptree const &params)\n+void Algorithm::read([[maybe_unused]] boost::property_tree::ptree const &params)\n {\n }\n \n-void Algorithm::Initialise() {}\n+void Algorithm::initialise()\n+{\n+}\n \n-void Algorithm::SwitchMode([[maybe_unused]] CameraMode const &camera_mode,\n+void Algorithm::switchMode([[maybe_unused]] CameraMode const &cameraMode,\n \t\t\t   [[maybe_unused]] Metadata *metadata)\n {\n }\n \n-void Algorithm::Prepare([[maybe_unused]] Metadata *image_metadata)\n+void Algorithm::prepare([[maybe_unused]] Metadata *imageMetadata)\n {\n }\n \n-void Algorithm::Process([[maybe_unused]] StatisticsPtr &stats,\n-\t\t\t[[maybe_unused]] Metadata *image_metadata)\n+void Algorithm::process([[maybe_unused]] StatisticsPtr &stats,\n+\t\t\t[[maybe_unused]] Metadata *imageMetadata)\n {\n }\n \n // For registering algorithms with the system:\n \n static std::map<std::string, AlgoCreateFunc> algorithms;\n-std::map<std::string, AlgoCreateFunc> const &RPiController::GetAlgorithms()\n+std::map<std::string, AlgoCreateFunc> const &RPiController::getAlgorithms()\n {\n \treturn algorithms;\n }\n \n RegisterAlgorithm::RegisterAlgorithm(char const *name,\n-\t\t\t\t     AlgoCreateFunc create_func)\n+\t\t\t\t     AlgoCreateFunc createFunc)\n {\n-\talgorithms[std::string(name)] = create_func;\n+\talgorithms[std::string(name)] = createFunc;\n }\ndiff --git a/src/ipa/raspberrypi/controller/algorithm.hpp b/src/ipa/raspberrypi/controller/algorithm.hpp\nindex 5123c87bab34..a33b14da2726 100644\n--- a/src/ipa/raspberrypi/controller/algorithm.hpp\n+++ b/src/ipa/raspberrypi/controller/algorithm.hpp\n@@ -29,18 +29,18 @@ public:\n \t{\n \t}\n \tvirtual ~Algorithm() = default;\n-\tvirtual char const *Name() const = 0;\n-\tvirtual bool IsPaused() const { return paused_; }\n-\tvirtual void Pause() { paused_ = true; }\n-\tvirtual void Resume() { paused_ = false; }\n-\tvirtual void Read(boost::property_tree::ptree const &params);\n-\tvirtual void Initialise();\n-\tvirtual void SwitchMode(CameraMode const &camera_mode, Metadata *metadata);\n-\tvirtual void Prepare(Metadata *image_metadata);\n-\tvirtual void Process(StatisticsPtr &stats, Metadata *image_metadata);\n-\tMetadata &GetGlobalMetadata() const\n+\tvirtual char const *name() const = 0;\n+\tvirtual bool isPaused() const { return paused_; }\n+\tvirtual void pause() { paused_ = true; }\n+\tvirtual void resume() { paused_ = false; }\n+\tvirtual void read(boost::property_tree::ptree const &params);\n+\tvirtual void initialise();\n+\tvirtual void switchMode(CameraMode const &cameraMode, Metadata *metadata);\n+\tvirtual void prepare(Metadata *imageMetadata);\n+\tvirtual void process(StatisticsPtr &stats, Metadata *imageMetadata);\n+\tMetadata &getGlobalMetadata() const\n \t{\n-\t\treturn controller_->GetGlobalMetadata();\n+\t\treturn controller_->getGlobalMetadata();\n \t}\n \n private:\n@@ -53,8 +53,8 @@ private:\n \n typedef Algorithm *(*AlgoCreateFunc)(Controller *controller);\n struct RegisterAlgorithm {\n-\tRegisterAlgorithm(char const *name, AlgoCreateFunc create_func);\n+\tRegisterAlgorithm(char const *name, AlgoCreateFunc createFunc);\n };\n-std::map<std::string, AlgoCreateFunc> const &GetAlgorithms();\n+std::map<std::string, AlgoCreateFunc> const &getAlgorithms();\n \n } // namespace RPiController\ndiff --git a/src/ipa/raspberrypi/controller/awb_algorithm.hpp b/src/ipa/raspberrypi/controller/awb_algorithm.hpp\nindex 96f88afc3a8d..c5d2ca90263c 100644\n--- a/src/ipa/raspberrypi/controller/awb_algorithm.hpp\n+++ b/src/ipa/raspberrypi/controller/awb_algorithm.hpp\n@@ -15,9 +15,9 @@ class AwbAlgorithm : public Algorithm\n public:\n \tAwbAlgorithm(Controller *controller) : Algorithm(controller) {}\n \t// An AWB algorithm must provide the following:\n-\tvirtual unsigned int GetConvergenceFrames() const = 0;\n-\tvirtual void SetMode(std::string const &mode_name) = 0;\n-\tvirtual void SetManualGains(double manual_r, double manual_b) = 0;\n+\tvirtual unsigned int getConvergenceFrames() const = 0;\n+\tvirtual void setMode(std::string const &modeName) = 0;\n+\tvirtual void setManualGains(double manualR, double manualB) = 0;\n };\n \n } // namespace RPiController\ndiff --git a/src/ipa/raspberrypi/controller/awb_status.h b/src/ipa/raspberrypi/controller/awb_status.h\nindex 46d7c842299a..bc428ed3206a 100644\n--- a/src/ipa/raspberrypi/controller/awb_status.h\n+++ b/src/ipa/raspberrypi/controller/awb_status.h\n@@ -15,10 +15,10 @@ extern \"C\" {\n \n struct AwbStatus {\n \tchar mode[32];\n-\tdouble temperature_K;\n-\tdouble gain_r;\n-\tdouble gain_g;\n-\tdouble gain_b;\n+\tdouble temperatureK;\n+\tdouble gainR;\n+\tdouble gainG;\n+\tdouble gainB;\n };\n \n #ifdef __cplusplus\ndiff --git a/src/ipa/raspberrypi/controller/black_level_status.h b/src/ipa/raspberrypi/controller/black_level_status.h\nindex d085f64b27fe..df3661401d99 100644\n--- a/src/ipa/raspberrypi/controller/black_level_status.h\n+++ b/src/ipa/raspberrypi/controller/black_level_status.h\n@@ -13,9 +13,9 @@ extern \"C\" {\n #endif\n \n struct BlackLevelStatus {\n-\tuint16_t black_level_r; // out of 16 bits\n-\tuint16_t black_level_g;\n-\tuint16_t black_level_b;\n+\tuint16_t blackLevelR; // out of 16 bits\n+\tuint16_t blackLevelG;\n+\tuint16_t blackLevelB;\n };\n \n #ifdef __cplusplus\ndiff --git a/src/ipa/raspberrypi/controller/camera_mode.h b/src/ipa/raspberrypi/controller/camera_mode.h\nindex e2b82828d4b6..8b81ca9df725 100644\n--- a/src/ipa/raspberrypi/controller/camera_mode.h\n+++ b/src/ipa/raspberrypi/controller/camera_mode.h\n@@ -26,21 +26,21 @@ struct CameraMode {\n \t// size in pixels of frames in this mode\n \tuint16_t width, height;\n \t// size of full resolution uncropped frame (\"sensor frame\")\n-\tuint16_t sensor_width, sensor_height;\n+\tuint16_t sensorWidth, sensorHeight;\n \t// binning factor (1 = no binning, 2 = 2-pixel binning etc.)\n-\tuint8_t bin_x, bin_y;\n+\tuint8_t binX, binY;\n \t// location of top left pixel in the sensor frame\n-\tuint16_t crop_x, crop_y;\n-\t// scaling factor (so if uncropped, width*scale_x is sensor_width)\n-\tdouble scale_x, scale_y;\n+\tuint16_t cropX, cropY;\n+\t// scaling factor (so if uncropped, width*scaleX is sensorWidth)\n+\tdouble scaleX, scaleY;\n \t// scaling of the noise compared to the native sensor mode\n-\tdouble noise_factor;\n+\tdouble noiseFactor;\n \t// line time\n-\tlibcamera::utils::Duration line_length;\n+\tlibcamera::utils::Duration lineLength;\n \t// any camera transform *not* reflected already in the camera tuning\n \tlibcamera::Transform transform;\n \t// minimum and maximum fame lengths in units of lines\n-\tuint32_t min_frame_length, max_frame_length;\n+\tuint32_t minFrameLength, maxFrameLength;\n \t// sensitivity of this mode\n \tdouble sensitivity;\n };\ndiff --git a/src/ipa/raspberrypi/controller/ccm_algorithm.hpp b/src/ipa/raspberrypi/controller/ccm_algorithm.hpp\nindex 33d0e30dc856..b8b5879ba99c 100644\n--- a/src/ipa/raspberrypi/controller/ccm_algorithm.hpp\n+++ b/src/ipa/raspberrypi/controller/ccm_algorithm.hpp\n@@ -15,7 +15,7 @@ class CcmAlgorithm : public Algorithm\n public:\n \tCcmAlgorithm(Controller *controller) : Algorithm(controller) {}\n \t// A CCM algorithm must provide the following:\n-\tvirtual void SetSaturation(double saturation) = 0;\n+\tvirtual void setSaturation(double saturation) = 0;\n };\n \n } // namespace RPiController\ndiff --git a/src/ipa/raspberrypi/controller/contrast_algorithm.hpp b/src/ipa/raspberrypi/controller/contrast_algorithm.hpp\nindex 7f03bba52844..c76f3cd759ba 100644\n--- a/src/ipa/raspberrypi/controller/contrast_algorithm.hpp\n+++ b/src/ipa/raspberrypi/controller/contrast_algorithm.hpp\n@@ -15,8 +15,8 @@ class ContrastAlgorithm : public Algorithm\n public:\n \tContrastAlgorithm(Controller *controller) : Algorithm(controller) {}\n \t// A contrast algorithm must provide the following:\n-\tvirtual void SetBrightness(double brightness) = 0;\n-\tvirtual void SetContrast(double contrast) = 0;\n+\tvirtual void setBrightness(double brightness) = 0;\n+\tvirtual void setContrast(double contrast) = 0;\n };\n \n } // namespace RPiController\ndiff --git a/src/ipa/raspberrypi/controller/controller.cpp b/src/ipa/raspberrypi/controller/controller.cpp\nindex d3433ad2e7e8..e0b152c74384 100644\n--- a/src/ipa/raspberrypi/controller/controller.cpp\n+++ b/src/ipa/raspberrypi/controller/controller.cpp\n@@ -19,85 +19,87 @@ using namespace libcamera;\n LOG_DEFINE_CATEGORY(RPiController)\n \n Controller::Controller()\n-\t: switch_mode_called_(false) {}\n+\t: switchModeCalled_(false)\n+{\n+}\n \n-Controller::Controller(char const *json_filename)\n-\t: switch_mode_called_(false)\n+Controller::Controller(char const *jsonFilename)\n+\t: switchModeCalled_(false)\n {\n-\tRead(json_filename);\n-\tInitialise();\n+\tread(jsonFilename);\n+\tinitialise();\n }\n \n Controller::~Controller() {}\n \n-void Controller::Read(char const *filename)\n+void Controller::read(char const *filename)\n {\n \tboost::property_tree::ptree root;\n \tboost::property_tree::read_json(filename, root);\n-\tfor (auto const &key_and_value : root) {\n-\t\tAlgorithm *algo = CreateAlgorithm(key_and_value.first.c_str());\n+\tfor (auto const &keyAndValue : root) {\n+\t\tAlgorithm *algo = createAlgorithm(keyAndValue.first.c_str());\n \t\tif (algo) {\n-\t\t\talgo->Read(key_and_value.second);\n+\t\t\talgo->read(keyAndValue.second);\n \t\t\talgorithms_.push_back(AlgorithmPtr(algo));\n \t\t} else\n \t\t\tLOG(RPiController, Warning)\n-\t\t\t\t<< \"No algorithm found for \\\"\" << key_and_value.first << \"\\\"\";\n+\t\t\t\t<< \"No algorithm found for \\\"\" << keyAndValue.first << \"\\\"\";\n \t}\n }\n \n-Algorithm *Controller::CreateAlgorithm(char const *name)\n+Algorithm *Controller::createAlgorithm(char const *name)\n {\n-\tauto it = GetAlgorithms().find(std::string(name));\n-\treturn it != GetAlgorithms().end() ? (*it->second)(this) : nullptr;\n+\tauto it = getAlgorithms().find(std::string(name));\n+\treturn it != getAlgorithms().end() ? (*it->second)(this) : nullptr;\n }\n \n-void Controller::Initialise()\n+void Controller::initialise()\n {\n \tfor (auto &algo : algorithms_)\n-\t\talgo->Initialise();\n+\t\talgo->initialise();\n }\n \n-void Controller::SwitchMode(CameraMode const &camera_mode, Metadata *metadata)\n+void Controller::switchMode(CameraMode const &cameraMode, Metadata *metadata)\n {\n \tfor (auto &algo : algorithms_)\n-\t\talgo->SwitchMode(camera_mode, metadata);\n-\tswitch_mode_called_ = true;\n+\t\talgo->switchMode(cameraMode, metadata);\n+\tswitchModeCalled_ = true;\n }\n \n-void Controller::Prepare(Metadata *image_metadata)\n+void Controller::prepare(Metadata *imageMetadata)\n {\n-\tassert(switch_mode_called_);\n+\tassert(switchModeCalled_);\n \tfor (auto &algo : algorithms_)\n-\t\tif (!algo->IsPaused())\n-\t\t\talgo->Prepare(image_metadata);\n+\t\tif (!algo->isPaused())\n+\t\t\talgo->prepare(imageMetadata);\n }\n \n-void Controller::Process(StatisticsPtr stats, Metadata *image_metadata)\n+void Controller::process(StatisticsPtr stats, Metadata *imageMetadata)\n {\n-\tassert(switch_mode_called_);\n+\tassert(switchModeCalled_);\n \tfor (auto &algo : algorithms_)\n-\t\tif (!algo->IsPaused())\n-\t\t\talgo->Process(stats, image_metadata);\n+\t\tif (!algo->isPaused())\n+\t\t\talgo->process(stats, imageMetadata);\n }\n \n-Metadata &Controller::GetGlobalMetadata()\n+Metadata &Controller::getGlobalMetadata()\n {\n-\treturn global_metadata_;\n+\treturn globalMetadata_;\n }\n \n-Algorithm *Controller::GetAlgorithm(std::string const &name) const\n+Algorithm *Controller::getAlgorithm(std::string const &name) const\n {\n \t// The passed name must be the entire algorithm name, or must match the\n \t// last part of it with a period (.) just before.\n-\tsize_t name_len = name.length();\n+\tsize_t nameLen = name.length();\n \tfor (auto &algo : algorithms_) {\n-\t\tchar const *algo_name = algo->Name();\n-\t\tsize_t algo_name_len = strlen(algo_name);\n-\t\tif (algo_name_len >= name_len &&\n+\t\tchar const *algoName = algo->name();\n+\t\tsize_t algoNameLen = strlen(algoName);\n+\t\tif (algoNameLen >= nameLen &&\n \t\t    strcasecmp(name.c_str(),\n-\t\t\t       algo_name + algo_name_len - name_len) == 0 &&\n-\t\t    (name_len == algo_name_len ||\n-\t\t     algo_name[algo_name_len - name_len - 1] == '.'))\n+\t\t\t       algoName + algoNameLen - nameLen) == 0 &&\n+\t\t    (nameLen == algoNameLen ||\n+\t\t     algoName[algoNameLen - nameLen - 1] == '.'))\n \t\t\treturn algo.get();\n \t}\n \treturn nullptr;\ndiff --git a/src/ipa/raspberrypi/controller/controller.hpp b/src/ipa/raspberrypi/controller/controller.hpp\nindex 3b50ae770d11..a5e1eb38ab9d 100644\n--- a/src/ipa/raspberrypi/controller/controller.hpp\n+++ b/src/ipa/raspberrypi/controller/controller.hpp\n@@ -34,21 +34,21 @@ class Controller\n {\n public:\n \tController();\n-\tController(char const *json_filename);\n+\tController(char const *jsonFilename);\n \t~Controller();\n-\tAlgorithm *CreateAlgorithm(char const *name);\n-\tvoid Read(char const *filename);\n-\tvoid Initialise();\n-\tvoid SwitchMode(CameraMode const &camera_mode, Metadata *metadata);\n-\tvoid Prepare(Metadata *image_metadata);\n-\tvoid Process(StatisticsPtr stats, Metadata *image_metadata);\n-\tMetadata &GetGlobalMetadata();\n-\tAlgorithm *GetAlgorithm(std::string const &name) const;\n+\tAlgorithm *createAlgorithm(char const *name);\n+\tvoid read(char const *filename);\n+\tvoid initialise();\n+\tvoid switchMode(CameraMode const &cameraMode, Metadata *metadata);\n+\tvoid prepare(Metadata *imageMetadata);\n+\tvoid process(StatisticsPtr stats, Metadata *imageMetadata);\n+\tMetadata &getGlobalMetadata();\n+\tAlgorithm *getAlgorithm(std::string const &name) const;\n \n protected:\n-\tMetadata global_metadata_;\n+\tMetadata globalMetadata_;\n \tstd::vector<AlgorithmPtr> algorithms_;\n-\tbool switch_mode_called_;\n+\tbool switchModeCalled_;\n };\n \n } // namespace RPiController\ndiff --git a/src/ipa/raspberrypi/controller/denoise_algorithm.hpp b/src/ipa/raspberrypi/controller/denoise_algorithm.hpp\nindex 39fcd7e94df2..48de542ac4f3 100644\n--- a/src/ipa/raspberrypi/controller/denoise_algorithm.hpp\n+++ b/src/ipa/raspberrypi/controller/denoise_algorithm.hpp\n@@ -17,7 +17,7 @@ class DenoiseAlgorithm : public Algorithm\n public:\n \tDenoiseAlgorithm(Controller *controller) : Algorithm(controller) {}\n \t// A Denoise algorithm must provide the following:\n-\tvirtual void SetMode(DenoiseMode mode) = 0;\n+\tvirtual void setMode(DenoiseMode mode) = 0;\n };\n \n } // namespace RPiController\ndiff --git a/src/ipa/raspberrypi/controller/denoise_status.h b/src/ipa/raspberrypi/controller/denoise_status.h\nindex 67a3c361387e..fe304d098253 100644\n--- a/src/ipa/raspberrypi/controller/denoise_status.h\n+++ b/src/ipa/raspberrypi/controller/denoise_status.h\n@@ -13,8 +13,8 @@ extern \"C\" {\n #endif\n \n struct DenoiseStatus {\n-\tdouble noise_constant;\n-\tdouble noise_slope;\n+\tdouble noiseConstant;\n+\tdouble noiseSlope;\n \tdouble strength;\n \tunsigned int mode;\n };\ndiff --git a/src/ipa/raspberrypi/controller/device_status.cpp b/src/ipa/raspberrypi/controller/device_status.cpp\nindex a389c40dafed..f8ed77354a0a 100644\n--- a/src/ipa/raspberrypi/controller/device_status.cpp\n+++ b/src/ipa/raspberrypi/controller/device_status.cpp\n@@ -10,21 +10,21 @@ using namespace libcamera; /* for the Duration operator<< overload */\n \n std::ostream &operator<<(std::ostream &out, const DeviceStatus &d)\n {\n-\tout << \"Exposure: \" << d.shutter_speed\n-\t    << \" Frame length: \" << d.frame_length\n-\t    << \" Gain: \" << d.analogue_gain;\n+\tout << \"Exposure: \" << d.shutterSpeed\n+\t    << \" Frame length: \" << d.frameLength\n+\t    << \" Gain: \" << d.analogueGain;\n \n \tif (d.aperture)\n \t\tout << \" Aperture: \" << *d.aperture;\n \n-\tif (d.lens_position)\n-\t\tout << \" Lens: \" << *d.lens_position;\n+\tif (d.lensPosition)\n+\t\tout << \" Lens: \" << *d.lensPosition;\n \n-\tif (d.flash_intensity)\n-\t\tout << \" Flash: \" << *d.flash_intensity;\n+\tif (d.flashIntensity)\n+\t\tout << \" Flash: \" << *d.flashIntensity;\n \n-\tif (d.sensor_temperature)\n-\t\tout << \" Temperature: \" << *d.sensor_temperature;\n+\tif (d.sensorTemperature)\n+\t\tout << \" Temperature: \" << *d.sensorTemperature;\n \n \treturn out;\n }\ndiff --git a/src/ipa/raspberrypi/controller/device_status.h b/src/ipa/raspberrypi/controller/device_status.h\nindex b33f0d093ff3..ebcd7da2586b 100644\n--- a/src/ipa/raspberrypi/controller/device_status.h\n+++ b/src/ipa/raspberrypi/controller/device_status.h\n@@ -18,24 +18,24 @@\n \n struct DeviceStatus {\n \tDeviceStatus()\n-\t\t: shutter_speed(std::chrono::seconds(0)), frame_length(0),\n-\t\t  analogue_gain(0.0)\n+\t\t: shutterSpeed(std::chrono::seconds(0)), frameLength(0),\n+\t\t  analogueGain(0.0)\n \t{\n \t}\n \n \tfriend std::ostream &operator<<(std::ostream &out, const DeviceStatus &d);\n \n \t/* time shutter is open */\n-\tlibcamera::utils::Duration shutter_speed;\n+\tlibcamera::utils::Duration shutterSpeed;\n \t/* frame length given in number of lines */\n-\tuint32_t frame_length;\n-\tdouble analogue_gain;\n+\tuint32_t frameLength;\n+\tdouble analogueGain;\n \t/* 1.0/distance-in-metres, or 0 if unknown */\n-\tstd::optional<double> lens_position;\n+\tstd::optional<double> lensPosition;\n \t/* 1/f so that brightness quadruples when this doubles, or 0 if unknown */\n \tstd::optional<double> aperture;\n \t/* proportional to brightness with 0 = no flash, 1 = maximum flash */\n-\tstd::optional<double> flash_intensity;\n+\tstd::optional<double> flashIntensity;\n \t/* Sensor reported temperature value (in degrees) */\n-\tstd::optional<double> sensor_temperature;\n+\tstd::optional<double> sensorTemperature;\n };\ndiff --git a/src/ipa/raspberrypi/controller/focus_status.h b/src/ipa/raspberrypi/controller/focus_status.h\nindex ace2fe2c317a..656455100b45 100644\n--- a/src/ipa/raspberrypi/controller/focus_status.h\n+++ b/src/ipa/raspberrypi/controller/focus_status.h\n@@ -18,7 +18,7 @@ extern \"C\" {\n \n struct FocusStatus {\n \tunsigned int num;\n-\tuint32_t focus_measures[FOCUS_REGIONS];\n+\tuint32_t focusMeasures[FOCUS_REGIONS];\n };\n \n #ifdef __cplusplus\ndiff --git a/src/ipa/raspberrypi/controller/histogram.cpp b/src/ipa/raspberrypi/controller/histogram.cpp\nindex 9916b3ed7f71..e865bef0057b 100644\n--- a/src/ipa/raspberrypi/controller/histogram.cpp\n+++ b/src/ipa/raspberrypi/controller/histogram.cpp\n@@ -11,25 +11,25 @@\n \n using namespace RPiController;\n \n-uint64_t Histogram::CumulativeFreq(double bin) const\n+uint64_t Histogram::cumulativeFreq(double bin) const\n {\n \tif (bin <= 0)\n \t\treturn 0;\n-\telse if (bin >= Bins())\n-\t\treturn Total();\n+\telse if (bin >= bins())\n+\t\treturn total();\n \tint b = (int)bin;\n \treturn cumulative_[b] +\n \t       (bin - b) * (cumulative_[b + 1] - cumulative_[b]);\n }\n \n-double Histogram::Quantile(double q, int first, int last) const\n+double Histogram::quantile(double q, int first, int last) const\n {\n \tif (first == -1)\n \t\tfirst = 0;\n \tif (last == -1)\n \t\tlast = cumulative_.size() - 2;\n \tassert(first <= last);\n-\tuint64_t items = q * Total();\n+\tuint64_t items = q * total();\n \twhile (first < last) // binary search to find the right bin\n \t{\n \t\tint middle = (first + last) / 2;\n@@ -45,20 +45,20 @@ double Histogram::Quantile(double q, int first, int last) const\n \treturn first + frac;\n }\n \n-double Histogram::InterQuantileMean(double q_lo, double q_hi) const\n+double Histogram::interQuantileMean(double qLo, double qHi) const\n {\n-\tassert(q_hi > q_lo);\n-\tdouble p_lo = Quantile(q_lo);\n-\tdouble p_hi = Quantile(q_hi, (int)p_lo);\n-\tdouble sum_bin_freq = 0, cumul_freq = 0;\n-\tfor (double p_next = floor(p_lo) + 1.0; p_next <= ceil(p_hi);\n-\t     p_lo = p_next, p_next += 1.0) {\n-\t\tint bin = floor(p_lo);\n+\tassert(qHi > qLo);\n+\tdouble pLo = quantile(qLo);\n+\tdouble pHi = quantile(qHi, (int)pLo);\n+\tdouble sumBinFreq = 0, cumulFreq = 0;\n+\tfor (double pNext = floor(pLo) + 1.0; pNext <= ceil(pHi);\n+\t     pLo = pNext, pNext += 1.0) {\n+\t\tint bin = floor(pLo);\n \t\tdouble freq = (cumulative_[bin + 1] - cumulative_[bin]) *\n-\t\t\t      (std::min(p_next, p_hi) - p_lo);\n-\t\tsum_bin_freq += bin * freq;\n-\t\tcumul_freq += freq;\n+\t\t\t      (std::min(pNext, pHi) - pLo);\n+\t\tsumBinFreq += bin * freq;\n+\t\tcumulFreq += freq;\n \t}\n \t// add 0.5 to give an average for bin mid-points\n-\treturn sum_bin_freq / cumul_freq + 0.5;\n+\treturn sumBinFreq / cumulFreq + 0.5;\n }\ndiff --git a/src/ipa/raspberrypi/controller/histogram.hpp b/src/ipa/raspberrypi/controller/histogram.hpp\nindex 90f5ac78e8c6..4ff5a56b0243 100644\n--- a/src/ipa/raspberrypi/controller/histogram.hpp\n+++ b/src/ipa/raspberrypi/controller/histogram.hpp\n@@ -27,15 +27,15 @@ public:\n \t\t\tcumulative_.push_back(cumulative_.back() +\n \t\t\t\t\t      histogram[i]);\n \t}\n-\tuint32_t Bins() const { return cumulative_.size() - 1; }\n-\tuint64_t Total() const { return cumulative_[cumulative_.size() - 1]; }\n+\tuint32_t bins() const { return cumulative_.size() - 1; }\n+\tuint64_t total() const { return cumulative_[cumulative_.size() - 1]; }\n \t// Cumulative frequency up to a (fractional) point in a bin.\n-\tuint64_t CumulativeFreq(double bin) const;\n+\tuint64_t cumulativeFreq(double bin) const;\n \t// Return the (fractional) bin of the point q (0 <= q <= 1) through the\n \t// histogram. Optionally provide limits to help.\n-\tdouble Quantile(double q, int first = -1, int last = -1) const;\n+\tdouble quantile(double q, int first = -1, int last = -1) const;\n \t// Return the average histogram bin value between the two quantiles.\n-\tdouble InterQuantileMean(double q_lo, double q_hi) const;\n+\tdouble interQuantileMean(double qLo, double qHi) const;\n \n private:\n \tstd::vector<uint64_t> cumulative_;\ndiff --git a/src/ipa/raspberrypi/controller/metadata.hpp b/src/ipa/raspberrypi/controller/metadata.hpp\nindex 51e576cfab95..a79a67d42cce 100644\n--- a/src/ipa/raspberrypi/controller/metadata.hpp\n+++ b/src/ipa/raspberrypi/controller/metadata.hpp\n@@ -22,26 +22,26 @@ public:\n \n \tMetadata(Metadata const &other)\n \t{\n-\t\tstd::scoped_lock other_lock(other.mutex_);\n+\t\tstd::scoped_lock otherLock(other.mutex_);\n \t\tdata_ = other.data_;\n \t}\n \n \tMetadata(Metadata &&other)\n \t{\n-\t\tstd::scoped_lock other_lock(other.mutex_);\n+\t\tstd::scoped_lock otherLock(other.mutex_);\n \t\tdata_ = std::move(other.data_);\n \t\tother.data_.clear();\n \t}\n \n \ttemplate<typename T>\n-\tvoid Set(std::string const &tag, T const &value)\n+\tvoid set(std::string const &tag, T const &value)\n \t{\n \t\tstd::scoped_lock lock(mutex_);\n \t\tdata_[tag] = value;\n \t}\n \n \ttemplate<typename T>\n-\tint Get(std::string const &tag, T &value) const\n+\tint get(std::string const &tag, T &value) const\n \t{\n \t\tstd::scoped_lock lock(mutex_);\n \t\tauto it = data_.find(tag);\n@@ -51,7 +51,7 @@ public:\n \t\treturn 0;\n \t}\n \n-\tvoid Clear()\n+\tvoid clear()\n \t{\n \t\tstd::scoped_lock lock(mutex_);\n \t\tdata_.clear();\n@@ -72,14 +72,14 @@ public:\n \t\treturn *this;\n \t}\n \n-\tvoid Merge(Metadata &other)\n+\tvoid merge(Metadata &other)\n \t{\n \t\tstd::scoped_lock lock(mutex_, other.mutex_);\n \t\tdata_.merge(other.data_);\n \t}\n \n \ttemplate<typename T>\n-\tT *GetLocked(std::string const &tag)\n+\tT *getLocked(std::string const &tag)\n \t{\n \t\t// This allows in-place access to the Metadata contents,\n \t\t// for which you should be holding the lock.\n@@ -90,7 +90,7 @@ public:\n \t}\n \n \ttemplate<typename T>\n-\tvoid SetLocked(std::string const &tag, T const &value)\n+\tvoid setLocked(std::string const &tag, T const &value)\n \t{\n \t\t// Use this only if you're holding the lock yourself.\n \t\tdata_[tag] = value;\ndiff --git a/src/ipa/raspberrypi/controller/noise_status.h b/src/ipa/raspberrypi/controller/noise_status.h\nindex 8439a40213aa..358af4fe869b 100644\n--- a/src/ipa/raspberrypi/controller/noise_status.h\n+++ b/src/ipa/raspberrypi/controller/noise_status.h\n@@ -13,8 +13,8 @@ extern \"C\" {\n #endif\n \n struct NoiseStatus {\n-\tdouble noise_constant;\n-\tdouble noise_slope;\n+\tdouble noiseConstant;\n+\tdouble noiseSlope;\n };\n \n #ifdef __cplusplus\ndiff --git a/src/ipa/raspberrypi/controller/pwl.cpp b/src/ipa/raspberrypi/controller/pwl.cpp\nindex 130c820b559f..24ff3ea34f5f 100644\n--- a/src/ipa/raspberrypi/controller/pwl.cpp\n+++ b/src/ipa/raspberrypi/controller/pwl.cpp\n@@ -12,7 +12,7 @@\n \n using namespace RPiController;\n \n-void Pwl::Read(boost::property_tree::ptree const &params)\n+void Pwl::read(boost::property_tree::ptree const &params)\n {\n \tfor (auto it = params.begin(); it != params.end(); it++) {\n \t\tdouble x = it->second.get_value<double>();\n@@ -24,24 +24,24 @@ void Pwl::Read(boost::property_tree::ptree const &params)\n \tassert(points_.size() >= 2);\n }\n \n-void Pwl::Append(double x, double y, const double eps)\n+void Pwl::append(double x, double y, const double eps)\n {\n \tif (points_.empty() || points_.back().x + eps < x)\n \t\tpoints_.push_back(Point(x, y));\n }\n \n-void Pwl::Prepend(double x, double y, const double eps)\n+void Pwl::prepend(double x, double y, const double eps)\n {\n \tif (points_.empty() || points_.front().x - eps > x)\n \t\tpoints_.insert(points_.begin(), Point(x, y));\n }\n \n-Pwl::Interval Pwl::Domain() const\n+Pwl::Interval Pwl::domain() const\n {\n \treturn Interval(points_[0].x, points_[points_.size() - 1].x);\n }\n \n-Pwl::Interval Pwl::Range() const\n+Pwl::Interval Pwl::range() const\n {\n \tdouble lo = points_[0].y, hi = lo;\n \tfor (auto &p : points_)\n@@ -49,18 +49,16 @@ Pwl::Interval Pwl::Range() const\n \treturn Interval(lo, hi);\n }\n \n-bool Pwl::Empty() const\n+bool Pwl::empty() const\n {\n \treturn points_.empty();\n }\n \n-double Pwl::Eval(double x, int *span_ptr, bool update_span) const\n+double Pwl::eval(double x, int *spanPtr, bool updateSpan) const\n {\n-\tint span = findSpan(x, span_ptr && *span_ptr != -1\n-\t\t\t\t       ? *span_ptr\n-\t\t\t\t       : points_.size() / 2 - 1);\n-\tif (span_ptr && update_span)\n-\t\t*span_ptr = span;\n+\tint span = findSpan(x, spanPtr && *spanPtr != -1 ? *spanPtr : points_.size() / 2 - 1);\n+\tif (spanPtr && updateSpan)\n+\t\t*spanPtr = span;\n \treturn points_[span].y +\n \t       (x - points_[span].x) * (points_[span + 1].y - points_[span].y) /\n \t\t       (points_[span + 1].x - points_[span].x);\n@@ -70,31 +68,31 @@ int Pwl::findSpan(double x, int span) const\n {\n \t// Pwls are generally small, so linear search may well be faster than\n \t// binary, though could review this if large PWls start turning up.\n-\tint last_span = points_.size() - 2;\n+\tint lastSpan = points_.size() - 2;\n \t// some algorithms may call us with span pointing directly at the last\n \t// control point\n-\tspan = std::max(0, std::min(last_span, span));\n-\twhile (span < last_span && x >= points_[span + 1].x)\n+\tspan = std::max(0, std::min(lastSpan, span));\n+\twhile (span < lastSpan && x >= points_[span + 1].x)\n \t\tspan++;\n \twhile (span && x < points_[span].x)\n \t\tspan--;\n \treturn span;\n }\n \n-Pwl::PerpType Pwl::Invert(Point const &xy, Point &perp, int &span,\n+Pwl::PerpType Pwl::invert(Point const &xy, Point &perp, int &span,\n \t\t\t  const double eps) const\n {\n \tassert(span >= -1);\n-\tbool prev_off_end = false;\n+\tbool prevOffEnd = false;\n \tfor (span = span + 1; span < (int)points_.size() - 1; span++) {\n-\t\tPoint span_vec = points_[span + 1] - points_[span];\n-\t\tdouble t = ((xy - points_[span]) % span_vec) / span_vec.Len2();\n+\t\tPoint spanVec = points_[span + 1] - points_[span];\n+\t\tdouble t = ((xy - points_[span]) % spanVec) / spanVec.len2();\n \t\tif (t < -eps) // off the start of this span\n \t\t{\n \t\t\tif (span == 0) {\n \t\t\t\tperp = points_[span];\n \t\t\t\treturn PerpType::Start;\n-\t\t\t} else if (prev_off_end) {\n+\t\t\t} else if (prevOffEnd) {\n \t\t\t\tperp = points_[span];\n \t\t\t\treturn PerpType::Vertex;\n \t\t\t}\n@@ -104,32 +102,32 @@ Pwl::PerpType Pwl::Invert(Point const &xy, Point &perp, int &span,\n \t\t\t\tperp = points_[span + 1];\n \t\t\t\treturn PerpType::End;\n \t\t\t}\n-\t\t\tprev_off_end = true;\n+\t\t\tprevOffEnd = true;\n \t\t} else // a true perpendicular\n \t\t{\n-\t\t\tperp = points_[span] + span_vec * t;\n+\t\t\tperp = points_[span] + spanVec * t;\n \t\t\treturn PerpType::Perpendicular;\n \t\t}\n \t}\n \treturn PerpType::None;\n }\n \n-Pwl Pwl::Inverse(bool *true_inverse, const double eps) const\n+Pwl Pwl::inverse(bool *trueInverse, const double eps) const\n {\n \tbool appended = false, prepended = false, neither = false;\n \tPwl inverse;\n \n \tfor (Point const &p : points_) {\n-\t\tif (inverse.Empty())\n-\t\t\tinverse.Append(p.y, p.x, eps);\n+\t\tif (inverse.empty())\n+\t\t\tinverse.append(p.y, p.x, eps);\n \t\telse if (std::abs(inverse.points_.back().x - p.y) <= eps ||\n \t\t\t std::abs(inverse.points_.front().x - p.y) <= eps)\n \t\t\t/* do nothing */;\n \t\telse if (p.y > inverse.points_.back().x) {\n-\t\t\tinverse.Append(p.y, p.x, eps);\n+\t\t\tinverse.append(p.y, p.x, eps);\n \t\t\tappended = true;\n \t\t} else if (p.y < inverse.points_.front().x) {\n-\t\t\tinverse.Prepend(p.y, p.x, eps);\n+\t\t\tinverse.prepend(p.y, p.x, eps);\n \t\t\tprepended = true;\n \t\t} else\n \t\t\tneither = true;\n@@ -138,63 +136,65 @@ Pwl Pwl::Inverse(bool *true_inverse, const double eps) const\n \t// This is not a proper inverse if we found ourselves putting points\n \t// onto both ends of the inverse, or if there were points that couldn't\n \t// go on either.\n-\tif (true_inverse)\n-\t\t*true_inverse = !(neither || (appended && prepended));\n+\tif (trueInverse)\n+\t\t*trueInverse = !(neither || (appended && prepended));\n \n \treturn inverse;\n }\n \n-Pwl Pwl::Compose(Pwl const &other, const double eps) const\n+Pwl Pwl::compose(Pwl const &other, const double eps) const\n {\n-\tdouble this_x = points_[0].x, this_y = points_[0].y;\n-\tint this_span = 0, other_span = other.findSpan(this_y, 0);\n-\tPwl result({ { this_x, other.Eval(this_y, &other_span, false) } });\n-\twhile (this_span != (int)points_.size() - 1) {\n-\t\tdouble dx = points_[this_span + 1].x - points_[this_span].x,\n-\t\t       dy = points_[this_span + 1].y - points_[this_span].y;\n+\tdouble thisX = points_[0].x, thisY = points_[0].y;\n+\tint thisSpan = 0, otherSpan = other.findSpan(thisY, 0);\n+\tPwl result({ { thisX, other.eval(thisY, &otherSpan, false) } });\n+\twhile (thisSpan != (int)points_.size() - 1) {\n+\t\tdouble dx = points_[thisSpan + 1].x - points_[thisSpan].x,\n+\t\t       dy = points_[thisSpan + 1].y - points_[thisSpan].y;\n \t\tif (abs(dy) > eps &&\n-\t\t    other_span + 1 < (int)other.points_.size() &&\n-\t\t    points_[this_span + 1].y >=\n-\t\t\t    other.points_[other_span + 1].x + eps) {\n+\t\t    otherSpan + 1 < (int)other.points_.size() &&\n+\t\t    points_[thisSpan + 1].y >=\n+\t\t\t    other.points_[otherSpan + 1].x + eps) {\n \t\t\t// next control point in result will be where this\n \t\t\t// function's y reaches the next span in other\n-\t\t\tthis_x = points_[this_span].x +\n-\t\t\t\t (other.points_[other_span + 1].x -\n-\t\t\t\t  points_[this_span].y) * dx / dy;\n-\t\t\tthis_y = other.points_[++other_span].x;\n-\t\t} else if (abs(dy) > eps && other_span > 0 &&\n-\t\t\t   points_[this_span + 1].y <=\n-\t\t\t\t   other.points_[other_span - 1].x - eps) {\n+\t\t\tthisX = points_[thisSpan].x +\n+\t\t\t\t(other.points_[otherSpan + 1].x -\n+\t\t\t\t points_[thisSpan].y) *\n+\t\t\t\t\tdx / dy;\n+\t\t\tthisY = other.points_[++otherSpan].x;\n+\t\t} else if (abs(dy) > eps && otherSpan > 0 &&\n+\t\t\t   points_[thisSpan + 1].y <=\n+\t\t\t\t   other.points_[otherSpan - 1].x - eps) {\n \t\t\t// next control point in result will be where this\n \t\t\t// function's y reaches the previous span in other\n-\t\t\tthis_x = points_[this_span].x +\n-\t\t\t\t (other.points_[other_span + 1].x -\n-\t\t\t\t  points_[this_span].y) * dx / dy;\n-\t\t\tthis_y = other.points_[--other_span].x;\n+\t\t\tthisX = points_[thisSpan].x +\n+\t\t\t\t(other.points_[otherSpan + 1].x -\n+\t\t\t\t points_[thisSpan].y) *\n+\t\t\t\t\tdx / dy;\n+\t\t\tthisY = other.points_[--otherSpan].x;\n \t\t} else {\n \t\t\t// we stay in the same span in other\n-\t\t\tthis_span++;\n-\t\t\tthis_x = points_[this_span].x,\n-\t\t\tthis_y = points_[this_span].y;\n+\t\t\tthisSpan++;\n+\t\t\tthisX = points_[thisSpan].x,\n+\t\t\tthisY = points_[thisSpan].y;\n \t\t}\n-\t\tresult.Append(this_x, other.Eval(this_y, &other_span, false),\n+\t\tresult.append(thisX, other.eval(thisY, &otherSpan, false),\n \t\t\t      eps);\n \t}\n \treturn result;\n }\n \n-void Pwl::Map(std::function<void(double x, double y)> f) const\n+void Pwl::map(std::function<void(double x, double y)> f) const\n {\n \tfor (auto &pt : points_)\n \t\tf(pt.x, pt.y);\n }\n \n-void Pwl::Map2(Pwl const &pwl0, Pwl const &pwl1,\n+void Pwl::map2(Pwl const &pwl0, Pwl const &pwl1,\n \t       std::function<void(double x, double y0, double y1)> f)\n {\n \tint span0 = 0, span1 = 0;\n \tdouble x = std::min(pwl0.points_[0].x, pwl1.points_[0].x);\n-\tf(x, pwl0.Eval(x, &span0, false), pwl1.Eval(x, &span1, false));\n+\tf(x, pwl0.eval(x, &span0, false), pwl1.eval(x, &span1, false));\n \twhile (span0 < (int)pwl0.points_.size() - 1 ||\n \t       span1 < (int)pwl1.points_.size() - 1) {\n \t\tif (span0 == (int)pwl0.points_.size() - 1)\n@@ -205,28 +205,28 @@ void Pwl::Map2(Pwl const &pwl0, Pwl const &pwl1,\n \t\t\tx = pwl1.points_[++span1].x;\n \t\telse\n \t\t\tx = pwl0.points_[++span0].x;\n-\t\tf(x, pwl0.Eval(x, &span0, false), pwl1.Eval(x, &span1, false));\n+\t\tf(x, pwl0.eval(x, &span0, false), pwl1.eval(x, &span1, false));\n \t}\n }\n \n-Pwl Pwl::Combine(Pwl const &pwl0, Pwl const &pwl1,\n+Pwl Pwl::combine(Pwl const &pwl0, Pwl const &pwl1,\n \t\t std::function<double(double x, double y0, double y1)> f,\n \t\t const double eps)\n {\n \tPwl result;\n-\tMap2(pwl0, pwl1, [&](double x, double y0, double y1) {\n-\t\tresult.Append(x, f(x, y0, y1), eps);\n+\tmap2(pwl0, pwl1, [&](double x, double y0, double y1) {\n+\t\tresult.append(x, f(x, y0, y1), eps);\n \t});\n \treturn result;\n }\n \n-void Pwl::MatchDomain(Interval const &domain, bool clip, const double eps)\n+void Pwl::matchDomain(Interval const &domain, bool clip, const double eps)\n {\n \tint span = 0;\n-\tPrepend(domain.start, Eval(clip ? points_[0].x : domain.start, &span),\n+\tprepend(domain.start, eval(clip ? points_[0].x : domain.start, &span),\n \t\teps);\n \tspan = points_.size() - 2;\n-\tAppend(domain.end, Eval(clip ? points_.back().x : domain.end, &span),\n+\tappend(domain.end, eval(clip ? points_.back().x : domain.end, &span),\n \t       eps);\n }\n \n@@ -237,7 +237,7 @@ Pwl &Pwl::operator*=(double d)\n \treturn *this;\n }\n \n-void Pwl::Debug(FILE *fp) const\n+void Pwl::debug(FILE *fp) const\n {\n \tfprintf(fp, \"Pwl {\\n\");\n \tfor (auto &p : points_)\ndiff --git a/src/ipa/raspberrypi/controller/pwl.hpp b/src/ipa/raspberrypi/controller/pwl.hpp\nindex 484672f64095..4a38d1df5a33 100644\n--- a/src/ipa/raspberrypi/controller/pwl.hpp\n+++ b/src/ipa/raspberrypi/controller/pwl.hpp\n@@ -17,24 +17,26 @@ class Pwl\n {\n public:\n \tstruct Interval {\n-\t\tInterval(double _start, double _end) : start(_start), end(_end)\n+\t\tInterval(double _start, double _end)\n+\t\t\t: start(_start), end(_end)\n \t\t{\n \t\t}\n \t\tdouble start, end;\n-\t\tbool Contains(double value)\n+\t\tbool contains(double value)\n \t\t{\n \t\t\treturn value >= start && value <= end;\n \t\t}\n-\t\tdouble Clip(double value)\n+\t\tdouble clip(double value)\n \t\t{\n \t\t\treturn value < start ? start\n \t\t\t\t\t     : (value > end ? end : value);\n \t\t}\n-\t\tdouble Len() const { return end - start; }\n+\t\tdouble len() const { return end - start; }\n \t};\n \tstruct Point {\n \t\tPoint() : x(0), y(0) {}\n-\t\tPoint(double _x, double _y) : x(_x), y(_y) {}\n+\t\tPoint(double _x, double _y)\n+\t\t\t: x(_x), y(_y) {}\n \t\tdouble x, y;\n \t\tPoint operator-(Point const &p) const\n \t\t{\n@@ -50,23 +52,23 @@ public:\n \t\t}\n \t\tPoint operator*(double f) const { return Point(x * f, y * f); }\n \t\tPoint operator/(double f) const { return Point(x / f, y / f); }\n-\t\tdouble Len2() const { return x * x + y * y; }\n-\t\tdouble Len() const { return sqrt(Len2()); }\n+\t\tdouble len2() const { return x * x + y * y; }\n+\t\tdouble len() const { return sqrt(len2()); }\n \t};\n \tPwl() {}\n \tPwl(std::vector<Point> const &points) : points_(points) {}\n-\tvoid Read(boost::property_tree::ptree const &params);\n-\tvoid Append(double x, double y, const double eps = 1e-6);\n-\tvoid Prepend(double x, double y, const double eps = 1e-6);\n-\tInterval Domain() const;\n-\tInterval Range() const;\n-\tbool Empty() const;\n+\tvoid read(boost::property_tree::ptree const &params);\n+\tvoid append(double x, double y, const double eps = 1e-6);\n+\tvoid prepend(double x, double y, const double eps = 1e-6);\n+\tInterval domain() const;\n+\tInterval range() const;\n+\tbool empty() const;\n \t// Evaluate Pwl, optionally supplying an initial guess for the\n \t// \"span\". The \"span\" may be optionally be updated.  If you want to know\n \t// the \"span\" value but don't have an initial guess you can set it to\n \t// -1.\n-\tdouble Eval(double x, int *span_ptr = nullptr,\n-\t\t    bool update_span = true) const;\n+\tdouble eval(double x, int *spanPtr = nullptr,\n+\t\t    bool updateSpan = true) const;\n \t// Find perpendicular closest to xy, starting from span+1 so you can\n \t// call it repeatedly to check for multiple closest points (set span to\n \t// -1 on the first call). Also returns \"pseudo\" perpendiculars; see\n@@ -78,31 +80,31 @@ public:\n \t\tVertex, // vertex of Pwl is closest point\n \t\tPerpendicular // true perpendicular found\n \t};\n-\tPerpType Invert(Point const &xy, Point &perp, int &span,\n+\tPerpType invert(Point const &xy, Point &perp, int &span,\n \t\t\tconst double eps = 1e-6) const;\n \t// Compute the inverse function. Indicate if it is a proper (true)\n \t// inverse, or only a best effort (e.g. input was non-monotonic).\n-\tPwl Inverse(bool *true_inverse = nullptr, const double eps = 1e-6) const;\n+\tPwl inverse(bool *trueInverse = nullptr, const double eps = 1e-6) const;\n \t// Compose two Pwls together, doing \"this\" first and \"other\" after.\n-\tPwl Compose(Pwl const &other, const double eps = 1e-6) const;\n+\tPwl compose(Pwl const &other, const double eps = 1e-6) const;\n \t// Apply function to (x,y) values at every control point.\n-\tvoid Map(std::function<void(double x, double y)> f) const;\n+\tvoid map(std::function<void(double x, double y)> f) const;\n \t// Apply function to (x, y0, y1) values wherever either Pwl has a\n \t// control point.\n-\tstatic void Map2(Pwl const &pwl0, Pwl const &pwl1,\n+\tstatic void map2(Pwl const &pwl0, Pwl const &pwl1,\n \t\t\t std::function<void(double x, double y0, double y1)> f);\n \t// Combine two Pwls, meaning we create a new Pwl where the y values are\n \t// given by running f wherever either has a knot.\n \tstatic Pwl\n-\tCombine(Pwl const &pwl0, Pwl const &pwl1,\n+\tcombine(Pwl const &pwl0, Pwl const &pwl1,\n \t\tstd::function<double(double x, double y0, double y1)> f,\n \t\tconst double eps = 1e-6);\n \t// Make \"this\" match (at least) the given domain. Any extension my be\n \t// clipped or linear.\n-\tvoid MatchDomain(Interval const &domain, bool clip = true,\n+\tvoid matchDomain(Interval const &domain, bool clip = true,\n \t\t\t const double eps = 1e-6);\n \tPwl &operator*=(double d);\n-\tvoid Debug(FILE *fp = stdout) const;\n+\tvoid debug(FILE *fp = stdout) const;\n \n private:\n \tint findSpan(double x, int span) const;\ndiff --git a/src/ipa/raspberrypi/controller/rpi/agc.cpp b/src/ipa/raspberrypi/controller/rpi/agc.cpp\nindex f6a9cb0a2cd8..408ff9cf296d 100644\n--- a/src/ipa/raspberrypi/controller/rpi/agc.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/agc.cpp\n@@ -30,7 +30,7 @@ LOG_DEFINE_CATEGORY(RPiAgc)\n \n #define PIPELINE_BITS 13 // seems to be a 13-bit pipeline\n \n-void AgcMeteringMode::Read(boost::property_tree::ptree const &params)\n+void AgcMeteringMode::read(boost::property_tree::ptree const &params)\n {\n \tint num = 0;\n \tfor (auto &p : params.get_child(\"weights\")) {\n@@ -43,265 +43,260 @@ void AgcMeteringMode::Read(boost::property_tree::ptree const &params)\n }\n \n static std::string\n-read_metering_modes(std::map<std::string, AgcMeteringMode> &metering_modes,\n-\t\t    boost::property_tree::ptree const &params)\n+readMeteringModes(std::map<std::string, AgcMeteringMode> &meteringModes,\n+\t\t  boost::property_tree::ptree const &params)\n {\n \tstd::string first;\n \tfor (auto &p : params) {\n-\t\tAgcMeteringMode metering_mode;\n-\t\tmetering_mode.Read(p.second);\n-\t\tmetering_modes[p.first] = std::move(metering_mode);\n+\t\tAgcMeteringMode meteringMode;\n+\t\tmeteringMode.read(p.second);\n+\t\tmeteringModes[p.first] = std::move(meteringMode);\n \t\tif (first.empty())\n \t\t\tfirst = p.first;\n \t}\n \treturn first;\n }\n \n-static int read_list(std::vector<double> &list,\n-\t\t     boost::property_tree::ptree const &params)\n+static int readList(std::vector<double> &list,\n+\t\t    boost::property_tree::ptree const &params)\n {\n \tfor (auto &p : params)\n \t\tlist.push_back(p.second.get_value<double>());\n \treturn list.size();\n }\n \n-static int read_list(std::vector<Duration> &list,\n-\t\t     boost::property_tree::ptree const &params)\n+static int readList(std::vector<Duration> &list,\n+\t\t    boost::property_tree::ptree const &params)\n {\n \tfor (auto &p : params)\n \t\tlist.push_back(p.second.get_value<double>() * 1us);\n \treturn list.size();\n }\n \n-void AgcExposureMode::Read(boost::property_tree::ptree const &params)\n+void AgcExposureMode::read(boost::property_tree::ptree const &params)\n {\n-\tint num_shutters = read_list(shutter, params.get_child(\"shutter\"));\n-\tint num_ags = read_list(gain, params.get_child(\"gain\"));\n-\tif (num_shutters < 2 || num_ags < 2)\n+\tint numShutters = readList(shutter, params.get_child(\"shutter\"));\n+\tint numAgs = readList(gain, params.get_child(\"gain\"));\n+\tif (numShutters < 2 || numAgs < 2)\n \t\tthrow std::runtime_error(\n \t\t\t\"AgcConfig: must have at least two entries in exposure profile\");\n-\tif (num_shutters != num_ags)\n+\tif (numShutters != numAgs)\n \t\tthrow std::runtime_error(\n \t\t\t\"AgcConfig: expect same number of exposure and gain entries in exposure profile\");\n }\n \n static std::string\n-read_exposure_modes(std::map<std::string, AgcExposureMode> &exposure_modes,\n-\t\t    boost::property_tree::ptree const &params)\n+readExposureModes(std::map<std::string, AgcExposureMode> &exposureModes,\n+\t\t  boost::property_tree::ptree const &params)\n {\n \tstd::string first;\n \tfor (auto &p : params) {\n-\t\tAgcExposureMode exposure_mode;\n-\t\texposure_mode.Read(p.second);\n-\t\texposure_modes[p.first] = std::move(exposure_mode);\n+\t\tAgcExposureMode exposureMode;\n+\t\texposureMode.read(p.second);\n+\t\texposureModes[p.first] = std::move(exposureMode);\n \t\tif (first.empty())\n \t\t\tfirst = p.first;\n \t}\n \treturn first;\n }\n \n-void AgcConstraint::Read(boost::property_tree::ptree const &params)\n+void AgcConstraint::read(boost::property_tree::ptree const &params)\n {\n-\tstd::string bound_string = params.get<std::string>(\"bound\", \"\");\n-\ttransform(bound_string.begin(), bound_string.end(),\n-\t\t  bound_string.begin(), ::toupper);\n-\tif (bound_string != \"UPPER\" && bound_string != \"LOWER\")\n+\tstd::string boundString = params.get<std::string>(\"bound\", \"\");\n+\ttransform(boundString.begin(), boundString.end(),\n+\t\t  boundString.begin(), ::toupper);\n+\tif (boundString != \"UPPER\" && boundString != \"LOWER\")\n \t\tthrow std::runtime_error(\n \t\t\t\"AGC constraint type should be UPPER or LOWER\");\n-\tbound = bound_string == \"UPPER\" ? Bound::UPPER : Bound::LOWER;\n-\tq_lo = params.get<double>(\"q_lo\");\n-\tq_hi = params.get<double>(\"q_hi\");\n-\tY_target.Read(params.get_child(\"y_target\"));\n+\tbound = boundString == \"UPPER\" ? Bound::UPPER : Bound::LOWER;\n+\tqLo = params.get<double>(\"q_lo\");\n+\tqHi = params.get<double>(\"q_hi\");\n+\tyTarget.read(params.get_child(\"y_target\"));\n }\n \n static AgcConstraintMode\n-read_constraint_mode(boost::property_tree::ptree const &params)\n+readConstraintMode(boost::property_tree::ptree const &params)\n {\n \tAgcConstraintMode mode;\n \tfor (auto &p : params) {\n \t\tAgcConstraint constraint;\n-\t\tconstraint.Read(p.second);\n+\t\tconstraint.read(p.second);\n \t\tmode.push_back(std::move(constraint));\n \t}\n \treturn mode;\n }\n \n-static std::string read_constraint_modes(\n-\tstd::map<std::string, AgcConstraintMode> &constraint_modes,\n-\tboost::property_tree::ptree const &params)\n+static std::string readConstraintModes(std::map<std::string, AgcConstraintMode> &constraintModes,\n+\t\t\t\t       boost::property_tree::ptree const &params)\n {\n \tstd::string first;\n \tfor (auto &p : params) {\n-\t\tconstraint_modes[p.first] = read_constraint_mode(p.second);\n+\t\tconstraintModes[p.first] = readConstraintMode(p.second);\n \t\tif (first.empty())\n \t\t\tfirst = p.first;\n \t}\n \treturn first;\n }\n \n-void AgcConfig::Read(boost::property_tree::ptree const &params)\n+void AgcConfig::read(boost::property_tree::ptree const &params)\n {\n \tLOG(RPiAgc, Debug) << \"AgcConfig\";\n-\tdefault_metering_mode = read_metering_modes(\n-\t\tmetering_modes, params.get_child(\"metering_modes\"));\n-\tdefault_exposure_mode = read_exposure_modes(\n-\t\texposure_modes, params.get_child(\"exposure_modes\"));\n-\tdefault_constraint_mode = read_constraint_modes(\n-\t\tconstraint_modes, params.get_child(\"constraint_modes\"));\n-\tY_target.Read(params.get_child(\"y_target\"));\n+\tdefaultMeteringMode = readMeteringModes(meteringModes, params.get_child(\"metering_modes\"));\n+\tdefaultExposureMode = readExposureModes(exposureModes, params.get_child(\"exposure_modes\"));\n+\tdefaultConstraintMode = readConstraintModes(constraintModes, params.get_child(\"constraint_modes\"));\n+\tyTarget.read(params.get_child(\"y_target\"));\n \tspeed = params.get<double>(\"speed\", 0.2);\n-\tstartup_frames = params.get<uint16_t>(\"startup_frames\", 10);\n-\tconvergence_frames = params.get<unsigned int>(\"convergence_frames\", 6);\n-\tfast_reduce_threshold =\n-\t\tparams.get<double>(\"fast_reduce_threshold\", 0.4);\n-\tbase_ev = params.get<double>(\"base_ev\", 1.0);\n+\tstartupFrames = params.get<uint16_t>(\"startup_frames\", 10);\n+\tconvergenceFrames = params.get<unsigned int>(\"convergence_frames\", 6);\n+\tfastReduceThreshold = params.get<double>(\"fast_reduce_threshold\", 0.4);\n+\tbaseEv = params.get<double>(\"base_ev\", 1.0);\n \t// Start with quite a low value as ramping up is easier than ramping down.\n-\tdefault_exposure_time = params.get<double>(\"default_exposure_time\", 1000) * 1us;\n-\tdefault_analogue_gain = params.get<double>(\"default_analogue_gain\", 1.0);\n+\tdefaultExposureTime = params.get<double>(\"default_exposure_time\", 1000) * 1us;\n+\tdefaultAnalogueGain = params.get<double>(\"default_analogueGain\", 1.0);\n }\n \n Agc::ExposureValues::ExposureValues()\n-\t: shutter(0s), analogue_gain(0),\n-\t  total_exposure(0s), total_exposure_no_dg(0s)\n+\t: shutter(0s), analogueGain(0),\n+\t  totalExposure(0s), totalExposureNoDG(0s)\n {\n }\n \n Agc::Agc(Controller *controller)\n-\t: AgcAlgorithm(controller), metering_mode_(nullptr),\n-\t  exposure_mode_(nullptr), constraint_mode_(nullptr),\n-\t  frame_count_(0), lock_count_(0),\n-\t  last_target_exposure_(0s), last_sensitivity_(0.0),\n-\t  ev_(1.0), flicker_period_(0s),\n-\t  max_shutter_(0s), fixed_shutter_(0s), fixed_analogue_gain_(0.0)\n+\t: AgcAlgorithm(controller), meteringMode_(nullptr),\n+\t  exposureMode_(nullptr), constraintMode_(nullptr),\n+\t  frameCount_(0), lockCount_(0),\n+\t  lastTargetExposure_(0s), lastSensitivity_(0.0),\n+\t  ev_(1.0), flickerPeriod_(0s),\n+\t  maxShutter_(0s), fixedShutter_(0s), fixedAnalogueGain_(0.0)\n {\n \tmemset(&awb_, 0, sizeof(awb_));\n-\t// Setting status_.total_exposure_value_ to zero initially tells us\n+\t// Setting status_.totalExposureValue_ to zero initially tells us\n \t// it's not been calculated yet (i.e. Process hasn't yet run).\n \tmemset(&status_, 0, sizeof(status_));\n \tstatus_.ev = ev_;\n }\n \n-char const *Agc::Name() const\n+char const *Agc::name() const\n {\n \treturn NAME;\n }\n \n-void Agc::Read(boost::property_tree::ptree const &params)\n+void Agc::read(boost::property_tree::ptree const &params)\n {\n \tLOG(RPiAgc, Debug) << \"Agc\";\n-\tconfig_.Read(params);\n+\tconfig_.read(params);\n \t// Set the config's defaults (which are the first ones it read) as our\n \t// current modes, until someone changes them.  (they're all known to\n \t// exist at this point)\n-\tmetering_mode_name_ = config_.default_metering_mode;\n-\tmetering_mode_ = &config_.metering_modes[metering_mode_name_];\n-\texposure_mode_name_ = config_.default_exposure_mode;\n-\texposure_mode_ = &config_.exposure_modes[exposure_mode_name_];\n-\tconstraint_mode_name_ = config_.default_constraint_mode;\n-\tconstraint_mode_ = &config_.constraint_modes[constraint_mode_name_];\n+\tmeteringModeName_ = config_.defaultMeteringMode;\n+\tmeteringMode_ = &config_.meteringModes[meteringModeName_];\n+\texposureModeName_ = config_.defaultExposureMode;\n+\texposureMode_ = &config_.exposureModes[exposureModeName_];\n+\tconstraintModeName_ = config_.defaultConstraintMode;\n+\tconstraintMode_ = &config_.constraintModes[constraintModeName_];\n \t// Set up the \"last shutter/gain\" values, in case AGC starts \"disabled\".\n-\tstatus_.shutter_time = config_.default_exposure_time;\n-\tstatus_.analogue_gain = config_.default_analogue_gain;\n+\tstatus_.shutterTime = config_.defaultExposureTime;\n+\tstatus_.analogueGain = config_.defaultAnalogueGain;\n }\n \n-bool Agc::IsPaused() const\n+bool Agc::isPaused() const\n {\n \treturn false;\n }\n \n-void Agc::Pause()\n+void Agc::pause()\n {\n-\tfixed_shutter_ = status_.shutter_time;\n-\tfixed_analogue_gain_ = status_.analogue_gain;\n+\tfixedShutter_ = status_.shutterTime;\n+\tfixedAnalogueGain_ = status_.analogueGain;\n }\n \n-void Agc::Resume()\n+void Agc::resume()\n {\n-\tfixed_shutter_ = 0s;\n-\tfixed_analogue_gain_ = 0;\n+\tfixedShutter_ = 0s;\n+\tfixedAnalogueGain_ = 0;\n }\n \n-unsigned int Agc::GetConvergenceFrames() const\n+unsigned int Agc::getConvergenceFrames() const\n {\n \t// If shutter and gain have been explicitly set, there is no\n \t// convergence to happen, so no need to drop any frames - return zero.\n-\tif (fixed_shutter_ && fixed_analogue_gain_)\n+\tif (fixedShutter_ && fixedAnalogueGain_)\n \t\treturn 0;\n \telse\n-\t\treturn config_.convergence_frames;\n+\t\treturn config_.convergenceFrames;\n }\n \n-void Agc::SetEv(double ev)\n+void Agc::setEv(double ev)\n {\n \tev_ = ev;\n }\n \n-void Agc::SetFlickerPeriod(Duration flicker_period)\n+void Agc::setFlickerPeriod(Duration flickerPeriod)\n {\n-\tflicker_period_ = flicker_period;\n+\tflickerPeriod_ = flickerPeriod;\n }\n \n-void Agc::SetMaxShutter(Duration max_shutter)\n+void Agc::setMaxShutter(Duration maxShutter)\n {\n-\tmax_shutter_ = max_shutter;\n+\tmaxShutter_ = maxShutter;\n }\n \n-void Agc::SetFixedShutter(Duration fixed_shutter)\n+void Agc::setFixedShutter(Duration fixedShutter)\n {\n-\tfixed_shutter_ = fixed_shutter;\n+\tfixedShutter_ = fixedShutter;\n \t// Set this in case someone calls Pause() straight after.\n-\tstatus_.shutter_time = clipShutter(fixed_shutter_);\n+\tstatus_.shutterTime = clipShutter(fixedShutter_);\n }\n \n-void Agc::SetFixedAnalogueGain(double fixed_analogue_gain)\n+void Agc::setFixedAnalogueGain(double fixedAnalogueGain)\n {\n-\tfixed_analogue_gain_ = fixed_analogue_gain;\n+\tfixedAnalogueGain_ = fixedAnalogueGain;\n \t// Set this in case someone calls Pause() straight after.\n-\tstatus_.analogue_gain = fixed_analogue_gain;\n+\tstatus_.analogueGain = fixedAnalogueGain;\n }\n \n-void Agc::SetMeteringMode(std::string const &metering_mode_name)\n+void Agc::setMeteringMode(std::string const &meteringModeName)\n {\n-\tmetering_mode_name_ = metering_mode_name;\n+\tmeteringModeName_ = meteringModeName;\n }\n \n-void Agc::SetExposureMode(std::string const &exposure_mode_name)\n+void Agc::setExposureMode(std::string const &exposureModeName)\n {\n-\texposure_mode_name_ = exposure_mode_name;\n+\texposureModeName_ = exposureModeName;\n }\n \n-void Agc::SetConstraintMode(std::string const &constraint_mode_name)\n+void Agc::setConstraintMode(std::string const &constraintModeName)\n {\n-\tconstraint_mode_name_ = constraint_mode_name;\n+\tconstraintModeName_ = constraintModeName;\n }\n \n-void Agc::SwitchMode(CameraMode const &camera_mode,\n+void Agc::switchMode(CameraMode const &cameraMode,\n \t\t     Metadata *metadata)\n {\n \t/* AGC expects the mode sensitivity always to be non-zero. */\n-\tASSERT(camera_mode.sensitivity);\n+\tASSERT(cameraMode.sensitivity);\n \n \thousekeepConfig();\n \n-\tDuration fixed_shutter = clipShutter(fixed_shutter_);\n-\tif (fixed_shutter && fixed_analogue_gain_) {\n+\tDuration fixedShutter = clipShutter(fixedShutter_);\n+\tif (fixedShutter && fixedAnalogueGain_) {\n \t\t// We're going to reset the algorithm here with these fixed values.\n \n \t\tfetchAwbStatus(metadata);\n-\t\tdouble min_colour_gain = std::min({ awb_.gain_r, awb_.gain_g, awb_.gain_b, 1.0 });\n-\t\tASSERT(min_colour_gain != 0.0);\n+\t\tdouble minColourGain = std::min({ awb_.gainR, awb_.gainG, awb_.gainB, 1.0 });\n+\t\tASSERT(minColourGain != 0.0);\n \n \t\t// This is the equivalent of computeTargetExposure and applyDigitalGain.\n-\t\ttarget_.total_exposure_no_dg = fixed_shutter * fixed_analogue_gain_;\n-\t\ttarget_.total_exposure = target_.total_exposure_no_dg / min_colour_gain;\n+\t\ttarget_.totalExposureNoDG = fixedShutter_ * fixedAnalogueGain_;\n+\t\ttarget_.totalExposure = target_.totalExposureNoDG / minColourGain;\n \n \t\t// Equivalent of filterExposure. This resets any \"history\".\n \t\tfiltered_ = target_;\n \n \t\t// Equivalent of divideUpExposure.\n-\t\tfiltered_.shutter = fixed_shutter;\n-\t\tfiltered_.analogue_gain = fixed_analogue_gain_;\n-\t} else if (status_.total_exposure_value) {\n+\t\tfiltered_.shutter = fixedShutter;\n+\t\tfiltered_.analogueGain = fixedAnalogueGain_;\n+\t} else if (status_.totalExposureValue) {\n \t\t// On a mode switch, various things could happen:\n \t\t// - the exposure profile might change\n \t\t// - a fixed exposure or gain might be set\n@@ -310,11 +305,11 @@ void Agc::SwitchMode(CameraMode const &camera_mode,\n \t\t// that we just need to re-divide the exposure/gain according to the\n \t\t// current exposure profile, which takes care of everything else.\n \n-\t\tdouble ratio = last_sensitivity_ / camera_mode.sensitivity;\n-\t\ttarget_.total_exposure_no_dg *= ratio;\n-\t\ttarget_.total_exposure *= ratio;\n-\t\tfiltered_.total_exposure_no_dg *= ratio;\n-\t\tfiltered_.total_exposure *= ratio;\n+\t\tdouble ratio = lastSensitivity_ / cameraMode.sensitivity;\n+\t\ttarget_.totalExposureNoDG *= ratio;\n+\t\ttarget_.totalExposure *= ratio;\n+\t\tfiltered_.totalExposureNoDG *= ratio;\n+\t\tfiltered_.totalExposure *= ratio;\n \n \t\tdivideUpExposure();\n \t} else {\n@@ -324,114 +319,110 @@ void Agc::SwitchMode(CameraMode const &camera_mode,\n \t\t// for any that weren't set.\n \n \t\t// Equivalent of divideUpExposure.\n-\t\tfiltered_.shutter = fixed_shutter ? fixed_shutter : config_.default_exposure_time;\n-\t\tfiltered_.analogue_gain = fixed_analogue_gain_ ? fixed_analogue_gain_ : config_.default_analogue_gain;\n+\t\tfiltered_.shutter = fixedShutter ? fixedShutter : config_.defaultExposureTime;\n+\t\tfiltered_.analogueGain = fixedAnalogueGain_ ? fixedAnalogueGain_ : config_.defaultAnalogueGain;\n \t}\n \n \twriteAndFinish(metadata, false);\n \n \t// We must remember the sensitivity of this mode for the next SwitchMode.\n-\tlast_sensitivity_ = camera_mode.sensitivity;\n+\tlastSensitivity_ = cameraMode.sensitivity;\n }\n \n-void Agc::Prepare(Metadata *image_metadata)\n+void Agc::prepare(Metadata *imageMetadata)\n {\n-\tstatus_.digital_gain = 1.0;\n-\tfetchAwbStatus(image_metadata); // always fetch it so that Process knows it's been done\n+\tstatus_.digitalGain = 1.0;\n+\tfetchAwbStatus(imageMetadata); // always fetch it so that Process knows it's been done\n \n-\tif (status_.total_exposure_value) {\n+\tif (status_.totalExposureValue) {\n \t\t// Process has run, so we have meaningful values.\n-\t\tDeviceStatus device_status;\n-\t\tif (image_metadata->Get(\"device.status\", device_status) == 0) {\n-\t\t\tDuration actual_exposure = device_status.shutter_speed *\n-\t\t\t\t\t\t   device_status.analogue_gain;\n-\t\t\tif (actual_exposure) {\n-\t\t\t\tstatus_.digital_gain =\n-\t\t\t\t\tstatus_.total_exposure_value /\n-\t\t\t\t\tactual_exposure;\n-\t\t\t\tLOG(RPiAgc, Debug) << \"Want total exposure \" << status_.total_exposure_value;\n+\t\tDeviceStatus deviceStatus;\n+\t\tif (imageMetadata->get(\"device.status\", deviceStatus) == 0) {\n+\t\t\tDuration actualExposure = deviceStatus.shutterSpeed *\n+\t\t\t\t\t\t  deviceStatus.analogueGain;\n+\t\t\tif (actualExposure) {\n+\t\t\t\tstatus_.digitalGain = status_.totalExposureValue / actualExposure;\n+\t\t\t\tLOG(RPiAgc, Debug) << \"Want total exposure \" << status_.totalExposureValue;\n \t\t\t\t// Never ask for a gain < 1.0, and also impose\n \t\t\t\t// some upper limit. Make it customisable?\n-\t\t\t\tstatus_.digital_gain = std::max(\n-\t\t\t\t\t1.0,\n-\t\t\t\t\tstd::min(status_.digital_gain, 4.0));\n-\t\t\t\tLOG(RPiAgc, Debug) << \"Actual exposure \" << actual_exposure;\n-\t\t\t\tLOG(RPiAgc, Debug) << \"Use digital_gain \" << status_.digital_gain;\n+\t\t\t\tstatus_.digitalGain = std::max(1.0, std::min(status_.digitalGain, 4.0));\n+\t\t\t\tLOG(RPiAgc, Debug) << \"Actual exposure \" << actualExposure;\n+\t\t\t\tLOG(RPiAgc, Debug) << \"Use digitalGain \" << status_.digitalGain;\n \t\t\t\tLOG(RPiAgc, Debug) << \"Effective exposure \"\n-\t\t\t\t\t\t   << actual_exposure * status_.digital_gain;\n+\t\t\t\t\t\t   << actualExposure * status_.digitalGain;\n \t\t\t\t// Decide whether AEC/AGC has converged.\n-\t\t\t\tupdateLockStatus(device_status);\n+\t\t\t\tupdateLockStatus(deviceStatus);\n \t\t\t}\n \t\t} else\n-\t\t\tLOG(RPiAgc, Warning) << Name() << \": no device metadata\";\n-\t\timage_metadata->Set(\"agc.status\", status_);\n+\t\t\tLOG(RPiAgc, Warning) << name() << \": no device metadata\";\n+\t\timageMetadata->set(\"agc.status\", status_);\n \t}\n }\n \n-void Agc::Process(StatisticsPtr &stats, Metadata *image_metadata)\n+void Agc::process(StatisticsPtr &stats, Metadata *imageMetadata)\n {\n-\tframe_count_++;\n+\tframeCount_++;\n \t// First a little bit of housekeeping, fetching up-to-date settings and\n \t// configuration, that kind of thing.\n \thousekeepConfig();\n \t// Get the current exposure values for the frame that's just arrived.\n-\tfetchCurrentExposure(image_metadata);\n+\tfetchCurrentExposure(imageMetadata);\n \t// Compute the total gain we require relative to the current exposure.\n-\tdouble gain, target_Y;\n-\tcomputeGain(stats.get(), image_metadata, gain, target_Y);\n+\tdouble gain, targetY;\n+\tcomputeGain(stats.get(), imageMetadata, gain, targetY);\n \t// Now compute the target (final) exposure which we think we want.\n \tcomputeTargetExposure(gain);\n \t// Some of the exposure has to be applied as digital gain, so work out\n \t// what that is. This function also tells us whether it's decided to\n \t// \"desaturate\" the image more quickly.\n-\tbool desaturate = applyDigitalGain(gain, target_Y);\n+\tbool desaturate = applyDigitalGain(gain, targetY);\n \t// The results have to be filtered so as not to change too rapidly.\n \tfilterExposure(desaturate);\n \t// The last thing is to divide up the exposure value into a shutter time\n-\t// and analogue_gain, according to the current exposure mode.\n+\t// and analogue gain, according to the current exposure mode.\n \tdivideUpExposure();\n \t// Finally advertise what we've done.\n-\twriteAndFinish(image_metadata, desaturate);\n+\twriteAndFinish(imageMetadata, desaturate);\n }\n \n-void Agc::updateLockStatus(DeviceStatus const &device_status)\n+void Agc::updateLockStatus(DeviceStatus const &deviceStatus)\n {\n-\tconst double ERROR_FACTOR = 0.10; // make these customisable?\n-\tconst int MAX_LOCK_COUNT = 5;\n-\t// Reset \"lock count\" when we exceed this multiple of ERROR_FACTOR\n-\tconst double RESET_MARGIN = 1.5;\n+\tconst double errorFactor = 0.10; // make these customisable?\n+\tconst int maxLockCount = 5;\n+\t// Reset \"lock count\" when we exceed this multiple of errorFactor\n+\tconst double resetMargin = 1.5;\n \n \t// Add 200us to the exposure time error to allow for line quantisation.\n-\tDuration exposure_error = last_device_status_.shutter_speed * ERROR_FACTOR + 200us;\n-\tdouble gain_error = last_device_status_.analogue_gain * ERROR_FACTOR;\n-\tDuration target_error = last_target_exposure_ * ERROR_FACTOR;\n+\tDuration exposureError = lastDeviceStatus_.shutterSpeed * errorFactor + 200us;\n+\tdouble gainError = lastDeviceStatus_.analogueGain * errorFactor;\n+\tDuration targetError = lastTargetExposure_ * errorFactor;\n \n \t// Note that we don't know the exposure/gain limits of the sensor, so\n \t// the values we keep requesting may be unachievable. For this reason\n \t// we only insist that we're close to values in the past few frames.\n-\tif (device_status.shutter_speed > last_device_status_.shutter_speed - exposure_error &&\n-\t    device_status.shutter_speed < last_device_status_.shutter_speed + exposure_error &&\n-\t    device_status.analogue_gain > last_device_status_.analogue_gain - gain_error &&\n-\t    device_status.analogue_gain < last_device_status_.analogue_gain + gain_error &&\n-\t    status_.target_exposure_value > last_target_exposure_ - target_error &&\n-\t    status_.target_exposure_value < last_target_exposure_ + target_error)\n-\t\tlock_count_ = std::min(lock_count_ + 1, MAX_LOCK_COUNT);\n-\telse if (device_status.shutter_speed < last_device_status_.shutter_speed - RESET_MARGIN * exposure_error ||\n-\t\t device_status.shutter_speed > last_device_status_.shutter_speed + RESET_MARGIN * exposure_error ||\n-\t\t device_status.analogue_gain < last_device_status_.analogue_gain - RESET_MARGIN * gain_error ||\n-\t\t device_status.analogue_gain > last_device_status_.analogue_gain + RESET_MARGIN * gain_error ||\n-\t\t status_.target_exposure_value < last_target_exposure_ - RESET_MARGIN * target_error ||\n-\t\t status_.target_exposure_value > last_target_exposure_ + RESET_MARGIN * target_error)\n-\t\tlock_count_ = 0;\n-\n-\tlast_device_status_ = device_status;\n-\tlast_target_exposure_ = status_.target_exposure_value;\n-\n-\tLOG(RPiAgc, Debug) << \"Lock count updated to \" << lock_count_;\n-\tstatus_.locked = lock_count_ == MAX_LOCK_COUNT;\n-}\n-\n-static void copy_string(std::string const &s, char *d, size_t size)\n+\tif (deviceStatus.shutterSpeed > lastDeviceStatus_.shutterSpeed - exposureError &&\n+\t    deviceStatus.shutterSpeed < lastDeviceStatus_.shutterSpeed + exposureError &&\n+\t    deviceStatus.analogueGain > lastDeviceStatus_.analogueGain - gainError &&\n+\t    deviceStatus.analogueGain < lastDeviceStatus_.analogueGain + gainError &&\n+\t    status_.targetExposureValue > lastTargetExposure_ - targetError &&\n+\t    status_.targetExposureValue < lastTargetExposure_ + targetError)\n+\t\tlockCount_ = std::min(lockCount_ + 1, maxLockCount);\n+\telse if (deviceStatus.shutterSpeed < lastDeviceStatus_.shutterSpeed - resetMargin * exposureError ||\n+\t\t deviceStatus.shutterSpeed > lastDeviceStatus_.shutterSpeed + resetMargin * exposureError ||\n+\t\t deviceStatus.analogueGain < lastDeviceStatus_.analogueGain - resetMargin * gainError ||\n+\t\t deviceStatus.analogueGain > lastDeviceStatus_.analogueGain + resetMargin * gainError ||\n+\t\t status_.targetExposureValue < lastTargetExposure_ - resetMargin * targetError ||\n+\t\t status_.targetExposureValue > lastTargetExposure_ + resetMargin * targetError)\n+\t\tlockCount_ = 0;\n+\n+\tlastDeviceStatus_ = deviceStatus;\n+\tlastTargetExposure_ = status_.targetExposureValue;\n+\n+\tLOG(RPiAgc, Debug) << \"Lock count updated to \" << lockCount_;\n+\tstatus_.locked = lockCount_ == maxLockCount;\n+}\n+\n+static void copyString(std::string const &s, char *d, size_t size)\n {\n \tsize_t length = s.copy(d, size - 1);\n \td[length] = '\\0';\n@@ -441,97 +432,97 @@ void Agc::housekeepConfig()\n {\n \t// First fetch all the up-to-date settings, so no one else has to do it.\n \tstatus_.ev = ev_;\n-\tstatus_.fixed_shutter = clipShutter(fixed_shutter_);\n-\tstatus_.fixed_analogue_gain = fixed_analogue_gain_;\n-\tstatus_.flicker_period = flicker_period_;\n-\tLOG(RPiAgc, Debug) << \"ev \" << status_.ev << \" fixed_shutter \"\n-\t\t\t   << status_.fixed_shutter << \" fixed_analogue_gain \"\n-\t\t\t   << status_.fixed_analogue_gain;\n+\tstatus_.fixedShutter = clipShutter(fixedShutter_);\n+\tstatus_.fixedAnalogueGain = fixedAnalogueGain_;\n+\tstatus_.flickerPeriod = flickerPeriod_;\n+\tLOG(RPiAgc, Debug) << \"ev \" << status_.ev << \" fixedShutter \"\n+\t\t\t   << status_.fixedShutter << \" fixedAnalogueGain \"\n+\t\t\t   << status_.fixedAnalogueGain;\n \t// Make sure the \"mode\" pointers point to the up-to-date things, if\n \t// they've changed.\n-\tif (strcmp(metering_mode_name_.c_str(), status_.metering_mode)) {\n-\t\tauto it = config_.metering_modes.find(metering_mode_name_);\n-\t\tif (it == config_.metering_modes.end())\n+\tif (strcmp(meteringModeName_.c_str(), status_.meteringMode)) {\n+\t\tauto it = config_.meteringModes.find(meteringModeName_);\n+\t\tif (it == config_.meteringModes.end())\n \t\t\tthrow std::runtime_error(\"Agc: no metering mode \" +\n-\t\t\t\t\t\t metering_mode_name_);\n-\t\tmetering_mode_ = &it->second;\n-\t\tcopy_string(metering_mode_name_, status_.metering_mode,\n-\t\t\t    sizeof(status_.metering_mode));\n+\t\t\t\t\t\t meteringModeName_);\n+\t\tmeteringMode_ = &it->second;\n+\t\tcopyString(meteringModeName_, status_.meteringMode,\n+\t\t\t   sizeof(status_.meteringMode));\n \t}\n-\tif (strcmp(exposure_mode_name_.c_str(), status_.exposure_mode)) {\n-\t\tauto it = config_.exposure_modes.find(exposure_mode_name_);\n-\t\tif (it == config_.exposure_modes.end())\n+\tif (strcmp(exposureModeName_.c_str(), status_.exposureMode)) {\n+\t\tauto it = config_.exposureModes.find(exposureModeName_);\n+\t\tif (it == config_.exposureModes.end())\n \t\t\tthrow std::runtime_error(\"Agc: no exposure profile \" +\n-\t\t\t\t\t\t exposure_mode_name_);\n-\t\texposure_mode_ = &it->second;\n-\t\tcopy_string(exposure_mode_name_, status_.exposure_mode,\n-\t\t\t    sizeof(status_.exposure_mode));\n+\t\t\t\t\t\t exposureModeName_);\n+\t\texposureMode_ = &it->second;\n+\t\tcopyString(exposureModeName_, status_.exposureMode,\n+\t\t\t   sizeof(status_.exposureMode));\n \t}\n-\tif (strcmp(constraint_mode_name_.c_str(), status_.constraint_mode)) {\n+\tif (strcmp(constraintModeName_.c_str(), status_.constraintMode)) {\n \t\tauto it =\n-\t\t\tconfig_.constraint_modes.find(constraint_mode_name_);\n-\t\tif (it == config_.constraint_modes.end())\n+\t\t\tconfig_.constraintModes.find(constraintModeName_);\n+\t\tif (it == config_.constraintModes.end())\n \t\t\tthrow std::runtime_error(\"Agc: no constraint list \" +\n-\t\t\t\t\t\t constraint_mode_name_);\n-\t\tconstraint_mode_ = &it->second;\n-\t\tcopy_string(constraint_mode_name_, status_.constraint_mode,\n-\t\t\t    sizeof(status_.constraint_mode));\n+\t\t\t\t\t\t constraintModeName_);\n+\t\tconstraintMode_ = &it->second;\n+\t\tcopyString(constraintModeName_, status_.constraintMode,\n+\t\t\t   sizeof(status_.constraintMode));\n \t}\n-\tLOG(RPiAgc, Debug) << \"exposure_mode \"\n-\t\t\t   << exposure_mode_name_ << \" constraint_mode \"\n-\t\t\t   << constraint_mode_name_ << \" metering_mode \"\n-\t\t\t   << metering_mode_name_;\n+\tLOG(RPiAgc, Debug) << \"exposureMode \"\n+\t\t\t   << exposureModeName_ << \" constraintMode \"\n+\t\t\t   << constraintModeName_ << \" meteringMode \"\n+\t\t\t   << meteringModeName_;\n }\n \n-void Agc::fetchCurrentExposure(Metadata *image_metadata)\n+void Agc::fetchCurrentExposure(Metadata *imageMetadata)\n {\n-\tstd::unique_lock<Metadata> lock(*image_metadata);\n-\tDeviceStatus *device_status =\n-\t\timage_metadata->GetLocked<DeviceStatus>(\"device.status\");\n-\tif (!device_status)\n+\tstd::unique_lock<Metadata> lock(*imageMetadata);\n+\tDeviceStatus *deviceStatus =\n+\t\timageMetadata->getLocked<DeviceStatus>(\"device.status\");\n+\tif (!deviceStatus)\n \t\tthrow std::runtime_error(\"Agc: no device metadata\");\n-\tcurrent_.shutter = device_status->shutter_speed;\n-\tcurrent_.analogue_gain = device_status->analogue_gain;\n-\tAgcStatus *agc_status =\n-\t\timage_metadata->GetLocked<AgcStatus>(\"agc.status\");\n-\tcurrent_.total_exposure = agc_status ? agc_status->total_exposure_value : 0s;\n-\tcurrent_.total_exposure_no_dg = current_.shutter * current_.analogue_gain;\n+\tcurrent_.shutter = deviceStatus->shutterSpeed;\n+\tcurrent_.analogueGain = deviceStatus->analogueGain;\n+\tAgcStatus *agcStatus =\n+\t\timageMetadata->getLocked<AgcStatus>(\"agc.status\");\n+\tcurrent_.totalExposure = agcStatus ? agcStatus->totalExposureValue : 0s;\n+\tcurrent_.totalExposureNoDG = current_.shutter * current_.analogueGain;\n }\n \n-void Agc::fetchAwbStatus(Metadata *image_metadata)\n+void Agc::fetchAwbStatus(Metadata *imageMetadata)\n {\n-\tawb_.gain_r = 1.0; // in case not found in metadata\n-\tawb_.gain_g = 1.0;\n-\tawb_.gain_b = 1.0;\n-\tif (image_metadata->Get(\"awb.status\", awb_) != 0)\n+\tawb_.gainR = 1.0; // in case not found in metadata\n+\tawb_.gainG = 1.0;\n+\tawb_.gainB = 1.0;\n+\tif (imageMetadata->get(\"awb.status\", awb_) != 0)\n \t\tLOG(RPiAgc, Debug) << \"Agc: no AWB status found\";\n }\n \n-static double compute_initial_Y(bcm2835_isp_stats *stats, AwbStatus const &awb,\n-\t\t\t\tdouble weights[], double gain)\n+static double computeInitialY(bcm2835_isp_stats *stats, AwbStatus const &awb,\n+\t\t\t      double weights[], double gain)\n {\n \tbcm2835_isp_stats_region *regions = stats->agc_stats;\n \t// Note how the calculation below means that equal weights give you\n \t// \"average\" metering (i.e. all pixels equally important).\n-\tdouble R_sum = 0, G_sum = 0, B_sum = 0, pixel_sum = 0;\n+\tdouble rSum = 0, gSum = 0, bSum = 0, pixelSum = 0;\n \tfor (int i = 0; i < AGC_STATS_SIZE; i++) {\n \t\tdouble counted = regions[i].counted;\n-\t\tdouble r_sum = std::min(regions[i].r_sum * gain, ((1 << PIPELINE_BITS) - 1) * counted);\n-\t\tdouble g_sum = std::min(regions[i].g_sum * gain, ((1 << PIPELINE_BITS) - 1) * counted);\n-\t\tdouble b_sum = std::min(regions[i].b_sum * gain, ((1 << PIPELINE_BITS) - 1) * counted);\n-\t\tR_sum += r_sum * weights[i];\n-\t\tG_sum += g_sum * weights[i];\n-\t\tB_sum += b_sum * weights[i];\n-\t\tpixel_sum += counted * weights[i];\n+\t\tdouble rAcc = std::min(regions[i].r_sum * gain, ((1 << PIPELINE_BITS) - 1) * counted);\n+\t\tdouble gAcc = std::min(regions[i].g_sum * gain, ((1 << PIPELINE_BITS) - 1) * counted);\n+\t\tdouble bAcc = std::min(regions[i].b_sum * gain, ((1 << PIPELINE_BITS) - 1) * counted);\n+\t\trSum += rAcc * weights[i];\n+\t\tgSum += gAcc * weights[i];\n+\t\tbSum += bAcc * weights[i];\n+\t\tpixelSum += counted * weights[i];\n \t}\n-\tif (pixel_sum == 0.0) {\n-\t\tLOG(RPiAgc, Warning) << \"compute_initial_Y: pixel_sum is zero\";\n+\tif (pixelSum == 0.0) {\n+\t\tLOG(RPiAgc, Warning) << \"computeInitialY: pixel_sum is zero\";\n \t\treturn 0;\n \t}\n-\tdouble Y_sum = R_sum * awb.gain_r * .299 +\n-\t\t       G_sum * awb.gain_g * .587 +\n-\t\t       B_sum * awb.gain_b * .114;\n-\treturn Y_sum / pixel_sum / (1 << PIPELINE_BITS);\n+\tdouble ySum = rSum * awb.gainR * .299 +\n+\t\t      gSum * awb.gainG * .587 +\n+\t\t      bSum * awb.gainB * .114;\n+\treturn ySum / pixelSum / (1 << PIPELINE_BITS);\n }\n \n // We handle extra gain through EV by adjusting our Y targets. However, you\n@@ -542,108 +533,102 @@ static double compute_initial_Y(bcm2835_isp_stats *stats, AwbStatus const &awb,\n \n #define EV_GAIN_Y_TARGET_LIMIT 0.9\n \n-static double constraint_compute_gain(AgcConstraint &c, Histogram &h,\n-\t\t\t\t      double lux, double ev_gain,\n-\t\t\t\t      double &target_Y)\n+static double constraintComputeGain(AgcConstraint &c, Histogram &h, double lux,\n+\t\t\t\t    double evGain, double &targetY)\n {\n-\ttarget_Y = c.Y_target.Eval(c.Y_target.Domain().Clip(lux));\n-\ttarget_Y = std::min(EV_GAIN_Y_TARGET_LIMIT, target_Y * ev_gain);\n-\tdouble iqm = h.InterQuantileMean(c.q_lo, c.q_hi);\n-\treturn (target_Y * NUM_HISTOGRAM_BINS) / iqm;\n+\ttargetY = c.yTarget.eval(c.yTarget.domain().clip(lux));\n+\ttargetY = std::min(EV_GAIN_Y_TARGET_LIMIT, targetY * evGain);\n+\tdouble iqm = h.interQuantileMean(c.qLo, c.qHi);\n+\treturn (targetY * NUM_HISTOGRAM_BINS) / iqm;\n }\n \n-void Agc::computeGain(bcm2835_isp_stats *statistics, Metadata *image_metadata,\n-\t\t      double &gain, double &target_Y)\n+void Agc::computeGain(bcm2835_isp_stats *statistics, Metadata *imageMetadata,\n+\t\t      double &gain, double &targetY)\n {\n \tstruct LuxStatus lux = {};\n \tlux.lux = 400; // default lux level to 400 in case no metadata found\n-\tif (image_metadata->Get(\"lux.status\", lux) != 0)\n+\tif (imageMetadata->get(\"lux.status\", lux) != 0)\n \t\tLOG(RPiAgc, Warning) << \"Agc: no lux level found\";\n \tHistogram h(statistics->hist[0].g_hist, NUM_HISTOGRAM_BINS);\n-\tdouble ev_gain = status_.ev * config_.base_ev;\n+\tdouble evGain = status_.ev * config_.baseEv;\n \t// The initial gain and target_Y come from some of the regions. After\n \t// that we consider the histogram constraints.\n-\ttarget_Y =\n-\t\tconfig_.Y_target.Eval(config_.Y_target.Domain().Clip(lux.lux));\n-\ttarget_Y = std::min(EV_GAIN_Y_TARGET_LIMIT, target_Y * ev_gain);\n+\ttargetY = config_.yTarget.eval(config_.yTarget.domain().clip(lux.lux));\n+\ttargetY = std::min(EV_GAIN_Y_TARGET_LIMIT, targetY * evGain);\n \n \t// Do this calculation a few times as brightness increase can be\n \t// non-linear when there are saturated regions.\n \tgain = 1.0;\n \tfor (int i = 0; i < 8; i++) {\n-\t\tdouble initial_Y = compute_initial_Y(statistics, awb_,\n-\t\t\t\t\t\t     metering_mode_->weights, gain);\n-\t\tdouble extra_gain = std::min(10.0, target_Y / (initial_Y + .001));\n-\t\tgain *= extra_gain;\n-\t\tLOG(RPiAgc, Debug) << \"Initial Y \" << initial_Y << \" target \" << target_Y\n+\t\tdouble initialY = computeInitialY(statistics, awb_, meteringMode_->weights, gain);\n+\t\tdouble extraGain = std::min(10.0, targetY / (initialY + .001));\n+\t\tgain *= extraGain;\n+\t\tLOG(RPiAgc, Debug) << \"Initial Y \" << initialY << \" target \" << targetY\n \t\t\t\t   << \" gives gain \" << gain;\n-\t\tif (extra_gain < 1.01) // close enough\n+\t\tif (extraGain < 1.01) // close enough\n \t\t\tbreak;\n \t}\n \n-\tfor (auto &c : *constraint_mode_) {\n-\t\tdouble new_target_Y;\n-\t\tdouble new_gain =\n-\t\t\tconstraint_compute_gain(c, h, lux.lux, ev_gain,\n-\t\t\t\t\t\tnew_target_Y);\n+\tfor (auto &c : *constraintMode_) {\n+\t\tdouble newTargetY;\n+\t\tdouble newGain = constraintComputeGain(c, h, lux.lux, evGain, newTargetY);\n \t\tLOG(RPiAgc, Debug) << \"Constraint has target_Y \"\n-\t\t\t\t   << new_target_Y << \" giving gain \" << new_gain;\n-\t\tif (c.bound == AgcConstraint::Bound::LOWER &&\n-\t\t    new_gain > gain) {\n+\t\t\t\t   << newTargetY << \" giving gain \" << newGain;\n+\t\tif (c.bound == AgcConstraint::Bound::LOWER && newGain > gain) {\n \t\t\tLOG(RPiAgc, Debug) << \"Lower bound constraint adopted\";\n-\t\t\tgain = new_gain, target_Y = new_target_Y;\n-\t\t} else if (c.bound == AgcConstraint::Bound::UPPER &&\n-\t\t\t   new_gain < gain) {\n+\t\t\tgain = newGain;\n+\t\t\ttargetY = newTargetY;\n+\t\t} else if (c.bound == AgcConstraint::Bound::UPPER && newGain < gain) {\n \t\t\tLOG(RPiAgc, Debug) << \"Upper bound constraint adopted\";\n-\t\t\tgain = new_gain, target_Y = new_target_Y;\n+\t\t\tgain = newGain;\n+\t\t\ttargetY = newTargetY;\n \t\t}\n \t}\n-\tLOG(RPiAgc, Debug) << \"Final gain \" << gain << \" (target_Y \" << target_Y << \" ev \"\n-\t\t\t   << status_.ev << \" base_ev \" << config_.base_ev\n+\tLOG(RPiAgc, Debug) << \"Final gain \" << gain << \" (target_Y \" << targetY << \" ev \"\n+\t\t\t   << status_.ev << \" base_ev \" << config_.baseEv\n \t\t\t   << \")\";\n }\n \n void Agc::computeTargetExposure(double gain)\n {\n-\tif (status_.fixed_shutter && status_.fixed_analogue_gain) {\n+\tif (status_.fixedShutter && status_.fixedAnalogueGain) {\n \t\t// When ag and shutter are both fixed, we need to drive the\n \t\t// total exposure so that we end up with a digital gain of at least\n-\t\t// 1/min_colour_gain. Otherwise we'd desaturate channels causing\n+\t\t// 1/minColourGain. Otherwise we'd desaturate channels causing\n \t\t// white to go cyan or magenta.\n-\t\tdouble min_colour_gain = std::min({ awb_.gain_r, awb_.gain_g, awb_.gain_b, 1.0 });\n-\t\tASSERT(min_colour_gain != 0.0);\n-\t\ttarget_.total_exposure =\n-\t\t\tstatus_.fixed_shutter * status_.fixed_analogue_gain / min_colour_gain;\n+\t\tdouble minColourGain = std::min({ awb_.gainR, awb_.gainG, awb_.gainB, 1.0 });\n+\t\tASSERT(minColourGain != 0.0);\n+\t\ttarget_.totalExposure =\n+\t\t\tstatus_.fixedShutter * status_.fixedAnalogueGain / minColourGain;\n \t} else {\n \t\t// The statistics reflect the image without digital gain, so the final\n \t\t// total exposure we're aiming for is:\n-\t\ttarget_.total_exposure = current_.total_exposure_no_dg * gain;\n+\t\ttarget_.totalExposure = current_.totalExposureNoDG * gain;\n \t\t// The final target exposure is also limited to what the exposure\n \t\t// mode allows.\n-\t\tDuration max_shutter = status_.fixed_shutter\n-\t\t\t\t   ? status_.fixed_shutter\n-\t\t\t\t   : exposure_mode_->shutter.back();\n-\t\tmax_shutter = clipShutter(max_shutter);\n-\t\tDuration max_total_exposure =\n-\t\t\tmax_shutter *\n-\t\t\t(status_.fixed_analogue_gain != 0.0\n-\t\t\t\t ? status_.fixed_analogue_gain\n-\t\t\t\t : exposure_mode_->gain.back());\n-\t\ttarget_.total_exposure = std::min(target_.total_exposure,\n-\t\t\t\t\t\t  max_total_exposure);\n+\t\tDuration maxShutter = status_.fixedShutter\n+\t\t\t\t\t      ? status_.fixedShutter\n+\t\t\t\t\t      : exposureMode_->shutter.back();\n+\t\tmaxShutter = clipShutter(maxShutter);\n+\t\tDuration maxTotalExposure =\n+\t\t\tmaxShutter *\n+\t\t\t(status_.fixedAnalogueGain != 0.0\n+\t\t\t\t ? status_.fixedAnalogueGain\n+\t\t\t\t : exposureMode_->gain.back());\n+\t\ttarget_.totalExposure = std::min(target_.totalExposure, maxTotalExposure);\n \t}\n-\tLOG(RPiAgc, Debug) << \"Target total_exposure \" << target_.total_exposure;\n+\tLOG(RPiAgc, Debug) << \"Target totalExposure \" << target_.totalExposure;\n }\n \n-bool Agc::applyDigitalGain(double gain, double target_Y)\n+bool Agc::applyDigitalGain(double gain, double targetY)\n {\n-\tdouble min_colour_gain = std::min({ awb_.gain_r, awb_.gain_g, awb_.gain_b, 1.0 });\n-\tASSERT(min_colour_gain != 0.0);\n-\tdouble dg = 1.0 / min_colour_gain;\n+\tdouble minColourGain = std::min({ awb_.gainR, awb_.gainG, awb_.gainB, 1.0 });\n+\tASSERT(minColourGain != 0.0);\n+\tdouble dg = 1.0 / minColourGain;\n \t// I think this pipeline subtracts black level and rescales before we\n \t// get the stats, so no need to worry about it.\n \tLOG(RPiAgc, Debug) << \"after AWB, target dg \" << dg << \" gain \" << gain\n-\t\t\t   << \" target_Y \" << target_Y;\n+\t\t\t   << \" target_Y \" << targetY;\n \t// Finally, if we're trying to reduce exposure but the target_Y is\n \t// \"close\" to 1.0, then the gain computed for that constraint will be\n \t// only slightly less than one, because the measured Y can never be\n@@ -651,13 +636,13 @@ bool Agc::applyDigitalGain(double gain, double target_Y)\n \t// that the exposure can be reduced, de-saturating the image much more\n \t// quickly (and we then approach the correct value more quickly from\n \t// below).\n-\tbool desaturate = target_Y > config_.fast_reduce_threshold &&\n-\t\t\t  gain < sqrt(target_Y);\n+\tbool desaturate = targetY > config_.fastReduceThreshold &&\n+\t\t\t  gain < sqrt(targetY);\n \tif (desaturate)\n-\t\tdg /= config_.fast_reduce_threshold;\n+\t\tdg /= config_.fastReduceThreshold;\n \tLOG(RPiAgc, Debug) << \"Digital gain \" << dg << \" desaturate? \" << desaturate;\n-\ttarget_.total_exposure_no_dg = target_.total_exposure / dg;\n-\tLOG(RPiAgc, Debug) << \"Target total_exposure_no_dg \" << target_.total_exposure_no_dg;\n+\ttarget_.totalExposureNoDG = target_.totalExposure / dg;\n+\tLOG(RPiAgc, Debug) << \"Target totalExposureNoDG \" << target_.totalExposureNoDG;\n \treturn desaturate;\n }\n \n@@ -666,39 +651,38 @@ void Agc::filterExposure(bool desaturate)\n \tdouble speed = config_.speed;\n \t// AGC adapts instantly if both shutter and gain are directly specified\n \t// or we're in the startup phase.\n-\tif ((status_.fixed_shutter && status_.fixed_analogue_gain) ||\n-\t    frame_count_ <= config_.startup_frames)\n+\tif ((status_.fixedShutter && status_.fixedAnalogueGain) ||\n+\t    frameCount_ <= config_.startupFrames)\n \t\tspeed = 1.0;\n-\tif (!filtered_.total_exposure) {\n-\t\tfiltered_.total_exposure = target_.total_exposure;\n-\t\tfiltered_.total_exposure_no_dg = target_.total_exposure_no_dg;\n+\tif (!filtered_.totalExposure) {\n+\t\tfiltered_.totalExposure = target_.totalExposure;\n+\t\tfiltered_.totalExposureNoDG = target_.totalExposureNoDG;\n \t} else {\n \t\t// If close to the result go faster, to save making so many\n \t\t// micro-adjustments on the way. (Make this customisable?)\n-\t\tif (filtered_.total_exposure < 1.2 * target_.total_exposure &&\n-\t\t    filtered_.total_exposure > 0.8 * target_.total_exposure)\n+\t\tif (filtered_.totalExposure < 1.2 * target_.totalExposure &&\n+\t\t    filtered_.totalExposure > 0.8 * target_.totalExposure)\n \t\t\tspeed = sqrt(speed);\n-\t\tfiltered_.total_exposure = speed * target_.total_exposure +\n-\t\t\t\t\t   filtered_.total_exposure * (1.0 - speed);\n-\t\t// When desaturing, take a big jump down in exposure_no_dg,\n+\t\tfiltered_.totalExposure = speed * target_.totalExposure +\n+\t\t\t\t\t  filtered_.totalExposure * (1.0 - speed);\n+\t\t// When desaturing, take a big jump down in totalExposureNoDG,\n \t\t// which we'll hide with digital gain.\n \t\tif (desaturate)\n-\t\t\tfiltered_.total_exposure_no_dg =\n-\t\t\t\ttarget_.total_exposure_no_dg;\n+\t\t\tfiltered_.totalExposureNoDG =\n+\t\t\t\ttarget_.totalExposureNoDG;\n \t\telse\n-\t\t\tfiltered_.total_exposure_no_dg =\n-\t\t\t\tspeed * target_.total_exposure_no_dg +\n-\t\t\t\tfiltered_.total_exposure_no_dg * (1.0 - speed);\n+\t\t\tfiltered_.totalExposureNoDG =\n+\t\t\t\tspeed * target_.totalExposureNoDG +\n+\t\t\t\tfiltered_.totalExposureNoDG * (1.0 - speed);\n \t}\n-\t// We can't let the no_dg exposure deviate too far below the\n+\t// We can't let the totalExposureNoDG exposure deviate too far below the\n \t// total exposure, as there might not be enough digital gain available\n \t// in the ISP to hide it (which will cause nasty oscillation).\n-\tif (filtered_.total_exposure_no_dg <\n-\t    filtered_.total_exposure * config_.fast_reduce_threshold)\n-\t\tfiltered_.total_exposure_no_dg = filtered_.total_exposure *\n-\t\t\t\t\t\t config_.fast_reduce_threshold;\n-\tLOG(RPiAgc, Debug) << \"After filtering, total_exposure \" << filtered_.total_exposure\n-\t\t\t   << \" no dg \" << filtered_.total_exposure_no_dg;\n+\tif (filtered_.totalExposureNoDG <\n+\t    filtered_.totalExposure * config_.fastReduceThreshold)\n+\t\tfiltered_.totalExposureNoDG = filtered_.totalExposure * config_.fastReduceThreshold;\n+\tLOG(RPiAgc, Debug) << \"After filtering, totalExposure \" << filtered_.totalExposure\n+\t\t\t   << \" no dg \" << filtered_.totalExposureNoDG;\n }\n \n void Agc::divideUpExposure()\n@@ -706,92 +690,84 @@ void Agc::divideUpExposure()\n \t// Sending the fixed shutter/gain cases through the same code may seem\n \t// unnecessary, but it will make more sense when extend this to cover\n \t// variable aperture.\n-\tDuration exposure_value = filtered_.total_exposure_no_dg;\n-\tDuration shutter_time;\n-\tdouble analogue_gain;\n-\tshutter_time = status_.fixed_shutter\n-\t\t\t       ? status_.fixed_shutter\n-\t\t\t       : exposure_mode_->shutter[0];\n-\tshutter_time = clipShutter(shutter_time);\n-\tanalogue_gain = status_.fixed_analogue_gain != 0.0\n-\t\t\t\t? status_.fixed_analogue_gain\n-\t\t\t\t: exposure_mode_->gain[0];\n-\tif (shutter_time * analogue_gain < exposure_value) {\n+\tDuration exposureValue = filtered_.totalExposureNoDG;\n+\tDuration shutterTime;\n+\tdouble analogueGain;\n+\tshutterTime = status_.fixedShutter ? status_.fixedShutter\n+\t\t\t\t\t   : exposureMode_->shutter[0];\n+\tshutterTime = clipShutter(shutterTime);\n+\tanalogueGain = status_.fixedAnalogueGain != 0.0 ? status_.fixedAnalogueGain\n+\t\t\t\t\t\t\t: exposureMode_->gain[0];\n+\tif (shutterTime * analogueGain < exposureValue) {\n \t\tfor (unsigned int stage = 1;\n-\t\t     stage < exposure_mode_->gain.size(); stage++) {\n-\t\t\tif (!status_.fixed_shutter) {\n-\t\t\t\tDuration stage_shutter =\n-\t\t\t\t\tclipShutter(exposure_mode_->shutter[stage]);\n-\t\t\t\tif (stage_shutter * analogue_gain >=\n-\t\t\t\t    exposure_value) {\n-\t\t\t\t\tshutter_time =\n-\t\t\t\t\t\texposure_value / analogue_gain;\n+\t\t     stage < exposureMode_->gain.size(); stage++) {\n+\t\t\tif (!status_.fixedShutter) {\n+\t\t\t\tDuration stageShutter =\n+\t\t\t\t\tclipShutter(exposureMode_->shutter[stage]);\n+\t\t\t\tif (stageShutter * analogueGain >= exposureValue) {\n+\t\t\t\t\tshutterTime = exposureValue / analogueGain;\n \t\t\t\t\tbreak;\n \t\t\t\t}\n-\t\t\t\tshutter_time = stage_shutter;\n+\t\t\t\tshutterTime = stageShutter;\n \t\t\t}\n-\t\t\tif (status_.fixed_analogue_gain == 0.0) {\n-\t\t\t\tif (exposure_mode_->gain[stage] *\n-\t\t\t\t\t    shutter_time >=\n-\t\t\t\t    exposure_value) {\n-\t\t\t\t\tanalogue_gain =\n-\t\t\t\t\t\texposure_value / shutter_time;\n+\t\t\tif (status_.fixedAnalogueGain == 0.0) {\n+\t\t\t\tif (exposureMode_->gain[stage] * shutterTime >= exposureValue) {\n+\t\t\t\t\tanalogueGain = exposureValue / shutterTime;\n \t\t\t\t\tbreak;\n \t\t\t\t}\n-\t\t\t\tanalogue_gain = exposure_mode_->gain[stage];\n+\t\t\t\tanalogueGain = exposureMode_->gain[stage];\n \t\t\t}\n \t\t}\n \t}\n-\tLOG(RPiAgc, Debug) << \"Divided up shutter and gain are \" << shutter_time << \" and \"\n-\t\t\t   << analogue_gain;\n+\tLOG(RPiAgc, Debug) << \"Divided up shutter and gain are \" << shutterTime << \" and \"\n+\t\t\t   << analogueGain;\n \t// Finally adjust shutter time for flicker avoidance (require both\n \t// shutter and gain not to be fixed).\n-\tif (!status_.fixed_shutter && !status_.fixed_analogue_gain &&\n-\t    status_.flicker_period) {\n-\t\tint flicker_periods = shutter_time / status_.flicker_period;\n-\t\tif (flicker_periods) {\n-\t\t\tDuration new_shutter_time = flicker_periods * status_.flicker_period;\n-\t\t\tanalogue_gain *= shutter_time / new_shutter_time;\n+\tif (!status_.fixedShutter && !status_.fixedAnalogueGain &&\n+\t    status_.flickerPeriod) {\n+\t\tint flickerPeriods = shutterTime / status_.flickerPeriod;\n+\t\tif (flickerPeriods) {\n+\t\t\tDuration newShutterTime = flickerPeriods * status_.flickerPeriod;\n+\t\t\tanalogueGain *= shutterTime / newShutterTime;\n \t\t\t// We should still not allow the ag to go over the\n \t\t\t// largest value in the exposure mode. Note that this\n \t\t\t// may force more of the total exposure into the digital\n \t\t\t// gain as a side-effect.\n-\t\t\tanalogue_gain = std::min(analogue_gain,\n-\t\t\t\t\t\t exposure_mode_->gain.back());\n-\t\t\tshutter_time = new_shutter_time;\n+\t\t\tanalogueGain = std::min(analogueGain, exposureMode_->gain.back());\n+\t\t\tshutterTime = newShutterTime;\n \t\t}\n \t\tLOG(RPiAgc, Debug) << \"After flicker avoidance, shutter \"\n-\t\t\t\t   << shutter_time << \" gain \" << analogue_gain;\n+\t\t\t\t   << shutterTime << \" gain \" << analogueGain;\n \t}\n-\tfiltered_.shutter = shutter_time;\n-\tfiltered_.analogue_gain = analogue_gain;\n+\tfiltered_.shutter = shutterTime;\n+\tfiltered_.analogueGain = analogueGain;\n }\n \n-void Agc::writeAndFinish(Metadata *image_metadata, bool desaturate)\n+void Agc::writeAndFinish(Metadata *imageMetadata, bool desaturate)\n {\n-\tstatus_.total_exposure_value = filtered_.total_exposure;\n-\tstatus_.target_exposure_value = desaturate ? 0s : target_.total_exposure_no_dg;\n-\tstatus_.shutter_time = filtered_.shutter;\n-\tstatus_.analogue_gain = filtered_.analogue_gain;\n+\tstatus_.totalExposureValue = filtered_.totalExposure;\n+\tstatus_.targetExposureValue = desaturate ? 0s : target_.totalExposureNoDG;\n+\tstatus_.shutterTime = filtered_.shutter;\n+\tstatus_.analogueGain = filtered_.analogueGain;\n \t// Write to metadata as well, in case anyone wants to update the camera\n \t// immediately.\n-\timage_metadata->Set(\"agc.status\", status_);\n+\timageMetadata->set(\"agc.status\", status_);\n \tLOG(RPiAgc, Debug) << \"Output written, total exposure requested is \"\n-\t\t\t   << filtered_.total_exposure;\n+\t\t\t   << filtered_.totalExposure;\n \tLOG(RPiAgc, Debug) << \"Camera exposure update: shutter time \" << filtered_.shutter\n-\t\t\t   << \" analogue gain \" << filtered_.analogue_gain;\n+\t\t\t   << \" analogue gain \" << filtered_.analogueGain;\n }\n \n Duration Agc::clipShutter(Duration shutter)\n {\n-\tif (max_shutter_)\n-\t\tshutter = std::min(shutter, max_shutter_);\n+\tif (maxShutter_)\n+\t\tshutter = std::min(shutter, maxShutter_);\n \treturn shutter;\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 Agc(controller);\n }\n-static RegisterAlgorithm reg(NAME, &Create);\n+static RegisterAlgorithm reg(NAME, &create);\ndiff --git a/src/ipa/raspberrypi/controller/rpi/agc.hpp b/src/ipa/raspberrypi/controller/rpi/agc.hpp\nindex c100d3128c90..4ed7293bce97 100644\n--- a/src/ipa/raspberrypi/controller/rpi/agc.hpp\n+++ b/src/ipa/raspberrypi/controller/rpi/agc.hpp\n@@ -26,114 +26,114 @@ namespace RPiController {\n \n struct AgcMeteringMode {\n \tdouble weights[AGC_STATS_SIZE];\n-\tvoid Read(boost::property_tree::ptree const &params);\n+\tvoid read(boost::property_tree::ptree const &params);\n };\n \n struct AgcExposureMode {\n \tstd::vector<libcamera::utils::Duration> shutter;\n \tstd::vector<double> gain;\n-\tvoid Read(boost::property_tree::ptree const &params);\n+\tvoid read(boost::property_tree::ptree const &params);\n };\n \n struct AgcConstraint {\n \tenum class Bound { LOWER = 0, UPPER = 1 };\n \tBound bound;\n-\tdouble q_lo;\n-\tdouble q_hi;\n-\tPwl Y_target;\n-\tvoid Read(boost::property_tree::ptree const &params);\n+\tdouble qLo;\n+\tdouble qHi;\n+\tPwl yTarget;\n+\tvoid read(boost::property_tree::ptree const &params);\n };\n \n typedef std::vector<AgcConstraint> AgcConstraintMode;\n \n struct AgcConfig {\n-\tvoid Read(boost::property_tree::ptree const &params);\n-\tstd::map<std::string, AgcMeteringMode> metering_modes;\n-\tstd::map<std::string, AgcExposureMode> exposure_modes;\n-\tstd::map<std::string, AgcConstraintMode> constraint_modes;\n-\tPwl Y_target;\n+\tvoid read(boost::property_tree::ptree const &params);\n+\tstd::map<std::string, AgcMeteringMode> meteringModes;\n+\tstd::map<std::string, AgcExposureMode> exposureModes;\n+\tstd::map<std::string, AgcConstraintMode> constraintModes;\n+\tPwl yTarget;\n \tdouble speed;\n-\tuint16_t startup_frames;\n-\tunsigned int convergence_frames;\n-\tdouble max_change;\n-\tdouble min_change;\n-\tdouble fast_reduce_threshold;\n-\tdouble speed_up_threshold;\n-\tstd::string default_metering_mode;\n-\tstd::string default_exposure_mode;\n-\tstd::string default_constraint_mode;\n-\tdouble base_ev;\n-\tlibcamera::utils::Duration default_exposure_time;\n-\tdouble default_analogue_gain;\n+\tuint16_t startupFrames;\n+\tunsigned int convergenceFrames;\n+\tdouble maxChange;\n+\tdouble minChange;\n+\tdouble fastReduceThreshold;\n+\tdouble speedUpThreshold;\n+\tstd::string defaultMeteringMode;\n+\tstd::string defaultExposureMode;\n+\tstd::string defaultConstraintMode;\n+\tdouble baseEv;\n+\tlibcamera::utils::Duration defaultExposureTime;\n+\tdouble defaultAnalogueGain;\n };\n \n class Agc : public AgcAlgorithm\n {\n public:\n \tAgc(Controller *controller);\n-\tchar const *Name() const override;\n-\tvoid Read(boost::property_tree::ptree const &params) override;\n+\tchar const *name() const override;\n+\tvoid read(boost::property_tree::ptree const &params) override;\n \t// AGC handles \"pausing\" for itself.\n-\tbool IsPaused() const override;\n-\tvoid Pause() override;\n-\tvoid Resume() override;\n-\tunsigned int GetConvergenceFrames() const override;\n-\tvoid SetEv(double ev) override;\n-\tvoid SetFlickerPeriod(libcamera::utils::Duration flicker_period) override;\n-\tvoid SetMaxShutter(libcamera::utils::Duration max_shutter) override;\n-\tvoid SetFixedShutter(libcamera::utils::Duration fixed_shutter) override;\n-\tvoid SetFixedAnalogueGain(double fixed_analogue_gain) override;\n-\tvoid SetMeteringMode(std::string const &metering_mode_name) override;\n-\tvoid SetExposureMode(std::string const &exposure_mode_name) override;\n-\tvoid SetConstraintMode(std::string const &contraint_mode_name) override;\n-\tvoid SwitchMode(CameraMode const &camera_mode, Metadata *metadata) override;\n-\tvoid Prepare(Metadata *image_metadata) override;\n-\tvoid Process(StatisticsPtr &stats, Metadata *image_metadata) override;\n+\tbool isPaused() const override;\n+\tvoid pause() override;\n+\tvoid resume() override;\n+\tunsigned int getConvergenceFrames() const override;\n+\tvoid setEv(double ev) override;\n+\tvoid setFlickerPeriod(libcamera::utils::Duration flickerPeriod) override;\n+\tvoid setMaxShutter(libcamera::utils::Duration maxShutter) override;\n+\tvoid setFixedShutter(libcamera::utils::Duration fixedShutter) override;\n+\tvoid setFixedAnalogueGain(double fixedAnalogueGain) override;\n+\tvoid setMeteringMode(std::string const &meteringModeName) override;\n+\tvoid setExposureMode(std::string const &exposureModeName) override;\n+\tvoid setConstraintMode(std::string const &contraintModeName) override;\n+\tvoid switchMode(CameraMode const &cameraMode, Metadata *metadata) override;\n+\tvoid prepare(Metadata *imageMetadata) override;\n+\tvoid process(StatisticsPtr &stats, Metadata *imageMetadata) override;\n \n private:\n-\tvoid updateLockStatus(DeviceStatus const &device_status);\n+\tvoid updateLockStatus(DeviceStatus const &deviceStatus);\n \tAgcConfig config_;\n \tvoid housekeepConfig();\n-\tvoid fetchCurrentExposure(Metadata *image_metadata);\n-\tvoid fetchAwbStatus(Metadata *image_metadata);\n-\tvoid computeGain(bcm2835_isp_stats *statistics, Metadata *image_metadata,\n-\t\t\t double &gain, double &target_Y);\n+\tvoid fetchCurrentExposure(Metadata *imageMetadata);\n+\tvoid fetchAwbStatus(Metadata *imageMetadata);\n+\tvoid computeGain(bcm2835_isp_stats *statistics, Metadata *imageMetadata,\n+\t\t\t double &gain, double &targetY);\n \tvoid computeTargetExposure(double gain);\n-\tbool applyDigitalGain(double gain, double target_Y);\n+\tbool applyDigitalGain(double gain, double targetY);\n \tvoid filterExposure(bool desaturate);\n \tvoid divideUpExposure();\n-\tvoid writeAndFinish(Metadata *image_metadata, bool desaturate);\n+\tvoid writeAndFinish(Metadata *imageMetadata, bool desaturate);\n \tlibcamera::utils::Duration clipShutter(libcamera::utils::Duration shutter);\n-\tAgcMeteringMode *metering_mode_;\n-\tAgcExposureMode *exposure_mode_;\n-\tAgcConstraintMode *constraint_mode_;\n-\tuint64_t frame_count_;\n+\tAgcMeteringMode *meteringMode_;\n+\tAgcExposureMode *exposureMode_;\n+\tAgcConstraintMode *constraintMode_;\n+\tuint64_t frameCount_;\n \tAwbStatus awb_;\n \tstruct ExposureValues {\n \t\tExposureValues();\n \n \t\tlibcamera::utils::Duration shutter;\n-\t\tdouble analogue_gain;\n-\t\tlibcamera::utils::Duration total_exposure;\n-\t\tlibcamera::utils::Duration total_exposure_no_dg; // without digital gain\n+\t\tdouble analogueGain;\n+\t\tlibcamera::utils::Duration totalExposure;\n+\t\tlibcamera::utils::Duration totalExposureNoDG; // without digital gain\n \t};\n \tExposureValues current_;  // values for the current frame\n \tExposureValues target_;   // calculate the values we want here\n \tExposureValues filtered_; // these values are filtered towards target\n \tAgcStatus status_;\n-\tint lock_count_;\n-\tDeviceStatus last_device_status_;\n-\tlibcamera::utils::Duration last_target_exposure_;\n-\tdouble last_sensitivity_; // sensitivity of the previous camera mode\n+\tint lockCount_;\n+\tDeviceStatus lastDeviceStatus_;\n+\tlibcamera::utils::Duration lastTargetExposure_;\n+\tdouble lastSensitivity_; // sensitivity of the previous camera mode\n \t// Below here the \"settings\" that applications can change.\n-\tstd::string metering_mode_name_;\n-\tstd::string exposure_mode_name_;\n-\tstd::string constraint_mode_name_;\n+\tstd::string meteringModeName_;\n+\tstd::string exposureModeName_;\n+\tstd::string constraintModeName_;\n \tdouble ev_;\n-\tlibcamera::utils::Duration flicker_period_;\n-\tlibcamera::utils::Duration max_shutter_;\n-\tlibcamera::utils::Duration fixed_shutter_;\n-\tdouble fixed_analogue_gain_;\n+\tlibcamera::utils::Duration flickerPeriod_;\n+\tlibcamera::utils::Duration maxShutter_;\n+\tlibcamera::utils::Duration fixedShutter_;\n+\tdouble fixedAnalogueGain_;\n };\n \n } // namespace RPiController\ndiff --git a/src/ipa/raspberrypi/controller/rpi/alsc.cpp b/src/ipa/raspberrypi/controller/rpi/alsc.cpp\nindex e575c14a92db..98b771542d95 100644\n--- a/src/ipa/raspberrypi/controller/rpi/alsc.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/alsc.cpp\n@@ -26,31 +26,31 @@ LOG_DEFINE_CATEGORY(RPiAlsc)\n static const int X = ALSC_CELLS_X;\n static const int Y = ALSC_CELLS_Y;\n static const int XY = X * Y;\n-static const double INSUFFICIENT_DATA = -1.0;\n+static const double InsufficientData = -1.0;\n \n Alsc::Alsc(Controller *controller)\n \t: Algorithm(controller)\n {\n-\tasync_abort_ = async_start_ = async_started_ = async_finished_ = false;\n-\tasync_thread_ = std::thread(std::bind(&Alsc::asyncFunc, this));\n+\tasyncAbort_ = asyncStart_ = asyncStarted_ = asyncFinished_ = false;\n+\tasyncThread_ = std::thread(std::bind(&Alsc::asyncFunc, this));\n }\n \n Alsc::~Alsc()\n {\n \t{\n \t\tstd::lock_guard<std::mutex> lock(mutex_);\n-\t\tasync_abort_ = true;\n+\t\tasyncAbort_ = true;\n \t}\n-\tasync_signal_.notify_one();\n-\tasync_thread_.join();\n+\tasyncSignal_.notify_one();\n+\tasyncThread_.join();\n }\n \n-char const *Alsc::Name() const\n+char const *Alsc::name() const\n {\n \treturn NAME;\n }\n \n-static void generate_lut(double *lut, boost::property_tree::ptree const &params)\n+static void generateLut(double *lut, boost::property_tree::ptree const &params)\n {\n \tdouble cstrength = params.get<double>(\"corner_strength\", 2.0);\n \tif (cstrength <= 1.0)\n@@ -73,34 +73,34 @@ static void generate_lut(double *lut, boost::property_tree::ptree const &params)\n \t}\n }\n \n-static void read_lut(double *lut, boost::property_tree::ptree const &params)\n+static void readLut(double *lut, boost::property_tree::ptree const &params)\n {\n \tint num = 0;\n-\tconst int max_num = XY;\n+\tconst int maxNum = XY;\n \tfor (auto &p : params) {\n-\t\tif (num == max_num)\n+\t\tif (num == maxNum)\n \t\t\tthrow std::runtime_error(\n \t\t\t\t\"Alsc: too many entries in LSC table\");\n \t\tlut[num++] = p.second.get_value<double>();\n \t}\n-\tif (num < max_num)\n+\tif (num < maxNum)\n \t\tthrow std::runtime_error(\"Alsc: too few entries in LSC table\");\n }\n \n-static void read_calibrations(std::vector<AlscCalibration> &calibrations,\n-\t\t\t      boost::property_tree::ptree const &params,\n-\t\t\t      std::string const &name)\n+static void readCalibrations(std::vector<AlscCalibration> &calibrations,\n+\t\t\t     boost::property_tree::ptree const &params,\n+\t\t\t     std::string const &name)\n {\n \tif (params.get_child_optional(name)) {\n-\t\tdouble last_ct = 0;\n+\t\tdouble lastCt = 0;\n \t\tfor (auto &p : params.get_child(name)) {\n \t\t\tdouble ct = p.second.get<double>(\"ct\");\n-\t\t\tif (ct <= last_ct)\n+\t\t\tif (ct <= lastCt)\n \t\t\t\tthrow std::runtime_error(\n \t\t\t\t\t\"Alsc: entries in \" + name +\n \t\t\t\t\t\" must be in increasing ct order\");\n \t\t\tAlscCalibration calibration;\n-\t\t\tcalibration.ct = last_ct = ct;\n+\t\t\tcalibration.ct = lastCt = ct;\n \t\t\tboost::property_tree::ptree const &table =\n \t\t\t\tp.second.get_child(\"table\");\n \t\t\tint num = 0;\n@@ -124,249 +124,239 @@ static void read_calibrations(std::vector<AlscCalibration> &calibrations,\n \t}\n }\n \n-void Alsc::Read(boost::property_tree::ptree const &params)\n+void Alsc::read(boost::property_tree::ptree const &params)\n {\n-\tconfig_.frame_period = params.get<uint16_t>(\"frame_period\", 12);\n-\tconfig_.startup_frames = params.get<uint16_t>(\"startup_frames\", 10);\n+\tconfig_.framePeriod = params.get<uint16_t>(\"frame_period\", 12);\n+\tconfig_.startupFrames = params.get<uint16_t>(\"startup_frames\", 10);\n \tconfig_.speed = params.get<double>(\"speed\", 0.05);\n \tdouble sigma = params.get<double>(\"sigma\", 0.01);\n-\tconfig_.sigma_Cr = params.get<double>(\"sigma_Cr\", sigma);\n-\tconfig_.sigma_Cb = params.get<double>(\"sigma_Cb\", sigma);\n-\tconfig_.min_count = params.get<double>(\"min_count\", 10.0);\n-\tconfig_.min_G = params.get<uint16_t>(\"min_G\", 50);\n+\tconfig_.sigmaCr = params.get<double>(\"sigma_Cr\", sigma);\n+\tconfig_.sigmaCb = params.get<double>(\"sigma_Cb\", sigma);\n+\tconfig_.minCount = params.get<double>(\"min_count\", 10.0);\n+\tconfig_.minG = params.get<uint16_t>(\"min_G\", 50);\n \tconfig_.omega = params.get<double>(\"omega\", 1.3);\n-\tconfig_.n_iter = params.get<uint32_t>(\"n_iter\", X + Y);\n-\tconfig_.luminance_strength =\n+\tconfig_.nIter = params.get<uint32_t>(\"n_iter\", X + Y);\n+\tconfig_.luminanceStrength =\n \t\tparams.get<double>(\"luminance_strength\", 1.0);\n \tfor (int i = 0; i < XY; i++)\n-\t\tconfig_.luminance_lut[i] = 1.0;\n+\t\tconfig_.luminanceLut[i] = 1.0;\n \tif (params.get_child_optional(\"corner_strength\"))\n-\t\tgenerate_lut(config_.luminance_lut, params);\n+\t\tgenerateLut(config_.luminanceLut, params);\n \telse if (params.get_child_optional(\"luminance_lut\"))\n-\t\tread_lut(config_.luminance_lut,\n-\t\t\t params.get_child(\"luminance_lut\"));\n+\t\treadLut(config_.luminanceLut,\n+\t\t\tparams.get_child(\"luminance_lut\"));\n \telse\n \t\tLOG(RPiAlsc, Warning)\n \t\t\t<< \"no luminance table - assume unity everywhere\";\n-\tread_calibrations(config_.calibrations_Cr, params, \"calibrations_Cr\");\n-\tread_calibrations(config_.calibrations_Cb, params, \"calibrations_Cb\");\n-\tconfig_.default_ct = params.get<double>(\"default_ct\", 4500.0);\n+\treadCalibrations(config_.calibrationsCr, params, \"calibrations_Cr\");\n+\treadCalibrations(config_.calibrationsCb, params, \"calibrations_Cb\");\n+\tconfig_.defaultCt = params.get<double>(\"default_ct\", 4500.0);\n \tconfig_.threshold = params.get<double>(\"threshold\", 1e-3);\n-\tconfig_.lambda_bound = params.get<double>(\"lambda_bound\", 0.05);\n-}\n-\n-static double get_ct(Metadata *metadata, double default_ct);\n-static void get_cal_table(double ct,\n-\t\t\t  std::vector<AlscCalibration> const &calibrations,\n-\t\t\t  double cal_table[XY]);\n-static void resample_cal_table(double const cal_table_in[XY],\n-\t\t\t       CameraMode const &camera_mode,\n-\t\t\t       double cal_table_out[XY]);\n-static void compensate_lambdas_for_cal(double const cal_table[XY],\n-\t\t\t\t       double const old_lambdas[XY],\n-\t\t\t\t       double new_lambdas[XY]);\n-static void add_luminance_to_tables(double results[3][Y][X],\n-\t\t\t\t    double const lambda_r[XY], double lambda_g,\n-\t\t\t\t    double const lambda_b[XY],\n-\t\t\t\t    double const luminance_lut[XY],\n-\t\t\t\t    double luminance_strength);\n-\n-void Alsc::Initialise()\n-{\n-\tframe_count2_ = frame_count_ = frame_phase_ = 0;\n-\tfirst_time_ = true;\n-\tct_ = config_.default_ct;\n+\tconfig_.lambdaBound = params.get<double>(\"lambda_bound\", 0.05);\n+}\n+\n+static double getCt(Metadata *metadata, double defaultCt);\n+static void getCalTable(double ct, std::vector<AlscCalibration> const &calibrations,\n+\t\t\tdouble calTable[XY]);\n+static void resampleCalTable(double const calTableIn[XY], CameraMode const &cameraMode,\n+\t\t\t     double calTableOut[XY]);\n+static void compensateLambdasForCal(double const calTable[XY], double const oldLambdas[XY],\n+\t\t\t\t    double newLambdas[XY]);\n+static void addLuminanceToTables(double results[3][Y][X], double const lambdaR[XY], double lambdaG,\n+\t\t\t\t double const lambdaB[XY], double const luminanceLut[XY],\n+\t\t\t\t double luminanceStrength);\n+\n+void Alsc::initialise()\n+{\n+\tframeCount2_ = frameCount_ = framePhase_ = 0;\n+\tfirstTime_ = true;\n+\tct_ = config_.defaultCt;\n \t// The lambdas are initialised in the SwitchMode.\n }\n \n void Alsc::waitForAysncThread()\n {\n-\tif (async_started_) {\n-\t\tasync_started_ = false;\n+\tif (asyncStarted_) {\n+\t\tasyncStarted_ = false;\n \t\tstd::unique_lock<std::mutex> lock(mutex_);\n-\t\tsync_signal_.wait(lock, [&] {\n-\t\t\treturn async_finished_;\n+\t\tsyncSignal_.wait(lock, [&] {\n+\t\t\treturn asyncFinished_;\n \t\t});\n-\t\tasync_finished_ = false;\n+\t\tasyncFinished_ = false;\n \t}\n }\n \n-static bool compare_modes(CameraMode const &cm0, CameraMode const &cm1)\n+static bool compareModes(CameraMode const &cm0, CameraMode const &cm1)\n {\n \t// Return true if the modes crop from the sensor significantly differently,\n \t// or if the user transform has changed.\n \tif (cm0.transform != cm1.transform)\n \t\treturn true;\n-\tint left_diff = abs(cm0.crop_x - cm1.crop_x);\n-\tint top_diff = abs(cm0.crop_y - cm1.crop_y);\n-\tint right_diff = fabs(cm0.crop_x + cm0.scale_x * cm0.width -\n-\t\t\t      cm1.crop_x - cm1.scale_x * cm1.width);\n-\tint bottom_diff = fabs(cm0.crop_y + cm0.scale_y * cm0.height -\n-\t\t\t       cm1.crop_y - cm1.scale_y * cm1.height);\n+\tint leftDiff = abs(cm0.cropX - cm1.cropX);\n+\tint topDiff = abs(cm0.cropY - cm1.cropY);\n+\tint rightDiff = fabs(cm0.cropX + cm0.scaleX * cm0.width -\n+\t\t\t     cm1.cropX - cm1.scaleX * cm1.width);\n+\tint bottomDiff = fabs(cm0.cropY + cm0.scaleY * cm0.height -\n+\t\t\t      cm1.cropY - cm1.scaleY * cm1.height);\n \t// These thresholds are a rather arbitrary amount chosen to trigger\n \t// when carrying on with the previously calculated tables might be\n \t// worse than regenerating them (but without the adaptive algorithm).\n-\tint threshold_x = cm0.sensor_width >> 4;\n-\tint threshold_y = cm0.sensor_height >> 4;\n-\treturn left_diff > threshold_x || right_diff > threshold_x ||\n-\t       top_diff > threshold_y || bottom_diff > threshold_y;\n+\tint thresholdX = cm0.sensorWidth >> 4;\n+\tint thresholdY = cm0.sensorHeight >> 4;\n+\treturn leftDiff > thresholdX || rightDiff > thresholdX ||\n+\t       topDiff > thresholdY || bottomDiff > thresholdY;\n }\n \n-void Alsc::SwitchMode(CameraMode const &camera_mode,\n+void Alsc::switchMode(CameraMode const &cameraMode,\n \t\t      [[maybe_unused]] Metadata *metadata)\n {\n \t// We're going to start over with the tables if there's any \"significant\"\n \t// change.\n-\tbool reset_tables = first_time_ || compare_modes(camera_mode_, camera_mode);\n+\tbool resetTables = firstTime_ || compareModes(cameraMode_, cameraMode);\n \n \t// Believe the colour temperature from the AWB, if there is one.\n-\tct_ = get_ct(metadata, ct_);\n+\tct_ = getCt(metadata, ct_);\n \n \t// Ensure the other thread isn't running while we do this.\n \twaitForAysncThread();\n \n-\tcamera_mode_ = camera_mode;\n+\tcameraMode_ = cameraMode;\n \n \t// We must resample the luminance table like we do the others, but it's\n \t// fixed so we can simply do it up front here.\n-\tresample_cal_table(config_.luminance_lut, camera_mode_, luminance_table_);\n+\tresampleCalTable(config_.luminanceLut, cameraMode_, luminanceTable_);\n \n-\tif (reset_tables) {\n+\tif (resetTables) {\n \t\t// Upon every \"table reset\", arrange for something sensible to be\n \t\t// generated. Construct the tables for the previous recorded colour\n \t\t// temperature. In order to start over from scratch we initialise\n \t\t// the lambdas, but the rest of this code then echoes the code in\n \t\t// doAlsc, without the adaptive algorithm.\n \t\tfor (int i = 0; i < XY; i++)\n-\t\t\tlambda_r_[i] = lambda_b_[i] = 1.0;\n-\t\tdouble cal_table_r[XY], cal_table_b[XY], cal_table_tmp[XY];\n-\t\tget_cal_table(ct_, config_.calibrations_Cr, cal_table_tmp);\n-\t\tresample_cal_table(cal_table_tmp, camera_mode_, cal_table_r);\n-\t\tget_cal_table(ct_, config_.calibrations_Cb, cal_table_tmp);\n-\t\tresample_cal_table(cal_table_tmp, camera_mode_, cal_table_b);\n-\t\tcompensate_lambdas_for_cal(cal_table_r, lambda_r_,\n-\t\t\t\t\t   async_lambda_r_);\n-\t\tcompensate_lambdas_for_cal(cal_table_b, lambda_b_,\n-\t\t\t\t\t   async_lambda_b_);\n-\t\tadd_luminance_to_tables(sync_results_, async_lambda_r_, 1.0,\n-\t\t\t\t\tasync_lambda_b_, luminance_table_,\n-\t\t\t\t\tconfig_.luminance_strength);\n-\t\tmemcpy(prev_sync_results_, sync_results_,\n-\t\t       sizeof(prev_sync_results_));\n-\t\tframe_phase_ = config_.frame_period; // run the algo again asap\n-\t\tfirst_time_ = false;\n+\t\t\tlambdaR_[i] = lambdaB_[i] = 1.0;\n+\t\tdouble calTableR[XY], calTableB[XY], calTableTmp[XY];\n+\t\tgetCalTable(ct_, config_.calibrationsCr, calTableTmp);\n+\t\tresampleCalTable(calTableTmp, cameraMode_, calTableR);\n+\t\tgetCalTable(ct_, config_.calibrationsCb, calTableTmp);\n+\t\tresampleCalTable(calTableTmp, cameraMode_, calTableB);\n+\t\tcompensateLambdasForCal(calTableR, lambdaR_, asyncLambdaR_);\n+\t\tcompensateLambdasForCal(calTableB, lambdaB_, asyncLambdaB_);\n+\t\taddLuminanceToTables(syncResults_, asyncLambdaR_, 1.0, asyncLambdaB_,\n+\t\t\t\t     luminanceTable_, config_.luminanceStrength);\n+\t\tmemcpy(prevSyncResults_, syncResults_, sizeof(prevSyncResults_));\n+\t\tframePhase_ = config_.framePeriod; // run the algo again asap\n+\t\tfirstTime_ = false;\n \t}\n }\n \n void Alsc::fetchAsyncResults()\n {\n \tLOG(RPiAlsc, Debug) << \"Fetch ALSC results\";\n-\tasync_finished_ = false;\n-\tasync_started_ = false;\n-\tmemcpy(sync_results_, async_results_, sizeof(sync_results_));\n+\tasyncFinished_ = false;\n+\tasyncStarted_ = false;\n+\tmemcpy(syncResults_, asyncResults_, sizeof(syncResults_));\n }\n \n-double get_ct(Metadata *metadata, double default_ct)\n+double getCt(Metadata *metadata, double defaultCt)\n {\n-\tAwbStatus awb_status;\n-\tawb_status.temperature_K = default_ct; // in case nothing found\n-\tif (metadata->Get(\"awb.status\", awb_status) != 0)\n+\tAwbStatus awbStatus;\n+\tawbStatus.temperatureK = defaultCt; // in case nothing found\n+\tif (metadata->get(\"awb.status\", awbStatus) != 0)\n \t\tLOG(RPiAlsc, Debug) << \"no AWB results found, using \"\n-\t\t\t\t    << awb_status.temperature_K;\n+\t\t\t\t    << awbStatus.temperatureK;\n \telse\n \t\tLOG(RPiAlsc, Debug) << \"AWB results found, using \"\n-\t\t\t\t    << awb_status.temperature_K;\n-\treturn awb_status.temperature_K;\n+\t\t\t\t    << awbStatus.temperatureK;\n+\treturn awbStatus.temperatureK;\n }\n \n-static void copy_stats(bcm2835_isp_stats_region regions[XY], StatisticsPtr &stats,\n-\t\t       AlscStatus const &status)\n+static void copyStats(bcm2835_isp_stats_region regions[XY], StatisticsPtr &stats,\n+\t\t      AlscStatus const &status)\n {\n-\tbcm2835_isp_stats_region *input_regions = stats->awb_stats;\n-\tdouble *r_table = (double *)status.r;\n-\tdouble *g_table = (double *)status.g;\n-\tdouble *b_table = (double *)status.b;\n+\tbcm2835_isp_stats_region *inputRegions = stats->awb_stats;\n+\tdouble *rTable = (double *)status.r;\n+\tdouble *gTable = (double *)status.g;\n+\tdouble *bTable = (double *)status.b;\n \tfor (int i = 0; i < XY; i++) {\n-\t\tregions[i].r_sum = input_regions[i].r_sum / r_table[i];\n-\t\tregions[i].g_sum = input_regions[i].g_sum / g_table[i];\n-\t\tregions[i].b_sum = input_regions[i].b_sum / b_table[i];\n-\t\tregions[i].counted = input_regions[i].counted;\n+\t\tregions[i].r_sum = inputRegions[i].r_sum / rTable[i];\n+\t\tregions[i].g_sum = inputRegions[i].g_sum / gTable[i];\n+\t\tregions[i].b_sum = inputRegions[i].b_sum / bTable[i];\n+\t\tregions[i].counted = inputRegions[i].counted;\n \t\t// (don't care about the uncounted value)\n \t}\n }\n \n-void Alsc::restartAsync(StatisticsPtr &stats, Metadata *image_metadata)\n+void Alsc::restartAsync(StatisticsPtr &stats, Metadata *imageMetadata)\n {\n \tLOG(RPiAlsc, Debug) << \"Starting ALSC calculation\";\n \t// Get the current colour temperature. It's all we need from the\n \t// metadata. Default to the last CT value (which could be the default).\n-\tct_ = get_ct(image_metadata, ct_);\n+\tct_ = getCt(imageMetadata, ct_);\n \t// We have to copy the statistics here, dividing out our best guess of\n \t// the LSC table that the pipeline applied to them.\n-\tAlscStatus alsc_status;\n-\tif (image_metadata->Get(\"alsc.status\", alsc_status) != 0) {\n+\tAlscStatus alscStatus;\n+\tif (imageMetadata->get(\"alsc.status\", alscStatus) != 0) {\n \t\tLOG(RPiAlsc, Warning)\n \t\t\t<< \"No ALSC status found for applied gains!\";\n \t\tfor (int y = 0; y < Y; y++)\n \t\t\tfor (int x = 0; x < X; x++) {\n-\t\t\t\talsc_status.r[y][x] = 1.0;\n-\t\t\t\talsc_status.g[y][x] = 1.0;\n-\t\t\t\talsc_status.b[y][x] = 1.0;\n+\t\t\t\talscStatus.r[y][x] = 1.0;\n+\t\t\t\talscStatus.g[y][x] = 1.0;\n+\t\t\t\talscStatus.b[y][x] = 1.0;\n \t\t\t}\n \t}\n-\tcopy_stats(statistics_, stats, alsc_status);\n-\tframe_phase_ = 0;\n-\tasync_started_ = true;\n+\tcopyStats(statistics_, stats, alscStatus);\n+\tframePhase_ = 0;\n+\tasyncStarted_ = true;\n \t{\n \t\tstd::lock_guard<std::mutex> lock(mutex_);\n-\t\tasync_start_ = true;\n+\t\tasyncStart_ = true;\n \t}\n-\tasync_signal_.notify_one();\n+\tasyncSignal_.notify_one();\n }\n \n-void Alsc::Prepare(Metadata *image_metadata)\n+void Alsc::prepare(Metadata *imageMetadata)\n {\n \t// Count frames since we started, and since we last poked the async\n \t// thread.\n-\tif (frame_count_ < (int)config_.startup_frames)\n-\t\tframe_count_++;\n-\tdouble speed = frame_count_ < (int)config_.startup_frames\n+\tif (frameCount_ < (int)config_.startupFrames)\n+\t\tframeCount_++;\n+\tdouble speed = frameCount_ < (int)config_.startupFrames\n \t\t\t       ? 1.0\n \t\t\t       : config_.speed;\n \tLOG(RPiAlsc, Debug)\n-\t\t<< \"frame_count \" << frame_count_ << \" speed \" << speed;\n+\t\t<< \"frame count \" << frameCount_ << \" speed \" << speed;\n \t{\n \t\tstd::unique_lock<std::mutex> lock(mutex_);\n-\t\tif (async_started_ && async_finished_)\n+\t\tif (asyncStarted_ && asyncFinished_)\n \t\t\tfetchAsyncResults();\n \t}\n \t// Apply IIR filter to results and program into the pipeline.\n-\tdouble *ptr = (double *)sync_results_,\n-\t       *pptr = (double *)prev_sync_results_;\n-\tfor (unsigned int i = 0;\n-\t     i < sizeof(sync_results_) / sizeof(double); i++)\n+\tdouble *ptr = (double *)syncResults_,\n+\t       *pptr = (double *)prevSyncResults_;\n+\tfor (unsigned int i = 0; i < sizeof(syncResults_) / sizeof(double); i++)\n \t\tpptr[i] = speed * ptr[i] + (1.0 - speed) * pptr[i];\n \t// Put output values into status metadata.\n \tAlscStatus status;\n-\tmemcpy(status.r, prev_sync_results_[0], sizeof(status.r));\n-\tmemcpy(status.g, prev_sync_results_[1], sizeof(status.g));\n-\tmemcpy(status.b, prev_sync_results_[2], sizeof(status.b));\n-\timage_metadata->Set(\"alsc.status\", status);\n+\tmemcpy(status.r, prevSyncResults_[0], sizeof(status.r));\n+\tmemcpy(status.g, prevSyncResults_[1], sizeof(status.g));\n+\tmemcpy(status.b, prevSyncResults_[2], sizeof(status.b));\n+\timageMetadata->set(\"alsc.status\", status);\n }\n \n-void Alsc::Process(StatisticsPtr &stats, Metadata *image_metadata)\n+void Alsc::process(StatisticsPtr &stats, Metadata *imageMetadata)\n {\n \t// Count frames since we started, and since we last poked the async\n \t// thread.\n-\tif (frame_phase_ < (int)config_.frame_period)\n-\t\tframe_phase_++;\n-\tif (frame_count2_ < (int)config_.startup_frames)\n-\t\tframe_count2_++;\n-\tLOG(RPiAlsc, Debug) << \"frame_phase \" << frame_phase_;\n-\tif (frame_phase_ >= (int)config_.frame_period ||\n-\t    frame_count2_ < (int)config_.startup_frames) {\n-\t\tif (async_started_ == false)\n-\t\t\trestartAsync(stats, image_metadata);\n+\tif (framePhase_ < (int)config_.framePeriod)\n+\t\tframePhase_++;\n+\tif (frameCount2_ < (int)config_.startupFrames)\n+\t\tframeCount2_++;\n+\tLOG(RPiAlsc, Debug) << \"frame_phase \" << framePhase_;\n+\tif (framePhase_ >= (int)config_.framePeriod ||\n+\t    frameCount2_ < (int)config_.startupFrames) {\n+\t\tif (asyncStarted_ == false)\n+\t\t\trestartAsync(stats, imageMetadata);\n \t}\n }\n \n@@ -375,143 +365,140 @@ void Alsc::asyncFunc()\n \twhile (true) {\n \t\t{\n \t\t\tstd::unique_lock<std::mutex> lock(mutex_);\n-\t\t\tasync_signal_.wait(lock, [&] {\n-\t\t\t\treturn async_start_ || async_abort_;\n+\t\t\tasyncSignal_.wait(lock, [&] {\n+\t\t\t\treturn asyncStart_ || asyncAbort_;\n \t\t\t});\n-\t\t\tasync_start_ = false;\n-\t\t\tif (async_abort_)\n+\t\t\tasyncStart_ = false;\n+\t\t\tif (asyncAbort_)\n \t\t\t\tbreak;\n \t\t}\n \t\tdoAlsc();\n \t\t{\n \t\t\tstd::lock_guard<std::mutex> lock(mutex_);\n-\t\t\tasync_finished_ = true;\n+\t\t\tasyncFinished_ = true;\n \t\t}\n-\t\tsync_signal_.notify_one();\n+\t\tsyncSignal_.notify_one();\n \t}\n }\n \n-void get_cal_table(double ct, std::vector<AlscCalibration> const &calibrations,\n-\t\t   double cal_table[XY])\n+void getCalTable(double ct, std::vector<AlscCalibration> const &calibrations,\n+\t\t double calTable[XY])\n {\n \tif (calibrations.empty()) {\n \t\tfor (int i = 0; i < XY; i++)\n-\t\t\tcal_table[i] = 1.0;\n+\t\t\tcalTable[i] = 1.0;\n \t\tLOG(RPiAlsc, Debug) << \"no calibrations found\";\n \t} else if (ct <= calibrations.front().ct) {\n-\t\tmemcpy(cal_table, calibrations.front().table,\n-\t\t       XY * sizeof(double));\n+\t\tmemcpy(calTable, calibrations.front().table, XY * sizeof(double));\n \t\tLOG(RPiAlsc, Debug) << \"using calibration for \"\n \t\t\t\t    << calibrations.front().ct;\n \t} else if (ct >= calibrations.back().ct) {\n-\t\tmemcpy(cal_table, calibrations.back().table,\n-\t\t       XY * sizeof(double));\n+\t\tmemcpy(calTable, calibrations.back().table, XY * sizeof(double));\n \t\tLOG(RPiAlsc, Debug) << \"using calibration for \"\n \t\t\t\t    << calibrations.back().ct;\n \t} else {\n \t\tint idx = 0;\n \t\twhile (ct > calibrations[idx + 1].ct)\n \t\t\tidx++;\n-\t\tdouble ct0 = calibrations[idx].ct,\n-\t\t       ct1 = calibrations[idx + 1].ct;\n+\t\tdouble ct0 = calibrations[idx].ct, ct1 = calibrations[idx + 1].ct;\n \t\tLOG(RPiAlsc, Debug)\n \t\t\t<< \"ct is \" << ct << \", interpolating between \"\n \t\t\t<< ct0 << \" and \" << ct1;\n \t\tfor (int i = 0; i < XY; i++)\n-\t\t\tcal_table[i] =\n+\t\t\tcalTable[i] =\n \t\t\t\t(calibrations[idx].table[i] * (ct1 - ct) +\n \t\t\t\t calibrations[idx + 1].table[i] * (ct - ct0)) /\n \t\t\t\t(ct1 - ct0);\n \t}\n }\n \n-void resample_cal_table(double const cal_table_in[XY],\n-\t\t\tCameraMode const &camera_mode, double cal_table_out[XY])\n+void resampleCalTable(double const calTableIn[XY],\n+\t\t      CameraMode const &cameraMode, double calTableOut[XY])\n {\n \t// Precalculate and cache the x sampling locations and phases to save\n \t// recomputing them on every row.\n-\tint x_lo[X], x_hi[X];\n+\tint xLo[X], xHi[X];\n \tdouble xf[X];\n-\tdouble scale_x = camera_mode.sensor_width /\n-\t\t\t (camera_mode.width * camera_mode.scale_x);\n-\tdouble x_off = camera_mode.crop_x / (double)camera_mode.sensor_width;\n-\tdouble x = .5 / scale_x + x_off * X - .5;\n-\tdouble x_inc = 1 / scale_x;\n-\tfor (int i = 0; i < X; i++, x += x_inc) {\n-\t\tx_lo[i] = floor(x);\n-\t\txf[i] = x - x_lo[i];\n-\t\tx_hi[i] = std::min(x_lo[i] + 1, X - 1);\n-\t\tx_lo[i] = std::max(x_lo[i], 0);\n-\t\tif (!!(camera_mode.transform & libcamera::Transform::HFlip)) {\n-\t\t\tx_lo[i] = X - 1 - x_lo[i];\n-\t\t\tx_hi[i] = X - 1 - x_hi[i];\n+\tdouble scaleX = cameraMode.sensorWidth /\n+\t\t\t(cameraMode.width * cameraMode.scaleX);\n+\tdouble xOff = cameraMode.cropX / (double)cameraMode.sensorWidth;\n+\tdouble x = .5 / scaleX + xOff * X - .5;\n+\tdouble xInc = 1 / scaleX;\n+\tfor (int i = 0; i < X; i++, x += xInc) {\n+\t\txLo[i] = floor(x);\n+\t\txf[i] = x - xLo[i];\n+\t\txHi[i] = std::min(xLo[i] + 1, X - 1);\n+\t\txLo[i] = std::max(xLo[i], 0);\n+\t\tif (!!(cameraMode.transform & libcamera::Transform::HFlip)) {\n+\t\t\txLo[i] = X - 1 - xLo[i];\n+\t\t\txHi[i] = X - 1 - xHi[i];\n \t\t}\n \t}\n \t// Now march over the output table generating the new values.\n-\tdouble scale_y = camera_mode.sensor_height /\n-\t\t\t (camera_mode.height * camera_mode.scale_y);\n-\tdouble y_off = camera_mode.crop_y / (double)camera_mode.sensor_height;\n-\tdouble y = .5 / scale_y + y_off * Y - .5;\n-\tdouble y_inc = 1 / scale_y;\n-\tfor (int j = 0; j < Y; j++, y += y_inc) {\n-\t\tint y_lo = floor(y);\n-\t\tdouble yf = y - y_lo;\n-\t\tint y_hi = std::min(y_lo + 1, Y - 1);\n-\t\ty_lo = std::max(y_lo, 0);\n-\t\tif (!!(camera_mode.transform & libcamera::Transform::VFlip)) {\n-\t\t\ty_lo = Y - 1 - y_lo;\n-\t\t\ty_hi = Y - 1 - y_hi;\n+\tdouble scaleY = cameraMode.sensorHeight /\n+\t\t\t(cameraMode.height * cameraMode.scaleY);\n+\tdouble yOff = cameraMode.cropY / (double)cameraMode.sensorHeight;\n+\tdouble y = .5 / scaleY + yOff * Y - .5;\n+\tdouble yInc = 1 / scaleY;\n+\tfor (int j = 0; j < Y; j++, y += yInc) {\n+\t\tint yLo = floor(y);\n+\t\tdouble yf = y - yLo;\n+\t\tint yHi = std::min(yLo + 1, Y - 1);\n+\t\tyLo = std::max(yLo, 0);\n+\t\tif (!!(cameraMode.transform & libcamera::Transform::VFlip)) {\n+\t\t\tyLo = Y - 1 - yLo;\n+\t\t\tyHi = Y - 1 - yHi;\n \t\t}\n-\t\tdouble const *row_above = cal_table_in + X * y_lo;\n-\t\tdouble const *row_below = cal_table_in + X * y_hi;\n+\t\tdouble const *rowAbove = calTableIn + X * yLo;\n+\t\tdouble const *rowBelow = calTableIn + X * yHi;\n \t\tfor (int i = 0; i < X; i++) {\n-\t\t\tdouble above = row_above[x_lo[i]] * (1 - xf[i]) +\n-\t\t\t\t       row_above[x_hi[i]] * xf[i];\n-\t\t\tdouble below = row_below[x_lo[i]] * (1 - xf[i]) +\n-\t\t\t\t       row_below[x_hi[i]] * xf[i];\n-\t\t\t*(cal_table_out++) = above * (1 - yf) + below * yf;\n+\t\t\tdouble above = rowAbove[xLo[i]] * (1 - xf[i]) +\n+\t\t\t\t       rowAbove[xHi[i]] * xf[i];\n+\t\t\tdouble below = rowBelow[xLo[i]] * (1 - xf[i]) +\n+\t\t\t\t       rowBelow[xHi[i]] * xf[i];\n+\t\t\t*(calTableOut++) = above * (1 - yf) + below * yf;\n \t\t}\n \t}\n }\n \n // Calculate chrominance statistics (R/G and B/G) for each region.\n static_assert(XY == AWB_REGIONS, \"ALSC/AWB statistics region mismatch\");\n-static void calculate_Cr_Cb(bcm2835_isp_stats_region *awb_region, double Cr[XY],\n-\t\t\t    double Cb[XY], uint32_t min_count, uint16_t min_G)\n+static void calculateCrCb(bcm2835_isp_stats_region *awbRegion, double cr[XY],\n+\t\t\t  double cb[XY], uint32_t minCount, uint16_t minG)\n {\n \tfor (int i = 0; i < XY; i++) {\n-\t\tbcm2835_isp_stats_region &zone = awb_region[i];\n-\t\tif (zone.counted <= min_count ||\n-\t\t    zone.g_sum / zone.counted <= min_G) {\n-\t\t\tCr[i] = Cb[i] = INSUFFICIENT_DATA;\n+\t\tbcm2835_isp_stats_region &zone = awbRegion[i];\n+\t\tif (zone.counted <= minCount ||\n+\t\t    zone.g_sum / zone.counted <= minG) {\n+\t\t\tcr[i] = cb[i] = InsufficientData;\n \t\t\tcontinue;\n \t\t}\n-\t\tCr[i] = zone.r_sum / (double)zone.g_sum;\n-\t\tCb[i] = zone.b_sum / (double)zone.g_sum;\n+\t\tcr[i] = zone.r_sum / (double)zone.g_sum;\n+\t\tcb[i] = zone.b_sum / (double)zone.g_sum;\n \t}\n }\n \n-static void apply_cal_table(double const cal_table[XY], double C[XY])\n+static void applyCalTable(double const calTable[XY], double C[XY])\n {\n \tfor (int i = 0; i < XY; i++)\n-\t\tif (C[i] != INSUFFICIENT_DATA)\n-\t\t\tC[i] *= cal_table[i];\n+\t\tif (C[i] != InsufficientData)\n+\t\t\tC[i] *= calTable[i];\n }\n \n-void compensate_lambdas_for_cal(double const cal_table[XY],\n-\t\t\t\tdouble const old_lambdas[XY],\n-\t\t\t\tdouble new_lambdas[XY])\n+void compensateLambdasForCal(double const calTable[XY],\n+\t\t\t     double const oldLambdas[XY],\n+\t\t\t     double newLambdas[XY])\n {\n-\tdouble min_new_lambda = std::numeric_limits<double>::max();\n+\tdouble minNewLambda = std::numeric_limits<double>::max();\n \tfor (int i = 0; i < XY; i++) {\n-\t\tnew_lambdas[i] = old_lambdas[i] * cal_table[i];\n-\t\tmin_new_lambda = std::min(min_new_lambda, new_lambdas[i]);\n+\t\tnewLambdas[i] = oldLambdas[i] * calTable[i];\n+\t\tminNewLambda = std::min(minNewLambda, newLambdas[i]);\n \t}\n \tfor (int i = 0; i < XY; i++)\n-\t\tnew_lambdas[i] /= min_new_lambda;\n+\t\tnewLambdas[i] /= minNewLambda;\n }\n \n-[[maybe_unused]] static void print_cal_table(double const C[XY])\n+[[maybe_unused]] static void printCalTable(double const C[XY])\n {\n \tprintf(\"table: [\\n\");\n \tfor (int j = 0; j < Y; j++) {\n@@ -527,31 +514,29 @@ void compensate_lambdas_for_cal(double const cal_table[XY],\n \n // Compute weight out of 1.0 which reflects how similar we wish to make the\n // colours of these two regions.\n-static double compute_weight(double C_i, double C_j, double sigma)\n+static double computeWeight(double Ci, double Cj, double sigma)\n {\n-\tif (C_i == INSUFFICIENT_DATA || C_j == INSUFFICIENT_DATA)\n+\tif (Ci == InsufficientData || Cj == InsufficientData)\n \t\treturn 0;\n-\tdouble diff = (C_i - C_j) / sigma;\n+\tdouble diff = (Ci - Cj) / sigma;\n \treturn exp(-diff * diff / 2);\n }\n \n // Compute all weights.\n-static void compute_W(double const C[XY], double sigma, double W[XY][4])\n+static void computeW(double const C[XY], double sigma, double W[XY][4])\n {\n \tfor (int i = 0; i < XY; i++) {\n \t\t// Start with neighbour above and go clockwise.\n-\t\tW[i][0] = i >= X ? compute_weight(C[i], C[i - X], sigma) : 0;\n-\t\tW[i][1] = i % X < X - 1 ? compute_weight(C[i], C[i + 1], sigma)\n-\t\t\t\t\t: 0;\n-\t\tW[i][2] =\n-\t\t\ti < XY - X ? compute_weight(C[i], C[i + X], sigma) : 0;\n-\t\tW[i][3] = i % X ? compute_weight(C[i], C[i - 1], sigma) : 0;\n+\t\tW[i][0] = i >= X ? computeWeight(C[i], C[i - X], sigma) : 0;\n+\t\tW[i][1] = i % X < X - 1 ? computeWeight(C[i], C[i + 1], sigma) : 0;\n+\t\tW[i][2] = i < XY - X ? computeWeight(C[i], C[i + X], sigma) : 0;\n+\t\tW[i][3] = i % X ? computeWeight(C[i], C[i - 1], sigma) : 0;\n \t}\n }\n \n // Compute M, the large but sparse matrix such that M * lambdas = 0.\n-static void construct_M(double const C[XY], double const W[XY][4],\n-\t\t\tdouble M[XY][4])\n+static void constructM(double const C[XY], double const W[XY][4],\n+\t\t       double M[XY][4])\n {\n \tdouble epsilon = 0.001;\n \tfor (int i = 0; i < XY; i++) {\n@@ -560,108 +545,96 @@ static void construct_M(double const C[XY], double const W[XY][4],\n \t\tint m = !!(i >= X) + !!(i % X < X - 1) + !!(i < XY - X) +\n \t\t\t!!(i % X); // total number of neighbours\n \t\t// we'll divide the diagonal out straight away\n-\t\tdouble diagonal =\n-\t\t\t(epsilon + W[i][0] + W[i][1] + W[i][2] + W[i][3]) *\n-\t\t\tC[i];\n-\t\tM[i][0] = i >= X ? (W[i][0] * C[i - X] + epsilon / m * C[i]) /\n-\t\t\t\t\t   diagonal\n-\t\t\t\t : 0;\n-\t\tM[i][1] = i % X < X - 1\n-\t\t\t\t  ? (W[i][1] * C[i + 1] + epsilon / m * C[i]) /\n-\t\t\t\t\t    diagonal\n-\t\t\t\t  : 0;\n-\t\tM[i][2] = i < XY - X\n-\t\t\t\t  ? (W[i][2] * C[i + X] + epsilon / m * C[i]) /\n-\t\t\t\t\t    diagonal\n-\t\t\t\t  : 0;\n-\t\tM[i][3] = i % X ? (W[i][3] * C[i - 1] + epsilon / m * C[i]) /\n-\t\t\t\t\t  diagonal\n-\t\t\t\t: 0;\n+\t\tdouble diagonal = (epsilon + W[i][0] + W[i][1] + W[i][2] + W[i][3]) * C[i];\n+\t\tM[i][0] = i >= X ? (W[i][0] * C[i - X] + epsilon / m * C[i]) / diagonal : 0;\n+\t\tM[i][1] = i % X < X - 1 ? (W[i][1] * C[i + 1] + epsilon / m * C[i]) / diagonal : 0;\n+\t\tM[i][2] = i < XY - X ? (W[i][2] * C[i + X] + epsilon / m * C[i]) / diagonal : 0;\n+\t\tM[i][3] = i % X ? (W[i][3] * C[i - 1] + epsilon / m * C[i]) / diagonal : 0;\n \t}\n }\n \n // In the compute_lambda_ functions, note that the matrix coefficients for the\n // left/right neighbours are zero down the left/right edges, so we don't need\n // need to test the i value to exclude them.\n-static double compute_lambda_bottom(int i, double const M[XY][4],\n-\t\t\t\t    double lambda[XY])\n+static double computeLambdaBottom(int i, double const M[XY][4],\n+\t\t\t\t  double lambda[XY])\n {\n \treturn M[i][1] * lambda[i + 1] + M[i][2] * lambda[i + X] +\n \t       M[i][3] * lambda[i - 1];\n }\n-static double compute_lambda_bottom_start(int i, double const M[XY][4],\n-\t\t\t\t\t  double lambda[XY])\n+static double computeLambdaBottomStart(int i, double const M[XY][4],\n+\t\t\t\t       double lambda[XY])\n {\n \treturn M[i][1] * lambda[i + 1] + M[i][2] * lambda[i + X];\n }\n-static double compute_lambda_interior(int i, double const M[XY][4],\n-\t\t\t\t      double lambda[XY])\n+static double computeLambdaInterior(int i, double const M[XY][4],\n+\t\t\t\t    double lambda[XY])\n {\n \treturn M[i][0] * lambda[i - X] + M[i][1] * lambda[i + 1] +\n \t       M[i][2] * lambda[i + X] + M[i][3] * lambda[i - 1];\n }\n-static double compute_lambda_top(int i, double const M[XY][4],\n-\t\t\t\t double lambda[XY])\n+static double computeLambdaTop(int i, double const M[XY][4],\n+\t\t\t       double lambda[XY])\n {\n \treturn M[i][0] * lambda[i - X] + M[i][1] * lambda[i + 1] +\n \t       M[i][3] * lambda[i - 1];\n }\n-static double compute_lambda_top_end(int i, double const M[XY][4],\n-\t\t\t\t     double lambda[XY])\n+static double computeLambdaTopEnd(int i, double const M[XY][4],\n+\t\t\t\t  double lambda[XY])\n {\n \treturn M[i][0] * lambda[i - X] + M[i][3] * lambda[i - 1];\n }\n \n // Gauss-Seidel iteration with over-relaxation.\n-static double gauss_seidel2_SOR(double const M[XY][4], double omega,\n-\t\t\t\tdouble lambda[XY], double lambda_bound)\n+static double gaussSeidel2Sor(double const M[XY][4], double omega,\n+\t\t\t      double lambda[XY], double lambdaBound)\n {\n-\tconst double min = 1 - lambda_bound, max = 1 + lambda_bound;\n-\tdouble old_lambda[XY];\n+\tconst double min = 1 - lambdaBound, max = 1 + lambdaBound;\n+\tdouble oldLambda[XY];\n \tint i;\n \tfor (i = 0; i < XY; i++)\n-\t\told_lambda[i] = lambda[i];\n-\tlambda[0] = compute_lambda_bottom_start(0, M, lambda);\n+\t\toldLambda[i] = lambda[i];\n+\tlambda[0] = computeLambdaBottomStart(0, M, lambda);\n \tlambda[0] = std::clamp(lambda[0], min, max);\n \tfor (i = 1; i < X; i++) {\n-\t\tlambda[i] = compute_lambda_bottom(i, M, lambda);\n+\t\tlambda[i] = computeLambdaBottom(i, M, lambda);\n \t\tlambda[i] = std::clamp(lambda[i], min, max);\n \t}\n \tfor (; i < XY - X; i++) {\n-\t\tlambda[i] = compute_lambda_interior(i, M, lambda);\n+\t\tlambda[i] = computeLambdaInterior(i, M, lambda);\n \t\tlambda[i] = std::clamp(lambda[i], min, max);\n \t}\n \tfor (; i < XY - 1; i++) {\n-\t\tlambda[i] = compute_lambda_top(i, M, lambda);\n+\t\tlambda[i] = computeLambdaTop(i, M, lambda);\n \t\tlambda[i] = std::clamp(lambda[i], min, max);\n \t}\n-\tlambda[i] = compute_lambda_top_end(i, M, lambda);\n+\tlambda[i] = computeLambdaTopEnd(i, M, lambda);\n \tlambda[i] = std::clamp(lambda[i], min, max);\n \t// Also solve the system from bottom to top, to help spread the updates\n \t// better.\n-\tlambda[i] = compute_lambda_top_end(i, M, lambda);\n+\tlambda[i] = computeLambdaTopEnd(i, M, lambda);\n \tlambda[i] = std::clamp(lambda[i], min, max);\n \tfor (i = XY - 2; i >= XY - X; i--) {\n-\t\tlambda[i] = compute_lambda_top(i, M, lambda);\n+\t\tlambda[i] = computeLambdaTop(i, M, lambda);\n \t\tlambda[i] = std::clamp(lambda[i], min, max);\n \t}\n \tfor (; i >= X; i--) {\n-\t\tlambda[i] = compute_lambda_interior(i, M, lambda);\n+\t\tlambda[i] = computeLambdaInterior(i, M, lambda);\n \t\tlambda[i] = std::clamp(lambda[i], min, max);\n \t}\n \tfor (; i >= 1; i--) {\n-\t\tlambda[i] = compute_lambda_bottom(i, M, lambda);\n+\t\tlambda[i] = computeLambdaBottom(i, M, lambda);\n \t\tlambda[i] = std::clamp(lambda[i], min, max);\n \t}\n-\tlambda[0] = compute_lambda_bottom_start(0, M, lambda);\n+\tlambda[0] = computeLambdaBottomStart(0, M, lambda);\n \tlambda[0] = std::clamp(lambda[0], min, max);\n-\tdouble max_diff = 0;\n+\tdouble maxDiff = 0;\n \tfor (i = 0; i < XY; i++) {\n-\t\tlambda[i] = old_lambda[i] + (lambda[i] - old_lambda[i]) * omega;\n-\t\tif (fabs(lambda[i] - old_lambda[i]) > fabs(max_diff))\n-\t\t\tmax_diff = lambda[i] - old_lambda[i];\n+\t\tlambda[i] = oldLambda[i] + (lambda[i] - oldLambda[i]) * omega;\n+\t\tif (fabs(lambda[i] - oldLambda[i]) > fabs(maxDiff))\n+\t\t\tmaxDiff = lambda[i] - oldLambda[i];\n \t}\n-\treturn max_diff;\n+\treturn maxDiff;\n }\n \n // Normalise the values so that the smallest value is 1.\n@@ -683,105 +656,99 @@ static void reaverage(Span<double> data)\n \t\td *= ratio;\n }\n \n-static void run_matrix_iterations(double const C[XY], double lambda[XY],\n-\t\t\t\t  double const W[XY][4], double omega,\n-\t\t\t\t  int n_iter, double threshold, double lambda_bound)\n+static void runMatrixIterations(double const C[XY], double lambda[XY],\n+\t\t\t\tdouble const W[XY][4], double omega,\n+\t\t\t\tint nIter, double threshold, double lambdaBound)\n {\n \tdouble M[XY][4];\n-\tconstruct_M(C, W, M);\n-\tdouble last_max_diff = std::numeric_limits<double>::max();\n-\tfor (int i = 0; i < n_iter; i++) {\n-\t\tdouble max_diff = fabs(gauss_seidel2_SOR(M, omega, lambda, lambda_bound));\n-\t\tif (max_diff < threshold) {\n+\tconstructM(C, W, M);\n+\tdouble lastMaxDiff = std::numeric_limits<double>::max();\n+\tfor (int i = 0; i < nIter; i++) {\n+\t\tdouble maxDiff = fabs(gaussSeidel2Sor(M, omega, lambda, lambdaBound));\n+\t\tif (maxDiff < threshold) {\n \t\t\tLOG(RPiAlsc, Debug)\n \t\t\t\t<< \"Stop after \" << i + 1 << \" iterations\";\n \t\t\tbreak;\n \t\t}\n \t\t// this happens very occasionally (so make a note), though\n \t\t// doesn't seem to matter\n-\t\tif (max_diff > last_max_diff)\n+\t\tif (maxDiff > lastMaxDiff)\n \t\t\tLOG(RPiAlsc, Debug)\n-\t\t\t\t<< \"Iteration \" << i << \": max_diff gone up \"\n-\t\t\t\t<< last_max_diff << \" to \" << max_diff;\n-\t\tlast_max_diff = max_diff;\n+\t\t\t\t<< \"Iteration \" << i << \": maxDiff gone up \"\n+\t\t\t\t<< lastMaxDiff << \" to \" << maxDiff;\n+\t\tlastMaxDiff = maxDiff;\n \t}\n \t// We're going to normalise the lambdas so the total average is 1.\n \treaverage({ lambda, XY });\n }\n \n-static void add_luminance_rb(double result[XY], double const lambda[XY],\n-\t\t\t     double const luminance_lut[XY],\n-\t\t\t     double luminance_strength)\n+static void addLuminanceRb(double result[XY], double const lambda[XY],\n+\t\t\t   double const luminanceLut[XY],\n+\t\t\t   double luminanceStrength)\n {\n \tfor (int i = 0; i < XY; i++)\n-\t\tresult[i] = lambda[i] *\n-\t\t\t    ((luminance_lut[i] - 1) * luminance_strength + 1);\n+\t\tresult[i] = lambda[i] * ((luminanceLut[i] - 1) * luminanceStrength + 1);\n }\n \n-static void add_luminance_g(double result[XY], double lambda,\n-\t\t\t    double const luminance_lut[XY],\n-\t\t\t    double luminance_strength)\n+static void addLuminanceG(double result[XY], double lambda,\n+\t\t\t  double const luminanceLut[XY],\n+\t\t\t  double luminanceStrength)\n {\n \tfor (int i = 0; i < XY; i++)\n-\t\tresult[i] = lambda *\n-\t\t\t    ((luminance_lut[i] - 1) * luminance_strength + 1);\n+\t\tresult[i] = lambda * ((luminanceLut[i] - 1) * luminanceStrength + 1);\n }\n \n-void add_luminance_to_tables(double results[3][Y][X], double const lambda_r[XY],\n-\t\t\t     double lambda_g, double const lambda_b[XY],\n-\t\t\t     double const luminance_lut[XY],\n-\t\t\t     double luminance_strength)\n+void addLuminanceToTables(double results[3][Y][X], double const lambdaR[XY],\n+\t\t\t  double lambdaG, double const lambdaB[XY],\n+\t\t\t  double const luminanceLut[XY],\n+\t\t\t  double luminanceStrength)\n {\n-\tadd_luminance_rb((double *)results[0], lambda_r, luminance_lut,\n-\t\t\t luminance_strength);\n-\tadd_luminance_g((double *)results[1], lambda_g, luminance_lut,\n-\t\t\tluminance_strength);\n-\tadd_luminance_rb((double *)results[2], lambda_b, luminance_lut,\n-\t\t\t luminance_strength);\n+\taddLuminanceRb((double *)results[0], lambdaR, luminanceLut, luminanceStrength);\n+\taddLuminanceG((double *)results[1], lambdaG, luminanceLut, luminanceStrength);\n+\taddLuminanceRb((double *)results[2], lambdaB, luminanceLut, luminanceStrength);\n \tnormalise((double *)results, 3 * XY);\n }\n \n void Alsc::doAlsc()\n {\n-\tdouble Cr[XY], Cb[XY], Wr[XY][4], Wb[XY][4], cal_table_r[XY],\n-\t\tcal_table_b[XY], cal_table_tmp[XY];\n+\tdouble cr[XY], cb[XY], wr[XY][4], wb[XY][4], calTableR[XY], calTableB[XY], calTableTmp[XY];\n \t// Calculate our R/B (\"Cr\"/\"Cb\") colour statistics, and assess which are\n \t// usable.\n-\tcalculate_Cr_Cb(statistics_, Cr, Cb, config_.min_count, config_.min_G);\n+\tcalculateCrCb(statistics_, cr, cb, config_.minCount, config_.minG);\n \t// Fetch the new calibrations (if any) for this CT. Resample them in\n \t// case the camera mode is not full-frame.\n-\tget_cal_table(ct_, config_.calibrations_Cr, cal_table_tmp);\n-\tresample_cal_table(cal_table_tmp, camera_mode_, cal_table_r);\n-\tget_cal_table(ct_, config_.calibrations_Cb, cal_table_tmp);\n-\tresample_cal_table(cal_table_tmp, camera_mode_, cal_table_b);\n+\tgetCalTable(ct_, config_.calibrationsCr, calTableTmp);\n+\tresampleCalTable(calTableTmp, cameraMode_, calTableR);\n+\tgetCalTable(ct_, config_.calibrationsCb, calTableTmp);\n+\tresampleCalTable(calTableTmp, cameraMode_, calTableB);\n \t// You could print out the cal tables for this image here, if you're\n \t// tuning the algorithm...\n \t// Apply any calibration to the statistics, so the adaptive algorithm\n \t// makes only the extra adjustments.\n-\tapply_cal_table(cal_table_r, Cr);\n-\tapply_cal_table(cal_table_b, Cb);\n+\tapplyCalTable(calTableR, cr);\n+\tapplyCalTable(calTableB, cb);\n \t// Compute weights between zones.\n-\tcompute_W(Cr, config_.sigma_Cr, Wr);\n-\tcompute_W(Cb, config_.sigma_Cb, Wb);\n+\tcomputeW(cr, config_.sigmaCr, wr);\n+\tcomputeW(cb, config_.sigmaCb, wb);\n \t// Run Gauss-Seidel iterations over the resulting matrix, for R and B.\n-\trun_matrix_iterations(Cr, lambda_r_, Wr, config_.omega, config_.n_iter,\n-\t\t\t      config_.threshold, config_.lambda_bound);\n-\trun_matrix_iterations(Cb, lambda_b_, Wb, config_.omega, config_.n_iter,\n-\t\t\t      config_.threshold, config_.lambda_bound);\n+\trunMatrixIterations(cr, lambdaR_, wr, config_.omega, config_.nIter,\n+\t\t\t    config_.threshold, config_.lambdaBound);\n+\trunMatrixIterations(cb, lambdaB_, wb, config_.omega, config_.nIter,\n+\t\t\t    config_.threshold, config_.lambdaBound);\n \t// Fold the calibrated gains into our final lambda values. (Note that on\n \t// the next run, we re-start with the lambda values that don't have the\n \t// calibration gains included.)\n-\tcompensate_lambdas_for_cal(cal_table_r, lambda_r_, async_lambda_r_);\n-\tcompensate_lambdas_for_cal(cal_table_b, lambda_b_, async_lambda_b_);\n+\tcompensateLambdasForCal(calTableR, lambdaR_, asyncLambdaR_);\n+\tcompensateLambdasForCal(calTableB, lambdaB_, asyncLambdaB_);\n \t// Fold in the luminance table at the appropriate strength.\n-\tadd_luminance_to_tables(async_results_, async_lambda_r_, 1.0,\n-\t\t\t\tasync_lambda_b_, luminance_table_,\n-\t\t\t\tconfig_.luminance_strength);\n+\taddLuminanceToTables(asyncResults_, asyncLambdaR_, 1.0,\n+\t\t\t     asyncLambdaB_, luminanceTable_,\n+\t\t\t     config_.luminanceStrength);\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 Alsc(controller);\n }\n-static RegisterAlgorithm reg(NAME, &Create);\n+static RegisterAlgorithm reg(NAME, &create);\ndiff --git a/src/ipa/raspberrypi/controller/rpi/alsc.hpp b/src/ipa/raspberrypi/controller/rpi/alsc.hpp\nindex d1dbe0d1d22d..7a0949d1ccc5 100644\n--- a/src/ipa/raspberrypi/controller/rpi/alsc.hpp\n+++ b/src/ipa/raspberrypi/controller/rpi/alsc.hpp\n@@ -24,24 +24,24 @@ struct AlscCalibration {\n \n struct AlscConfig {\n \t// Only repeat the ALSC calculation every \"this many\" frames\n-\tuint16_t frame_period;\n+\tuint16_t framePeriod;\n \t// number of initial frames for which speed taken as 1.0 (maximum)\n-\tuint16_t startup_frames;\n+\tuint16_t startupFrames;\n \t// IIR filter speed applied to algorithm results\n \tdouble speed;\n-\tdouble sigma_Cr;\n-\tdouble sigma_Cb;\n-\tdouble min_count;\n-\tuint16_t min_G;\n+\tdouble sigmaCr;\n+\tdouble sigmaCb;\n+\tdouble minCount;\n+\tuint16_t minG;\n \tdouble omega;\n-\tuint32_t n_iter;\n-\tdouble luminance_lut[ALSC_CELLS_X * ALSC_CELLS_Y];\n-\tdouble luminance_strength;\n-\tstd::vector<AlscCalibration> calibrations_Cr;\n-\tstd::vector<AlscCalibration> calibrations_Cb;\n-\tdouble default_ct; // colour temperature if no metadata found\n+\tuint32_t nIter;\n+\tdouble luminanceLut[ALSC_CELLS_X * ALSC_CELLS_Y];\n+\tdouble luminanceStrength;\n+\tstd::vector<AlscCalibration> calibrationsCr;\n+\tstd::vector<AlscCalibration> calibrationsCb;\n+\tdouble defaultCt; // colour temperature if no metadata found\n \tdouble threshold; // iteration termination threshold\n-\tdouble lambda_bound; // upper/lower bound for lambda from a value of 1\n+\tdouble lambdaBound; // upper/lower bound for lambda from a value of 1\n };\n \n class Alsc : public Algorithm\n@@ -49,58 +49,58 @@ class Alsc : public Algorithm\n public:\n \tAlsc(Controller *controller = NULL);\n \t~Alsc();\n-\tchar const *Name() const override;\n-\tvoid Initialise() override;\n-\tvoid SwitchMode(CameraMode const &camera_mode, Metadata *metadata) override;\n-\tvoid Read(boost::property_tree::ptree const &params) 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 initialise() override;\n+\tvoid switchMode(CameraMode const &cameraMode, Metadata *metadata) override;\n+\tvoid read(boost::property_tree::ptree const &params) override;\n+\tvoid prepare(Metadata *imageMetadata) override;\n+\tvoid process(StatisticsPtr &stats, Metadata *imageMetadata) override;\n \n private:\n \t// configuration is read-only, and available to both threads\n \tAlscConfig config_;\n-\tbool first_time_;\n-\tCameraMode camera_mode_;\n-\tdouble luminance_table_[ALSC_CELLS_X * ALSC_CELLS_Y];\n-\tstd::thread async_thread_;\n+\tbool firstTime_;\n+\tCameraMode cameraMode_;\n+\tdouble luminanceTable_[ALSC_CELLS_X * ALSC_CELLS_Y];\n+\tstd::thread asyncThread_;\n \tvoid asyncFunc(); // asynchronous thread function\n \tstd::mutex mutex_;\n \t// condvar for async thread to wait on\n-\tstd::condition_variable async_signal_;\n+\tstd::condition_variable asyncSignal_;\n \t// condvar for synchronous thread to wait on\n-\tstd::condition_variable sync_signal_;\n+\tstd::condition_variable syncSignal_;\n \t// for sync thread to check  if async thread finished (requires mutex)\n-\tbool async_finished_;\n+\tbool asyncFinished_;\n \t// for async thread to check if it's been told to run (requires mutex)\n-\tbool async_start_;\n+\tbool asyncStart_;\n \t// for async thread to check if it's been told to quit (requires mutex)\n-\tbool async_abort_;\n+\tbool asyncAbort_;\n \n \t// The following are only for the synchronous thread to use:\n \t// for sync thread to note its has asked async thread to run\n-\tbool async_started_;\n-\t// counts up to frame_period before restarting the async thread\n-\tint frame_phase_;\n-\t// counts up to startup_frames\n-\tint frame_count_;\n-\t// counts up to startup_frames for Process function\n-\tint frame_count2_;\n-\tdouble sync_results_[3][ALSC_CELLS_Y][ALSC_CELLS_X];\n-\tdouble prev_sync_results_[3][ALSC_CELLS_Y][ALSC_CELLS_X];\n+\tbool asyncStarted_;\n+\t// counts up to framePeriod before restarting the async thread\n+\tint framePhase_;\n+\t// counts up to startupFrames\n+\tint frameCount_;\n+\t// counts up to startupFrames for Process function\n+\tint frameCount2_;\n+\tdouble syncResults_[3][ALSC_CELLS_Y][ALSC_CELLS_X];\n+\tdouble prevSyncResults_[3][ALSC_CELLS_Y][ALSC_CELLS_X];\n \tvoid waitForAysncThread();\n \t// The following are for the asynchronous thread to use, though the main\n \t// thread can set/reset them if the async thread is known to be idle:\n-\tvoid restartAsync(StatisticsPtr &stats, Metadata *image_metadata);\n+\tvoid restartAsync(StatisticsPtr &stats, Metadata *imageMetadata);\n \t// copy out the results from the async thread so that it can be restarted\n \tvoid fetchAsyncResults();\n \tdouble ct_;\n \tbcm2835_isp_stats_region statistics_[ALSC_CELLS_Y * ALSC_CELLS_X];\n-\tdouble async_results_[3][ALSC_CELLS_Y][ALSC_CELLS_X];\n-\tdouble async_lambda_r_[ALSC_CELLS_X * ALSC_CELLS_Y];\n-\tdouble async_lambda_b_[ALSC_CELLS_X * ALSC_CELLS_Y];\n+\tdouble asyncResults_[3][ALSC_CELLS_Y][ALSC_CELLS_X];\n+\tdouble asyncLambdaR_[ALSC_CELLS_X * ALSC_CELLS_Y];\n+\tdouble asyncLambdaB_[ALSC_CELLS_X * ALSC_CELLS_Y];\n \tvoid doAlsc();\n-\tdouble lambda_r_[ALSC_CELLS_X * ALSC_CELLS_Y];\n-\tdouble lambda_b_[ALSC_CELLS_X * ALSC_CELLS_Y];\n+\tdouble lambdaR_[ALSC_CELLS_X * ALSC_CELLS_Y];\n+\tdouble lambdaB_[ALSC_CELLS_X * ALSC_CELLS_Y];\n };\n \n } // namespace RPiController\ndiff --git a/src/ipa/raspberrypi/controller/rpi/awb.cpp b/src/ipa/raspberrypi/controller/rpi/awb.cpp\nindex d4c934473832..a305237f31fb 100644\n--- a/src/ipa/raspberrypi/controller/rpi/awb.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/awb.cpp\n@@ -24,33 +24,33 @@ LOG_DEFINE_CATEGORY(RPiAwb)\n // todo - the locking in this algorithm needs some tidying up as has been done\n // elsewhere (ALSC and AGC).\n \n-void AwbMode::Read(boost::property_tree::ptree const &params)\n+void AwbMode::read(boost::property_tree::ptree const &params)\n {\n-\tct_lo = params.get<double>(\"lo\");\n-\tct_hi = params.get<double>(\"hi\");\n+\tctLo = params.get<double>(\"lo\");\n+\tctHi = params.get<double>(\"hi\");\n }\n \n-void AwbPrior::Read(boost::property_tree::ptree const &params)\n+void AwbPrior::read(boost::property_tree::ptree const &params)\n {\n \tlux = params.get<double>(\"lux\");\n-\tprior.Read(params.get_child(\"prior\"));\n+\tprior.read(params.get_child(\"prior\"));\n }\n \n-static void read_ct_curve(Pwl &ct_r, Pwl &ct_b,\n-\t\t\t  boost::property_tree::ptree const &params)\n+static void readCtCurve(Pwl &ctR, Pwl &ctB,\n+\t\t\tboost::property_tree::ptree const &params)\n {\n \tint num = 0;\n \tfor (auto it = params.begin(); it != params.end(); it++) {\n \t\tdouble ct = it->second.get_value<double>();\n-\t\tassert(it == params.begin() || ct != ct_r.Domain().end);\n+\t\tassert(it == params.begin() || ct != ctR.domain().end);\n \t\tif (++it == params.end())\n \t\t\tthrow std::runtime_error(\n \t\t\t\t\"AwbConfig: incomplete CT curve entry\");\n-\t\tct_r.Append(ct, it->second.get_value<double>());\n+\t\tctR.append(ct, it->second.get_value<double>());\n \t\tif (++it == params.end())\n \t\t\tthrow std::runtime_error(\n \t\t\t\t\"AwbConfig: incomplete CT curve entry\");\n-\t\tct_b.Append(ct, it->second.get_value<double>());\n+\t\tctB.append(ct, it->second.get_value<double>());\n \t\tnum++;\n \t}\n \tif (num < 2)\n@@ -58,22 +58,21 @@ static void read_ct_curve(Pwl &ct_r, Pwl &ct_b,\n \t\t\t\"AwbConfig: insufficient points in CT curve\");\n }\n \n-void AwbConfig::Read(boost::property_tree::ptree const &params)\n+void AwbConfig::read(boost::property_tree::ptree const &params)\n {\n \tbayes = params.get<int>(\"bayes\", 1);\n-\tframe_period = params.get<uint16_t>(\"frame_period\", 10);\n-\tstartup_frames = params.get<uint16_t>(\"startup_frames\", 10);\n-\tconvergence_frames = params.get<unsigned int>(\"convergence_frames\", 3);\n+\tframePeriod = params.get<uint16_t>(\"framePeriod\", 10);\n+\tstartupFrames = params.get<uint16_t>(\"startupFrames\", 10);\n+\tconvergenceFrames = params.get<unsigned int>(\"convergence_frames\", 3);\n \tspeed = params.get<double>(\"speed\", 0.05);\n \tif (params.get_child_optional(\"ct_curve\"))\n-\t\tread_ct_curve(ct_r, ct_b, params.get_child(\"ct_curve\"));\n+\t\treadCtCurve(ctR, ctB, params.get_child(\"ct_curve\"));\n \tif (params.get_child_optional(\"priors\")) {\n \t\tfor (auto &p : params.get_child(\"priors\")) {\n \t\t\tAwbPrior prior;\n-\t\t\tprior.Read(p.second);\n+\t\t\tprior.read(p.second);\n \t\t\tif (!priors.empty() && prior.lux <= priors.back().lux)\n-\t\t\t\tthrow std::runtime_error(\n-\t\t\t\t\t\"AwbConfig: Prior must be ordered in increasing lux value\");\n+\t\t\t\tthrow std::runtime_error(\"AwbConfig: Prior must be ordered in increasing lux value\");\n \t\t\tpriors.push_back(prior);\n \t\t}\n \t\tif (priors.empty())\n@@ -82,177 +81,170 @@ void AwbConfig::Read(boost::property_tree::ptree const &params)\n \t}\n \tif (params.get_child_optional(\"modes\")) {\n \t\tfor (auto &p : params.get_child(\"modes\")) {\n-\t\t\tmodes[p.first].Read(p.second);\n-\t\t\tif (default_mode == nullptr)\n-\t\t\t\tdefault_mode = &modes[p.first];\n+\t\t\tmodes[p.first].read(p.second);\n+\t\t\tif (defaultMode == nullptr)\n+\t\t\t\tdefaultMode = &modes[p.first];\n \t\t}\n-\t\tif (default_mode == nullptr)\n-\t\t\tthrow std::runtime_error(\n-\t\t\t\t\"AwbConfig: no AWB modes configured\");\n+\t\tif (defaultMode == nullptr)\n+\t\t\tthrow std::runtime_error(\"AwbConfig: no AWB modes configured\");\n \t}\n-\tmin_pixels = params.get<double>(\"min_pixels\", 16.0);\n-\tmin_G = params.get<uint16_t>(\"min_G\", 32);\n-\tmin_regions = params.get<uint32_t>(\"min_regions\", 10);\n-\tdelta_limit = params.get<double>(\"delta_limit\", 0.2);\n-\tcoarse_step = params.get<double>(\"coarse_step\", 0.2);\n-\ttransverse_pos = params.get<double>(\"transverse_pos\", 0.01);\n-\ttransverse_neg = params.get<double>(\"transverse_neg\", 0.01);\n-\tif (transverse_pos <= 0 || transverse_neg <= 0)\n-\t\tthrow std::runtime_error(\n-\t\t\t\"AwbConfig: transverse_pos/neg must be > 0\");\n-\tsensitivity_r = params.get<double>(\"sensitivity_r\", 1.0);\n-\tsensitivity_b = params.get<double>(\"sensitivity_b\", 1.0);\n+\tminPixels = params.get<double>(\"min_pixels\", 16.0);\n+\tminG = params.get<uint16_t>(\"min_G\", 32);\n+\tminRegions = params.get<uint32_t>(\"min_regions\", 10);\n+\tdeltaLimit = params.get<double>(\"delta_limit\", 0.2);\n+\tcoarseStep = params.get<double>(\"coarse_step\", 0.2);\n+\ttransversePos = params.get<double>(\"transverse_pos\", 0.01);\n+\ttransverseNeg = params.get<double>(\"transverse_neg\", 0.01);\n+\tif (transversePos <= 0 || transverseNeg <= 0)\n+\t\tthrow std::runtime_error(\"AwbConfig: transverse_pos/neg must be > 0\");\n+\tsensitivityR = params.get<double>(\"sensitivity_r\", 1.0);\n+\tsensitivityB = params.get<double>(\"sensitivity_b\", 1.0);\n \tif (bayes) {\n-\t\tif (ct_r.Empty() || ct_b.Empty() || priors.empty() ||\n-\t\t    default_mode == nullptr) {\n+\t\tif (ctR.empty() || ctB.empty() || priors.empty() ||\n+\t\t    defaultMode == nullptr) {\n \t\t\tLOG(RPiAwb, Warning)\n \t\t\t\t<< \"Bayesian AWB mis-configured - switch to Grey method\";\n \t\t\tbayes = false;\n \t\t}\n \t}\n-\tfast = params.get<int>(\n-\t\t\"fast\", bayes); // default to fast for Bayesian, otherwise slow\n-\twhitepoint_r = params.get<double>(\"whitepoint_r\", 0.0);\n-\twhitepoint_b = params.get<double>(\"whitepoint_b\", 0.0);\n+\tfast = params.get<int>(\"fast\", bayes); // default to fast for Bayesian, otherwise slow\n+\twhitepointR = params.get<double>(\"whitepoint_r\", 0.0);\n+\twhitepointB = params.get<double>(\"whitepoint_b\", 0.0);\n \tif (bayes == false)\n-\t\tsensitivity_r = sensitivity_b =\n-\t\t\t1.0; // nor do sensitivities make any sense\n+\t\tsensitivityR = sensitivityB = 1.0; // nor do sensitivities make any sense\n }\n \n Awb::Awb(Controller *controller)\n \t: AwbAlgorithm(controller)\n {\n-\tasync_abort_ = async_start_ = async_started_ = async_finished_ = false;\n+\tasyncAbort_ = asyncStart_ = asyncStarted_ = asyncFinished_ = false;\n \tmode_ = nullptr;\n-\tmanual_r_ = manual_b_ = 0.0;\n-\tfirst_switch_mode_ = true;\n-\tasync_thread_ = std::thread(std::bind(&Awb::asyncFunc, this));\n+\tmanualR_ = manualB_ = 0.0;\n+\tfirstSwitchMode_ = true;\n+\tasyncThread_ = std::thread(std::bind(&Awb::asyncFunc, this));\n }\n \n Awb::~Awb()\n {\n \t{\n \t\tstd::lock_guard<std::mutex> lock(mutex_);\n-\t\tasync_abort_ = true;\n+\t\tasyncAbort_ = true;\n \t}\n-\tasync_signal_.notify_one();\n-\tasync_thread_.join();\n+\tasyncSignal_.notify_one();\n+\tasyncThread_.join();\n }\n \n-char const *Awb::Name() const\n+char const *Awb::name() const\n {\n \treturn NAME;\n }\n \n-void Awb::Read(boost::property_tree::ptree const &params)\n+void Awb::read(boost::property_tree::ptree const &params)\n {\n-\tconfig_.Read(params);\n+\tconfig_.read(params);\n }\n \n-void Awb::Initialise()\n+void Awb::initialise()\n {\n-\tframe_count_ = frame_phase_ = 0;\n+\tframeCount_ = framePhase_ = 0;\n \t// Put something sane into the status that we are filtering towards,\n \t// just in case the first few frames don't have anything meaningful in\n \t// them.\n-\tif (!config_.ct_r.Empty() && !config_.ct_b.Empty()) {\n-\t\tsync_results_.temperature_K = config_.ct_r.Domain().Clip(4000);\n-\t\tsync_results_.gain_r =\n-\t\t\t1.0 / config_.ct_r.Eval(sync_results_.temperature_K);\n-\t\tsync_results_.gain_g = 1.0;\n-\t\tsync_results_.gain_b =\n-\t\t\t1.0 / config_.ct_b.Eval(sync_results_.temperature_K);\n+\tif (!config_.ctR.empty() && !config_.ctB.empty()) {\n+\t\tsyncResults_.temperatureK = config_.ctR.domain().clip(4000);\n+\t\tsyncResults_.gainR = 1.0 / config_.ctR.eval(syncResults_.temperatureK);\n+\t\tsyncResults_.gainG = 1.0;\n+\t\tsyncResults_.gainB = 1.0 / config_.ctB.eval(syncResults_.temperatureK);\n \t} else {\n \t\t// random values just to stop the world blowing up\n-\t\tsync_results_.temperature_K = 4500;\n-\t\tsync_results_.gain_r = sync_results_.gain_g =\n-\t\t\tsync_results_.gain_b = 1.0;\n+\t\tsyncResults_.temperatureK = 4500;\n+\t\tsyncResults_.gainR = syncResults_.gainG = syncResults_.gainB = 1.0;\n \t}\n-\tprev_sync_results_ = sync_results_;\n-\tasync_results_ = sync_results_;\n+\tprevSyncResults_ = syncResults_;\n+\tasyncResults_ = syncResults_;\n }\n \n-bool Awb::IsPaused() const\n+bool Awb::isPaused() const\n {\n \treturn false;\n }\n \n-void Awb::Pause()\n+void Awb::pause()\n {\n \t// \"Pause\" by fixing everything to the most recent values.\n-\tmanual_r_ = sync_results_.gain_r = prev_sync_results_.gain_r;\n-\tmanual_b_ = sync_results_.gain_b = prev_sync_results_.gain_b;\n-\tsync_results_.gain_g = prev_sync_results_.gain_g;\n-\tsync_results_.temperature_K = prev_sync_results_.temperature_K;\n+\tmanualR_ = syncResults_.gainR = prevSyncResults_.gainR;\n+\tmanualB_ = syncResults_.gainB = prevSyncResults_.gainB;\n+\tsyncResults_.gainG = prevSyncResults_.gainG;\n+\tsyncResults_.temperatureK = prevSyncResults_.temperatureK;\n }\n \n-void Awb::Resume()\n+void Awb::resume()\n {\n-\tmanual_r_ = 0.0;\n-\tmanual_b_ = 0.0;\n+\tmanualR_ = 0.0;\n+\tmanualB_ = 0.0;\n }\n \n-unsigned int Awb::GetConvergenceFrames() const\n+unsigned int Awb::getConvergenceFrames() const\n {\n \t// If not in auto mode, there is no convergence\n \t// to happen, so no need to drop any frames - return zero.\n \tif (!isAutoEnabled())\n \t\treturn 0;\n \telse\n-\t\treturn config_.convergence_frames;\n+\t\treturn config_.convergenceFrames;\n }\n \n-void Awb::SetMode(std::string const &mode_name)\n+void Awb::setMode(std::string const &modeName)\n {\n-\tmode_name_ = mode_name;\n+\tmodeName_ = modeName;\n }\n \n-void Awb::SetManualGains(double manual_r, double manual_b)\n+void Awb::setManualGains(double manualR, double manualB)\n {\n \t// If any of these are 0.0, we swich back to auto.\n-\tmanual_r_ = manual_r;\n-\tmanual_b_ = manual_b;\n-\t// If not in auto mode, set these values into the sync_results which\n+\tmanualR_ = manualR;\n+\tmanualB_ = manualB;\n+\t// If not in auto mode, set these values into the syncResults which\n \t// means that Prepare() will adopt them immediately.\n \tif (!isAutoEnabled()) {\n-\t\tsync_results_.gain_r = prev_sync_results_.gain_r = manual_r_;\n-\t\tsync_results_.gain_g = prev_sync_results_.gain_g = 1.0;\n-\t\tsync_results_.gain_b = prev_sync_results_.gain_b = manual_b_;\n+\t\tsyncResults_.gainR = prevSyncResults_.gainR = manualR_;\n+\t\tsyncResults_.gainG = prevSyncResults_.gainG = 1.0;\n+\t\tsyncResults_.gainB = prevSyncResults_.gainB = manualB_;\n \t}\n }\n \n-void Awb::SwitchMode([[maybe_unused]] CameraMode const &camera_mode,\n+void Awb::switchMode([[maybe_unused]] CameraMode const &cameraMode,\n \t\t     Metadata *metadata)\n {\n \t// On the first mode switch we'll have no meaningful colour\n \t// temperature, so try to dead reckon one if in manual mode.\n-\tif (!isAutoEnabled() && first_switch_mode_ && config_.bayes) {\n-\t\tPwl ct_r_inverse = config_.ct_r.Inverse();\n-\t\tPwl ct_b_inverse = config_.ct_b.Inverse();\n-\t\tdouble ct_r = ct_r_inverse.Eval(ct_r_inverse.Domain().Clip(1 / manual_r_));\n-\t\tdouble ct_b = ct_b_inverse.Eval(ct_b_inverse.Domain().Clip(1 / manual_b_));\n-\t\tprev_sync_results_.temperature_K = (ct_r + ct_b) / 2;\n-\t\tsync_results_.temperature_K = prev_sync_results_.temperature_K;\n+\tif (!isAutoEnabled() && firstSwitchMode_ && config_.bayes) {\n+\t\tPwl ctRInverse = config_.ctR.inverse();\n+\t\tPwl ctBInverse = config_.ctB.inverse();\n+\t\tdouble ctR = ctRInverse.eval(ctRInverse.domain().clip(1 / manualR_));\n+\t\tdouble ctB = ctBInverse.eval(ctBInverse.domain().clip(1 / manualB_));\n+\t\tprevSyncResults_.temperatureK = (ctR + ctB) / 2;\n+\t\tsyncResults_.temperatureK = prevSyncResults_.temperatureK;\n \t}\n \t// Let other algorithms know the current white balance values.\n-\tmetadata->Set(\"awb.status\", prev_sync_results_);\n-\tfirst_switch_mode_ = false;\n+\tmetadata->set(\"awb.status\", prevSyncResults_);\n+\tfirstSwitchMode_ = false;\n }\n \n bool Awb::isAutoEnabled() const\n {\n-\treturn manual_r_ == 0.0 || manual_b_ == 0.0;\n+\treturn manualR_ == 0.0 || manualB_ == 0.0;\n }\n \n void Awb::fetchAsyncResults()\n {\n \tLOG(RPiAwb, Debug) << \"Fetch AWB results\";\n-\tasync_finished_ = false;\n-\tasync_started_ = false;\n+\tasyncFinished_ = false;\n+\tasyncStarted_ = false;\n \t// It's possible manual gains could be set even while the async\n \t// thread was running, so only copy the results if still in auto mode.\n \tif (isAutoEnabled())\n-\t\tsync_results_ = async_results_;\n+\t\tsyncResults_ = asyncResults_;\n }\n \n void Awb::restartAsync(StatisticsPtr &stats, double lux)\n@@ -261,75 +253,74 @@ void Awb::restartAsync(StatisticsPtr &stats, double lux)\n \t// this makes a new reference which belongs to the asynchronous thread\n \tstatistics_ = stats;\n \t// store the mode as it could technically change\n-\tauto m = config_.modes.find(mode_name_);\n+\tauto m = config_.modes.find(modeName_);\n \tmode_ = m != config_.modes.end()\n \t\t\t? &m->second\n-\t\t\t: (mode_ == nullptr ? config_.default_mode : mode_);\n+\t\t\t: (mode_ == nullptr ? config_.defaultMode : mode_);\n \tlux_ = lux;\n-\tframe_phase_ = 0;\n-\tasync_started_ = true;\n-\tsize_t len = mode_name_.copy(async_results_.mode,\n-\t\t\t\t     sizeof(async_results_.mode) - 1);\n-\tasync_results_.mode[len] = '\\0';\n+\tframePhase_ = 0;\n+\tasyncStarted_ = true;\n+\tsize_t len = modeName_.copy(asyncResults_.mode,\n+\t\t\t\t    sizeof(asyncResults_.mode) - 1);\n+\tasyncResults_.mode[len] = '\\0';\n \t{\n \t\tstd::lock_guard<std::mutex> lock(mutex_);\n-\t\tasync_start_ = true;\n+\t\tasyncStart_ = true;\n \t}\n-\tasync_signal_.notify_one();\n+\tasyncSignal_.notify_one();\n }\n \n-void Awb::Prepare(Metadata *image_metadata)\n+void Awb::prepare(Metadata *imageMetadata)\n {\n-\tif (frame_count_ < (int)config_.startup_frames)\n-\t\tframe_count_++;\n-\tdouble speed = frame_count_ < (int)config_.startup_frames\n+\tif (frameCount_ < (int)config_.startupFrames)\n+\t\tframeCount_++;\n+\tdouble speed = frameCount_ < (int)config_.startupFrames\n \t\t\t       ? 1.0\n \t\t\t       : config_.speed;\n \tLOG(RPiAwb, Debug)\n-\t\t<< \"frame_count \" << frame_count_ << \" speed \" << speed;\n+\t\t<< \"frame_count \" << frameCount_ << \" speed \" << speed;\n \t{\n \t\tstd::unique_lock<std::mutex> lock(mutex_);\n-\t\tif (async_started_ && async_finished_)\n+\t\tif (asyncStarted_ && asyncFinished_)\n \t\t\tfetchAsyncResults();\n \t}\n \t// Finally apply IIR filter to results and put into metadata.\n-\tmemcpy(prev_sync_results_.mode, sync_results_.mode,\n-\t       sizeof(prev_sync_results_.mode));\n-\tprev_sync_results_.temperature_K =\n-\t\tspeed * sync_results_.temperature_K +\n-\t\t(1.0 - speed) * prev_sync_results_.temperature_K;\n-\tprev_sync_results_.gain_r = speed * sync_results_.gain_r +\n-\t\t\t\t    (1.0 - speed) * prev_sync_results_.gain_r;\n-\tprev_sync_results_.gain_g = speed * sync_results_.gain_g +\n-\t\t\t\t    (1.0 - speed) * prev_sync_results_.gain_g;\n-\tprev_sync_results_.gain_b = speed * sync_results_.gain_b +\n-\t\t\t\t    (1.0 - speed) * prev_sync_results_.gain_b;\n-\timage_metadata->Set(\"awb.status\", prev_sync_results_);\n+\tmemcpy(prevSyncResults_.mode, syncResults_.mode,\n+\t       sizeof(prevSyncResults_.mode));\n+\tprevSyncResults_.temperatureK = speed * syncResults_.temperatureK +\n+\t\t\t\t\t(1.0 - speed) * prevSyncResults_.temperatureK;\n+\tprevSyncResults_.gainR = speed * syncResults_.gainR +\n+\t\t\t\t (1.0 - speed) * prevSyncResults_.gainR;\n+\tprevSyncResults_.gainG = speed * syncResults_.gainG +\n+\t\t\t\t (1.0 - speed) * prevSyncResults_.gainG;\n+\tprevSyncResults_.gainB = speed * syncResults_.gainB +\n+\t\t\t\t (1.0 - speed) * prevSyncResults_.gainB;\n+\timageMetadata->set(\"awb.status\", prevSyncResults_);\n \tLOG(RPiAwb, Debug)\n-\t\t<< \"Using AWB gains r \" << prev_sync_results_.gain_r << \" g \"\n-\t\t<< prev_sync_results_.gain_g << \" b \"\n-\t\t<< prev_sync_results_.gain_b;\n+\t\t<< \"Using AWB gains r \" << prevSyncResults_.gainR << \" g \"\n+\t\t<< prevSyncResults_.gainG << \" b \"\n+\t\t<< prevSyncResults_.gainB;\n }\n \n-void Awb::Process(StatisticsPtr &stats, Metadata *image_metadata)\n+void Awb::process(StatisticsPtr &stats, Metadata *imageMetadata)\n {\n \t// Count frames since we last poked the async thread.\n-\tif (frame_phase_ < (int)config_.frame_period)\n-\t\tframe_phase_++;\n-\tLOG(RPiAwb, Debug) << \"frame_phase \" << frame_phase_;\n+\tif (framePhase_ < (int)config_.framePeriod)\n+\t\tframePhase_++;\n+\tLOG(RPiAwb, Debug) << \"frame_phase \" << framePhase_;\n \t// We do not restart the async thread if we're not in auto mode.\n \tif (isAutoEnabled() &&\n-\t    (frame_phase_ >= (int)config_.frame_period ||\n-\t     frame_count_ < (int)config_.startup_frames)) {\n+\t    (framePhase_ >= (int)config_.framePeriod ||\n+\t     frameCount_ < (int)config_.startupFrames)) {\n \t\t// Update any settings and any image metadata that we need.\n-\t\tstruct LuxStatus lux_status = {};\n-\t\tlux_status.lux = 400; // in case no metadata\n-\t\tif (image_metadata->Get(\"lux.status\", lux_status) != 0)\n+\t\tstruct LuxStatus luxStatus = {};\n+\t\tluxStatus.lux = 400; // in case no metadata\n+\t\tif (imageMetadata->get(\"lux.status\", luxStatus) != 0)\n \t\t\tLOG(RPiAwb, Debug) << \"No lux metadata found\";\n-\t\tLOG(RPiAwb, Debug) << \"Awb lux value is \" << lux_status.lux;\n+\t\tLOG(RPiAwb, Debug) << \"Awb lux value is \" << luxStatus.lux;\n \n-\t\tif (async_started_ == false)\n-\t\t\trestartAsync(stats, lux_status.lux);\n+\t\tif (asyncStarted_ == false)\n+\t\t\trestartAsync(stats, luxStatus.lux);\n \t}\n }\n \n@@ -338,32 +329,32 @@ void Awb::asyncFunc()\n \twhile (true) {\n \t\t{\n \t\t\tstd::unique_lock<std::mutex> lock(mutex_);\n-\t\t\tasync_signal_.wait(lock, [&] {\n-\t\t\t\treturn async_start_ || async_abort_;\n+\t\t\tasyncSignal_.wait(lock, [&] {\n+\t\t\t\treturn asyncStart_ || asyncAbort_;\n \t\t\t});\n-\t\t\tasync_start_ = false;\n-\t\t\tif (async_abort_)\n+\t\t\tasyncStart_ = false;\n+\t\t\tif (asyncAbort_)\n \t\t\t\tbreak;\n \t\t}\n \t\tdoAwb();\n \t\t{\n \t\t\tstd::lock_guard<std::mutex> lock(mutex_);\n-\t\t\tasync_finished_ = true;\n+\t\t\tasyncFinished_ = true;\n \t\t}\n-\t\tsync_signal_.notify_one();\n+\t\tsyncSignal_.notify_one();\n \t}\n }\n \n-static void generate_stats(std::vector<Awb::RGB> &zones,\n-\t\t\t   bcm2835_isp_stats_region *stats, double min_pixels,\n-\t\t\t   double min_G)\n+static void generateStats(std::vector<Awb::RGB> &zones,\n+\t\t\t  bcm2835_isp_stats_region *stats, double minPixels,\n+\t\t\t  double minG)\n {\n \tfor (int i = 0; i < AWB_STATS_SIZE_X * AWB_STATS_SIZE_Y; i++) {\n \t\tAwb::RGB zone;\n \t\tdouble counted = stats[i].counted;\n-\t\tif (counted >= min_pixels) {\n+\t\tif (counted >= minPixels) {\n \t\t\tzone.G = stats[i].g_sum / counted;\n-\t\t\tif (zone.G >= min_G) {\n+\t\t\tif (zone.G >= minG) {\n \t\t\t\tzone.R = stats[i].r_sum / counted;\n \t\t\t\tzone.B = stats[i].b_sum / counted;\n \t\t\t\tzones.push_back(zone);\n@@ -377,32 +368,33 @@ void Awb::prepareStats()\n \tzones_.clear();\n \t// LSC has already been applied to the stats in this pipeline, so stop\n \t// any LSC compensation.  We also ignore config_.fast in this version.\n-\tgenerate_stats(zones_, statistics_->awb_stats, config_.min_pixels,\n-\t\t       config_.min_G);\n+\tgenerateStats(zones_, statistics_->awb_stats, config_.minPixels,\n+\t\t      config_.minG);\n \t// we're done with these; we may as well relinquish our hold on the\n \t// pointer.\n \tstatistics_.reset();\n \t// apply sensitivities, so values appear to come from our \"canonical\"\n \t// sensor.\n-\tfor (auto &zone : zones_)\n-\t\tzone.R *= config_.sensitivity_r,\n-\t\t\tzone.B *= config_.sensitivity_b;\n+\tfor (auto &zone : zones_) {\n+\t\tzone.R *= config_.sensitivityR;\n+\t\tzone.B *= config_.sensitivityB;\n+\t}\n }\n \n-double Awb::computeDelta2Sum(double gain_r, double gain_b)\n+double Awb::computeDelta2Sum(double gainR, double gainB)\n {\n \t// Compute the sum of the squared colour error (non-greyness) as it\n \t// appears in the log likelihood equation.\n-\tdouble delta2_sum = 0;\n+\tdouble delta2Sum = 0;\n \tfor (auto &z : zones_) {\n-\t\tdouble delta_r = gain_r * z.R - 1 - config_.whitepoint_r;\n-\t\tdouble delta_b = gain_b * z.B - 1 - config_.whitepoint_b;\n-\t\tdouble delta2 = delta_r * delta_r + delta_b * delta_b;\n+\t\tdouble deltaR = gainR * z.R - 1 - config_.whitepointR;\n+\t\tdouble deltaB = gainB * z.B - 1 - config_.whitepointB;\n+\t\tdouble delta2 = deltaR * deltaR + deltaB * deltaB;\n \t\t//LOG(RPiAwb, Debug) << \"delta_r \" << delta_r << \" delta_b \" << delta_b << \" delta2 \" << delta2;\n-\t\tdelta2 = std::min(delta2, config_.delta_limit);\n-\t\tdelta2_sum += delta2;\n+\t\tdelta2 = std::min(delta2, config_.deltaLimit);\n+\t\tdelta2Sum += delta2;\n \t}\n-\treturn delta2_sum;\n+\treturn delta2Sum;\n }\n \n Pwl Awb::interpolatePrior()\n@@ -420,7 +412,7 @@ Pwl Awb::interpolatePrior()\n \t\t\tidx++;\n \t\tdouble lux0 = config_.priors[idx].lux,\n \t\t       lux1 = config_.priors[idx + 1].lux;\n-\t\treturn Pwl::Combine(config_.priors[idx].prior,\n+\t\treturn Pwl::combine(config_.priors[idx].prior,\n \t\t\t\t    config_.priors[idx + 1].prior,\n \t\t\t\t    [&](double /*x*/, double y0, double y1) {\n \t\t\t\t\t    return y0 + (y1 - y0) *\n@@ -429,62 +421,60 @@ Pwl Awb::interpolatePrior()\n \t}\n }\n \n-static double interpolate_quadatric(Pwl::Point const &A, Pwl::Point const &B,\n-\t\t\t\t    Pwl::Point const &C)\n+static double interpolateQuadatric(Pwl::Point const &a, Pwl::Point const &b,\n+\t\t\t\t   Pwl::Point const &c)\n {\n \t// Given 3 points on a curve, find the extremum of the function in that\n \t// interval by fitting a quadratic.\n \tconst double eps = 1e-3;\n-\tPwl::Point CA = C - A, BA = B - A;\n-\tdouble denominator = 2 * (BA.y * CA.x - CA.y * BA.x);\n+\tPwl::Point ca = c - a, ba = b - a;\n+\tdouble denominator = 2 * (ba.y * ca.x - ca.y * ba.x);\n \tif (abs(denominator) > eps) {\n-\t\tdouble numerator = BA.y * CA.x * CA.x - CA.y * BA.x * BA.x;\n-\t\tdouble result = numerator / denominator + A.x;\n-\t\treturn std::max(A.x, std::min(C.x, result));\n+\t\tdouble numerator = ba.y * ca.x * ca.x - ca.y * ba.x * ba.x;\n+\t\tdouble result = numerator / denominator + a.x;\n+\t\treturn std::max(a.x, std::min(c.x, result));\n \t}\n \t// has degenerated to straight line segment\n-\treturn A.y < C.y - eps ? A.x : (C.y < A.y - eps ? C.x : B.x);\n+\treturn a.y < c.y - eps ? a.x : (c.y < a.y - eps ? c.x : b.x);\n }\n \n double Awb::coarseSearch(Pwl const &prior)\n {\n \tpoints_.clear(); // assume doesn't deallocate memory\n-\tsize_t best_point = 0;\n-\tdouble t = mode_->ct_lo;\n-\tint span_r = 0, span_b = 0;\n+\tsize_t bestPoint = 0;\n+\tdouble t = mode_->ctLo;\n+\tint spanR = 0, spanB = 0;\n \t// Step down the CT curve evaluating log likelihood.\n \twhile (true) {\n-\t\tdouble r = config_.ct_r.Eval(t, &span_r);\n-\t\tdouble b = config_.ct_b.Eval(t, &span_b);\n-\t\tdouble gain_r = 1 / r, gain_b = 1 / b;\n-\t\tdouble delta2_sum = computeDelta2Sum(gain_r, gain_b);\n-\t\tdouble prior_log_likelihood =\n-\t\t\tprior.Eval(prior.Domain().Clip(t));\n-\t\tdouble final_log_likelihood = delta2_sum - prior_log_likelihood;\n+\t\tdouble r = config_.ctR.eval(t, &spanR);\n+\t\tdouble b = config_.ctB.eval(t, &spanB);\n+\t\tdouble gainR = 1 / r, gainB = 1 / b;\n+\t\tdouble delta2Sum = computeDelta2Sum(gainR, gainB);\n+\t\tdouble priorLogLikelihood = prior.eval(prior.domain().clip(t));\n+\t\tdouble finalLogLikelihood = delta2Sum - priorLogLikelihood;\n \t\tLOG(RPiAwb, Debug)\n-\t\t\t<< \"t: \" << t << \" gain_r \" << gain_r << \" gain_b \"\n-\t\t\t<< gain_b << \" delta2_sum \" << delta2_sum\n-\t\t\t<< \" prior \" << prior_log_likelihood << \" final \"\n-\t\t\t<< final_log_likelihood;\n-\t\tpoints_.push_back(Pwl::Point(t, final_log_likelihood));\n-\t\tif (points_.back().y < points_[best_point].y)\n-\t\t\tbest_point = points_.size() - 1;\n-\t\tif (t == mode_->ct_hi)\n+\t\t\t<< \"t: \" << t << \" gain R \" << gainR << \" gain B \"\n+\t\t\t<< gainB << \" delta2_sum \" << delta2Sum\n+\t\t\t<< \" prior \" << priorLogLikelihood << \" final \"\n+\t\t\t<< finalLogLikelihood;\n+\t\tpoints_.push_back(Pwl::Point(t, finalLogLikelihood));\n+\t\tif (points_.back().y < points_[bestPoint].y)\n+\t\t\tbestPoint = points_.size() - 1;\n+\t\tif (t == mode_->ctHi)\n \t\t\tbreak;\n \t\t// for even steps along the r/b curve scale them by the current t\n-\t\tt = std::min(t + t / 10 * config_.coarse_step,\n-\t\t\t     mode_->ct_hi);\n+\t\tt = std::min(t + t / 10 * config_.coarseStep, mode_->ctHi);\n \t}\n-\tt = points_[best_point].x;\n+\tt = points_[bestPoint].x;\n \tLOG(RPiAwb, Debug) << \"Coarse search found CT \" << t;\n \t// We have the best point of the search, but refine it with a quadratic\n \t// interpolation around its neighbours.\n \tif (points_.size() > 2) {\n-\t\tunsigned long bp = std::min(best_point, points_.size() - 2);\n-\t\tbest_point = std::max(1UL, bp);\n-\t\tt = interpolate_quadatric(points_[best_point - 1],\n-\t\t\t\t\t  points_[best_point],\n-\t\t\t\t\t  points_[best_point + 1]);\n+\t\tunsigned long bp = std::min(bestPoint, points_.size() - 2);\n+\t\tbestPoint = std::max(1UL, bp);\n+\t\tt = interpolateQuadatric(points_[bestPoint - 1],\n+\t\t\t\t\t points_[bestPoint],\n+\t\t\t\t\t points_[bestPoint + 1]);\n \t\tLOG(RPiAwb, Debug)\n \t\t\t<< \"After quadratic refinement, coarse search has CT \"\n \t\t\t<< t;\n@@ -494,80 +484,76 @@ double Awb::coarseSearch(Pwl const &prior)\n \n void Awb::fineSearch(double &t, double &r, double &b, Pwl const &prior)\n {\n-\tint span_r = -1, span_b = -1;\n-\tconfig_.ct_r.Eval(t, &span_r);\n-\tconfig_.ct_b.Eval(t, &span_b);\n-\tdouble step = t / 10 * config_.coarse_step * 0.1;\n+\tint spanR = -1, spanB = -1;\n+\tconfig_.ctR.eval(t, &spanR);\n+\tconfig_.ctB.eval(t, &spanB);\n+\tdouble step = t / 10 * config_.coarseStep * 0.1;\n \tint nsteps = 5;\n-\tdouble r_diff = config_.ct_r.Eval(t + nsteps * step, &span_r) -\n-\t\t\tconfig_.ct_r.Eval(t - nsteps * step, &span_r);\n-\tdouble b_diff = config_.ct_b.Eval(t + nsteps * step, &span_b) -\n-\t\t\tconfig_.ct_b.Eval(t - nsteps * step, &span_b);\n-\tPwl::Point transverse(b_diff, -r_diff);\n-\tif (transverse.Len2() < 1e-6)\n+\tdouble rDiff = config_.ctR.eval(t + nsteps * step, &spanR) -\n+\t\t       config_.ctR.eval(t - nsteps * step, &spanR);\n+\tdouble bDiff = config_.ctB.eval(t + nsteps * step, &spanB) -\n+\t\t       config_.ctB.eval(t - nsteps * step, &spanB);\n+\tPwl::Point transverse(bDiff, -rDiff);\n+\tif (transverse.len2() < 1e-6)\n \t\treturn;\n \t// unit vector orthogonal to the b vs. r function (pointing outwards\n \t// with r and b increasing)\n-\ttransverse = transverse / transverse.Len();\n-\tdouble best_log_likelihood = 0, best_t = 0, best_r = 0, best_b = 0;\n-\tdouble transverse_range =\n-\t\tconfig_.transverse_neg + config_.transverse_pos;\n-\tconst int MAX_NUM_DELTAS = 12;\n+\ttransverse = transverse / transverse.len();\n+\tdouble bestLogLikelihood = 0, bestT = 0, bestR = 0, bestB = 0;\n+\tdouble transverseRange = config_.transverseNeg + config_.transversePos;\n+\tconst int maxNumDeltas = 12;\n \t// a transverse step approximately every 0.01 r/b units\n-\tint num_deltas = floor(transverse_range * 100 + 0.5) + 1;\n-\tnum_deltas = num_deltas < 3 ? 3 :\n-\t\t     (num_deltas > MAX_NUM_DELTAS ? MAX_NUM_DELTAS : num_deltas);\n+\tint numDeltas = floor(transverseRange * 100 + 0.5) + 1;\n+\tnumDeltas = numDeltas < 3 ? 3 : (numDeltas > maxNumDeltas ? maxNumDeltas : numDeltas);\n \t// Step down CT curve. March a bit further if the transverse range is\n \t// large.\n-\tnsteps += num_deltas;\n+\tnsteps += numDeltas;\n \tfor (int i = -nsteps; i <= nsteps; i++) {\n-\t\tdouble t_test = t + i * step;\n-\t\tdouble prior_log_likelihood =\n-\t\t\tprior.Eval(prior.Domain().Clip(t_test));\n-\t\tdouble r_curve = config_.ct_r.Eval(t_test, &span_r);\n-\t\tdouble b_curve = config_.ct_b.Eval(t_test, &span_b);\n+\t\tdouble tTest = t + i * step;\n+\t\tdouble priorLogLikelihood =\n+\t\t\tprior.eval(prior.domain().clip(tTest));\n+\t\tdouble rCurve = config_.ctR.eval(tTest, &spanR);\n+\t\tdouble bCurve = config_.ctB.eval(tTest, &spanB);\n \t\t// x will be distance off the curve, y the log likelihood there\n-\t\tPwl::Point points[MAX_NUM_DELTAS];\n-\t\tint best_point = 0;\n+\t\tPwl::Point points[maxNumDeltas];\n+\t\tint bestPoint = 0;\n \t\t// Take some measurements transversely *off* the CT curve.\n-\t\tfor (int j = 0; j < num_deltas; j++) {\n-\t\t\tpoints[j].x = -config_.transverse_neg +\n-\t\t\t\t      (transverse_range * j) / (num_deltas - 1);\n-\t\t\tPwl::Point rb_test = Pwl::Point(r_curve, b_curve) +\n-\t\t\t\t\t     transverse * points[j].x;\n-\t\t\tdouble r_test = rb_test.x, b_test = rb_test.y;\n-\t\t\tdouble gain_r = 1 / r_test, gain_b = 1 / b_test;\n-\t\t\tdouble delta2_sum = computeDelta2Sum(gain_r, gain_b);\n-\t\t\tpoints[j].y = delta2_sum - prior_log_likelihood;\n+\t\tfor (int j = 0; j < numDeltas; j++) {\n+\t\t\tpoints[j].x = -config_.transverseNeg +\n+\t\t\t\t      (transverseRange * j) / (numDeltas - 1);\n+\t\t\tPwl::Point rbTest = Pwl::Point(rCurve, bCurve) +\n+\t\t\t\t\t    transverse * points[j].x;\n+\t\t\tdouble rTest = rbTest.x, bTest = rbTest.y;\n+\t\t\tdouble gainR = 1 / rTest, gainB = 1 / bTest;\n+\t\t\tdouble delta2Sum = computeDelta2Sum(gainR, gainB);\n+\t\t\tpoints[j].y = delta2Sum - priorLogLikelihood;\n \t\t\tLOG(RPiAwb, Debug)\n-\t\t\t\t<< \"At t \" << t_test << \" r \" << r_test << \" b \"\n-\t\t\t\t<< b_test << \": \" << points[j].y;\n-\t\t\tif (points[j].y < points[best_point].y)\n-\t\t\t\tbest_point = j;\n+\t\t\t\t<< \"At t \" << tTest << \" r \" << rTest << \" b \"\n+\t\t\t\t<< bTest << \": \" << points[j].y;\n+\t\t\tif (points[j].y < points[bestPoint].y)\n+\t\t\t\tbestPoint = j;\n \t\t}\n \t\t// We have NUM_DELTAS points transversely across the CT curve,\n \t\t// now let's do a quadratic interpolation for the best result.\n-\t\tbest_point = std::max(1, std::min(best_point, num_deltas - 2));\n-\t\tPwl::Point rb_test =\n-\t\t\tPwl::Point(r_curve, b_curve) +\n-\t\t\ttransverse *\n-\t\t\t\tinterpolate_quadatric(points[best_point - 1],\n-\t\t\t\t\t\t      points[best_point],\n-\t\t\t\t\t\t      points[best_point + 1]);\n-\t\tdouble r_test = rb_test.x, b_test = rb_test.y;\n-\t\tdouble gain_r = 1 / r_test, gain_b = 1 / b_test;\n-\t\tdouble delta2_sum = computeDelta2Sum(gain_r, gain_b);\n-\t\tdouble final_log_likelihood = delta2_sum - prior_log_likelihood;\n+\t\tbestPoint = std::max(1, std::min(bestPoint, numDeltas - 2));\n+\t\tPwl::Point rbTest = Pwl::Point(rCurve, bCurve) +\n+\t\t\t\t\ttransverse * interpolateQuadatric(points[bestPoint - 1],\n+\t\t\t\t\t\t\t\t\tpoints[bestPoint],\n+\t\t\t\t\t\t\t\t\tpoints[bestPoint + 1]);\n+\t\tdouble rTest = rbTest.x, bTest = rbTest.y;\n+\t\tdouble gainR = 1 / rTest, gainB = 1 / bTest;\n+\t\tdouble delta2Sum = computeDelta2Sum(gainR, gainB);\n+\t\tdouble finalLogLikelihood = delta2Sum - priorLogLikelihood;\n \t\tLOG(RPiAwb, Debug)\n \t\t\t<< \"Finally \"\n-\t\t\t<< t_test << \" r \" << r_test << \" b \" << b_test << \": \"\n-\t\t\t<< final_log_likelihood\n-\t\t\t<< (final_log_likelihood < best_log_likelihood ? \" BEST\" : \"\");\n-\t\tif (best_t == 0 || final_log_likelihood < best_log_likelihood)\n-\t\t\tbest_log_likelihood = final_log_likelihood,\n-\t\t\tbest_t = t_test, best_r = r_test, best_b = b_test;\n+\t\t\t<< tTest << \" r \" << rTest << \" b \" << bTest << \": \"\n+\t\t\t<< finalLogLikelihood\n+\t\t\t<< (finalLogLikelihood < bestLogLikelihood ? \" BEST\" : \"\");\n+\t\tif (bestT == 0 || finalLogLikelihood < bestLogLikelihood)\n+\t\t\tbestLogLikelihood = finalLogLikelihood,\n+\t\t\tbestT = tTest, bestR = rTest, bestB = bTest;\n \t}\n-\tt = best_t, r = best_r, b = best_b;\n+\tt = bestT, r = bestR, b = bestB;\n \tLOG(RPiAwb, Debug)\n \t\t<< \"Fine search found t \" << t << \" r \" << r << \" b \" << b;\n }\n@@ -582,12 +568,12 @@ void Awb::awbBayes()\n \t// valid... not entirely sure about this.\n \tPwl prior = interpolatePrior();\n \tprior *= zones_.size() / (double)(AWB_STATS_SIZE_X * AWB_STATS_SIZE_Y);\n-\tprior.Map([](double x, double y) {\n+\tprior.map([](double x, double y) {\n \t\tLOG(RPiAwb, Debug) << \"(\" << x << \",\" << y << \")\";\n \t});\n \tdouble t = coarseSearch(prior);\n-\tdouble r = config_.ct_r.Eval(t);\n-\tdouble b = config_.ct_b.Eval(t);\n+\tdouble r = config_.ctR.eval(t);\n+\tdouble b = config_.ctB.eval(t);\n \tLOG(RPiAwb, Debug)\n \t\t<< \"After coarse search: r \" << r << \" b \" << b << \" (gains r \"\n \t\t<< 1 / r << \" b \" << 1 / b << \")\";\n@@ -604,10 +590,10 @@ void Awb::awbBayes()\n \t// Write results out for the main thread to pick up. Remember to adjust\n \t// the gains from the ones that the \"canonical sensor\" would require to\n \t// the ones needed by *this* sensor.\n-\tasync_results_.temperature_K = t;\n-\tasync_results_.gain_r = 1.0 / r * config_.sensitivity_r;\n-\tasync_results_.gain_g = 1.0;\n-\tasync_results_.gain_b = 1.0 / b * config_.sensitivity_b;\n+\tasyncResults_.temperatureK = t;\n+\tasyncResults_.gainR = 1.0 / r * config_.sensitivityR;\n+\tasyncResults_.gainG = 1.0;\n+\tasyncResults_.gainB = 1.0 / b * config_.sensitivityB;\n }\n \n void Awb::awbGrey()\n@@ -617,51 +603,51 @@ void Awb::awbGrey()\n \t// that we can sort them to exclude the extreme gains.  We could\n \t// consider some variations, such as normalising all the zones first, or\n \t// doing an L2 average etc.\n-\tstd::vector<RGB> &derivs_R(zones_);\n-\tstd::vector<RGB> derivs_B(derivs_R);\n-\tstd::sort(derivs_R.begin(), derivs_R.end(),\n+\tstd::vector<RGB> &derivsR(zones_);\n+\tstd::vector<RGB> derivsB(derivsR);\n+\tstd::sort(derivsR.begin(), derivsR.end(),\n \t\t  [](RGB const &a, RGB const &b) {\n \t\t\t  return a.G * b.R < b.G * a.R;\n \t\t  });\n-\tstd::sort(derivs_B.begin(), derivs_B.end(),\n+\tstd::sort(derivsB.begin(), derivsB.end(),\n \t\t  [](RGB const &a, RGB const &b) {\n \t\t\t  return a.G * b.B < b.G * a.B;\n \t\t  });\n \t// Average the middle half of the values.\n-\tint discard = derivs_R.size() / 4;\n-\tRGB sum_R(0, 0, 0), sum_B(0, 0, 0);\n-\tfor (auto ri = derivs_R.begin() + discard,\n-\t\t  bi = derivs_B.begin() + discard;\n-\t     ri != derivs_R.end() - discard; ri++, bi++)\n-\t\tsum_R += *ri, sum_B += *bi;\n-\tdouble gain_r = sum_R.G / (sum_R.R + 1),\n-\t       gain_b = sum_B.G / (sum_B.B + 1);\n-\tasync_results_.temperature_K = 4500; // don't know what it is\n-\tasync_results_.gain_r = gain_r;\n-\tasync_results_.gain_g = 1.0;\n-\tasync_results_.gain_b = gain_b;\n+\tint discard = derivsR.size() / 4;\n+\tRGB sumR(0, 0, 0), sumB(0, 0, 0);\n+\tfor (auto ri = derivsR.begin() + discard,\n+\t\t  bi = derivsB.begin() + discard;\n+\t     ri != derivsR.end() - discard; ri++, bi++)\n+\t\tsumR += *ri, sumB += *bi;\n+\tdouble gainR = sumR.G / (sumR.R + 1),\n+\t       gainB = sumB.G / (sumB.B + 1);\n+\tasyncResults_.temperatureK = 4500; // don't know what it is\n+\tasyncResults_.gainR = gainR;\n+\tasyncResults_.gainG = 1.0;\n+\tasyncResults_.gainB = gainB;\n }\n \n void Awb::doAwb()\n {\n \tprepareStats();\n \tLOG(RPiAwb, Debug) << \"Valid zones: \" << zones_.size();\n-\tif (zones_.size() > config_.min_regions) {\n+\tif (zones_.size() > config_.minRegions) {\n \t\tif (config_.bayes)\n \t\t\tawbBayes();\n \t\telse\n \t\t\tawbGrey();\n \t\tLOG(RPiAwb, Debug)\n \t\t\t<< \"CT found is \"\n-\t\t\t<< async_results_.temperature_K\n-\t\t\t<< \" with gains r \" << async_results_.gain_r\n-\t\t\t<< \" and b \" << async_results_.gain_b;\n+\t\t\t<< asyncResults_.temperatureK\n+\t\t\t<< \" with gains r \" << asyncResults_.gainR\n+\t\t\t<< \" and b \" << asyncResults_.gainB;\n \t}\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 Awb(controller);\n }\n-static RegisterAlgorithm reg(NAME, &Create);\n+static RegisterAlgorithm reg(NAME, &create);\ndiff --git a/src/ipa/raspberrypi/controller/rpi/awb.hpp b/src/ipa/raspberrypi/controller/rpi/awb.hpp\nindex ac3dca6f42fc..91251d6be2da 100644\n--- a/src/ipa/raspberrypi/controller/rpi/awb.hpp\n+++ b/src/ipa/raspberrypi/controller/rpi/awb.hpp\n@@ -19,59 +19,59 @@ namespace RPiController {\n // Control algorithm to perform AWB calculations.\n \n struct AwbMode {\n-\tvoid Read(boost::property_tree::ptree const &params);\n-\tdouble ct_lo; // low CT value for search\n-\tdouble ct_hi; // high CT value for search\n+\tvoid read(boost::property_tree::ptree const &params);\n+\tdouble ctLo; // low CT value for search\n+\tdouble ctHi; // high CT value for search\n };\n \n struct AwbPrior {\n-\tvoid Read(boost::property_tree::ptree const &params);\n+\tvoid read(boost::property_tree::ptree const &params);\n \tdouble lux; // lux level\n \tPwl prior; // maps CT to prior log likelihood for this lux level\n };\n \n struct AwbConfig {\n-\tAwbConfig() : default_mode(nullptr) {}\n-\tvoid Read(boost::property_tree::ptree const &params);\n+\tAwbConfig() : defaultMode(nullptr) {}\n+\tvoid read(boost::property_tree::ptree const &params);\n \t// Only repeat the AWB calculation every \"this many\" frames\n-\tuint16_t frame_period;\n+\tuint16_t framePeriod;\n \t// number of initial frames for which speed taken as 1.0 (maximum)\n-\tuint16_t startup_frames;\n-\tunsigned int convergence_frames; // approx number of frames to converge\n+\tuint16_t startupFrames;\n+\tunsigned int convergenceFrames; // approx number of frames to converge\n \tdouble speed; // IIR filter speed applied to algorithm results\n \tbool fast; // \"fast\" mode uses a 16x16 rather than 32x32 grid\n-\tPwl ct_r; // function maps CT to r (= R/G)\n-\tPwl ct_b; // function maps CT to b (= B/G)\n+\tPwl ctR; // function maps CT to r (= R/G)\n+\tPwl ctB; // function maps CT to b (= B/G)\n \t// table of illuminant priors at different lux levels\n \tstd::vector<AwbPrior> priors;\n \t// AWB \"modes\" (determines the search range)\n \tstd::map<std::string, AwbMode> modes;\n-\tAwbMode *default_mode; // mode used if no mode selected\n+\tAwbMode *defaultMode; // mode used if no mode selected\n \t// minimum proportion of pixels counted within AWB region for it to be\n \t// \"useful\"\n-\tdouble min_pixels;\n+\tdouble minPixels;\n \t// minimum G value of those pixels, to be regarded a \"useful\"\n-\tuint16_t min_G;\n+\tuint16_t minG;\n \t// number of AWB regions that must be \"useful\" in order to do the AWB\n \t// calculation\n-\tuint32_t min_regions;\n+\tuint32_t minRegions;\n \t// clamp on colour error term (so as not to penalise non-grey excessively)\n-\tdouble delta_limit;\n+\tdouble deltaLimit;\n \t// step size control in coarse search\n-\tdouble coarse_step;\n+\tdouble coarseStep;\n \t// how far to wander off CT curve towards \"more purple\"\n-\tdouble transverse_pos;\n+\tdouble transversePos;\n \t// how far to wander off CT curve towards \"more green\"\n-\tdouble transverse_neg;\n+\tdouble transverseNeg;\n \t// red sensitivity ratio (set to canonical sensor's R/G divided by this\n \t// sensor's R/G)\n-\tdouble sensitivity_r;\n+\tdouble sensitivityR;\n \t// blue sensitivity ratio (set to canonical sensor's B/G divided by this\n \t// sensor's B/G)\n-\tdouble sensitivity_b;\n+\tdouble sensitivityB;\n \t// The whitepoint (which we normally \"aim\" for) can be moved.\n-\tdouble whitepoint_r;\n-\tdouble whitepoint_b;\n+\tdouble whitepointR;\n+\tdouble whitepointB;\n \tbool bayes; // use Bayesian algorithm\n };\n \n@@ -80,22 +80,22 @@ class Awb : public AwbAlgorithm\n public:\n \tAwb(Controller *controller = NULL);\n \t~Awb();\n-\tchar const *Name() const override;\n-\tvoid Initialise() override;\n-\tvoid Read(boost::property_tree::ptree const &params) override;\n+\tchar const *name() const override;\n+\tvoid initialise() override;\n+\tvoid read(boost::property_tree::ptree const &params) override;\n \t// AWB handles \"pausing\" for itself.\n-\tbool IsPaused() const override;\n-\tvoid Pause() override;\n-\tvoid Resume() override;\n-\tunsigned int GetConvergenceFrames() const override;\n-\tvoid SetMode(std::string const &name) override;\n-\tvoid SetManualGains(double manual_r, double manual_b) override;\n-\tvoid SwitchMode(CameraMode const &camera_mode, Metadata *metadata) override;\n-\tvoid Prepare(Metadata *image_metadata) override;\n-\tvoid Process(StatisticsPtr &stats, Metadata *image_metadata) override;\n+\tbool isPaused() const override;\n+\tvoid pause() override;\n+\tvoid resume() override;\n+\tunsigned int getConvergenceFrames() const override;\n+\tvoid setMode(std::string const &name) override;\n+\tvoid setManualGains(double manualR, double manualB) override;\n+\tvoid switchMode(CameraMode const &cameraMode, Metadata *metadata) override;\n+\tvoid prepare(Metadata *imageMetadata) override;\n+\tvoid process(StatisticsPtr &stats, Metadata *imageMetadata) override;\n \tstruct RGB {\n-\t\tRGB(double _R = 0, double _G = 0, double _B = 0)\n-\t\t\t: R(_R), G(_G), B(_B)\n+\t\tRGB(double r = 0, double g = 0, double b = 0)\n+\t\t\t: R(r), G(g), B(b)\n \t\t{\n \t\t}\n \t\tdouble R, G, B;\n@@ -110,29 +110,29 @@ private:\n \tbool isAutoEnabled() const;\n \t// configuration is read-only, and available to both threads\n \tAwbConfig config_;\n-\tstd::thread async_thread_;\n+\tstd::thread asyncThread_;\n \tvoid asyncFunc(); // asynchronous thread function\n \tstd::mutex mutex_;\n \t// condvar for async thread to wait on\n-\tstd::condition_variable async_signal_;\n+\tstd::condition_variable asyncSignal_;\n \t// condvar for synchronous thread to wait on\n-\tstd::condition_variable sync_signal_;\n+\tstd::condition_variable syncSignal_;\n \t// for sync thread to check  if async thread finished (requires mutex)\n-\tbool async_finished_;\n+\tbool asyncFinished_;\n \t// for async thread to check if it's been told to run (requires mutex)\n-\tbool async_start_;\n+\tbool asyncStart_;\n \t// for async thread to check if it's been told to quit (requires mutex)\n-\tbool async_abort_;\n+\tbool asyncAbort_;\n \n \t// The following are only for the synchronous thread to use:\n \t// for sync thread to note its has asked async thread to run\n-\tbool async_started_;\n-\t// counts up to frame_period before restarting the async thread\n-\tint frame_phase_;\n-\tint frame_count_; // counts up to startup_frames\n-\tAwbStatus sync_results_;\n-\tAwbStatus prev_sync_results_;\n-\tstd::string mode_name_;\n+\tbool asyncStarted_;\n+\t// counts up to framePeriod before restarting the async thread\n+\tint framePhase_;\n+\tint frameCount_; // counts up to startup_frames\n+\tAwbStatus syncResults_;\n+\tAwbStatus prevSyncResults_;\n+\tstd::string modeName_;\n \t// The following are for the asynchronous thread to use, though the main\n \t// thread can set/reset them if the async thread is known to be idle:\n \tvoid restartAsync(StatisticsPtr &stats, double lux);\n@@ -141,22 +141,22 @@ private:\n \tStatisticsPtr statistics_;\n \tAwbMode *mode_;\n \tdouble lux_;\n-\tAwbStatus async_results_;\n+\tAwbStatus asyncResults_;\n \tvoid doAwb();\n \tvoid awbBayes();\n \tvoid awbGrey();\n \tvoid prepareStats();\n-\tdouble computeDelta2Sum(double gain_r, double gain_b);\n+\tdouble computeDelta2Sum(double gain_r, double gainB);\n \tPwl interpolatePrior();\n \tdouble coarseSearch(Pwl const &prior);\n \tvoid fineSearch(double &t, double &r, double &b, Pwl const &prior);\n \tstd::vector<RGB> zones_;\n \tstd::vector<Pwl::Point> points_;\n \t// manual r setting\n-\tdouble manual_r_;\n+\tdouble manualR_;\n \t// manual b setting\n-\tdouble manual_b_;\n-\tbool first_switch_mode_; // is this the first call to SwitchMode?\n+\tdouble manualB_;\n+\tbool firstSwitchMode_; // is this the first call to SwitchMode?\n };\n \n static inline Awb::RGB operator+(Awb::RGB const &a, Awb::RGB const &b)\ndiff --git a/src/ipa/raspberrypi/controller/rpi/black_level.cpp b/src/ipa/raspberrypi/controller/rpi/black_level.cpp\nindex 6b3497f13c19..340da0f0a5f7 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// 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);\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_;\ndiff --git a/src/ipa/raspberrypi/controller/rpi/focus.cpp b/src/ipa/raspberrypi/controller/rpi/focus.cpp\nindex a87ec802b964..90f36e58f28c 100644\n--- a/src/ipa/raspberrypi/controller/rpi/focus.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/focus.cpp\n@@ -23,28 +23,28 @@ Focus::Focus(Controller *controller)\n {\n }\n \n-char const *Focus::Name() const\n+char const *Focus::name() const\n {\n \treturn NAME;\n }\n \n-void Focus::Process(StatisticsPtr &stats, Metadata *image_metadata)\n+void Focus::process(StatisticsPtr &stats, Metadata *imageMetadata)\n {\n \tFocusStatus status;\n \tunsigned int i;\n \tfor (i = 0; i < FOCUS_REGIONS; i++)\n-\t\tstatus.focus_measures[i] = stats->focus_stats[i].contrast_val[1][1] / 1000;\n+\t\tstatus.focusMeasures[i] = stats->focus_stats[i].contrast_val[1][1] / 1000;\n \tstatus.num = i;\n-\timage_metadata->Set(\"focus.status\", status);\n+\timageMetadata->set(\"focus.status\", status);\n \n \tLOG(RPiFocus, Debug)\n \t\t<< \"Focus contrast measure: \"\n-\t\t<< (status.focus_measures[5] + status.focus_measures[6]) / 10;\n+\t\t<< (status.focusMeasures[5] + status.focusMeasures[6]) / 10;\n }\n \n /* Register algorithm with the system. */\n-static Algorithm *Create(Controller *controller)\n+static Algorithm *create(Controller *controller)\n {\n \treturn new Focus(controller);\n }\n-static RegisterAlgorithm reg(NAME, &Create);\n+static RegisterAlgorithm reg(NAME, &create);\ndiff --git a/src/ipa/raspberrypi/controller/rpi/focus.hpp b/src/ipa/raspberrypi/controller/rpi/focus.hpp\nindex 131b1d0f2fbf..a9207eb3cc23 100644\n--- a/src/ipa/raspberrypi/controller/rpi/focus.hpp\n+++ b/src/ipa/raspberrypi/controller/rpi/focus.hpp\n@@ -21,8 +21,8 @@ class Focus : public Algorithm\n {\n public:\n \tFocus(Controller *controller);\n-\tchar const *Name() const override;\n-\tvoid Process(StatisticsPtr &stats, Metadata *image_metadata) override;\n+\tchar const *name() const override;\n+\tvoid process(StatisticsPtr &stats, Metadata *imageMetadata) override;\n };\n \n } /* namespace RPiController */\ndiff --git a/src/ipa/raspberrypi/controller/rpi/geq.cpp b/src/ipa/raspberrypi/controller/rpi/geq.cpp\nindex 4530cb75792c..0da5efdf3d3d 100644\n--- a/src/ipa/raspberrypi/controller/rpi/geq.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/geq.cpp\n@@ -28,54 +28,52 @@ Geq::Geq(Controller *controller)\n {\n }\n \n-char const *Geq::Name() const\n+char const *Geq::name() const\n {\n \treturn NAME;\n }\n \n-void Geq::Read(boost::property_tree::ptree const &params)\n+void Geq::read(boost::property_tree::ptree const &params)\n {\n \tconfig_.offset = params.get<uint16_t>(\"offset\", 0);\n \tconfig_.slope = params.get<double>(\"slope\", 0.0);\n \tif (config_.slope < 0.0 || config_.slope >= 1.0)\n \t\tthrow std::runtime_error(\"Geq: bad slope value\");\n \tif (params.get_child_optional(\"strength\"))\n-\t\tconfig_.strength.Read(params.get_child(\"strength\"));\n+\t\tconfig_.strength.read(params.get_child(\"strength\"));\n }\n \n-void Geq::Prepare(Metadata *image_metadata)\n+void Geq::prepare(Metadata *imageMetadata)\n {\n-\tLuxStatus lux_status = {};\n-\tlux_status.lux = 400;\n-\tif (image_metadata->Get(\"lux.status\", lux_status))\n+\tLuxStatus luxStatus = {};\n+\tluxStatus.lux = 400;\n+\tif (imageMetadata->get(\"lux.status\", luxStatus))\n \t\tLOG(RPiGeq, Warning) << \"no lux data found\";\n-\tDeviceStatus device_status;\n-\tdevice_status.analogue_gain = 1.0; // in case not found\n-\tif (image_metadata->Get(\"device.status\", device_status))\n+\tDeviceStatus deviceStatus;\n+\tdeviceStatus.analogueGain = 1.0; // in case not found\n+\tif (imageMetadata->get(\"device.status\", deviceStatus))\n \t\tLOG(RPiGeq, Warning)\n \t\t\t<< \"no device metadata - use analogue gain of 1x\";\n-\tGeqStatus geq_status = {};\n-\tdouble strength =\n-\t\tconfig_.strength.Empty()\n+\tGeqStatus geqStatus = {};\n+\tdouble strength = config_.strength.empty()\n \t\t\t? 1.0\n-\t\t\t: config_.strength.Eval(config_.strength.Domain().Clip(\n-\t\t\t\t  lux_status.lux));\n-\tstrength *= device_status.analogue_gain;\n+\t\t\t: config_.strength.eval(config_.strength.domain().clip(luxStatus.lux));\n+\tstrength *= deviceStatus.analogueGain;\n \tdouble offset = config_.offset * strength;\n \tdouble slope = config_.slope * strength;\n-\tgeq_status.offset = std::min(65535.0, std::max(0.0, offset));\n-\tgeq_status.slope = std::min(.99999, std::max(0.0, slope));\n+\tgeqStatus.offset = std::min(65535.0, std::max(0.0, offset));\n+\tgeqStatus.slope = std::min(.99999, std::max(0.0, slope));\n \tLOG(RPiGeq, Debug)\n-\t\t<< \"offset \" << geq_status.offset << \" slope \"\n-\t\t<< geq_status.slope << \" (analogue gain \"\n-\t\t<< device_status.analogue_gain << \" lux \"\n-\t\t<< lux_status.lux << \")\";\n-\timage_metadata->Set(\"geq.status\", geq_status);\n+\t\t<< \"offset \" << geqStatus.offset << \" slope \"\n+\t\t<< geqStatus.slope << \" (analogue gain \"\n+\t\t<< deviceStatus.analogueGain << \" lux \"\n+\t\t<< luxStatus.lux << \")\";\n+\timageMetadata->set(\"geq.status\", geqStatus);\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 Geq(controller);\n }\n-static RegisterAlgorithm reg(NAME, &Create);\n+static RegisterAlgorithm reg(NAME, &create);\ndiff --git a/src/ipa/raspberrypi/controller/rpi/geq.hpp b/src/ipa/raspberrypi/controller/rpi/geq.hpp\nindex 8ba3046b2a2b..bdbc55b2e2d9 100644\n--- a/src/ipa/raspberrypi/controller/rpi/geq.hpp\n+++ b/src/ipa/raspberrypi/controller/rpi/geq.hpp\n@@ -23,9 +23,9 @@ class Geq : public Algorithm\n {\n public:\n \tGeq(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 \tGeqConfig config_;\ndiff --git a/src/ipa/raspberrypi/controller/rpi/lux.cpp b/src/ipa/raspberrypi/controller/rpi/lux.cpp\nindex 4d145b6ff0e9..739a3d533874 100644\n--- a/src/ipa/raspberrypi/controller/rpi/lux.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/lux.cpp\n@@ -31,74 +31,74 @@ Lux::Lux(Controller *controller)\n \tstatus_.lux = 400;\n }\n \n-char const *Lux::Name() const\n+char const *Lux::name() const\n {\n \treturn NAME;\n }\n \n-void Lux::Read(boost::property_tree::ptree const &params)\n+void Lux::read(boost::property_tree::ptree const &params)\n {\n-\treference_shutter_speed_ =\n+\treferenceShutterSpeed_ =\n \t\tparams.get<double>(\"reference_shutter_speed\") * 1.0us;\n-\treference_gain_ = params.get<double>(\"reference_gain\");\n-\treference_aperture_ = params.get<double>(\"reference_aperture\", 1.0);\n-\treference_Y_ = params.get<double>(\"reference_Y\");\n-\treference_lux_ = params.get<double>(\"reference_lux\");\n-\tcurrent_aperture_ = reference_aperture_;\n+\treferenceGain_ = params.get<double>(\"reference_gain\");\n+\treferenceAperture_ = params.get<double>(\"reference_aperture\", 1.0);\n+\treferenceY_ = params.get<double>(\"reference_Y\");\n+\treferenceLux_ = params.get<double>(\"reference_lux\");\n+\tcurrentAperture_ = referenceAperture_;\n }\n \n-void Lux::SetCurrentAperture(double aperture)\n+void Lux::setCurrentAperture(double aperture)\n {\n-\tcurrent_aperture_ = aperture;\n+\tcurrentAperture_ = aperture;\n }\n \n-void Lux::Prepare(Metadata *image_metadata)\n+void Lux::prepare(Metadata *imageMetadata)\n {\n \tstd::unique_lock<std::mutex> lock(mutex_);\n-\timage_metadata->Set(\"lux.status\", status_);\n+\timageMetadata->set(\"lux.status\", status_);\n }\n \n-void Lux::Process(StatisticsPtr &stats, Metadata *image_metadata)\n+void Lux::process(StatisticsPtr &stats, Metadata *imageMetadata)\n {\n-\tDeviceStatus device_status;\n-\tif (image_metadata->Get(\"device.status\", device_status) == 0) {\n-\t\tdouble current_gain = device_status.analogue_gain;\n-\t\tdouble current_aperture = device_status.aperture.value_or(current_aperture_);\n+\tDeviceStatus deviceStatus;\n+\tif (imageMetadata->get(\"device.status\", deviceStatus) == 0) {\n+\t\tdouble currentGain = deviceStatus.analogueGain;\n+\t\tdouble currentAperture = deviceStatus.aperture.value_or(currentAperture_);\n \t\tuint64_t sum = 0;\n \t\tuint32_t num = 0;\n \t\tuint32_t *bin = stats->hist[0].g_hist;\n-\t\tconst int num_bins = sizeof(stats->hist[0].g_hist) /\n-\t\t\t\t     sizeof(stats->hist[0].g_hist[0]);\n-\t\tfor (int i = 0; i < num_bins; i++)\n+\t\tconst int numBins = sizeof(stats->hist[0].g_hist) /\n+\t\t\t\t    sizeof(stats->hist[0].g_hist[0]);\n+\t\tfor (int i = 0; i < numBins; i++)\n \t\t\tsum += bin[i] * (uint64_t)i, num += bin[i];\n \t\t// add .5 to reflect the mid-points of bins\n-\t\tdouble current_Y = sum / (double)num + .5;\n-\t\tdouble gain_ratio = reference_gain_ / current_gain;\n-\t\tdouble shutter_speed_ratio =\n-\t\t\treference_shutter_speed_ / device_status.shutter_speed;\n-\t\tdouble aperture_ratio = reference_aperture_ / current_aperture;\n-\t\tdouble Y_ratio = current_Y * (65536 / num_bins) / reference_Y_;\n-\t\tdouble estimated_lux = shutter_speed_ratio * gain_ratio *\n-\t\t\t\t       aperture_ratio * aperture_ratio *\n-\t\t\t\t       Y_ratio * reference_lux_;\n+\t\tdouble currentY = sum / (double)num + .5;\n+\t\tdouble gainRatio = referenceGain_ / currentGain;\n+\t\tdouble shutterSpeedRatio =\n+\t\t\treferenceShutterSpeed_ / deviceStatus.shutterSpeed;\n+\t\tdouble apertureRatio = referenceAperture_ / currentAperture;\n+\t\tdouble yRatio = currentY * (65536 / numBins) / referenceY_;\n+\t\tdouble estimatedLux = shutterSpeedRatio * gainRatio *\n+\t\t\t\t      apertureRatio * apertureRatio *\n+\t\t\t\t      yRatio * referenceLux_;\n \t\tLuxStatus status;\n-\t\tstatus.lux = estimated_lux;\n-\t\tstatus.aperture = current_aperture;\n-\t\tLOG(RPiLux, Debug) << \": estimated lux \" << estimated_lux;\n+\t\tstatus.lux = estimatedLux;\n+\t\tstatus.aperture = currentAperture;\n+\t\tLOG(RPiLux, Debug) << \": estimated lux \" << estimatedLux;\n \t\t{\n \t\t\tstd::unique_lock<std::mutex> lock(mutex_);\n \t\t\tstatus_ = status;\n \t\t}\n \t\t// Overwrite the metadata here as well, so that downstream\n \t\t// algorithms get the latest value.\n-\t\timage_metadata->Set(\"lux.status\", status);\n+\t\timageMetadata->set(\"lux.status\", status);\n \t} else\n \t\tLOG(RPiLux, Warning) << \": no device metadata\";\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 Lux(controller);\n }\n-static RegisterAlgorithm reg(NAME, &Create);\n+static RegisterAlgorithm reg(NAME, &create);\ndiff --git a/src/ipa/raspberrypi/controller/rpi/lux.hpp b/src/ipa/raspberrypi/controller/rpi/lux.hpp\nindex 3ebd35d1e382..bd49a409d402 100644\n--- a/src/ipa/raspberrypi/controller/rpi/lux.hpp\n+++ b/src/ipa/raspberrypi/controller/rpi/lux.hpp\n@@ -21,21 +21,21 @@ class Lux : public Algorithm\n {\n public:\n \tLux(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-\tvoid Process(StatisticsPtr &stats, Metadata *image_metadata) override;\n-\tvoid SetCurrentAperture(double aperture);\n+\tchar const *name() const override;\n+\tvoid read(boost::property_tree::ptree const &params) override;\n+\tvoid prepare(Metadata *imageMetadata) override;\n+\tvoid process(StatisticsPtr &stats, Metadata *imageMetadata) override;\n+\tvoid setCurrentAperture(double aperture);\n \n private:\n \t// These values define the conditions of the reference image, against\n \t// which we compare the new image.\n-\tlibcamera::utils::Duration reference_shutter_speed_;\n-\tdouble reference_gain_;\n-\tdouble reference_aperture_; // units of 1/f\n-\tdouble reference_Y_; // out of 65536\n-\tdouble reference_lux_;\n-\tdouble current_aperture_;\n+\tlibcamera::utils::Duration referenceShutterSpeed_;\n+\tdouble referenceGain_;\n+\tdouble referenceAperture_; // units of 1/f\n+\tdouble referenceY_; // out of 65536\n+\tdouble referenceLux_;\n+\tdouble currentAperture_;\n \tLuxStatus status_;\n \tstd::mutex mutex_;\n };\ndiff --git a/src/ipa/raspberrypi/controller/rpi/noise.cpp b/src/ipa/raspberrypi/controller/rpi/noise.cpp\nindex 63cad639f313..97b0fd05e9d3 100644\n--- a/src/ipa/raspberrypi/controller/rpi/noise.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/noise.cpp\n@@ -22,55 +22,55 @@ LOG_DEFINE_CATEGORY(RPiNoise)\n #define NAME \"rpi.noise\"\n \n Noise::Noise(Controller *controller)\n-\t: Algorithm(controller), mode_factor_(1.0)\n+\t: Algorithm(controller), modeFactor_(1.0)\n {\n }\n \n-char const *Noise::Name() const\n+char const *Noise::name() const\n {\n \treturn NAME;\n }\n \n-void Noise::SwitchMode(CameraMode const &camera_mode,\n+void Noise::switchMode(CameraMode const &cameraMode,\n \t\t       [[maybe_unused]] Metadata *metadata)\n {\n \t// For example, we would expect a 2x2 binned mode to have a \"noise\n \t// factor\" of sqrt(2x2) = 2. (can't be less than one, right?)\n-\tmode_factor_ = std::max(1.0, camera_mode.noise_factor);\n+\tmodeFactor_ = std::max(1.0, cameraMode.noiseFactor);\n }\n \n-void Noise::Read(boost::property_tree::ptree const &params)\n+void Noise::read(boost::property_tree::ptree const &params)\n {\n-\treference_constant_ = params.get<double>(\"reference_constant\");\n-\treference_slope_ = params.get<double>(\"reference_slope\");\n+\treferenceConstant_ = params.get<double>(\"reference_constant\");\n+\treferenceSlope_ = params.get<double>(\"reference_slope\");\n }\n \n-void Noise::Prepare(Metadata *image_metadata)\n+void Noise::prepare(Metadata *imageMetadata)\n {\n-\tstruct DeviceStatus device_status;\n-\tdevice_status.analogue_gain = 1.0; // keep compiler calm\n-\tif (image_metadata->Get(\"device.status\", device_status) == 0) {\n+\tstruct DeviceStatus deviceStatus;\n+\tdeviceStatus.analogueGain = 1.0; // keep compiler calm\n+\tif (imageMetadata->get(\"device.status\", deviceStatus) == 0) {\n \t\t// There is a slight question as to exactly how the noise\n \t\t// profile, specifically the constant part of it, scales. For\n \t\t// now we assume it all scales the same, and we'll revisit this\n \t\t// if it proves substantially wrong.  NOTE: we may also want to\n \t\t// make some adjustments based on the camera mode (such as\n \t\t// binning), if we knew how to discover it...\n-\t\tdouble factor = sqrt(device_status.analogue_gain) / mode_factor_;\n+\t\tdouble factor = sqrt(deviceStatus.analogueGain) / modeFactor_;\n \t\tstruct NoiseStatus status;\n-\t\tstatus.noise_constant = reference_constant_ * factor;\n-\t\tstatus.noise_slope = reference_slope_ * factor;\n-\t\timage_metadata->Set(\"noise.status\", status);\n+\t\tstatus.noiseConstant = referenceConstant_ * factor;\n+\t\tstatus.noiseSlope = referenceSlope_ * factor;\n+\t\timageMetadata->set(\"noise.status\", status);\n \t\tLOG(RPiNoise, Debug)\n-\t\t\t<< \"constant \" << status.noise_constant\n-\t\t\t<< \" slope \" << status.noise_slope;\n+\t\t\t<< \"constant \" << status.noiseConstant\n+\t\t\t<< \" slope \" << status.noiseSlope;\n \t} else\n \t\tLOG(RPiNoise, Warning) << \" no metadata\";\n }\n \n // Register algorithm with the system.\n-static Algorithm *Create(Controller *controller)\n+static Algorithm *create(Controller *controller)\n {\n \treturn new Noise(controller);\n }\n-static RegisterAlgorithm reg(NAME, &Create);\n+static RegisterAlgorithm reg(NAME, &create);\ndiff --git a/src/ipa/raspberrypi/controller/rpi/noise.hpp b/src/ipa/raspberrypi/controller/rpi/noise.hpp\nindex 1c9de5c87d08..ed6ffe910e27 100644\n--- a/src/ipa/raspberrypi/controller/rpi/noise.hpp\n+++ b/src/ipa/raspberrypi/controller/rpi/noise.hpp\n@@ -17,16 +17,16 @@ class Noise : public Algorithm\n {\n public:\n \tNoise(Controller *controller);\n-\tchar const *Name() const override;\n-\tvoid SwitchMode(CameraMode const &camera_mode, Metadata *metadata) 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 switchMode(CameraMode const &cameraMode, Metadata *metadata) override;\n+\tvoid read(boost::property_tree::ptree const &params) override;\n+\tvoid prepare(Metadata *imageMetadata) override;\n \n private:\n \t// the noise profile for analogue gain of 1.0\n-\tdouble reference_constant_;\n-\tdouble reference_slope_;\n-\tdouble mode_factor_;\n+\tdouble referenceConstant_;\n+\tdouble referenceSlope_;\n+\tdouble modeFactor_;\n };\n \n } // namespace RPiController\ndiff --git a/src/ipa/raspberrypi/controller/rpi/sdn.cpp b/src/ipa/raspberrypi/controller/rpi/sdn.cpp\nindex 9384550983e7..480da38dc068 100644\n--- a/src/ipa/raspberrypi/controller/rpi/sdn.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/sdn.cpp\n@@ -27,49 +27,51 @@ Sdn::Sdn(Controller *controller)\n {\n }\n \n-char const *Sdn::Name() const\n+char const *Sdn::name() const\n {\n \treturn NAME;\n }\n \n-void Sdn::Read(boost::property_tree::ptree const &params)\n+void Sdn::read(boost::property_tree::ptree const &params)\n {\n \tdeviation_ = params.get<double>(\"deviation\", 3.2);\n \tstrength_ = params.get<double>(\"strength\", 0.75);\n }\n \n-void Sdn::Initialise() {}\n+void Sdn::initialise()\n+{\n+}\n \n-void Sdn::Prepare(Metadata *image_metadata)\n+void Sdn::prepare(Metadata *imageMetadata)\n {\n-\tstruct NoiseStatus noise_status = {};\n-\tnoise_status.noise_slope = 3.0; // in case no metadata\n-\tif (image_metadata->Get(\"noise.status\", noise_status) != 0)\n+\tstruct NoiseStatus noiseStatus = {};\n+\tnoiseStatus.noiseSlope = 3.0; // in case no metadata\n+\tif (imageMetadata->get(\"noise.status\", noiseStatus) != 0)\n \t\tLOG(RPiSdn, Warning) << \"no noise profile found\";\n \tLOG(RPiSdn, Debug)\n-\t\t<< \"Noise profile: constant \" << noise_status.noise_constant\n-\t\t<< \" slope \" << noise_status.noise_slope;\n+\t\t<< \"Noise profile: constant \" << noiseStatus.noiseConstant\n+\t\t<< \" slope \" << noiseStatus.noiseSlope;\n \tstruct DenoiseStatus status;\n-\tstatus.noise_constant = noise_status.noise_constant * deviation_;\n-\tstatus.noise_slope = noise_status.noise_slope * deviation_;\n+\tstatus.noiseConstant = noiseStatus.noiseConstant * deviation_;\n+\tstatus.noiseSlope = noiseStatus.noiseSlope * deviation_;\n \tstatus.strength = strength_;\n \tstatus.mode = static_cast<std::underlying_type_t<DenoiseMode>>(mode_);\n-\timage_metadata->Set(\"denoise.status\", status);\n+\timageMetadata->set(\"denoise.status\", status);\n \tLOG(RPiSdn, Debug)\n-\t\t<< \"programmed constant \" << status.noise_constant\n-\t\t<< \" slope \" << status.noise_slope\n+\t\t<< \"programmed constant \" << status.noiseConstant\n+\t\t<< \" slope \" << status.noiseSlope\n \t\t<< \" strength \" << status.strength;\n }\n \n-void Sdn::SetMode(DenoiseMode mode)\n+void Sdn::setMode(DenoiseMode mode)\n {\n \t// We only distinguish between off and all other modes.\n \tmode_ = mode;\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 Sdn(controller);\n }\n-static RegisterAlgorithm reg(NAME, &Create);\n+static RegisterAlgorithm reg(NAME, &create);\ndiff --git a/src/ipa/raspberrypi/controller/rpi/sdn.hpp b/src/ipa/raspberrypi/controller/rpi/sdn.hpp\nindex 2371ce04163f..d9b18f296635 100644\n--- a/src/ipa/raspberrypi/controller/rpi/sdn.hpp\n+++ b/src/ipa/raspberrypi/controller/rpi/sdn.hpp\n@@ -17,11 +17,11 @@ class Sdn : public DenoiseAlgorithm\n {\n public:\n \tSdn(Controller *controller = NULL);\n-\tchar const *Name() const override;\n-\tvoid Read(boost::property_tree::ptree const &params) override;\n-\tvoid Initialise() override;\n-\tvoid Prepare(Metadata *image_metadata) override;\n-\tvoid SetMode(DenoiseMode mode) override;\n+\tchar const *name() const override;\n+\tvoid read(boost::property_tree::ptree const &params) override;\n+\tvoid initialise() override;\n+\tvoid prepare(Metadata *imageMetadata) override;\n+\tvoid setMode(DenoiseMode mode) override;\n \n private:\n \tdouble deviation_;\ndiff --git a/src/ipa/raspberrypi/controller/rpi/sharpen.cpp b/src/ipa/raspberrypi/controller/rpi/sharpen.cpp\nindex 18825a43867b..3fe62bc8a5cf 100644\n--- a/src/ipa/raspberrypi/controller/rpi/sharpen.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/sharpen.cpp\n@@ -21,23 +21,23 @@ LOG_DEFINE_CATEGORY(RPiSharpen)\n #define NAME \"rpi.sharpen\"\n \n Sharpen::Sharpen(Controller *controller)\n-\t: SharpenAlgorithm(controller), user_strength_(1.0)\n+\t: SharpenAlgorithm(controller), userStrength_(1.0)\n {\n }\n \n-char const *Sharpen::Name() const\n+char const *Sharpen::name() const\n {\n \treturn NAME;\n }\n \n-void Sharpen::SwitchMode(CameraMode const &camera_mode,\n+void Sharpen::switchMode(CameraMode const &cameraMode,\n \t\t\t [[maybe_unused]] Metadata *metadata)\n {\n \t// can't be less than one, right?\n-\tmode_factor_ = std::max(1.0, camera_mode.noise_factor);\n+\tmodeFactor_ = std::max(1.0, cameraMode.noiseFactor);\n }\n \n-void Sharpen::Read(boost::property_tree::ptree const &params)\n+void Sharpen::read(boost::property_tree::ptree const &params)\n {\n \tthreshold_ = params.get<double>(\"threshold\", 1.0);\n \tstrength_ = params.get<double>(\"strength\", 1.0);\n@@ -48,38 +48,38 @@ void Sharpen::Read(boost::property_tree::ptree const &params)\n \t\t<< \" limit \" << limit_;\n }\n \n-void Sharpen::SetStrength(double strength)\n+void Sharpen::setStrength(double strength)\n {\n \t// Note that this function is how an application sets the overall\n \t// sharpening \"strength\". We call this the \"user strength\" field\n \t// as there already is a strength_ field - being an internal gain\n \t// parameter that gets passed to the ISP control code. Negative\n \t// values are not allowed - coerce them to zero (no sharpening).\n-\tuser_strength_ = std::max(0.0, strength);\n+\tuserStrength_ = std::max(0.0, strength);\n }\n \n-void Sharpen::Prepare(Metadata *image_metadata)\n+void Sharpen::prepare(Metadata *imageMetadata)\n {\n-\t// The user_strength_ affects the algorithm's internal gain directly, but\n+\t// The userStrength_ affects the algorithm's internal gain directly, but\n \t// we adjust the limit and threshold less aggressively. Using a sqrt\n \t// function is an arbitrary but gentle way of accomplishing this.\n-\tdouble user_strength_sqrt = sqrt(user_strength_);\n+\tdouble userStrengthSqrt = sqrt(userStrength_);\n \tstruct SharpenStatus status;\n \t// Binned modes seem to need the sharpening toned down with this\n-\t// pipeline, thus we use the mode_factor here. Also avoid\n-\t// divide-by-zero with the user_strength_sqrt.\n-\tstatus.threshold = threshold_ * mode_factor_ /\n-\t\t\t   std::max(0.01, user_strength_sqrt);\n-\tstatus.strength = strength_ / mode_factor_ * user_strength_;\n-\tstatus.limit = limit_ / mode_factor_ * user_strength_sqrt;\n-\t// Finally, report any application-supplied parameters that were used.\n-\tstatus.user_strength = user_strength_;\n-\timage_metadata->Set(\"sharpen.status\", status);\n+\t// pipeline, thus we use the modeFactor_ here. Also avoid\n+\t// divide-by-zero with the userStrengthSqrt.\n+\tstatus.threshold = threshold_ * modeFactor_ /\n+\t\t\t   std::max(0.01, userStrengthSqrt);\n+\tstatus.strength = strength_ / modeFactor_ * userStrength_;\n+\tstatus.limit = limit_ / modeFactor_ * userStrengthSqrt;\n+\t/* Finally, report any application-supplied parameters that were used. */\n+\tstatus.userStrength = userStrength_;\n+\timageMetadata->set(\"sharpen.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 Sharpen(controller);\n }\n-static RegisterAlgorithm reg(NAME, &Create);\n+static RegisterAlgorithm reg(NAME, &create);\ndiff --git a/src/ipa/raspberrypi/controller/rpi/sharpen.hpp b/src/ipa/raspberrypi/controller/rpi/sharpen.hpp\nindex 13a076a86895..ced917f3c42b 100644\n--- a/src/ipa/raspberrypi/controller/rpi/sharpen.hpp\n+++ b/src/ipa/raspberrypi/controller/rpi/sharpen.hpp\n@@ -17,18 +17,18 @@ class Sharpen : public SharpenAlgorithm\n {\n public:\n \tSharpen(Controller *controller);\n-\tchar const *Name() const override;\n-\tvoid SwitchMode(CameraMode const &camera_mode, Metadata *metadata) override;\n-\tvoid Read(boost::property_tree::ptree const &params) override;\n-\tvoid SetStrength(double strength) override;\n-\tvoid Prepare(Metadata *image_metadata) override;\n+\tchar const *name() const override;\n+\tvoid switchMode(CameraMode const &cameraMode, Metadata *metadata) override;\n+\tvoid read(boost::property_tree::ptree const &params) override;\n+\tvoid setStrength(double strength) override;\n+\tvoid prepare(Metadata *imageMetadata) override;\n \n private:\n \tdouble threshold_;\n \tdouble strength_;\n \tdouble limit_;\n-\tdouble mode_factor_;\n-\tdouble user_strength_;\n+\tdouble modeFactor_;\n+\tdouble userStrength_;\n };\n \n } // namespace RPiController\ndiff --git a/src/ipa/raspberrypi/controller/sharpen_algorithm.hpp b/src/ipa/raspberrypi/controller/sharpen_algorithm.hpp\nindex ca800308fd6c..888f4569c56a 100644\n--- a/src/ipa/raspberrypi/controller/sharpen_algorithm.hpp\n+++ b/src/ipa/raspberrypi/controller/sharpen_algorithm.hpp\n@@ -15,7 +15,7 @@ class SharpenAlgorithm : public Algorithm\n public:\n \tSharpenAlgorithm(Controller *controller) : Algorithm(controller) {}\n \t// A sharpness control algorithm must provide the following:\n-\tvirtual void SetStrength(double strength) = 0;\n+\tvirtual void setStrength(double strength) = 0;\n };\n \n } // namespace RPiController\ndiff --git a/src/ipa/raspberrypi/controller/sharpen_status.h b/src/ipa/raspberrypi/controller/sharpen_status.h\nindex 7501b191d6f6..2b0490742fba 100644\n--- a/src/ipa/raspberrypi/controller/sharpen_status.h\n+++ b/src/ipa/raspberrypi/controller/sharpen_status.h\n@@ -20,7 +20,7 @@ struct SharpenStatus {\n \t// upper limit of the allowed sharpening response\n \tdouble limit;\n \t// The sharpening strength requested by the user or application.\n-\tdouble user_strength;\n+\tdouble userStrength;\n };\n \n #ifdef __cplusplus\ndiff --git a/src/ipa/raspberrypi/md_parser.hpp b/src/ipa/raspberrypi/md_parser.hpp\nindex d32d0f549b9c..298d51811256 100644\n--- a/src/ipa/raspberrypi/md_parser.hpp\n+++ b/src/ipa/raspberrypi/md_parser.hpp\n@@ -75,40 +75,40 @@ public:\n \t};\n \n \tMdParser()\n-\t\t: reset_(true), bits_per_pixel_(0), num_lines_(0), line_length_bytes_(0)\n+\t\t: reset_(true), bitsPerPixel_(0), numLines_(0), lineLengthBytes_(0)\n \t{\n \t}\n \n \tvirtual ~MdParser() = default;\n \n-\tvoid Reset()\n+\tvoid reset()\n \t{\n \t\treset_ = true;\n \t}\n \n-\tvoid SetBitsPerPixel(int bpp)\n+\tvoid setBitsPerPixel(int bpp)\n \t{\n-\t\tbits_per_pixel_ = bpp;\n+\t\tbitsPerPixel_ = bpp;\n \t}\n \n-\tvoid SetNumLines(unsigned int num_lines)\n+\tvoid setNumLines(unsigned int numLines)\n \t{\n-\t\tnum_lines_ = num_lines;\n+\t\tnumLines_ = numLines;\n \t}\n \n-\tvoid SetLineLengthBytes(unsigned int num_bytes)\n+\tvoid setLineLengthBytes(unsigned int numBytes)\n \t{\n-\t\tline_length_bytes_ = num_bytes;\n+\t\tlineLengthBytes_ = numBytes;\n \t}\n \n-\tvirtual Status Parse(libcamera::Span<const uint8_t> buffer,\n+\tvirtual Status parse(libcamera::Span<const uint8_t> buffer,\n \t\t\t     RegisterMap &registers) = 0;\n \n protected:\n \tbool reset_;\n-\tint bits_per_pixel_;\n-\tunsigned int num_lines_;\n-\tunsigned int line_length_bytes_;\n+\tint bitsPerPixel_;\n+\tunsigned int numLines_;\n+\tunsigned int lineLengthBytes_;\n };\n \n /*\n@@ -123,7 +123,7 @@ class MdParserSmia final : public MdParser\n public:\n \tMdParserSmia(std::initializer_list<uint32_t> registerList);\n \n-\tMdParser::Status Parse(libcamera::Span<const uint8_t> buffer,\n+\tMdParser::Status parse(libcamera::Span<const uint8_t> buffer,\n \t\t\t       RegisterMap &registers) override;\n \n private:\n@@ -133,18 +133,18 @@ private:\n \t/*\n \t * Note that error codes > 0 are regarded as non-fatal; codes < 0\n \t * indicate a bad data buffer. Status codes are:\n-\t * PARSE_OK     - found all registers, much happiness\n-\t * MISSING_REGS - some registers found; should this be a hard error?\n+\t * ParseOk     - found all registers, much happiness\n+\t * MissingRegs - some registers found; should this be a hard error?\n \t * The remaining codes are all hard errors.\n \t */\n \tenum ParseStatus {\n-\t\tPARSE_OK      =  0,\n-\t\tMISSING_REGS  =  1,\n-\t\tNO_LINE_START = -1,\n-\t\tILLEGAL_TAG   = -2,\n-\t\tBAD_DUMMY     = -3,\n-\t\tBAD_LINE_END  = -4,\n-\t\tBAD_PADDING   = -5\n+\t\tParseOk      =  0,\n+\t\tMissingRegs  =  1,\n+\t\tNoLineStart  = -1,\n+\t\tIllegalTag   = -2,\n+\t\tBadDummy     = -3,\n+\t\tBadLineEnd   = -4,\n+\t\tBadPadding   = -5\n \t};\n \n \tParseStatus findRegs(libcamera::Span<const uint8_t> buffer);\ndiff --git a/src/ipa/raspberrypi/md_parser_smia.cpp b/src/ipa/raspberrypi/md_parser_smia.cpp\nindex ea5eac414b36..9fab6594baac 100644\n--- a/src/ipa/raspberrypi/md_parser_smia.cpp\n+++ b/src/ipa/raspberrypi/md_parser_smia.cpp\n@@ -20,12 +20,12 @@ using namespace libcamera;\n  * sensors, I think.\n  */\n \n-constexpr unsigned int LINE_START = 0x0a;\n-constexpr unsigned int LINE_END_TAG = 0x07;\n-constexpr unsigned int REG_HI_BITS = 0xaa;\n-constexpr unsigned int REG_LOW_BITS = 0xa5;\n-constexpr unsigned int REG_VALUE = 0x5a;\n-constexpr unsigned int REG_SKIP = 0x55;\n+constexpr unsigned int LineStart = 0x0a;\n+constexpr unsigned int LineEndTag = 0x07;\n+constexpr unsigned int RegHiBits = 0xaa;\n+constexpr unsigned int RegLowBits = 0xa5;\n+constexpr unsigned int RegValue = 0x5a;\n+constexpr unsigned int RegSkip = 0x55;\n \n MdParserSmia::MdParserSmia(std::initializer_list<uint32_t> registerList)\n {\n@@ -33,7 +33,7 @@ MdParserSmia::MdParserSmia(std::initializer_list<uint32_t> registerList)\n \t\toffsets_[r] = {};\n }\n \n-MdParser::Status MdParserSmia::Parse(libcamera::Span<const uint8_t> buffer,\n+MdParser::Status MdParserSmia::parse(libcamera::Span<const uint8_t> buffer,\n \t\t\t\t     RegisterMap &registers)\n {\n \tif (reset_) {\n@@ -41,7 +41,7 @@ MdParser::Status MdParserSmia::Parse(libcamera::Span<const uint8_t> buffer,\n \t\t * Search again through the metadata for all the registers\n \t\t * requested.\n \t\t */\n-\t\tASSERT(bits_per_pixel_);\n+\t\tASSERT(bitsPerPixel_);\n \n \t\tfor (const auto &kv : offsets_)\n \t\t\toffsets_[kv.first] = {};\n@@ -53,7 +53,7 @@ MdParser::Status MdParserSmia::Parse(libcamera::Span<const uint8_t> buffer,\n \t\t *\n \t\t * In either case, we retry parsing on the next frame.\n \t\t */\n-\t\tif (ret != PARSE_OK)\n+\t\tif (ret != ParseOk)\n \t\t\treturn ERROR;\n \n \t\treset_ = false;\n@@ -76,74 +76,74 @@ MdParserSmia::ParseStatus MdParserSmia::findRegs(libcamera::Span<const uint8_t>\n {\n \tASSERT(offsets_.size());\n \n-\tif (buffer[0] != LINE_START)\n-\t\treturn NO_LINE_START;\n+\tif (buffer[0] != LineStart)\n+\t\treturn NoLineStart;\n \n-\tunsigned int current_offset = 1; /* after the LINE_START */\n-\tunsigned int current_line_start = 0, current_line = 0;\n-\tunsigned int reg_num = 0, regs_done = 0;\n+\tunsigned int currentOffset = 1; /* after the LineStart */\n+\tunsigned int currentLineStart = 0, currentLine = 0;\n+\tunsigned int regNum = 0, regsDone = 0;\n \n \twhile (1) {\n-\t\tint tag = buffer[current_offset++];\n-\n-\t\tif ((bits_per_pixel_ == 10 &&\n-\t\t     (current_offset + 1 - current_line_start) % 5 == 0) ||\n-\t\t    (bits_per_pixel_ == 12 &&\n-\t\t     (current_offset + 1 - current_line_start) % 3 == 0)) {\n-\t\t\tif (buffer[current_offset++] != REG_SKIP)\n-\t\t\t\treturn BAD_DUMMY;\n+\t\tint tag = buffer[currentOffset++];\n+\n+\t\tif ((bitsPerPixel_ == 10 &&\n+\t\t     (currentOffset + 1 - currentLineStart) % 5 == 0) ||\n+\t\t    (bitsPerPixel_ == 12 &&\n+\t\t     (currentOffset + 1 - currentLineStart) % 3 == 0)) {\n+\t\t\tif (buffer[currentOffset++] != RegSkip)\n+\t\t\t\treturn BadDummy;\n \t\t}\n \n-\t\tint data_byte = buffer[current_offset++];\n+\t\tint dataByte = buffer[currentOffset++];\n \n-\t\tif (tag == LINE_END_TAG) {\n-\t\t\tif (data_byte != LINE_END_TAG)\n-\t\t\t\treturn BAD_LINE_END;\n+\t\tif (tag == LineEndTag) {\n+\t\t\tif (dataByte != LineEndTag)\n+\t\t\t\treturn BadLineEnd;\n \n-\t\t\tif (num_lines_ && ++current_line == num_lines_)\n-\t\t\t\treturn MISSING_REGS;\n+\t\t\tif (numLines_ && ++currentLine == numLines_)\n+\t\t\t\treturn MissingRegs;\n \n-\t\t\tif (line_length_bytes_) {\n-\t\t\t\tcurrent_offset = current_line_start + line_length_bytes_;\n+\t\t\tif (lineLengthBytes_) {\n+\t\t\t\tcurrentOffset = currentLineStart + lineLengthBytes_;\n \n \t\t\t\t/* Require whole line to be in the buffer (if buffer size set). */\n \t\t\t\tif (buffer.size() &&\n-\t\t\t\t    current_offset + line_length_bytes_ > buffer.size())\n-\t\t\t\t\treturn MISSING_REGS;\n+\t\t\t\t    currentOffset + lineLengthBytes_ > buffer.size())\n+\t\t\t\t\treturn MissingRegs;\n \n-\t\t\t\tif (buffer[current_offset] != LINE_START)\n-\t\t\t\t\treturn NO_LINE_START;\n+\t\t\t\tif (buffer[currentOffset] != LineStart)\n+\t\t\t\t\treturn NoLineStart;\n \t\t\t} else {\n \t\t\t\t/* allow a zero line length to mean \"hunt for the next line\" */\n-\t\t\t\twhile (current_offset < buffer.size() &&\n-\t\t\t\t       buffer[current_offset] != LINE_START)\n-\t\t\t\t\tcurrent_offset++;\n+\t\t\t\twhile (currentOffset < buffer.size() &&\n+\t\t\t\t       buffer[currentOffset] != LineStart)\n+\t\t\t\t\tcurrentOffset++;\n \n-\t\t\t\tif (current_offset == buffer.size())\n-\t\t\t\t\treturn NO_LINE_START;\n+\t\t\t\tif (currentOffset == buffer.size())\n+\t\t\t\t\treturn NoLineStart;\n \t\t\t}\n \n-\t\t\t/* inc current_offset to after LINE_START */\n-\t\t\tcurrent_line_start = current_offset++;\n+\t\t\t/* inc current_offset to after LineStart */\n+\t\t\tcurrentLineStart = currentOffset++;\n \t\t} else {\n-\t\t\tif (tag == REG_HI_BITS)\n-\t\t\t\treg_num = (reg_num & 0xff) | (data_byte << 8);\n-\t\t\telse if (tag == REG_LOW_BITS)\n-\t\t\t\treg_num = (reg_num & 0xff00) | data_byte;\n-\t\t\telse if (tag == REG_SKIP)\n-\t\t\t\treg_num++;\n-\t\t\telse if (tag == REG_VALUE) {\n-\t\t\t\tauto reg = offsets_.find(reg_num);\n+\t\t\tif (tag == RegHiBits)\n+\t\t\t\tregNum = (regNum & 0xff) | (dataByte << 8);\n+\t\t\telse if (tag == RegLowBits)\n+\t\t\t\tregNum = (regNum & 0xff00) | dataByte;\n+\t\t\telse if (tag == RegSkip)\n+\t\t\t\tregNum++;\n+\t\t\telse if (tag == RegValue) {\n+\t\t\t\tauto reg = offsets_.find(regNum);\n \n \t\t\t\tif (reg != offsets_.end()) {\n-\t\t\t\t\toffsets_[reg_num] = current_offset - 1;\n+\t\t\t\t\toffsets_[regNum] = currentOffset - 1;\n \n-\t\t\t\t\tif (++regs_done == offsets_.size())\n-\t\t\t\t\t\treturn PARSE_OK;\n+\t\t\t\t\tif (++regsDone == offsets_.size())\n+\t\t\t\t\t\treturn ParseOk;\n \t\t\t\t}\n-\t\t\t\treg_num++;\n+\t\t\t\tregNum++;\n \t\t\t} else\n-\t\t\t\treturn ILLEGAL_TAG;\n+\t\t\t\treturn IllegalTag;\n \t\t}\n \t}\n }\ndiff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex c7492a77a3fd..f315ebcd4c6b 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -208,7 +208,7 @@ int IPARPi::init(const IPASettings &settings, IPAInitResult *result)\n \t * that the kernel driver doesn't. We only do this the first time; we don't need\n \t * to re-parse the metadata after a simple mode-switch for no reason.\n \t */\n-\thelper_ = std::unique_ptr<RPiController::CamHelper>(RPiController::CamHelper::Create(settings.sensorModel));\n+\thelper_ = std::unique_ptr<RPiController::CamHelper>(RPiController::CamHelper::create(settings.sensorModel));\n \tif (!helper_) {\n \t\tLOG(IPARPI, Error) << \"Could not create camera helper for \"\n \t\t\t\t   << settings.sensorModel;\n@@ -220,8 +220,8 @@ int IPARPi::init(const IPASettings &settings, IPAInitResult *result)\n \t * to setup the staggered writer class.\n \t */\n \tint gainDelay, exposureDelay, vblankDelay, sensorMetadata;\n-\thelper_->GetDelays(exposureDelay, gainDelay, vblankDelay);\n-\tsensorMetadata = helper_->SensorEmbeddedDataPresent();\n+\thelper_->getDelays(exposureDelay, gainDelay, vblankDelay);\n+\tsensorMetadata = helper_->sensorEmbeddedDataPresent();\n \n \tresult->sensorConfig.gainDelay = gainDelay;\n \tresult->sensorConfig.exposureDelay = exposureDelay;\n@@ -229,8 +229,8 @@ int IPARPi::init(const IPASettings &settings, IPAInitResult *result)\n \tresult->sensorConfig.sensorMetadata = sensorMetadata;\n \n \t/* Load the tuning file for this sensor. */\n-\tcontroller_.Read(settings.configurationFile.c_str());\n-\tcontroller_.Initialise();\n+\tcontroller_.read(settings.configurationFile.c_str());\n+\tcontroller_.initialise();\n \n \t/* Return the controls handled by the IPA */\n \tControlInfoMap::Map ctrlMap = ipaControls;\n@@ -249,15 +249,15 @@ void IPARPi::start(const ControlList &controls, StartConfig *startConfig)\n \t\tqueueRequest(controls);\n \t}\n \n-\tcontroller_.SwitchMode(mode_, &metadata);\n+\tcontroller_.switchMode(mode_, &metadata);\n \n \t/* SwitchMode may supply updated exposure/gain values to use. */\n \tAgcStatus agcStatus;\n-\tagcStatus.shutter_time = 0.0s;\n-\tagcStatus.analogue_gain = 0.0;\n+\tagcStatus.shutterTime = 0.0s;\n+\tagcStatus.analogueGain = 0.0;\n \n-\tmetadata.Get(\"agc.status\", agcStatus);\n-\tif (agcStatus.shutter_time && agcStatus.analogue_gain) {\n+\tmetadata.get(\"agc.status\", agcStatus);\n+\tif (agcStatus.shutterTime && agcStatus.analogueGain) {\n \t\tControlList ctrls(sensorCtrls_);\n \t\tapplyAGC(&agcStatus, ctrls);\n \t\tstartConfig->controls = std::move(ctrls);\n@@ -271,8 +271,8 @@ void IPARPi::start(const ControlList &controls, StartConfig *startConfig)\n \tframeCount_ = 0;\n \tcheckCount_ = 0;\n \tif (firstStart_) {\n-\t\tdropFrameCount_ = helper_->HideFramesStartup();\n-\t\tmistrustCount_ = helper_->MistrustFramesStartup();\n+\t\tdropFrameCount_ = helper_->hideFramesStartup();\n+\t\tmistrustCount_ = helper_->mistrustFramesStartup();\n \n \t\t/*\n \t\t * Query the AGC/AWB for how many frames they may take to\n@@ -283,18 +283,18 @@ void IPARPi::start(const ControlList &controls, StartConfig *startConfig)\n \t\t */\n \t\tunsigned int agcConvergenceFrames = 0;\n \t\tRPiController::AgcAlgorithm *agc = dynamic_cast<RPiController::AgcAlgorithm *>(\n-\t\t\tcontroller_.GetAlgorithm(\"agc\"));\n+\t\t\tcontroller_.getAlgorithm(\"agc\"));\n \t\tif (agc) {\n-\t\t\tagcConvergenceFrames = agc->GetConvergenceFrames();\n+\t\t\tagcConvergenceFrames = agc->getConvergenceFrames();\n \t\t\tif (agcConvergenceFrames)\n \t\t\t\tagcConvergenceFrames += mistrustCount_;\n \t\t}\n \n \t\tunsigned int awbConvergenceFrames = 0;\n \t\tRPiController::AwbAlgorithm *awb = dynamic_cast<RPiController::AwbAlgorithm *>(\n-\t\t\tcontroller_.GetAlgorithm(\"awb\"));\n+\t\t\tcontroller_.getAlgorithm(\"awb\"));\n \t\tif (awb) {\n-\t\t\tawbConvergenceFrames = awb->GetConvergenceFrames();\n+\t\t\tawbConvergenceFrames = awb->getConvergenceFrames();\n \t\t\tif (awbConvergenceFrames)\n \t\t\t\tawbConvergenceFrames += mistrustCount_;\n \t\t}\n@@ -302,12 +302,12 @@ void IPARPi::start(const ControlList &controls, StartConfig *startConfig)\n \t\tdropFrameCount_ = std::max({ dropFrameCount_, agcConvergenceFrames, awbConvergenceFrames });\n \t\tLOG(IPARPI, Debug) << \"Drop \" << dropFrameCount_ << \" frames on startup\";\n \t} else {\n-\t\tdropFrameCount_ = helper_->HideFramesModeSwitch();\n-\t\tmistrustCount_ = helper_->MistrustFramesModeSwitch();\n+\t\tdropFrameCount_ = helper_->hideFramesModeSwitch();\n+\t\tmistrustCount_ = helper_->mistrustFramesModeSwitch();\n \t}\n \n \tstartConfig->dropFrameCount = dropFrameCount_;\n-\tconst Duration maxSensorFrameDuration = mode_.max_frame_length * mode_.line_length;\n+\tconst Duration maxSensorFrameDuration = mode_.maxFrameLength * mode_.lineLength;\n \tstartConfig->maxSensorFrameLengthMs = maxSensorFrameDuration.get<std::milli>();\n \n \tfirstStart_ = false;\n@@ -319,17 +319,17 @@ void IPARPi::setMode(const IPACameraSensorInfo &sensorInfo)\n \tmode_.bitdepth = sensorInfo.bitsPerPixel;\n \tmode_.width = sensorInfo.outputSize.width;\n \tmode_.height = sensorInfo.outputSize.height;\n-\tmode_.sensor_width = sensorInfo.activeAreaSize.width;\n-\tmode_.sensor_height = sensorInfo.activeAreaSize.height;\n-\tmode_.crop_x = sensorInfo.analogCrop.x;\n-\tmode_.crop_y = sensorInfo.analogCrop.y;\n+\tmode_.sensorWidth = sensorInfo.activeAreaSize.width;\n+\tmode_.sensorHeight = sensorInfo.activeAreaSize.height;\n+\tmode_.cropX = sensorInfo.analogCrop.x;\n+\tmode_.cropY = sensorInfo.analogCrop.y;\n \n \t/*\n \t * Calculate scaling parameters. The scale_[xy] factors are determined\n \t * by the ratio between the crop rectangle size and the output size.\n \t */\n-\tmode_.scale_x = sensorInfo.analogCrop.width / sensorInfo.outputSize.width;\n-\tmode_.scale_y = sensorInfo.analogCrop.height / sensorInfo.outputSize.height;\n+\tmode_.scaleX = sensorInfo.analogCrop.width / sensorInfo.outputSize.width;\n+\tmode_.scaleY = sensorInfo.analogCrop.height / sensorInfo.outputSize.height;\n \n \t/*\n \t * We're not told by the pipeline handler how scaling is split between\n@@ -339,30 +339,30 @@ void IPARPi::setMode(const IPACameraSensorInfo &sensorInfo)\n \t *\n \t * \\todo Get the pipeline handle to provide the full data\n \t */\n-\tmode_.bin_x = std::min(2, static_cast<int>(mode_.scale_x));\n-\tmode_.bin_y = std::min(2, static_cast<int>(mode_.scale_y));\n+\tmode_.binX = std::min(2, static_cast<int>(mode_.scaleX));\n+\tmode_.binY = std::min(2, static_cast<int>(mode_.scaleY));\n \n \t/* The noise factor is the square root of the total binning factor. */\n-\tmode_.noise_factor = sqrt(mode_.bin_x * mode_.bin_y);\n+\tmode_.noiseFactor = sqrt(mode_.binX * mode_.binY);\n \n \t/*\n \t * Calculate the line length as the ratio between the line length in\n \t * pixels and the pixel rate.\n \t */\n-\tmode_.line_length = sensorInfo.lineLength * (1.0s / sensorInfo.pixelRate);\n+\tmode_.lineLength = sensorInfo.lineLength * (1.0s / sensorInfo.pixelRate);\n \n \t/*\n \t * Set the frame length limits for the mode to ensure exposure and\n \t * framerate calculations are clipped appropriately.\n \t */\n-\tmode_.min_frame_length = sensorInfo.minFrameLength;\n-\tmode_.max_frame_length = sensorInfo.maxFrameLength;\n+\tmode_.minFrameLength = sensorInfo.minFrameLength;\n+\tmode_.maxFrameLength = sensorInfo.maxFrameLength;\n \n \t/*\n \t * Some sensors may have different sensitivities in different modes;\n \t * the CamHelper will know the correct value.\n \t */\n-\tmode_.sensitivity = helper_->GetModeSensitivity(mode_);\n+\tmode_.sensitivity = helper_->getModeSensitivity(mode_);\n }\n \n int IPARPi::configure(const IPACameraSensorInfo &sensorInfo,\n@@ -421,7 +421,7 @@ int IPARPi::configure(const IPACameraSensorInfo &sensorInfo,\n \t}\n \n \t/* Pass the camera mode to the CamHelper to setup algorithms. */\n-\thelper_->SetCameraMode(mode_);\n+\thelper_->setCameraMode(mode_);\n \n \t/*\n \t * Initialise this ControlList correctly, even if empty, in case the IPA is\n@@ -438,8 +438,8 @@ int IPARPi::configure(const IPACameraSensorInfo &sensorInfo,\n \n \t\t/* Supply initial values for gain and exposure. */\n \t\tAgcStatus agcStatus;\n-\t\tagcStatus.shutter_time = defaultExposureTime;\n-\t\tagcStatus.analogue_gain = defaultAnalogueGain;\n+\t\tagcStatus.shutterTime = defaultExposureTime;\n+\t\tagcStatus.analogueGain = defaultAnalogueGain;\n \t\tapplyAGC(&agcStatus, ctrls);\n \t}\n \n@@ -451,25 +451,25 @@ int IPARPi::configure(const IPACameraSensorInfo &sensorInfo,\n \t * based on the current sensor mode.\n \t */\n \tControlInfoMap::Map ctrlMap = ipaControls;\n-\tconst Duration minSensorFrameDuration = mode_.min_frame_length * mode_.line_length;\n-\tconst Duration maxSensorFrameDuration = mode_.max_frame_length * mode_.line_length;\n+\tconst Duration minSensorFrameDuration = mode_.minFrameLength * mode_.lineLength;\n+\tconst Duration maxSensorFrameDuration = mode_.maxFrameLength * mode_.lineLength;\n \tctrlMap[&controls::FrameDurationLimits] =\n \t\tControlInfo(static_cast<int64_t>(minSensorFrameDuration.get<std::micro>()),\n \t\t\t    static_cast<int64_t>(maxSensorFrameDuration.get<std::micro>()));\n \n \tctrlMap[&controls::AnalogueGain] =\n-\t\tControlInfo(1.0f, static_cast<float>(helper_->Gain(maxSensorGainCode_)));\n+\t\tControlInfo(1.0f, static_cast<float>(helper_->gain(maxSensorGainCode_)));\n \n \t/*\n \t * Calculate the max exposure limit from the frame duration limit as V4L2\n \t * will limit the maximum control value based on the current VBLANK value.\n \t */\n \tDuration maxShutter = Duration::max();\n-\thelper_->GetVBlanking(maxShutter, minSensorFrameDuration, maxSensorFrameDuration);\n+\thelper_->getVBlanking(maxShutter, minSensorFrameDuration, maxSensorFrameDuration);\n \tconst uint32_t exposureMin = sensorCtrls_.at(V4L2_CID_EXPOSURE).min().get<int32_t>();\n \n \tctrlMap[&controls::ExposureTime] =\n-\t\tControlInfo(static_cast<int32_t>(helper_->Exposure(exposureMin).get<std::micro>()),\n+\t\tControlInfo(static_cast<int32_t>(helper_->exposure(exposureMin).get<std::micro>()),\n \t\t\t    static_cast<int32_t>(maxShutter.get<std::micro>()));\n \n \tresult->controlInfo = ControlInfoMap(std::move(ctrlMap), controls::controls);\n@@ -536,54 +536,54 @@ void IPARPi::reportMetadata()\n \t * processed can be extracted and placed into the libcamera metadata\n \t * buffer, where an application could query it.\n \t */\n-\tDeviceStatus *deviceStatus = rpiMetadata_.GetLocked<DeviceStatus>(\"device.status\");\n+\tDeviceStatus *deviceStatus = rpiMetadata_.getLocked<DeviceStatus>(\"device.status\");\n \tif (deviceStatus) {\n \t\tlibcameraMetadata_.set(controls::ExposureTime,\n-\t\t\t\t       deviceStatus->shutter_speed.get<std::micro>());\n-\t\tlibcameraMetadata_.set(controls::AnalogueGain, deviceStatus->analogue_gain);\n+\t\t\t\t       deviceStatus->shutterSpeed.get<std::micro>());\n+\t\tlibcameraMetadata_.set(controls::AnalogueGain, deviceStatus->analogueGain);\n \t\tlibcameraMetadata_.set(controls::FrameDuration,\n-\t\t\t\t       helper_->Exposure(deviceStatus->frame_length).get<std::micro>());\n-\t\tif (deviceStatus->sensor_temperature)\n-\t\t\tlibcameraMetadata_.set(controls::SensorTemperature, *deviceStatus->sensor_temperature);\n+\t\t\t\t       helper_->exposure(deviceStatus->frameLength).get<std::micro>());\n+\t\tif (deviceStatus->sensorTemperature)\n+\t\t\tlibcameraMetadata_.set(controls::SensorTemperature, *deviceStatus->sensorTemperature);\n \t}\n \n-\tAgcStatus *agcStatus = rpiMetadata_.GetLocked<AgcStatus>(\"agc.status\");\n+\tAgcStatus *agcStatus = rpiMetadata_.getLocked<AgcStatus>(\"agc.status\");\n \tif (agcStatus) {\n \t\tlibcameraMetadata_.set(controls::AeLocked, agcStatus->locked);\n-\t\tlibcameraMetadata_.set(controls::DigitalGain, agcStatus->digital_gain);\n+\t\tlibcameraMetadata_.set(controls::DigitalGain, agcStatus->digitalGain);\n \t}\n \n-\tLuxStatus *luxStatus = rpiMetadata_.GetLocked<LuxStatus>(\"lux.status\");\n+\tLuxStatus *luxStatus = rpiMetadata_.getLocked<LuxStatus>(\"lux.status\");\n \tif (luxStatus)\n \t\tlibcameraMetadata_.set(controls::Lux, luxStatus->lux);\n \n-\tAwbStatus *awbStatus = rpiMetadata_.GetLocked<AwbStatus>(\"awb.status\");\n+\tAwbStatus *awbStatus = rpiMetadata_.getLocked<AwbStatus>(\"awb.status\");\n \tif (awbStatus) {\n-\t\tlibcameraMetadata_.set(controls::ColourGains, { static_cast<float>(awbStatus->gain_r),\n-\t\t\t\t\t\t\t\tstatic_cast<float>(awbStatus->gain_b) });\n-\t\tlibcameraMetadata_.set(controls::ColourTemperature, awbStatus->temperature_K);\n+\t\tlibcameraMetadata_.set(controls::ColourGains, { static_cast<float>(awbStatus->gainR),\n+\t\t\t\t\t\t\t\tstatic_cast<float>(awbStatus->gainB) });\n+\t\tlibcameraMetadata_.set(controls::ColourTemperature, awbStatus->temperatureK);\n \t}\n \n-\tBlackLevelStatus *blackLevelStatus = rpiMetadata_.GetLocked<BlackLevelStatus>(\"black_level.status\");\n+\tBlackLevelStatus *blackLevelStatus = rpiMetadata_.getLocked<BlackLevelStatus>(\"black_level.status\");\n \tif (blackLevelStatus)\n \t\tlibcameraMetadata_.set(controls::SensorBlackLevels,\n-\t\t\t\t       { static_cast<int32_t>(blackLevelStatus->black_level_r),\n-\t\t\t\t\t static_cast<int32_t>(blackLevelStatus->black_level_g),\n-\t\t\t\t\t static_cast<int32_t>(blackLevelStatus->black_level_g),\n-\t\t\t\t\t static_cast<int32_t>(blackLevelStatus->black_level_b) });\n+\t\t\t\t       { static_cast<int32_t>(blackLevelStatus->blackLevelR),\n+\t\t\t\t\t static_cast<int32_t>(blackLevelStatus->blackLevelG),\n+\t\t\t\t\t static_cast<int32_t>(blackLevelStatus->blackLevelG),\n+\t\t\t\t\t static_cast<int32_t>(blackLevelStatus->blackLevelB) });\n \n-\tFocusStatus *focusStatus = rpiMetadata_.GetLocked<FocusStatus>(\"focus.status\");\n+\tFocusStatus *focusStatus = rpiMetadata_.getLocked<FocusStatus>(\"focus.status\");\n \tif (focusStatus && focusStatus->num == 12) {\n \t\t/*\n \t\t * We get a 4x3 grid of regions by default. Calculate the average\n \t\t * FoM over the central two positions to give an overall scene FoM.\n \t\t * This can change later if it is not deemed suitable.\n \t\t */\n-\t\tint32_t focusFoM = (focusStatus->focus_measures[5] + focusStatus->focus_measures[6]) / 2;\n+\t\tint32_t focusFoM = (focusStatus->focusMeasures[5] + focusStatus->focusMeasures[6]) / 2;\n \t\tlibcameraMetadata_.set(controls::FocusFoM, focusFoM);\n \t}\n \n-\tCcmStatus *ccmStatus = rpiMetadata_.GetLocked<CcmStatus>(\"ccm.status\");\n+\tCcmStatus *ccmStatus = rpiMetadata_.getLocked<CcmStatus>(\"ccm.status\");\n \tif (ccmStatus) {\n \t\tfloat m[9];\n \t\tfor (unsigned int i = 0; i < 9; i++)\n@@ -695,7 +695,7 @@ void IPARPi::queueRequest(const ControlList &controls)\n \n \t\tswitch (ctrl.first) {\n \t\tcase controls::AE_ENABLE: {\n-\t\t\tRPiController::Algorithm *agc = controller_.GetAlgorithm(\"agc\");\n+\t\t\tRPiController::Algorithm *agc = controller_.getAlgorithm(\"agc\");\n \t\t\tif (!agc) {\n \t\t\t\tLOG(IPARPI, Warning)\n \t\t\t\t\t<< \"Could not set AE_ENABLE - no AGC algorithm\";\n@@ -703,9 +703,9 @@ void IPARPi::queueRequest(const ControlList &controls)\n \t\t\t}\n \n \t\t\tif (ctrl.second.get<bool>() == false)\n-\t\t\t\tagc->Pause();\n+\t\t\t\tagc->pause();\n \t\t\telse\n-\t\t\t\tagc->Resume();\n+\t\t\t\tagc->resume();\n \n \t\t\tlibcameraMetadata_.set(controls::AeEnable, ctrl.second.get<bool>());\n \t\t\tbreak;\n@@ -713,7 +713,7 @@ void IPARPi::queueRequest(const ControlList &controls)\n \n \t\tcase controls::EXPOSURE_TIME: {\n \t\t\tRPiController::AgcAlgorithm *agc = dynamic_cast<RPiController::AgcAlgorithm *>(\n-\t\t\t\tcontroller_.GetAlgorithm(\"agc\"));\n+\t\t\t\tcontroller_.getAlgorithm(\"agc\"));\n \t\t\tif (!agc) {\n \t\t\t\tLOG(IPARPI, Warning)\n \t\t\t\t\t<< \"Could not set EXPOSURE_TIME - no AGC algorithm\";\n@@ -721,7 +721,7 @@ void IPARPi::queueRequest(const ControlList &controls)\n \t\t\t}\n \n \t\t\t/* The control provides units of microseconds. */\n-\t\t\tagc->SetFixedShutter(ctrl.second.get<int32_t>() * 1.0us);\n+\t\t\tagc->setFixedShutter(ctrl.second.get<int32_t>() * 1.0us);\n \n \t\t\tlibcameraMetadata_.set(controls::ExposureTime, ctrl.second.get<int32_t>());\n \t\t\tbreak;\n@@ -729,14 +729,14 @@ void IPARPi::queueRequest(const ControlList &controls)\n \n \t\tcase controls::ANALOGUE_GAIN: {\n \t\t\tRPiController::AgcAlgorithm *agc = dynamic_cast<RPiController::AgcAlgorithm *>(\n-\t\t\t\tcontroller_.GetAlgorithm(\"agc\"));\n+\t\t\t\tcontroller_.getAlgorithm(\"agc\"));\n \t\t\tif (!agc) {\n \t\t\t\tLOG(IPARPI, Warning)\n \t\t\t\t\t<< \"Could not set ANALOGUE_GAIN - no AGC algorithm\";\n \t\t\t\tbreak;\n \t\t\t}\n \n-\t\t\tagc->SetFixedAnalogueGain(ctrl.second.get<float>());\n+\t\t\tagc->setFixedAnalogueGain(ctrl.second.get<float>());\n \n \t\t\tlibcameraMetadata_.set(controls::AnalogueGain,\n \t\t\t\t\t       ctrl.second.get<float>());\n@@ -745,7 +745,7 @@ void IPARPi::queueRequest(const ControlList &controls)\n \n \t\tcase controls::AE_METERING_MODE: {\n \t\t\tRPiController::AgcAlgorithm *agc = dynamic_cast<RPiController::AgcAlgorithm *>(\n-\t\t\t\tcontroller_.GetAlgorithm(\"agc\"));\n+\t\t\t\tcontroller_.getAlgorithm(\"agc\"));\n \t\t\tif (!agc) {\n \t\t\t\tLOG(IPARPI, Warning)\n \t\t\t\t\t<< \"Could not set AE_METERING_MODE - no AGC algorithm\";\n@@ -754,7 +754,7 @@ void IPARPi::queueRequest(const ControlList &controls)\n \n \t\t\tint32_t idx = ctrl.second.get<int32_t>();\n \t\t\tif (MeteringModeTable.count(idx)) {\n-\t\t\t\tagc->SetMeteringMode(MeteringModeTable.at(idx));\n+\t\t\t\tagc->setMeteringMode(MeteringModeTable.at(idx));\n \t\t\t\tlibcameraMetadata_.set(controls::AeMeteringMode, idx);\n \t\t\t} else {\n \t\t\t\tLOG(IPARPI, Error) << \"Metering mode \" << idx\n@@ -765,7 +765,7 @@ void IPARPi::queueRequest(const ControlList &controls)\n \n \t\tcase controls::AE_CONSTRAINT_MODE: {\n \t\t\tRPiController::AgcAlgorithm *agc = dynamic_cast<RPiController::AgcAlgorithm *>(\n-\t\t\t\tcontroller_.GetAlgorithm(\"agc\"));\n+\t\t\t\tcontroller_.getAlgorithm(\"agc\"));\n \t\t\tif (!agc) {\n \t\t\t\tLOG(IPARPI, Warning)\n \t\t\t\t\t<< \"Could not set AE_CONSTRAINT_MODE - no AGC algorithm\";\n@@ -774,7 +774,7 @@ void IPARPi::queueRequest(const ControlList &controls)\n \n \t\t\tint32_t idx = ctrl.second.get<int32_t>();\n \t\t\tif (ConstraintModeTable.count(idx)) {\n-\t\t\t\tagc->SetConstraintMode(ConstraintModeTable.at(idx));\n+\t\t\t\tagc->setConstraintMode(ConstraintModeTable.at(idx));\n \t\t\t\tlibcameraMetadata_.set(controls::AeConstraintMode, idx);\n \t\t\t} else {\n \t\t\t\tLOG(IPARPI, Error) << \"Constraint mode \" << idx\n@@ -785,7 +785,7 @@ void IPARPi::queueRequest(const ControlList &controls)\n \n \t\tcase controls::AE_EXPOSURE_MODE: {\n \t\t\tRPiController::AgcAlgorithm *agc = dynamic_cast<RPiController::AgcAlgorithm *>(\n-\t\t\t\tcontroller_.GetAlgorithm(\"agc\"));\n+\t\t\t\tcontroller_.getAlgorithm(\"agc\"));\n \t\t\tif (!agc) {\n \t\t\t\tLOG(IPARPI, Warning)\n \t\t\t\t\t<< \"Could not set AE_EXPOSURE_MODE - no AGC algorithm\";\n@@ -794,7 +794,7 @@ void IPARPi::queueRequest(const ControlList &controls)\n \n \t\t\tint32_t idx = ctrl.second.get<int32_t>();\n \t\t\tif (ExposureModeTable.count(idx)) {\n-\t\t\t\tagc->SetExposureMode(ExposureModeTable.at(idx));\n+\t\t\t\tagc->setExposureMode(ExposureModeTable.at(idx));\n \t\t\t\tlibcameraMetadata_.set(controls::AeExposureMode, idx);\n \t\t\t} else {\n \t\t\t\tLOG(IPARPI, Error) << \"Exposure mode \" << idx\n@@ -805,7 +805,7 @@ void IPARPi::queueRequest(const ControlList &controls)\n \n \t\tcase controls::EXPOSURE_VALUE: {\n \t\t\tRPiController::AgcAlgorithm *agc = dynamic_cast<RPiController::AgcAlgorithm *>(\n-\t\t\t\tcontroller_.GetAlgorithm(\"agc\"));\n+\t\t\t\tcontroller_.getAlgorithm(\"agc\"));\n \t\t\tif (!agc) {\n \t\t\t\tLOG(IPARPI, Warning)\n \t\t\t\t\t<< \"Could not set EXPOSURE_VALUE - no AGC algorithm\";\n@@ -817,14 +817,14 @@ void IPARPi::queueRequest(const ControlList &controls)\n \t\t\t * So convert to 2^EV\n \t\t\t */\n \t\t\tdouble ev = pow(2.0, ctrl.second.get<float>());\n-\t\t\tagc->SetEv(ev);\n+\t\t\tagc->setEv(ev);\n \t\t\tlibcameraMetadata_.set(controls::ExposureValue,\n \t\t\t\t\t       ctrl.second.get<float>());\n \t\t\tbreak;\n \t\t}\n \n \t\tcase controls::AWB_ENABLE: {\n-\t\t\tRPiController::Algorithm *awb = controller_.GetAlgorithm(\"awb\");\n+\t\t\tRPiController::Algorithm *awb = controller_.getAlgorithm(\"awb\");\n \t\t\tif (!awb) {\n \t\t\t\tLOG(IPARPI, Warning)\n \t\t\t\t\t<< \"Could not set AWB_ENABLE - no AWB algorithm\";\n@@ -832,9 +832,9 @@ void IPARPi::queueRequest(const ControlList &controls)\n \t\t\t}\n \n \t\t\tif (ctrl.second.get<bool>() == false)\n-\t\t\t\tawb->Pause();\n+\t\t\t\tawb->pause();\n \t\t\telse\n-\t\t\t\tawb->Resume();\n+\t\t\t\tawb->resume();\n \n \t\t\tlibcameraMetadata_.set(controls::AwbEnable,\n \t\t\t\t\t       ctrl.second.get<bool>());\n@@ -843,7 +843,7 @@ void IPARPi::queueRequest(const ControlList &controls)\n \n \t\tcase controls::AWB_MODE: {\n \t\t\tRPiController::AwbAlgorithm *awb = dynamic_cast<RPiController::AwbAlgorithm *>(\n-\t\t\t\tcontroller_.GetAlgorithm(\"awb\"));\n+\t\t\t\tcontroller_.getAlgorithm(\"awb\"));\n \t\t\tif (!awb) {\n \t\t\t\tLOG(IPARPI, Warning)\n \t\t\t\t\t<< \"Could not set AWB_MODE - no AWB algorithm\";\n@@ -852,7 +852,7 @@ void IPARPi::queueRequest(const ControlList &controls)\n \n \t\t\tint32_t idx = ctrl.second.get<int32_t>();\n \t\t\tif (AwbModeTable.count(idx)) {\n-\t\t\t\tawb->SetMode(AwbModeTable.at(idx));\n+\t\t\t\tawb->setMode(AwbModeTable.at(idx));\n \t\t\t\tlibcameraMetadata_.set(controls::AwbMode, idx);\n \t\t\t} else {\n \t\t\t\tLOG(IPARPI, Error) << \"AWB mode \" << idx\n@@ -864,14 +864,14 @@ void IPARPi::queueRequest(const ControlList &controls)\n \t\tcase controls::COLOUR_GAINS: {\n \t\t\tauto gains = ctrl.second.get<Span<const float>>();\n \t\t\tRPiController::AwbAlgorithm *awb = dynamic_cast<RPiController::AwbAlgorithm *>(\n-\t\t\t\tcontroller_.GetAlgorithm(\"awb\"));\n+\t\t\t\tcontroller_.getAlgorithm(\"awb\"));\n \t\t\tif (!awb) {\n \t\t\t\tLOG(IPARPI, Warning)\n \t\t\t\t\t<< \"Could not set COLOUR_GAINS - no AWB algorithm\";\n \t\t\t\tbreak;\n \t\t\t}\n \n-\t\t\tawb->SetManualGains(gains[0], gains[1]);\n+\t\t\tawb->setManualGains(gains[0], gains[1]);\n \t\t\tif (gains[0] != 0.0f && gains[1] != 0.0f)\n \t\t\t\t/* A gain of 0.0f will switch back to auto mode. */\n \t\t\t\tlibcameraMetadata_.set(controls::ColourGains,\n@@ -881,14 +881,14 @@ void IPARPi::queueRequest(const ControlList &controls)\n \n \t\tcase controls::BRIGHTNESS: {\n \t\t\tRPiController::ContrastAlgorithm *contrast = dynamic_cast<RPiController::ContrastAlgorithm *>(\n-\t\t\t\tcontroller_.GetAlgorithm(\"contrast\"));\n+\t\t\t\tcontroller_.getAlgorithm(\"contrast\"));\n \t\t\tif (!contrast) {\n \t\t\t\tLOG(IPARPI, Warning)\n \t\t\t\t\t<< \"Could not set BRIGHTNESS - no contrast algorithm\";\n \t\t\t\tbreak;\n \t\t\t}\n \n-\t\t\tcontrast->SetBrightness(ctrl.second.get<float>() * 65536);\n+\t\t\tcontrast->setBrightness(ctrl.second.get<float>() * 65536);\n \t\t\tlibcameraMetadata_.set(controls::Brightness,\n \t\t\t\t\t       ctrl.second.get<float>());\n \t\t\tbreak;\n@@ -896,14 +896,14 @@ void IPARPi::queueRequest(const ControlList &controls)\n \n \t\tcase controls::CONTRAST: {\n \t\t\tRPiController::ContrastAlgorithm *contrast = dynamic_cast<RPiController::ContrastAlgorithm *>(\n-\t\t\t\tcontroller_.GetAlgorithm(\"contrast\"));\n+\t\t\t\tcontroller_.getAlgorithm(\"contrast\"));\n \t\t\tif (!contrast) {\n \t\t\t\tLOG(IPARPI, Warning)\n \t\t\t\t\t<< \"Could not set CONTRAST - no contrast algorithm\";\n \t\t\t\tbreak;\n \t\t\t}\n \n-\t\t\tcontrast->SetContrast(ctrl.second.get<float>());\n+\t\t\tcontrast->setContrast(ctrl.second.get<float>());\n \t\t\tlibcameraMetadata_.set(controls::Contrast,\n \t\t\t\t\t       ctrl.second.get<float>());\n \t\t\tbreak;\n@@ -911,14 +911,14 @@ void IPARPi::queueRequest(const ControlList &controls)\n \n \t\tcase controls::SATURATION: {\n \t\t\tRPiController::CcmAlgorithm *ccm = dynamic_cast<RPiController::CcmAlgorithm *>(\n-\t\t\t\tcontroller_.GetAlgorithm(\"ccm\"));\n+\t\t\t\tcontroller_.getAlgorithm(\"ccm\"));\n \t\t\tif (!ccm) {\n \t\t\t\tLOG(IPARPI, Warning)\n \t\t\t\t\t<< \"Could not set SATURATION - no ccm algorithm\";\n \t\t\t\tbreak;\n \t\t\t}\n \n-\t\t\tccm->SetSaturation(ctrl.second.get<float>());\n+\t\t\tccm->setSaturation(ctrl.second.get<float>());\n \t\t\tlibcameraMetadata_.set(controls::Saturation,\n \t\t\t\t\t       ctrl.second.get<float>());\n \t\t\tbreak;\n@@ -926,14 +926,14 @@ void IPARPi::queueRequest(const ControlList &controls)\n \n \t\tcase controls::SHARPNESS: {\n \t\t\tRPiController::SharpenAlgorithm *sharpen = dynamic_cast<RPiController::SharpenAlgorithm *>(\n-\t\t\t\tcontroller_.GetAlgorithm(\"sharpen\"));\n+\t\t\t\tcontroller_.getAlgorithm(\"sharpen\"));\n \t\t\tif (!sharpen) {\n \t\t\t\tLOG(IPARPI, Warning)\n \t\t\t\t\t<< \"Could not set SHARPNESS - no sharpen algorithm\";\n \t\t\t\tbreak;\n \t\t\t}\n \n-\t\t\tsharpen->SetStrength(ctrl.second.get<float>());\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@@ -952,7 +952,7 @@ void IPARPi::queueRequest(const ControlList &controls)\n \n \t\tcase controls::NOISE_REDUCTION_MODE: {\n \t\t\tRPiController::DenoiseAlgorithm *sdn = dynamic_cast<RPiController::DenoiseAlgorithm *>(\n-\t\t\t\tcontroller_.GetAlgorithm(\"SDN\"));\n+\t\t\t\tcontroller_.getAlgorithm(\"SDN\"));\n \t\t\tif (!sdn) {\n \t\t\t\tLOG(IPARPI, Warning)\n \t\t\t\t\t<< \"Could not set NOISE_REDUCTION_MODE - no SDN algorithm\";\n@@ -962,7 +962,7 @@ void IPARPi::queueRequest(const ControlList &controls)\n \t\t\tint32_t idx = ctrl.second.get<int32_t>();\n \t\t\tauto mode = DenoiseModeTable.find(idx);\n \t\t\tif (mode != DenoiseModeTable.end()) {\n-\t\t\t\tsdn->SetMode(mode->second);\n+\t\t\t\tsdn->setMode(mode->second);\n \n \t\t\t\t/*\n \t\t\t\t * \\todo If the colour denoise is not going to run due to an\n@@ -1014,7 +1014,7 @@ void IPARPi::prepareISP(const ISPConfig &data)\n \t * This may overwrite the DeviceStatus using values from the sensor\n \t * metadata, and may also do additional custom processing.\n \t */\n-\thelper_->Prepare(embeddedBuffer, rpiMetadata_);\n+\thelper_->prepare(embeddedBuffer, rpiMetadata_);\n \n \t/* Done with embedded data now, return to pipeline handler asap. */\n \tif (data.embeddedBufferPresent)\n@@ -1030,7 +1030,7 @@ void IPARPi::prepareISP(const ISPConfig &data)\n \t\t * current frame, or any other bits of metadata that were added\n \t\t * in helper_->Prepare().\n \t\t */\n-\t\trpiMetadata_.Merge(lastMetadata);\n+\t\trpiMetadata_.merge(lastMetadata);\n \t\tprocessPending_ = false;\n \t\treturn;\n \t}\n@@ -1040,48 +1040,48 @@ void IPARPi::prepareISP(const ISPConfig &data)\n \n \tControlList ctrls(ispCtrls_);\n \n-\tcontroller_.Prepare(&rpiMetadata_);\n+\tcontroller_.prepare(&rpiMetadata_);\n \n \t/* Lock the metadata buffer to avoid constant locks/unlocks. */\n \tstd::unique_lock<RPiController::Metadata> lock(rpiMetadata_);\n \n-\tAwbStatus *awbStatus = rpiMetadata_.GetLocked<AwbStatus>(\"awb.status\");\n+\tAwbStatus *awbStatus = rpiMetadata_.getLocked<AwbStatus>(\"awb.status\");\n \tif (awbStatus)\n \t\tapplyAWB(awbStatus, ctrls);\n \n-\tCcmStatus *ccmStatus = rpiMetadata_.GetLocked<CcmStatus>(\"ccm.status\");\n+\tCcmStatus *ccmStatus = rpiMetadata_.getLocked<CcmStatus>(\"ccm.status\");\n \tif (ccmStatus)\n \t\tapplyCCM(ccmStatus, ctrls);\n \n-\tAgcStatus *dgStatus = rpiMetadata_.GetLocked<AgcStatus>(\"agc.status\");\n+\tAgcStatus *dgStatus = rpiMetadata_.getLocked<AgcStatus>(\"agc.status\");\n \tif (dgStatus)\n \t\tapplyDG(dgStatus, ctrls);\n \n-\tAlscStatus *lsStatus = rpiMetadata_.GetLocked<AlscStatus>(\"alsc.status\");\n+\tAlscStatus *lsStatus = rpiMetadata_.getLocked<AlscStatus>(\"alsc.status\");\n \tif (lsStatus)\n \t\tapplyLS(lsStatus, ctrls);\n \n-\tContrastStatus *contrastStatus = rpiMetadata_.GetLocked<ContrastStatus>(\"contrast.status\");\n+\tContrastStatus *contrastStatus = rpiMetadata_.getLocked<ContrastStatus>(\"contrast.status\");\n \tif (contrastStatus)\n \t\tapplyGamma(contrastStatus, ctrls);\n \n-\tBlackLevelStatus *blackLevelStatus = rpiMetadata_.GetLocked<BlackLevelStatus>(\"black_level.status\");\n+\tBlackLevelStatus *blackLevelStatus = rpiMetadata_.getLocked<BlackLevelStatus>(\"black_level.status\");\n \tif (blackLevelStatus)\n \t\tapplyBlackLevel(blackLevelStatus, ctrls);\n \n-\tGeqStatus *geqStatus = rpiMetadata_.GetLocked<GeqStatus>(\"geq.status\");\n+\tGeqStatus *geqStatus = rpiMetadata_.getLocked<GeqStatus>(\"geq.status\");\n \tif (geqStatus)\n \t\tapplyGEQ(geqStatus, ctrls);\n \n-\tDenoiseStatus *denoiseStatus = rpiMetadata_.GetLocked<DenoiseStatus>(\"denoise.status\");\n+\tDenoiseStatus *denoiseStatus = rpiMetadata_.getLocked<DenoiseStatus>(\"denoise.status\");\n \tif (denoiseStatus)\n \t\tapplyDenoise(denoiseStatus, ctrls);\n \n-\tSharpenStatus *sharpenStatus = rpiMetadata_.GetLocked<SharpenStatus>(\"sharpen.status\");\n+\tSharpenStatus *sharpenStatus = rpiMetadata_.getLocked<SharpenStatus>(\"sharpen.status\");\n \tif (sharpenStatus)\n \t\tapplySharpen(sharpenStatus, ctrls);\n \n-\tDpcStatus *dpcStatus = rpiMetadata_.GetLocked<DpcStatus>(\"dpc.status\");\n+\tDpcStatus *dpcStatus = rpiMetadata_.getLocked<DpcStatus>(\"dpc.status\");\n \tif (dpcStatus)\n \t\tapplyDPC(dpcStatus, ctrls);\n \n@@ -1097,13 +1097,13 @@ void IPARPi::fillDeviceStatus(const ControlList &sensorControls)\n \tint32_t gainCode = sensorControls.get(V4L2_CID_ANALOGUE_GAIN).get<int32_t>();\n \tint32_t vblank = sensorControls.get(V4L2_CID_VBLANK).get<int32_t>();\n \n-\tdeviceStatus.shutter_speed = helper_->Exposure(exposureLines);\n-\tdeviceStatus.analogue_gain = helper_->Gain(gainCode);\n-\tdeviceStatus.frame_length = mode_.height + vblank;\n+\tdeviceStatus.shutterSpeed = helper_->exposure(exposureLines);\n+\tdeviceStatus.analogueGain = helper_->gain(gainCode);\n+\tdeviceStatus.frameLength = mode_.height + vblank;\n \n \tLOG(IPARPI, Debug) << \"Metadata - \" << deviceStatus;\n \n-\trpiMetadata_.Set(\"device.status\", deviceStatus);\n+\trpiMetadata_.set(\"device.status\", deviceStatus);\n }\n \n void IPARPi::processStats(unsigned int bufferId)\n@@ -1117,11 +1117,11 @@ void IPARPi::processStats(unsigned int bufferId)\n \tSpan<uint8_t> mem = it->second.planes()[0];\n \tbcm2835_isp_stats *stats = reinterpret_cast<bcm2835_isp_stats *>(mem.data());\n \tRPiController::StatisticsPtr statistics = std::make_shared<bcm2835_isp_stats>(*stats);\n-\thelper_->Process(statistics, rpiMetadata_);\n-\tcontroller_.Process(statistics, &rpiMetadata_);\n+\thelper_->process(statistics, rpiMetadata_);\n+\tcontroller_.process(statistics, &rpiMetadata_);\n \n \tstruct AgcStatus agcStatus;\n-\tif (rpiMetadata_.Get(\"agc.status\", agcStatus) == 0) {\n+\tif (rpiMetadata_.get(\"agc.status\", agcStatus) == 0) {\n \t\tControlList ctrls(sensorCtrls_);\n \t\tapplyAGC(&agcStatus, ctrls);\n \n@@ -1131,19 +1131,19 @@ void IPARPi::processStats(unsigned int bufferId)\n \n void IPARPi::applyAWB(const struct AwbStatus *awbStatus, ControlList &ctrls)\n {\n-\tLOG(IPARPI, Debug) << \"Applying WB R: \" << awbStatus->gain_r << \" B: \"\n-\t\t\t   << awbStatus->gain_b;\n+\tLOG(IPARPI, Debug) << \"Applying WB R: \" << awbStatus->gainR << \" B: \"\n+\t\t\t   << awbStatus->gainB;\n \n \tctrls.set(V4L2_CID_RED_BALANCE,\n-\t\t  static_cast<int32_t>(awbStatus->gain_r * 1000));\n+\t\t  static_cast<int32_t>(awbStatus->gainR * 1000));\n \tctrls.set(V4L2_CID_BLUE_BALANCE,\n-\t\t  static_cast<int32_t>(awbStatus->gain_b * 1000));\n+\t\t  static_cast<int32_t>(awbStatus->gainB * 1000));\n }\n \n void IPARPi::applyFrameDurations(Duration minFrameDuration, Duration maxFrameDuration)\n {\n-\tconst Duration minSensorFrameDuration = mode_.min_frame_length * mode_.line_length;\n-\tconst Duration maxSensorFrameDuration = mode_.max_frame_length * mode_.line_length;\n+\tconst Duration minSensorFrameDuration = mode_.minFrameLength * mode_.lineLength;\n+\tconst Duration maxSensorFrameDuration = mode_.maxFrameLength * mode_.lineLength;\n \n \t/*\n \t * This will only be applied once AGC recalculations occur.\n@@ -1164,20 +1164,20 @@ void IPARPi::applyFrameDurations(Duration minFrameDuration, Duration maxFrameDur\n \n \t/*\n \t * Calculate the maximum exposure time possible for the AGC to use.\n-\t * GetVBlanking() will update maxShutter with the largest exposure\n+\t * getVBlanking() will update maxShutter with the largest exposure\n \t * value possible.\n \t */\n \tDuration maxShutter = Duration::max();\n-\thelper_->GetVBlanking(maxShutter, minFrameDuration_, maxFrameDuration_);\n+\thelper_->getVBlanking(maxShutter, minFrameDuration_, maxFrameDuration_);\n \n \tRPiController::AgcAlgorithm *agc = dynamic_cast<RPiController::AgcAlgorithm *>(\n-\t\tcontroller_.GetAlgorithm(\"agc\"));\n-\tagc->SetMaxShutter(maxShutter);\n+\t\tcontroller_.getAlgorithm(\"agc\"));\n+\tagc->setMaxShutter(maxShutter);\n }\n \n void IPARPi::applyAGC(const struct AgcStatus *agcStatus, ControlList &ctrls)\n {\n-\tint32_t gainCode = helper_->GainCode(agcStatus->analogue_gain);\n+\tint32_t gainCode = helper_->gainCode(agcStatus->analogueGain);\n \n \t/*\n \t * Ensure anything larger than the max gain code will not be passed to\n@@ -1186,15 +1186,15 @@ void IPARPi::applyAGC(const struct AgcStatus *agcStatus, ControlList &ctrls)\n \t */\n \tgainCode = std::min<int32_t>(gainCode, maxSensorGainCode_);\n \n-\t/* GetVBlanking might clip exposure time to the fps limits. */\n-\tDuration exposure = agcStatus->shutter_time;\n-\tint32_t vblanking = helper_->GetVBlanking(exposure, minFrameDuration_, maxFrameDuration_);\n-\tint32_t exposureLines = helper_->ExposureLines(exposure);\n+\t/* getVBlanking might clip exposure time to the fps limits. */\n+\tDuration exposure = agcStatus->shutterTime;\n+\tint32_t vblanking = helper_->getVBlanking(exposure, minFrameDuration_, maxFrameDuration_);\n+\tint32_t exposureLines = helper_->exposureLines(exposure);\n \n \tLOG(IPARPI, Debug) << \"Applying AGC Exposure: \" << exposure\n \t\t\t   << \" (Shutter lines: \" << exposureLines << \", AGC requested \"\n-\t\t\t   << agcStatus->shutter_time << \") Gain: \"\n-\t\t\t   << agcStatus->analogue_gain << \" (Gain Code: \"\n+\t\t\t   << agcStatus->shutterTime << \") Gain: \"\n+\t\t\t   << agcStatus->analogueGain << \" (Gain Code: \"\n \t\t\t   << gainCode << \")\";\n \n \t/*\n@@ -1210,7 +1210,7 @@ void IPARPi::applyAGC(const struct AgcStatus *agcStatus, ControlList &ctrls)\n void IPARPi::applyDG(const struct AgcStatus *dgStatus, ControlList &ctrls)\n {\n \tctrls.set(V4L2_CID_DIGITAL_GAIN,\n-\t\t  static_cast<int32_t>(dgStatus->digital_gain * 1000));\n+\t\t  static_cast<int32_t>(dgStatus->digitalGain * 1000));\n }\n \n void IPARPi::applyCCM(const struct CcmStatus *ccmStatus, ControlList &ctrls)\n@@ -1250,9 +1250,9 @@ void IPARPi::applyBlackLevel(const struct BlackLevelStatus *blackLevelStatus, Co\n \tbcm2835_isp_black_level blackLevel;\n \n \tblackLevel.enabled = 1;\n-\tblackLevel.black_level_r = blackLevelStatus->black_level_r;\n-\tblackLevel.black_level_g = blackLevelStatus->black_level_g;\n-\tblackLevel.black_level_b = blackLevelStatus->black_level_b;\n+\tblackLevel.black_level_r = blackLevelStatus->blackLevelR;\n+\tblackLevel.black_level_g = blackLevelStatus->blackLevelG;\n+\tblackLevel.black_level_b = blackLevelStatus->blackLevelB;\n \n \tControlValue c(Span<const uint8_t>{ reinterpret_cast<uint8_t *>(&blackLevel),\n \t\t\t\t\t    sizeof(blackLevel) });\n@@ -1281,8 +1281,8 @@ void IPARPi::applyDenoise(const struct DenoiseStatus *denoiseStatus, ControlList\n \tDenoiseMode mode = static_cast<DenoiseMode>(denoiseStatus->mode);\n \n \tdenoise.enabled = mode != DenoiseMode::Off;\n-\tdenoise.constant = denoiseStatus->noise_constant;\n-\tdenoise.slope.num = 1000 * denoiseStatus->noise_slope;\n+\tdenoise.constant = denoiseStatus->noiseConstant;\n+\tdenoise.slope.num = 1000 * denoiseStatus->noiseSlope;\n \tdenoise.slope.den = 1000;\n \tdenoise.strength.num = 1000 * denoiseStatus->strength;\n \tdenoise.strength.den = 1000;\n",
    "prefixes": [
        "libcamera-devel",
        "v3",
        "1/8"
    ]
}