Patch Detail
Show a patch.
GET /api/1.1/patches/18847/?format=api
{ "id": 18847, "url": "https://patchwork.libcamera.org/api/1.1/patches/18847/?format=api", "web_url": "https://patchwork.libcamera.org/patch/18847/", "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": "<20230718105210.83558-7-jacopo.mondi@ideasonboard.com>", "date": "2023-07-18T10:52:06", "name": "[libcamera-devel,v3,06/10] libcamera: transform: Invert operator*() operands", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "ca1c8c2156d8dbd8c5c2b9d0a2ae666c12257f56", "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/18847/mbox/", "series": [ { "id": 3976, "url": "https://patchwork.libcamera.org/api/1.1/series/3976/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3976", "date": "2023-07-18T10:52:00", "name": "libcamera: Replace CameraConfiguration::transform", "version": 3, "mbox": "https://patchwork.libcamera.org/series/3976/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/18847/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/18847/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 0CDF4BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 18 Jul 2023 10:52:31 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BC21C628CB;\n\tTue, 18 Jul 2023 12:52:30 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BD5CB628D3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 18 Jul 2023 12:52:26 +0200 (CEST)", "from uno.localdomain (mob-5-90-54-150.net.vodafone.it\n\t[5.90.54.150])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E3B7B838;\n\tTue, 18 Jul 2023 12:51:32 +0200 (CEST)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1689677550;\n\tbh=2iTaMg6BxE3UkjSfFi2uq5xTSFJoLzXzHoxMx7DNZjg=;\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=Xnw5ToXH0KN883D9YFfhM3b7Xu52kfutwWRs2+f8mpZNEbyfxpVxHq/zb4gY4vcry\n\tRBWhQxiWCy6OHowCjKPIOOKh9gX+s1YgL62izLIoll/XAYniDQT8KRAmhEDOEolum1\n\tNk3gdi0Jqltqe/DnZ1FSENtbIZIQmJqcs/OkdocRUL2ISa3MzIeDqvNW3wNQWcRvDA\n\t6ratQSngiC8pgrEGa4RZM2RFTmDut6cZOQUVqiHpSK5XQtBXOw2ieVNqeEhXNoXPGO\n\tmrNJ8WSqTeGqMDfFpP5taLyKtV2RULMHDoYtzgRk78ePUavPsCii28Vk4khtzGYhF7\n\ts2VHku+86x+VA==", "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1689677493;\n\tbh=2iTaMg6BxE3UkjSfFi2uq5xTSFJoLzXzHoxMx7DNZjg=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=RiHbfIZAoFqZTQ55SUMNbmjPTDdZdb2f81+lNZUs2deVCfr0wvN76BhUO/z8wvsIY\n\thGI9pnNSSWh1DhITfwdt/OBvFZo7NgtvSLGxdiWE/wZwv5e+KJ9S4Fz4h+IaESiZpw\n\tRB9jXPkK8rxONuOs85C8H5SwJTGvzg3r8lGy94CY=" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"RiHbfIZA\"; dkim-atps=neutral", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 18 Jul 2023 12:52:06 +0200", "Message-Id": "<20230718105210.83558-7-jacopo.mondi@ideasonboard.com>", "X-Mailer": "git-send-email 2.40.1", "In-Reply-To": "<20230718105210.83558-1-jacopo.mondi@ideasonboard.com>", "References": "<20230718105210.83558-1-jacopo.mondi@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v3 06/10] libcamera: transform: Invert\n\toperator*() operands", "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": "Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>", "Reply-To": "Jacopo Mondi <jacopo.mondi@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 current definition of operator*(Transform t1, Transform t0) follows\nthe function composition notion, where t0 is applied first then t1 is\napplied last.\n\nIn order to introduce operator*(Orientation, Transform) where a\nTransform is applied on top of an Orientation, invert the operand order\nof operator*(Transform, Transform) so that usage of operator* with both\nOrientation and Transform can be made associative.\n\nFor example:\n\nOrientation o;\nTransform t = t1 * t2\nTransform t3 = o * t\n\t = o * (t1 * t2) = (o * t1) * t2 = o * t1 * t2\n\nSigned-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n---\n src/libcamera/camera_sensor.cpp | 4 ++--\n src/libcamera/transform.cpp | 19 +++++++++++--------\n 2 files changed, 13 insertions(+), 10 deletions(-)", "diff": "diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\nindex 3ba364c44a40..038d8b959072 100644\n--- a/src/libcamera/camera_sensor.cpp\n+++ b/src/libcamera/camera_sensor.cpp\n@@ -1051,7 +1051,7 @@ Transform CameraSensor::validateTransform(Transform *transform) const\n \t * Combine the requested transform to compensate the sensor mounting\n \t * rotation.\n \t */\n-\tTransform combined = *transform * rotationTransform_;\n+\tTransform combined = rotationTransform_ * *transform;\n \n \t/*\n \t * We combine the platform and user transform, but must \"adjust away\"\n@@ -1080,7 +1080,7 @@ Transform CameraSensor::validateTransform(Transform *transform) const\n \t\t * If the sensor can do no transforms, then combined must be\n \t\t * changed to the identity. The only user transform that gives\n \t\t * rise to this is the inverse of the rotation. (Recall that\n-\t\t * combined = transform * rotationTransform.)\n+\t\t * combined = rotationTransform * transform.)\n \t\t */\n \t\t*transform = -rotationTransform_;\n \t\tcombined = Transform::Identity;\ndiff --git a/src/libcamera/transform.cpp b/src/libcamera/transform.cpp\nindex c70cac3f14ee..d192d63d9290 100644\n--- a/src/libcamera/transform.cpp\n+++ b/src/libcamera/transform.cpp\n@@ -189,14 +189,17 @@ Input image | | goes to output image | |\n */\n \n /**\n- * \\brief Compose two transforms together\n- * \\param[in] t1 The second transform\n- * \\param[in] t0 The first transform\n+ * \\brief Compose two transforms by applying \\a t0 first then \\a t1\n+ * \\param[in] t0 The first transform to apply\n+ * \\param[in] t1 The second transform to apply\n+ *\n+ * Compose two transforms by applying \\a t1 after \\a t0. The operation\n+ * is conceptually equivalent to the canonical notion of function composition,\n+ * with inverse order of operands. If in the canonical function composition\n+ * notation \"f * g\" equals to \"f(g())\", the notation for Transforms composition\n+ * \"t0 * t1\" equals to \"t1(t0()))\" where \\a t0 is applied first, then \\a t1.\n *\n- * Composing transforms follows the usual mathematical convention for\n- * composing functions. That is, when performing `t1 * t0`, \\a t0 is applied\n- * first, and then \\a t1.\n- * For example, `Transpose * HFlip` performs `HFlip` first and then the\n+ * For example, `HFlip * Transpose` performs `HFlip` first and then the\n * `Transpose` yielding `Rot270`, as shown below.\n ~~~\n A-B B-A B-D\n@@ -206,7 +209,7 @@ Input image | | -> HFLip -> | | -> Transpose -> | | = Rot270\n * Note that composition is generally non-commutative for Transforms,\n * and not the same as XOR-ing the underlying bit representations.\n */\n-Transform operator*(Transform t1, Transform t0)\n+Transform operator*(Transform t0, Transform t1)\n {\n \t/*\n \t * Reorder the operations so that we imagine doing t0's transpose\n", "prefixes": [ "libcamera-devel", "v3", "06/10" ] }