Patch Detail
Show a patch.
GET /api/patches/19176/?format=api
{ "id": 19176, "url": "https://patchwork.libcamera.org/api/patches/19176/?format=api", "web_url": "https://patchwork.libcamera.org/patch/19176/", "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": "<20231022224159.30298-8-laurent.pinchart@ideasonboard.com>", "date": "2023-10-22T22:41:58", "name": "[libcamera-devel,v6,20/12] libcamera: transform: Fold transformToOrientation() in its only caller", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "4841b9edab4dbd33c4620cc3a61d000d1f1d44ef", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/19176/mbox/", "series": [ { "id": 4053, "url": "https://patchwork.libcamera.org/api/series/4053/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4053", "date": "2023-10-19T14:01:21", "name": "libcamera: Replace CameraConfiguration::transform", "version": 6, "mbox": "https://patchwork.libcamera.org/series/4053/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/19176/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/19176/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 7F9A3C327D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 22 Oct 2023 22:42:06 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E0FEF62985;\n\tMon, 23 Oct 2023 00:42:03 +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 00A596298D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 23 Oct 2023 00:42:00 +0200 (CEST)", "from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi\n\t[213.243.189.158])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9A1B4D20;\n\tMon, 23 Oct 2023 00:41:50 +0200 (CEST)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1698014523;\n\tbh=qAXR8TS9CNRCG9Mlbp+xkNxza2p3RXintc1ku3gVvQ0=;\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:Cc:\n\tFrom;\n\tb=XFNmw48/yQ33Nfk4mOExjphiIJrcgmRwCN39JUYYFM5DIMf5vVWQGTiD0lTrLSGRf\n\tFvdVP5Xbl85PUJIZEvEM4kPVo3wbrJ2ysfC4MkIObTIoRlsTyQFMAY3wbEi9arvazo\n\t8Ri7zLNNkjApWc+2cXjp/zISjzww5M1ER73NXQjdh1PgyQ4Ad9ak9dQ9HlQz6wEvcv\n\toZvhawjvlkUYW/Hk0Wh150FxIGP/+oUWbHgmhyqkMHC4DruQ3e1nYjcP59klr7l/p2\n\tdnTT6QtiE0fhO9/t0+eRjNjpuP+i9Lr+SpNS+9Hal62yT+oDI2+S145eN9LzUSJ/8l\n\tTekAA4Jkf/GlQ==", "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1698014510;\n\tbh=qAXR8TS9CNRCG9Mlbp+xkNxza2p3RXintc1ku3gVvQ0=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=JAfyinkf8lDm1tSbfC3HYRdzeAgcI1tkEfw9rFQYKaOGNlMWQR/QBFpJ4Gfg5SJCq\n\tUdfpgn1uvlewh0HtBvY5fFxqEuVnVb0TvQIfpXwp3EKQEmvv9ZN9iB0icfpj3GYCG/\n\tjJTUaOUMAZia6CkCoghrHjbeEciU14VojwL3h8Q0=" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"JAfyinkf\"; dkim-atps=neutral", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 23 Oct 2023 01:41:58 +0300", "Message-ID": "<20231022224159.30298-8-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.41.0", "In-Reply-To": "<20231019140133.32090-1-jacopo.mondi@ideasonboard.com>", "References": "<20231019140133.32090-1-jacopo.mondi@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v6 20/12] libcamera: transform: Fold\n\ttransformToOrientation() in its only caller", "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": "Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>", "Reply-To": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "Cc": "Jacopo Mondi <jacopo.mondi@ideasonboard.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "The transformToOrientation() function is called from\n\nOrientation operator*(const Orientation &o, const Transform &t);\n\nonly. Fold the code in the caller and drop the transformToOrientation()\nfunction to drop what can be considered as an ill-defined operation from\nthe API.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/transform.h | 1 -\n src/libcamera/transform.cpp | 50 ++++++++++++++---------------------\n 2 files changed, 20 insertions(+), 31 deletions(-)", "diff": "diff --git a/include/libcamera/transform.h b/include/libcamera/transform.h\nindex 9eb10e156d0d..4998a6c04cb7 100644\n--- a/include/libcamera/transform.h\n+++ b/include/libcamera/transform.h\n@@ -72,7 +72,6 @@ constexpr Transform operator~(Transform t)\n \n Transform transformFromRotation(int angle, bool *success = nullptr);\n Transform transformFromOrientation(const Orientation &orientation);\n-Orientation transformToOrientation(const Transform &transform);\n \n Transform operator/(const Orientation &o1, const Orientation &o2);\n Orientation operator*(const Orientation &o, const Transform &t);\ndiff --git a/src/libcamera/transform.cpp b/src/libcamera/transform.cpp\nindex 0ccdb42fa406..cd2717c28c3a 100644\n--- a/src/libcamera/transform.cpp\n+++ b/src/libcamera/transform.cpp\n@@ -330,35 +330,6 @@ Transform transformFromOrientation(const Orientation &orientation)\n \treturn Transform::Identity;\n }\n \n-/**\n- * \\brief Return the Orientation representing \\a transform\n- * \\param[in] transform The transform to convert\n- * \\return The Orientation corresponding to \\a transform\n- */\n-Orientation transformToOrientation(const Transform &transform)\n-{\n-\tswitch (transform) {\n-\tcase Transform::Identity:\n-\t\treturn Orientation::Rotate0;\n-\tcase Transform::HFlip:\n-\t\treturn Orientation::Rotate0Mirror;\n-\tcase Transform::VFlip:\n-\t\treturn Orientation::Rotate180Mirror;\n-\tcase Transform::Rot180:\n-\t\treturn Orientation::Rotate180;\n-\tcase Transform::Transpose:\n-\t\treturn Orientation::Rotate90Mirror;\n-\tcase Transform::Rot270:\n-\t\treturn Orientation::Rotate270;\n-\tcase Transform::Rot90:\n-\t\treturn Orientation::Rotate90;\n-\tcase Transform::Rot180Transpose:\n-\t\treturn Orientation::Rotate270Mirror;\n-\t}\n-\n-\treturn Orientation::Rotate0;\n-}\n-\n /**\n * \\brief Return the Transform that applied to \\a o2 gives \\a o1\n * \\param o1 The Orientation to obtain\n@@ -389,7 +360,26 @@ Orientation operator*(const Orientation &o, const Transform &t)\n \t * Apply a Transform corresponding to the orientation first and\n \t * then apply \\a t to it.\n \t */\n-\treturn transformToOrientation(transformFromOrientation(o) * t);\n+\tswitch (transformFromOrientation(o) * t) {\n+\tcase Transform::Identity:\n+\t\treturn Orientation::Rotate0;\n+\tcase Transform::HFlip:\n+\t\treturn Orientation::Rotate0Mirror;\n+\tcase Transform::VFlip:\n+\t\treturn Orientation::Rotate180Mirror;\n+\tcase Transform::Rot180:\n+\t\treturn Orientation::Rotate180;\n+\tcase Transform::Transpose:\n+\t\treturn Orientation::Rotate90Mirror;\n+\tcase Transform::Rot270:\n+\t\treturn Orientation::Rotate270;\n+\tcase Transform::Rot90:\n+\t\treturn Orientation::Rotate90;\n+\tcase Transform::Rot180Transpose:\n+\t\treturn Orientation::Rotate270Mirror;\n+\t}\n+\n+\treturn Orientation::Rotate0;\n }\n \n /**\n", "prefixes": [ "libcamera-devel", "v6", "20/12" ] }