Show a patch.

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

{
    "id": 19958,
    "url": "https://patchwork.libcamera.org/api/patches/19958/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/19958/",
    "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": "<20240426073612.1230283-4-paul.elder@ideasonboard.com>",
    "date": "2024-04-26T07:36:11",
    "name": "[v2,3/4] ipa: libipa: pwl: Clean up Pwl class to match libcamera",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "cefe4461a00f0f25f8eb0e1ddf3bce669fab50ff",
    "submitter": {
        "id": 17,
        "url": "https://patchwork.libcamera.org/api/people/17/?format=api",
        "name": "Paul Elder",
        "email": "paul.elder@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/19958/mbox/",
    "series": [
        {
            "id": 4275,
            "url": "https://patchwork.libcamera.org/api/series/4275/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4275",
            "date": "2024-04-26T07:36:08",
            "name": "ipa: Move Pwl from Raspberry Pi to libipa",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/4275/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/19958/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/19958/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 B3B8AC32A2\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 26 Apr 2024 07:36:33 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2578763412;\n\tFri, 26 Apr 2024 09:36:33 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E794B633F8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 26 Apr 2024 09:36:29 +0200 (CEST)",
            "from pyrite.hamster-moth.ts.net (h175-177-049-156.catv02.itscom.jp\n\t[175.177.49.156])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A3331EA5;\n\tFri, 26 Apr 2024 09:35:35 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"djkZArhF\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1714116936;\n\tbh=rL/G7sKgGP3bCGilX2n0vq79rz5sRhgemetlKEXQuCA=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=djkZArhFb//3FbSym2TrpExWirdUht278X81uNovcxoqRgVPGVKzpPyauyF8/+cMX\n\tJ7Uci9QmU/BuxgJofbiJzyWBtmOXcpoVZ23MKj68/B6vr2s5zWodvibanTwkoQ6Z+6\n\t0+yAbkf6kTlhqYxMg7Ff/p/bFIgT7vAm5gfj29w8=",
        "From": "Paul Elder <paul.elder@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Paul Elder <paul.elder@ideasonboard.com>",
        "Subject": "[PATCH v2 3/4] ipa: libipa: pwl: Clean up Pwl class to match\n\tlibcamera",
        "Date": "Fri, 26 Apr 2024 16:36:11 +0900",
        "Message-Id": "<20240426073612.1230283-4-paul.elder@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.39.2",
        "In-Reply-To": "<20240426073612.1230283-1-paul.elder@ideasonboard.com>",
        "References": "<20240426073612.1230283-1-paul.elder@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Clean up the Pwl class copied from the Raspberry Pi IPA to align it more\nwith the libcamera style.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n\n---\nChanges in v2:\n- s/FPoint/PointF/g\n- improve documentation\n- s/matchDomain/extendDomain/\n---\n src/ipa/libipa/pwl.cpp | 156 ++++++++++++++++++++++++++++++++++-------\n src/ipa/libipa/pwl.h   | 117 ++++++++++++-------------------\n 2 files changed, 176 insertions(+), 97 deletions(-)",
    "diff": "diff --git a/src/ipa/libipa/pwl.cpp b/src/ipa/libipa/pwl.cpp\nindex 09f5d65c..4faf9c31 100644\n--- a/src/ipa/libipa/pwl.cpp\n+++ b/src/ipa/libipa/pwl.cpp\n@@ -1,17 +1,45 @@\n /* SPDX-License-Identifier: BSD-2-Clause */\n /*\n  * Copyright (C) 2019, Raspberry Pi Ltd\n+ * Copyright (C) 2024, Ideas on Board Oy\n  *\n  * pwl.cpp - piecewise linear functions\n  */\n \n+#include \"pwl.h\"\n+\n #include <cassert>\n #include <cmath>\n+#include <sstream>\n #include <stdexcept>\n \n-#include \"pwl.h\"\n+#include <libcamera/geometry.h>\n+\n+namespace libcamera {\n+\n+namespace ipa {\n+\n+/*\n+ * \\enum Pwl::PerpType\n+ * \\brief Type of perpendicular found when inverting a piecewise linear function\n+ *\n+ * \\var None\n+ * \\brief no perpendicular found\n+ *\n+ * \\var Start\n+ * \\brief start of Pwl is closest point\n+ *\n+ * \\var End\n+ * \\brief end of Pwl is closest point\n+ *\n+ * \\var Vertex\n+ * \\brief vertex of Pwl is closest point\n+ *\n+ * \\var Perpendicular\n+ * \\brief true perpendicular found\n+ */\n \n-int Pwl::read(const libcamera::YamlObject &params)\n+int Pwl::readYaml(const libcamera::YamlObject &params)\n {\n \tif (!params.size() || params.size() % 2)\n \t\treturn -EINVAL;\n@@ -29,7 +57,7 @@ int Pwl::read(const libcamera::YamlObject &params)\n \t\tif (!y)\n \t\t\treturn -EINVAL;\n \n-\t\tpoints_.push_back(Point(*x, *y));\n+\t\tpoints_.push_back(PointF(*x, *y));\n \t}\n \n \treturn 0;\n@@ -38,13 +66,13 @@ int Pwl::read(const libcamera::YamlObject &params)\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+\t\tpoints_.push_back(PointF(x, y));\n }\n \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+\t\tpoints_.insert(points_.begin(), PointF(x, y));\n }\n \n Pwl::Interval Pwl::domain() const\n@@ -65,6 +93,19 @@ bool Pwl::empty() const\n \treturn points_.empty();\n }\n \n+/*\n+ * \\brief Evaluate the piecewise linear function\n+ * \\param[in] x The x value to input into the function\n+ * \\param[inout] spanPtr Initial guess for span\n+ * \\param[in] updateSpan Set to true to update spanPtr\n+ *\n+ * Evaluate Pwl, optionally supplying an initial guess for the\n+ * \"span\". The \"span\" may be optionally be updated.  If you want to know\n+ * the \"span\" value but don't have an initial guess you can set it to\n+ * -1.\n+ *\n+ *  \\return The result of evaluating the piecewise linear function at position \\a x\n+ */\n double Pwl::eval(double x, int *spanPtr, bool updateSpan) const\n {\n \tint span = findSpan(x, spanPtr && *spanPtr != -1 ? *spanPtr : points_.size() / 2 - 1);\n@@ -94,16 +135,29 @@ int Pwl::findSpan(double x, int span) const\n \treturn span;\n }\n \n-Pwl::PerpType Pwl::invert(Point const &xy, Point &perp, int &span,\n+/*\n+ * \\brief Find perpendicular closest to a given point\n+ * \\param[in] xy Point to find the perpendicular to\n+ * \\param[out] perp The found perpendicular\n+ * \\param[inout] span The span+1 to start searching from\n+ * \\param[in] eps Epsilon\n+ *\n+ * Find perpendicular closest to \\a xy, starting from \\a span+1 so you can call\n+ * it repeatedly to check for multiple closest points (set span to -1 on the\n+ * first call). Also returns \"pseudo\" perpendiculars; see PerpType enum.\n+ *\n+ * \\return Type of perpendicular found\n+ */\n+Pwl::PerpType Pwl::invert(PointF const &xy, PointF &perp, int &span,\n \t\t\t  const double eps) const\n {\n \tassert(span >= -1);\n \tbool prevOffEnd = false;\n \tfor (span = span + 1; span < (int)points_.size() - 1; span++) {\n-\t\tPoint spanVec = points_[span + 1] - points_[span];\n+\t\tPointF 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\tif (t < -eps) {\n+\t\t\t/* off the start of this span */\n \t\t\tif (span == 0) {\n \t\t\t\tperp = points_[span];\n \t\t\t\treturn PerpType::Start;\n@@ -111,15 +165,15 @@ Pwl::PerpType Pwl::invert(Point const &xy, Point &perp, int &span,\n \t\t\t\tperp = points_[span];\n \t\t\t\treturn PerpType::Vertex;\n \t\t\t}\n-\t\t} else if (t > 1 + eps) /* off the end of this span */\n-\t\t{\n+\t\t} else if (t > 1 + eps) {\n+\t\t\t/* off the end of this span */\n \t\t\tif (span == (int)points_.size() - 2) {\n \t\t\t\tperp = points_[span + 1];\n \t\t\t\treturn PerpType::End;\n \t\t\t}\n \t\t\tprevOffEnd = true;\n-\t\t} else /* a true perpendicular */\n-\t\t{\n+\t\t} else {\n+\t\t\t/* a true perpendicular */\n \t\t\tperp = points_[span] + spanVec * t;\n \t\t\treturn PerpType::Perpendicular;\n \t\t}\n@@ -127,25 +181,36 @@ Pwl::PerpType Pwl::invert(Point const &xy, Point &perp, int &span,\n \treturn PerpType::None;\n }\n \n+/*\n+ * \\brief Compute the inverse function\n+ * \\param[out] trueInverse True if the result is a proper/true inverse\n+ * \\param[in] eps Epsilon (optional)\n+ *\n+ * Indicate if it is a proper (true) inverse, or only a best effort (e.g.\n+ * input was non-monotonic).\n+ *\n+ * \\return The inverse piecewise linear function\n+ */\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+\tfor (PointF const &p : points_) {\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} else 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} else if (p.y > inverse.points_.back().x) {\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\tprepended = true;\n-\t\t} else\n+\t\t} else {\n \t\t\tneither = true;\n+\t\t}\n \t}\n \n \t/*\n@@ -159,18 +224,27 @@ Pwl Pwl::inverse(bool *trueInverse, const double eps) const\n \treturn inverse;\n }\n \n+/*\n+ * \\brief Compose two piecewise linear functions together\n+ * \\param[in] other The \"other\" piecewise linear function\n+ * \\param[in] eps Epsilon (optiona)\n+ *\n+ * The \"this\" function is done first, and \"other\" after.\n+ *\n+ * \\return The composed piecewise linear function\n+ */\n Pwl Pwl::compose(Pwl const &other, const double eps) const\n {\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+\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 (std::abs(dy) > 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    points_[thisSpan + 1].y >= other.points_[otherSpan + 1].x + eps) {\n \t\t\t/*\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@@ -204,18 +278,24 @@ Pwl Pwl::compose(Pwl const &other, const double eps) const\n \treturn result;\n }\n \n+/* \\brief Apply function to (x,y) values at every control point. */\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+/*\n+ * \\brief Apply function to (x, y0, y1) values wherever either Pwl has a\n+ * control point.\n+ */\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+\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@@ -230,6 +310,12 @@ void Pwl::map2(Pwl const &pwl0, Pwl const &pwl1,\n \t}\n }\n \n+/*\n+ * \\brief Combine two Pwls\n+ *\n+ * Create a new Pwl where the y values are given by running f wherever either\n+ * has a knot.\n+ */\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@@ -241,7 +327,19 @@ Pwl Pwl::combine(Pwl const &pwl0, Pwl const &pwl1,\n \treturn result;\n }\n \n-void Pwl::matchDomain(Interval const &domain, bool clip, const double eps)\n+/*\n+ * \\brief Extend the domain of the piecewise linear function\n+ * \\param[in] domain The domain to extend to\n+ * \\param[in] clip True to keep the existing edge y values, false to extrapolate\n+ * \\param[in] eps Epsilon\n+ *\n+ * Extend the domain of the piecewise linear function to match \\a domain. If \\a\n+ * clip is set to true then the y values of the new edges will be the same as\n+ * the existing y values of the edge points of the pwl. If false, then the y\n+ * values will be extrapolated linearly from the existing edge points of the\n+ * pwl.\n+ */\n+void Pwl::extendDomain(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@@ -258,10 +356,16 @@ Pwl &Pwl::operator*=(double d)\n \treturn *this;\n }\n \n-void Pwl::debug(FILE *fp) const\n+std::string Pwl::toString() const\n {\n-\tfprintf(fp, \"Pwl {\\n\");\n+\tstd::stringstream ss;\n+\tss << \"Pwl { \";\n \tfor (auto &p : points_)\n-\t\tfprintf(fp, \"\\t(%g, %g)\\n\", p.x, p.y);\n-\tfprintf(fp, \"}\\n\");\n+\t\tss << \"(\" << p.x << \", \" << p.y << \") \";\n+\tss << \"}\";\n+\treturn ss.str();\n }\n+\n+} /* namespace ipa */\n+\n+} /* namespace libcamera */\ndiff --git a/src/ipa/libipa/pwl.h b/src/ipa/libipa/pwl.h\nindex 7a6a6452..8c8abb51 100644\n--- a/src/ipa/libipa/pwl.h\n+++ b/src/ipa/libipa/pwl.h\n@@ -8,116 +8,91 @@\n \n #include <functional>\n #include <math.h>\n+#include <string>\n #include <vector>\n \n+#include <libcamera/geometry.h>\n+\n #include \"libcamera/internal/yaml_parser.h\"\n \n+namespace libcamera {\n+\n+namespace ipa {\n+\n class Pwl\n {\n public:\n+\tenum class PerpType {\n+\t\tNone,\n+\t\tStart,\n+\t\tEnd,\n+\t\tVertex,\n+\t\tPerpendicular,\n+\t};\n+\n \tstruct Interval {\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\t\t: start(_start), end(_end) {}\n+\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+\n+\t\tdouble clamp(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+\n \t\tdouble len() const { return end - start; }\n+\n+\t\tdouble start, end;\n \t};\n-\tstruct Point {\n-\t\tPoint() : x(0), y(0) {}\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-\t\t\treturn Point(x - p.x, y - p.y);\n-\t\t}\n-\t\tPoint operator+(Point const &p) const\n-\t\t{\n-\t\t\treturn Point(x + p.x, y + p.y);\n-\t\t}\n-\t\tdouble operator%(Point const &p) const\n-\t\t{\n-\t\t\treturn x * p.x + y * p.y;\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};\n+\n \tPwl() {}\n-\tPwl(std::vector<Point> const &points) : points_(points) {}\n-\tint read(const libcamera::YamlObject &params);\n+\tPwl(std::vector<PointF> const &points)\n+\t\t: points_(points) {}\n+\tint readYaml(const libcamera::YamlObject &params);\n+\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+\n \tInterval domain() const;\n \tInterval range() const;\n+\n \tbool empty() const;\n-\t/*\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-\t */\n+\n \tdouble eval(double x, int *spanPtr = nullptr,\n \t\t    bool updateSpan = true) const;\n-\t/*\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-\t * PerpType enum.\n-\t */\n-\tenum class PerpType {\n-\t\tNone, /* no perpendicular found */\n-\t\tStart, /* start of Pwl is closest point */\n-\t\tEnd, /* end of Pwl is closest point */\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+\n+\tPerpType invert(PointF const &xy, PointF &perp, int &span,\n \t\t\tconst double eps = 1e-6) const;\n-\t/*\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-\t */\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-\t/* Apply function to (x,y) values at every control point. */\n+\n \tvoid map(std::function<void(double x, double y)> f) const;\n-\t/*\n-\t * Apply function to (x, y0, y1) values wherever either Pwl has a\n-\t * control point.\n-\t */\n+\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/*\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-\t */\n+\n \tstatic Pwl\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/*\n-\t * Make \"this\" match (at least) the given domain. Any extension my be\n-\t * clipped or linear.\n-\t */\n-\tvoid matchDomain(Interval const &domain, bool clip = true,\n-\t\t\t const double eps = 1e-6);\n+\n+\tvoid extendDomain(Interval const &domain, bool clip = true,\n+\t\t\t  const double eps = 1e-6);\n+\n \tPwl &operator*=(double d);\n-\tvoid debug(FILE *fp = stdout) const;\n+\n+\tstd::string toString() const;\n \n private:\n \tint findSpan(double x, int span) const;\n-\tstd::vector<Point> points_;\n+\tstd::vector<PointF> points_;\n };\n+\n+} /* namespace ipa */\n+\n+} /* namespace libcamera */\n",
    "prefixes": [
        "v2",
        "3/4"
    ]
}