[{"id":36239,"web_url":"https://patchwork.libcamera.org/comment/36239/","msgid":"<9b3fc1c8-e375-4df8-b28b-4b8fd3215e84@ideasonboard.com>","date":"2025-10-14T08:48:03","subject":"Re: [PATCH v1 09/12] ipa: rkisp1: lsc: Pass crop rectangle as\n\tparameter","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2025. 10. 14. 9:52 keltezéssel, Stefan Klug írta:\n> In preparation for the upcoming rework, pass the crop rectangle as\n> parameter to samplePolynomial(). This patch contains no functional\n> change.\n> \n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> ---\n\nReviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n\n\n>   src/ipa/rkisp1/algorithms/lsc.cpp | 22 ++++++++++++----------\n>   1 file changed, 12 insertions(+), 10 deletions(-)\n> \n> diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp\n> index 2fbc8bd1b242..29cd7efd83ef 100644\n> --- a/src/ipa/rkisp1/algorithms/lsc.cpp\n> +++ b/src/ipa/rkisp1/algorithms/lsc.cpp\n> @@ -91,7 +91,8 @@ private:\n>   \tstd::vector<double> sizesListToPositions(const std::vector<double> &sizes);\n>   \tstd::vector<uint16_t> samplePolynomial(const LscPolynomial &poly,\n>   \t\t\t\t\t       const std::vector<double> &xPositions,\n> -\t\t\t\t\t       const std::vector<double> &yPositions);\n> +\t\t\t\t\t       const std::vector<double> &yPositions,\n> +\t\t\t\t\t       const Rectangle &cropRectangle);\n>   \n>   \tSize sensorSize_;\n>   \tRectangle cropRectangle_;\n> @@ -134,10 +135,10 @@ int LscPolynomialLoader::parseLscData(const YamlObject &yamlSets,\n>   \n>   \t\tstd::vector<double> xPos(sizesListToPositions(xSizes_));\n>   \t\tstd::vector<double> yPos(sizesListToPositions(ySizes_));\n> -\t\tset.r = samplePolynomial(*pr, xPos, yPos);\n> -\t\tset.gr = samplePolynomial(*pgr, xPos, yPos);\n> -\t\tset.gb = samplePolynomial(*pgb, xPos, yPos);\n> -\t\tset.b = samplePolynomial(*pb, xPos, yPos);\n> +\t\tset.r = samplePolynomial(*pr, xPos, yPos, cropRectangle_);\n> +\t\tset.gr = samplePolynomial(*pgr, xPos, yPos, cropRectangle_);\n> +\t\tset.gb = samplePolynomial(*pgb, xPos, yPos, cropRectangle_);\n> +\t\tset.b = samplePolynomial(*pb, xPos, yPos, cropRectangle_);\n>   \t}\n>   \n>   \tif (lscData.empty()) {\n> @@ -176,13 +177,14 @@ std::vector<double> LscPolynomialLoader::sizesListToPositions(const std::vector<\n>   \n>   std::vector<uint16_t> LscPolynomialLoader::samplePolynomial(const LscPolynomial &poly,\n>   \t\t\t\t\t\t\t    const std::vector<double> &xPositions,\n> -\t\t\t\t\t\t\t    const std::vector<double> &yPositions)\n> +\t\t\t\t\t\t\t    const std::vector<double> &yPositions,\n> +\t\t\t\t\t\t\t    const Rectangle &cropRectangle)\n>   {\n>   \tdouble m = poly.getM();\n> -\tdouble x0 = cropRectangle_.x / m;\n> -\tdouble y0 = cropRectangle_.y / m;\n> -\tdouble w = cropRectangle_.width / m;\n> -\tdouble h = cropRectangle_.height / m;\n> +\tdouble x0 = cropRectangle.x / m;\n> +\tdouble y0 = cropRectangle.y / m;\n> +\tdouble w = cropRectangle.width / m;\n> +\tdouble h = cropRectangle.height / m;\n>   \tstd::vector<uint16_t> samples;\n>   \n>   \tsamples.reserve(xPositions.size() * yPositions.size());","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 B6EA3BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 14 Oct 2025 08:48:09 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A57A7605BD;\n\tTue, 14 Oct 2025 10:48:08 +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 B956A60316\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Oct 2025 10:48:07 +0200 (CEST)","from [192.168.33.20] (185.182.214.105.nat.pool.zt.hu\n\t[185.182.214.105])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5E051C73;\n\tTue, 14 Oct 2025 10:46:29 +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=\"ZPssv6tZ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1760431589;\n\tbh=v6d0ytlG9gtKerhVzMJQDJpRPtNoa7i0n1vSnSPiJeI=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=ZPssv6tZMCsi8jRCzulQQ+H1zbOgbKtkKklUn0ki4LaSxXmrkQ4MI7C1brpvQk4+T\n\twfH4qCtYgB/nSjdjDeKuiq3cjiW6YJQ5nDrL4OsKj4uUN/QqDEJEOQoXKnalEBnQRT\n\tgYxQx8aEYhxoApnN/boKXn1nI5JwQp9n0xxa45Ig=","Message-ID":"<9b3fc1c8-e375-4df8-b28b-4b8fd3215e84@ideasonboard.com>","Date":"Tue, 14 Oct 2025 10:48:03 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v1 09/12] ipa: rkisp1: lsc: Pass crop rectangle as\n\tparameter","To":"Stefan Klug <stefan.klug@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20251014075252.2876485-1-stefan.klug@ideasonboard.com>\n\t<20251014075252.2876485-10-stefan.klug@ideasonboard.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20251014075252.2876485-10-stefan.klug@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","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>"}},{"id":36504,"web_url":"https://patchwork.libcamera.org/comment/36504/","msgid":"<d7023586-7675-4fca-8ed6-47edd953d8c3@ideasonboard.com>","date":"2025-10-27T21:31:55","subject":"Re: [PATCH v1 09/12] ipa: rkisp1: lsc: Pass crop rectangle as\n\tparameter","submitter":{"id":241,"url":"https://patchwork.libcamera.org/api/people/241/","name":"Rui Wang","email":"rui.wang@ideasonboard.com"},"content":"On 2025-10-14 03:52, Stefan Klug wrote:\n> In preparation for the upcoming rework, pass the crop rectangle as\n> parameter to samplePolynomial(). This patch contains no functional\n> change.\n>\n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> ---\n>   src/ipa/rkisp1/algorithms/lsc.cpp | 22 ++++++++++++----------\n>   1 file changed, 12 insertions(+), 10 deletions(-)\n>\n> diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp\n> index 2fbc8bd1b242..29cd7efd83ef 100644\n> --- a/src/ipa/rkisp1/algorithms/lsc.cpp\n> +++ b/src/ipa/rkisp1/algorithms/lsc.cpp\n> @@ -91,7 +91,8 @@ private:\n>   \tstd::vector<double> sizesListToPositions(const std::vector<double> &sizes);\n>   \tstd::vector<uint16_t> samplePolynomial(const LscPolynomial &poly,\n>   \t\t\t\t\t       const std::vector<double> &xPositions,\n> -\t\t\t\t\t       const std::vector<double> &yPositions);\n> +\t\t\t\t\t       const std::vector<double> &yPositions,\n> +\t\t\t\t\t       const Rectangle &cropRectangle);\n>   \n>   \tSize sensorSize_;\n>   \tRectangle cropRectangle_;\n> @@ -134,10 +135,10 @@ int LscPolynomialLoader::parseLscData(const YamlObject &yamlSets,\n>   \n>   \t\tstd::vector<double> xPos(sizesListToPositions(xSizes_));\n>   \t\tstd::vector<double> yPos(sizesListToPositions(ySizes_));\n> -\t\tset.r = samplePolynomial(*pr, xPos, yPos);\n> -\t\tset.gr = samplePolynomial(*pgr, xPos, yPos);\n> -\t\tset.gb = samplePolynomial(*pgb, xPos, yPos);\n> -\t\tset.b = samplePolynomial(*pb, xPos, yPos);\n> +\t\tset.r = samplePolynomial(*pr, xPos, yPos, cropRectangle_);\n> +\t\tset.gr = samplePolynomial(*pgr, xPos, yPos, cropRectangle_);\n> +\t\tset.gb = samplePolynomial(*pgb, xPos, yPos, cropRectangle_);\n> +\t\tset.b = samplePolynomial(*pb, xPos, yPos, cropRectangle_);\n>   \t}\n>   \n>   \tif (lscData.empty()) {\n> @@ -176,13 +177,14 @@ std::vector<double> LscPolynomialLoader::sizesListToPositions(const std::vector<\n>   \n>   std::vector<uint16_t> LscPolynomialLoader::samplePolynomial(const LscPolynomial &poly,\n>   \t\t\t\t\t\t\t    const std::vector<double> &xPositions,\n> -\t\t\t\t\t\t\t    const std::vector<double> &yPositions)\n> +\t\t\t\t\t\t\t    const std::vector<double> &yPositions,\n> +\t\t\t\t\t\t\t    const Rectangle &cropRectangle)\n>   {\n>   \tdouble m = poly.getM();\n> -\tdouble x0 = cropRectangle_.x / m;\n> -\tdouble y0 = cropRectangle_.y / m;\n> -\tdouble w = cropRectangle_.width / m;\n> -\tdouble h = cropRectangle_.height / m;\n> +\tdouble x0 = cropRectangle.x / m;\n> +\tdouble y0 = cropRectangle.y / m;\n> +\tdouble w = cropRectangle.width / m;\n> +\tdouble h = cropRectangle.height / m;\n>   \tstd::vector<uint16_t> samples;\n>   \n>   \tsamples.reserve(xPositions.size() * yPositions.size());\n\n\nReviewed-by: Rui Wang <rui.wang@ideasonboard.com>","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 599EDC3259\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 27 Oct 2025 21:32:10 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 97AEF6077C;\n\tMon, 27 Oct 2025 22:32:09 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3353D6069A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 27 Oct 2025 22:32:08 +0100 (CET)","from [192.168.31.114] (unknown [209.216.122.90])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id CD6B4E70\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 27 Oct 2025 22:30:19 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"jeCJ/uT4\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1761600620;\n\tbh=lU5sf1OLhIOwp92UTLdsK4WREtQDO3zz4W/ZTVBX0EE=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=jeCJ/uT4fChnrVrHxRV/kxyE304ExjvEWBMJNVpmTfXuFg26/ZiT5Bo4gFSUIlrzz\n\tmAejyuafalGm2aEFWXikj4YG82BSB+b5Qagm53MvOnMwg5sgcGz2xCNCTAWlQQ5wGN\n\tY5RvNty+n8/CF/9wDWnBjoWrU4fb9DVYYVJKnoO8=","Message-ID":"<d7023586-7675-4fca-8ed6-47edd953d8c3@ideasonboard.com>","Date":"Mon, 27 Oct 2025 17:31:55 -0400","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v1 09/12] ipa: rkisp1: lsc: Pass crop rectangle as\n\tparameter","To":"libcamera-devel@lists.libcamera.org","References":"<20251014075252.2876485-1-stefan.klug@ideasonboard.com>\n\t<20251014075252.2876485-10-stefan.klug@ideasonboard.com>","Content-Language":"en-US","From":"rui wang <rui.wang@ideasonboard.com>","In-Reply-To":"<20251014075252.2876485-10-stefan.klug@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","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>"}}]