Patch Detail
Show a patch.
GET /api/1.1/patches/27213/?format=api
{ "id": 27213, "url": "https://patchwork.libcamera.org/api/1.1/patches/27213/?format=api", "web_url": "https://patchwork.libcamera.org/patch/27213/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/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": "<20260706-libipa-algorithms-v3-13-968757b038bb@ideasonboard.com>", "date": "2026-07-06T08:01:33", "name": "[v3,13/35] ipa: libipa: lsc_polynomial: Do not inline functions", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "2737beed2c3b6c7d729347a3e3a80bf63948537e", "submitter": { "id": 143, "url": "https://patchwork.libcamera.org/api/1.1/people/143/?format=api", "name": "Jacopo Mondi", "email": "jacopo.mondi@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/27213/mbox/", "series": [ { "id": 6038, "url": "https://patchwork.libcamera.org/api/1.1/series/6038/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=6038", "date": "2026-07-06T08:01:20", "name": "ipa: libipa: Introduce libipa algorithms", "version": 3, "mbox": "https://patchwork.libcamera.org/series/6038/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/27213/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/27213/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 CD571C330A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 6 Jul 2026 08:02:18 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1952F66041;\n\tMon, 6 Jul 2026 10:02:18 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 97C7B66024\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 6 Jul 2026 10:02:06 +0200 (CEST)", "from [192.168.125.177] (mob-109-113-60-81.net.vodafone.it\n\t[109.113.60.81])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4DB56293E;\n\tMon, 6 Jul 2026 10:01:17 +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=\"aoQorZNs\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1783324878;\n\tbh=oHPPuVkGX5pi4HusVH9TgGsRpDNtBgpyaSHuyM2mitM=;\n\th=From:Date:Subject:References:In-Reply-To:To:Cc:From;\n\tb=aoQorZNs3JTIXciJ96t51PtIVWQcE7yFM1zuRWvNPMneNIBMQwKqO1QI2+/RN+ECC\n\tqjuGhT3dcqDhaXCC77f6GpC8qS18Qt91qoppcChWujawjpsWr4NmgeDxR1GxVJhWAN\n\tHBexJT1nKwajE0hQF/EUH/JhwMnDVzw0pNycfpyA=", "From": "Jacopo Mondi <jacopo.mondi@ideasonboard.com>", "Date": "Mon, 06 Jul 2026 10:01:33 +0200", "Subject": "[PATCH v3 13/35] ipa: libipa: lsc_polynomial: Do not inline\n\tfunctions", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "7bit", "Message-Id": "<20260706-libipa-algorithms-v3-13-968757b038bb@ideasonboard.com>", "References": "<20260706-libipa-algorithms-v3-0-968757b038bb@ideasonboard.com>", "In-Reply-To": "<20260706-libipa-algorithms-v3-0-968757b038bb@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org, \n\tStefan Klug <stefan.klug@ideasonboard.com>", "Cc": "Jacopo Mondi <jacopo.mondi@ideasonboard.com>", "X-Mailer": "b4 0.14.3", "X-Developer-Signature": "v=1; a=openpgp-sha256; l=3967;\n\ti=jacopo.mondi@ideasonboard.com; h=from:subject:message-id;\n\tbh=oHPPuVkGX5pi4HusVH9TgGsRpDNtBgpyaSHuyM2mitM=;\n\tb=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBqS2Dwvr/mU9Qeis5xYR9p6ugc+3XnAT0mB+qDy\n\tEKDdJ6SwdGJAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCaktg8AAKCRByNAaPFqFW\n\tPGRJD/9EgTFOVj6S0LWr6BkFIOkXf9JUOeKT2PHLNtxA39ACufG6eijIaUxuAFGXQC6NfzOPUrY\n\tXiLHtMj5JDltS7/zK5qTy/Z1WYno956UpJu8xKQKUjXHoq+TFPHu+wnfpWMIoOiBqtYWfG1nnsN\n\tU+htL0iUK5b3UAif5TRALKC32F1pFyUHeCzBDvFoNN0g0y1auwjHs4WQW36VFexwzUeQkthlU70\n\tQ7wyCvDGChiuGdciNupGLwVRv7ktwBOxGmoMlXD64+CVNh+sJnONpFOJjewziJdUnJOsJPwfSfG\n\tqyySsa8RpKajhYwgW4SmFZeordqJLOVrrdSe0hwTeptI0c0StxVAOi6TgsHe1i3L8mabkIx+Ixa\n\ty9eXkBDAizlec+IyZaws+H3S6YEnYCbhDaYngE3BOdFq8DFl1mfVPo4TVdOT7/gdYcgrNqkcoem\n\tqiaR//Tt5t4hzLHO8VB5rHxxEBhr5Ns6DsTUTCPoyj5ClRqLCwRZY5PEikw0DTcHwRCjQW14Tgq\n\tb5oKrq9wBzzdhZf0alScCShHLisnwmUAIvhwh1eyUEGC+Jy4RgKyUELLN98UWzGoFK9pQ8XEB+8\n\tJm8wJsJC95ceMM+f8iTcMl8zmtmWiN1XvcQiHGYHBj4S3Y85sJeK/kFxOMcbF6MPDCBSDvzSXEj\n\tYNN3Pn4iORP0ujw==", "X-Developer-Key": "i=jacopo.mondi@ideasonboard.com; a=openpgp;\n\tfpr=72392EDC88144A65C701EA9BA5826A2587AD026B", "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": "There is no reason to inline the Polynomial class implementation.\n\nMove functions implementation to the corresponding .cpp file.\n\nWhile at it remove a rougue empty line between class members\ndefinitions.\n\nSigned-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n---\n src/ipa/libipa/lsc_polynomial.cpp | 34 +++++++++++++++++++++++++++++++---\n src/ipa/libipa/lsc_polynomial.h | 36 +++---------------------------------\n 2 files changed, 34 insertions(+), 36 deletions(-)", "diff": "diff --git a/src/ipa/libipa/lsc_polynomial.cpp b/src/ipa/libipa/lsc_polynomial.cpp\nindex d8981bd8a26a..a845d8b1783b 100644\n--- a/src/ipa/libipa/lsc_polynomial.cpp\n+++ b/src/ipa/libipa/lsc_polynomial.cpp\n@@ -47,7 +47,6 @@ namespace lsc {\n */\n \n /**\n- * \\fn Polynomial::sampleAtNormalizedPixelPos(double x, double y)\n * \\brief Sample the polynomial at the given normalized pixel position\n *\n * This functions samples the polynomial at the given pixel position divided by\n@@ -57,9 +56,20 @@ namespace lsc {\n * \\param y y position in normalized coordinates\n * \\return The sampled value\n */\n+double Polynomial::sampleAtNormalizedPixelPos(double x, double y) const\n+{\n+\tdouble dx = x - cnx_;\n+\tdouble dy = y - cny_;\n+\tdouble r = sqrt(dx * dx + dy * dy);\n+\tdouble res = 1.0;\n+\n+\tfor (unsigned int i = 0; i < coefficients_.size(); i++)\n+\t\tres += coefficients_[i] * std::pow(r, (i + 1) * 2);\n+\n+\treturn res;\n+}\n \n /**\n- * \\fn Polynomial::getM()\n * \\brief Get the value m as described in the dng specification\n *\n * Returns m according to dng spec. m represents the Euclidean distance\n@@ -68,9 +78,17 @@ namespace lsc {\n *\n * \\return The sampled value\n */\n+double Polynomial::getM() const\n+{\n+\tdouble cpx = imageSize_.width * cx_;\n+\tdouble cpy = imageSize_.height * cy_;\n+\tdouble mx = std::max(cpx, std::fabs(imageSize_.width - cpx));\n+\tdouble my = std::max(cpy, std::fabs(imageSize_.height - cpy));\n+\n+\treturn sqrt(mx * mx + my * my);\n+}\n \n /**\n- * \\fn Polynomial::setReferenceImageSize(const Size &size)\n * \\brief Set the reference image size\n *\n * Set the reference image size that is used for subsequent calls to getM() and\n@@ -78,6 +96,16 @@ namespace lsc {\n *\n * \\param size The size of the reference image\n */\n+void Polynomial::setReferenceImageSize(const Size &size)\n+{\n+\tassert(!size.isNull());\n+\timageSize_ = size;\n+\n+\t/* Calculate normalized centers */\n+\tdouble m = getM();\n+\tcnx_ = (size.width * cx_) / m;\n+\tcny_ = (size.height * cy_) / m;\n+}\n \n } /* namespace lsc */\n \ndiff --git a/src/ipa/libipa/lsc_polynomial.h b/src/ipa/libipa/lsc_polynomial.h\nindex 3be33edfe7d8..2caf46d2d759 100644\n--- a/src/ipa/libipa/lsc_polynomial.h\n+++ b/src/ipa/libipa/lsc_polynomial.h\n@@ -37,38 +37,9 @@ public:\n \t{\n \t}\n \n-\tdouble sampleAtNormalizedPixelPos(double x, double y) const\n-\t{\n-\t\tdouble dx = x - cnx_;\n-\t\tdouble dy = y - cny_;\n-\t\tdouble r = sqrt(dx * dx + dy * dy);\n-\t\tdouble res = 1.0;\n-\t\tfor (unsigned int i = 0; i < coefficients_.size(); i++) {\n-\t\t\tres += coefficients_[i] * std::pow(r, (i + 1) * 2);\n-\t\t}\n-\t\treturn res;\n-\t}\n-\n-\tdouble getM() const\n-\t{\n-\t\tdouble cpx = imageSize_.width * cx_;\n-\t\tdouble cpy = imageSize_.height * cy_;\n-\t\tdouble mx = std::max(cpx, std::fabs(imageSize_.width - cpx));\n-\t\tdouble my = std::max(cpy, std::fabs(imageSize_.height - cpy));\n-\n-\t\treturn sqrt(mx * mx + my * my);\n-\t}\n-\n-\tvoid setReferenceImageSize(const Size &size)\n-\t{\n-\t\tassert(!size.isNull());\n-\t\timageSize_ = size;\n-\n-\t\t/* Calculate normalized centers */\n-\t\tdouble m = getM();\n-\t\tcnx_ = (size.width * cx_) / m;\n-\t\tcny_ = (size.height * cy_) / m;\n-\t}\n+\tdouble sampleAtNormalizedPixelPos(double x, double y) const;\n+\tdouble getM() const;\n+\tvoid setReferenceImageSize(const Size &size);\n \n private:\n \tdouble cx_;\n@@ -76,7 +47,6 @@ private:\n \tdouble cnx_;\n \tdouble cny_;\n \tstd::array<double, 5> coefficients_;\n-\n \tSize imageSize_;\n };\n \n", "prefixes": [ "v3", "13/35" ] }