[{"id":36417,"web_url":"https://patchwork.libcamera.org/comment/36417/","msgid":"<176128912489.444292.5685195021409565951@localhost>","date":"2025-10-24T06:58:44","subject":"Re: [PATCH v2 28/35] libcamera: Add transpose() function to size","submitter":{"id":184,"url":"https://patchwork.libcamera.org/api/people/184/","name":"Stefan Klug","email":"stefan.klug@ideasonboard.com"},"content":"Note to self:\n\nI missed to implement the corresponding Test mentioned by Kieran.\nTo be done in v3.\n\nStefan\n\nQuoting Stefan Klug (2025-10-23 16:48:29)\n> Add a transpose() function to size that applies the\n> Transformation::Transpose operation in the size. This is useful when\n> handling orientation adjustments.\n> \n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> ---\n>  include/libcamera/geometry.h |  6 ++++++\n>  src/libcamera/geometry.cpp   | 10 ++++++++++\n>  2 files changed, 16 insertions(+)\n> \n> diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h\n> index d9378efeca8c..572a07e2cf92 100644\n> --- a/include/libcamera/geometry.h\n> +++ b/include/libcamera/geometry.h\n> @@ -108,6 +108,12 @@ public:\n>                 return *this;\n>         }\n>  \n> +       Size &transpose()\n> +       {\n> +               std::swap(width, height);\n> +               return *this;\n> +       }\n> +\n>         [[nodiscard]] constexpr Size alignedDownTo(unsigned int hAlignment,\n>                                                    unsigned int vAlignment) const\n>         {\n> diff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp\n> index de76d0c12a8c..2763967a6e57 100644\n> --- a/src/libcamera/geometry.cpp\n> +++ b/src/libcamera/geometry.cpp\n> @@ -209,6 +209,16 @@ std::string Size::toString() const\n>   * \\return A reference to this object\n>   */\n>  \n> +/**\n> + * \\fn Size::transpose()\n> + * \\brief Transpose the size in place\n> + *\n> + * This function swaps width and height of this size. This effectively applies\n> + * the \\a Transform::Transpose transformation on this size.\n> + *\n> + * \\return A reference to this object\n> + */\n> +\n>  /**\n>   * \\fn Size::alignedDownTo(unsigned int hAlignment, unsigned int vAlignment)\n>   * \\brief Align the size down horizontally and vertically\n> -- \n> 2.48.1\n>","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 43E8EC3259\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 24 Oct 2025 06:58:51 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 66D4360855;\n\tFri, 24 Oct 2025 08:58:50 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2E1E3607C9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Oct 2025 08:58:48 +0200 (CEST)","from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:7edc:62f4:c118:1549])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 902A6AB4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Oct 2025 08:57:02 +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=\"k+ZeyVWd\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1761289022;\n\tbh=EwW2Kya5IgXVThLCeX7O1RXIfLCJyg/WiDGOKKdaz6I=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=k+ZeyVWd3PnPwO75kPFuPPSDfLnU/yRmLtN8IIQ0UXC0gN8mcitNuwkVyvSFf5/L6\n\tJljLBFOrlGGGd07wNjRf7jIstohdsfoKce8+m2Af9gPHYFu+guMgARWN2KDbq9P2xh\n\tN28I1+62y04Toi6Fx+4VDhwK0qR1Is55Eeht+0Bo=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20251023144841.403689-29-stefan.klug@ideasonboard.com>","References":"<20251023144841.403689-1-stefan.klug@ideasonboard.com>\n\t<20251023144841.403689-29-stefan.klug@ideasonboard.com>","Subject":"Re: [PATCH v2 28/35] libcamera: Add transpose() function to size","From":"Stefan Klug <stefan.klug@ideasonboard.com>","Cc":"","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 24 Oct 2025 08:58:44 +0200","Message-ID":"<176128912489.444292.5685195021409565951@localhost>","User-Agent":"alot/0.12.dev8+g2c003385c862.d20250602","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>"}}]