Show a patch.

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

{
    "id": 16759,
    "url": "https://patchwork.libcamera.org/api/patches/16759/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/16759/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20220725134639.4572-7-naush@raspberrypi.com>",
    "date": "2022-07-25T13:46:30",
    "name": "[libcamera-devel,06/15] DNI: ipa: raspberrypi: Code refactoring to match style guidelines",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "3870ffa38c3fe0cf80724a4bf9e153db4f960f35",
    "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/16759/mbox/",
    "series": [
        {
            "id": 3323,
            "url": "https://patchwork.libcamera.org/api/series/3323/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3323",
            "date": "2022-07-25T13:46:24",
            "name": "Raspberry Pi IPA code refactor",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3323/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/16759/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/16759/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 8B85AC3275\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 25 Jul 2022 13:46:55 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1A92A6332B;\n\tMon, 25 Jul 2022 15:46:55 +0200 (CEST)",
            "from mail-wr1-x431.google.com (mail-wr1-x431.google.com\n\t[IPv6:2a00:1450:4864:20::431])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CC5B96331B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 25 Jul 2022 15:46:48 +0200 (CEST)",
            "by mail-wr1-x431.google.com with SMTP id l15so11988001wro.11\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 25 Jul 2022 06:46:48 -0700 (PDT)",
            "from naush-laptop.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\ta20-20020a05600c225400b003a32167b8d4sm18054320wmm.13.2022.07.25.06.46.47\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 25 Jul 2022 06:46:47 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1658756815;\n\tbh=/oA+UY64Sa9X7XAWhKJ7I25jxVmbsbpb107r6ZDRD3k=;\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=CChl/EdZqKYmfCYZR4FKoT/SvFiavSHAiqVtQ7SQh2GMzbpcLJsAMM3rahanGuHsD\n\t580r0IXcBuv9f4jifmf2wuiWSuwWu9S/t0NmvY5FoiIAzcTAAi1yw/olJA4eoXuWDz\n\ts76+17bzUZHTiuGNXTC6ka0HPzVspKVdDeXP5RAtA+7l2pWFQ4EYUI41B0EnVC/TAy\n\tGe1O63h3WgJKuOvBfRf70XbTblYEqY0WiqMiRG7s8KzvcPN6SsS31cr//rDR2ODhZ5\n\t8wzMdPekwuxkF5FfawFUbi4fX8jCe69yGaY6/8I5nBj6dGm2eVOoFHCoeQYBKHtAtV\n\tlhSCEXv+wAmqA==",
            "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=DB7D9SSxcToRx5QeYvvjUf+X9BM1Rn5YTfNtB3cDrDM=;\n\tb=UOEMysRwcG+6SQLKa3f1DJiGh9PcfmS4rvr63c6gxBG5c0j6A9QR4fqRdfQjlpaFb4\n\tCqh5IkAjNh8RW51vFJBRnWMaFmbVNHUv7EyEq4ruExYtBz3rM2eWAFeviC6R6KrgrN8f\n\tWlBJqSeQLT+JAwF5V7tL1Pf2u4alp7EqvM8eEXkMAizAr38TkaHSPVmt+MrnkI2ia/4R\n\t8Ua91kmNAaV7mce3YnJ1GRlgqNB3PSi4A2hkGAm/Bd0ulZ2fGk21rcvvj5mXrEwUPetH\n\tK7Gb8RDYJVM7fvyreu2Rd4yoWa5XO/NtWBrdJ3xsm1KSlb1rq+L57YYtY7/hBEfeVNL7\n\titLg=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"UOEMysRw\"; 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=DB7D9SSxcToRx5QeYvvjUf+X9BM1Rn5YTfNtB3cDrDM=;\n\tb=h/vLpxn+OUoLhGDGrYff+ZTEyK9l9oYemv4o5XX91JcRtv7NE99k1a7A8cZeFNsqd3\n\tZQE6gnyG9gS60anvPkTAt6fdaJqtGyRrlTWx9qeM9cOuXILP0JpOXyy6GG6d14JQoFsg\n\tJ8pTwlkTzLCNY1+TKYgSUZ493j/n50qqDKM69lITgTJXy0QdTtbsJ+kTAo8tKgu0xpuK\n\tZO1w2HAa3Eo+3tqJAeOuZwIhjQDEukJoB5ybZ2QZzelyray0PFSkss7d3LhBWo0zl8D9\n\tMyISdsxDyr/IsoExUDzWkDm/jirB7wy8vGEGQcM6Av+RSLkRdr+hGVxsyHDXd6ABNFe4\n\tkHtg==",
        "X-Gm-Message-State": "AJIora+s+pvvhumPCkJsjGatILAUQZDAIQNN4jhDHrpm1jesQUCPzpzE\n\tC3N+IoCG7eOZP3UdpBy9APzxlW5VYpSEAw==",
        "X-Google-Smtp-Source": "AGRyM1t4zSOISeK5xq99wFOdxXZJvGaErQEBoSAZPkblSFHX+FHnqW7Q90+iKJ7QCuj2eVvDruAPsw==",
        "X-Received": "by 2002:a05:6000:15ce:b0:21e:80b4:afda with SMTP id\n\ty14-20020a05600015ce00b0021e80b4afdamr5323627wry.85.1658756807824; \n\tMon, 25 Jul 2022 06:46:47 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon, 25 Jul 2022 14:46:30 +0100",
        "Message-Id": "<20220725134639.4572-7-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220725134639.4572-1-naush@raspberrypi.com>",
        "References": "<20220725134639.4572-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 06/15] DNI: ipa: raspberrypi: Code\n\trefactoring to match style guidelines",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "<libcamera-devel.lists.libcamera.org>",
        "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>",
        "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>",
        "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>",
        "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>",
        "From": "Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Naushir Patuck <naush@raspberrypi.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Refactor the remaining files under src/ipa/raspberrypi/controller/* to match the\nrecommended formatting guidelines for the libcamera project. The vast majority\nof changes in this commit comprise of switching from snake_case to CamelCase,\nand starting class member functions with a lower case character.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\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/pwl.cpp        | 130 +++++++++---------\n src/ipa/raspberrypi/controller/pwl.hpp        |  48 +++----\n 6 files changed, 121 insertions(+), 119 deletions(-)",
    "diff": "diff --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/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;\n",
    "prefixes": [
        "libcamera-devel",
        "06/15"
    ]
}