Show a patch.

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

{
    "id": 16783,
    "url": "https://patchwork.libcamera.org/api/patches/16783/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/16783/",
    "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": "<20220726124549.1646-11-naush@raspberrypi.com>",
    "date": "2022-07-26T12:45:42",
    "name": "[libcamera-devel,10/17] DNI: ipa: raspberrypi: Code refactoring to match style guidelines",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "f21ee84193051da606e71c9c3614300328dbad70",
    "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/16783/mbox/",
    "series": [
        {
            "id": 3325,
            "url": "https://patchwork.libcamera.org/api/series/3325/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3325",
            "date": "2022-07-26T12:45:32",
            "name": "Raspberry Pi IPA code refactor",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3325/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/16783/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/16783/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 46F2FC3275\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 26 Jul 2022 12:46:13 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 001DE63317;\n\tTue, 26 Jul 2022 14:46:12 +0200 (CEST)",
            "from mail-wr1-x433.google.com (mail-wr1-x433.google.com\n\t[IPv6:2a00:1450:4864:20::433])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2414263311\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Jul 2022 14:46:07 +0200 (CEST)",
            "by mail-wr1-x433.google.com with SMTP id d8so19898152wrp.6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Jul 2022 05:46:07 -0700 (PDT)",
            "from naush-laptop.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\ty17-20020adfd091000000b0021e87ec980bsm5948460wrh.84.2022.07.26.05.46.05\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 26 Jul 2022 05:46:05 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1658839573;\n\tbh=M6ZE3o2fghoWtS4ji2W8K8UQeneQpm7E86273fbZMWM=;\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=29rk8gCUpxeW4X+CpFAYdRcadXGGvQYV4vCLieZLuaFqsSMHof97H8TCLSZMu5zYI\n\tjx4O3Ag3dCidcYrIIQRGizq4P4D9Y5g2G048VEZt0JT968QGUhEQrz9YV3cniF3ZdO\n\t+HQ/qaItghbJVIY3tLTX7bJv5zJjn/TyoOwwvrgVwfb51bdIRERvf+GZ47UjDWd2K2\n\tyT5PpdS6ku9CYn/p4KGzGG9GvLHZiPdlRNcfAfapo6OdI1p8HEOtigK4lEYfTv/Eut\n\tCnjI9nmgP2LoKr7hpzg6MNeIDgySAhGYI3aIgeEsNmwR0fp/VahHYj4RxlvqoCYnbC\n\topkeG41ffCc9g==",
            "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=lJV82aXpXJtQQMSUEO7LLuOfWPbkgSr4e+cMhnX5w9s=;\n\tb=mLwFFv6gtsZAvycScGx8ZwQSR05r320PD+xNjcE2fidRhne7wHHjOiftfq/EFHWJiH\n\trG6gDaX+1k8Rr9A/nVF14VWpcfZBehEw4hWHmQKdqO5JcbkF7UicFeW7banAs8iRQmGn\n\t9Z7TsAOMEN5tVHYBjAxIzpsfEFyb5WyA0KkuSwUbDTzZTybhpRmtC9VxsQwKu+FilUzj\n\tDrv5s577eLYyqnn2VGJ9XtuUPTuti7Y9KSuXIMVf7HVmj3G4QaC2nxi7H6OPFW6LSpkC\n\tovqaRspdVtiu8JgqZ1cQ2V8+FQiYz1R6jYob30ZP5ipZ2CSjJPTXLm9Ctv9p30bm38fy\n\tHdoA=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"mLwFFv6g\"; 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=lJV82aXpXJtQQMSUEO7LLuOfWPbkgSr4e+cMhnX5w9s=;\n\tb=16K4ICkJsvUCyyHUvLZqoThiDtPOKR0EqHOebCIPo1IEBXCyWo0TSQek85LOoPWxzj\n\tylM/g/+nNULVnm4XyR+ktKGo3vHMQgwfRX73EiYE/N2rv3FuQoPJFgXO85EiYnVSCzlV\n\t9+iN61+XkZ8TheCE25w2a9db//2cuLmDO12zU80630cAdUVyUraE7nxJqY25bly07sCZ\n\tC9wTTsy3fpnEoSWtOqIJ5VuUC9Go0BxZHjVXTHweT/unTlpNxU/oAAzw6Rx9L2cgvKbR\n\tXaz/AftEsdRPDX1t8BflCmeoaTSTGP4rPUfoJddZpk5tifStrDoMdMQgtrHCCWqm05RP\n\tHrVw==",
        "X-Gm-Message-State": "AJIora9uLew0CJIIMWzWsUkJ75GYSu/j1IawKesrmYO4ycnqtqyJwM1s\n\tGnMLQYUltuTNBsKpagGpfy2rQjLH5nI2Eg==",
        "X-Google-Smtp-Source": "AGRyM1vBKuYvS2eNQQ01eQ75wOxrcUGIx8tnnl0Ds2G9cNGAS2v3LAMK3UpAbEMBFdWlz/zbxsoZug==",
        "X-Received": "by 2002:a05:6000:38c:b0:21e:b38d:6bad with SMTP id\n\tu12-20020a056000038c00b0021eb38d6badmr1078426wrf.130.1658839566452; \n\tTue, 26 Jul 2022 05:46:06 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue, 26 Jul 2022 13:45:42 +0100",
        "Message-Id": "<20220726124549.1646-11-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220726124549.1646-1-naush@raspberrypi.com>",
        "References": "<20220726124549.1646-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 10/17] DNI: ipa: raspberrypi: Code\n\trefactoring to match style guidelines",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "<libcamera-devel.lists.libcamera.org>",
        "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>",
        "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>",
        "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>",
        "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>",
        "From": "Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Naushir Patuck <naush@raspberrypi.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Refactor the source files src/ipa/raspberrypi/controller/rps/[n|s]* to match the\nrecommended formatting guidelines for the libcamera project. The vast majority\nof changes in this commit comprise of switching from snake_case to CamelCase,\nand starting class member functions with a lower case character.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\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 6 files changed, 78 insertions(+), 76 deletions(-)",
    "diff": "diff --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\n",
    "prefixes": [
        "libcamera-devel",
        "10/17"
    ]
}