[{"id":27556,"web_url":"https://patchwork.libcamera.org/comment/27556/","msgid":"<CAHW6GYL9889nPf_A_kssibH3zPwm+XLv1BJ4TL6=n2zFqE-R4A@mail.gmail.com>","date":"2023-07-17T09:30:52","subject":"Re: [libcamera-devel] [PATCH v2 4/9] libcamera: properties: Make\n\t'Rotation' the mounting rotation","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"content":"Hi Jacopo\n\nThanks for the patch!\n\nOn Fri, 14 Jul 2023 at 15:16, Jacopo Mondi\n<jacopo.mondi@ideasonboard.com> wrote:\n>\n> Specify in the documentation that properties::Rotation specifies the\n> mounting rotation of the camera module. This avoids confusion with the\n> image orientation which is instead expressed by\n> CameraConfiguration::orientation.\n>\n> For this reason, do not compensate the Rotation property when\n> initializing the CameraSensor class but report the value of\n> V4L2_CID_CAMERA_SENSOR_ROTATION or 0 if the control is not available.\n>\n> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nLooks good to me!\n\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n\nThanks\nDavid\n\n> ---\n>  src/libcamera/camera_sensor.cpp | 11 +----------\n>  src/libcamera/property_ids.yaml |  8 ++++----\n>  2 files changed, 5 insertions(+), 14 deletions(-)\n>\n> diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\n> index 9a033459742f..3ba364c44a40 100644\n> --- a/src/libcamera/camera_sensor.cpp\n> +++ b/src/libcamera/camera_sensor.cpp\n> @@ -476,20 +476,11 @@ int CameraSensor::initProperties()\n>                         rotationTransform_ = Transform::Identity;\n>                 }\n>\n> -               /*\n> -                * Adjust property::Rotation as validateTransform() compensates\n> -                * for the mounting rotation. However, as a camera sensor can\n> -                * only compensate rotations by applying H/VFlips, only rotation\n> -                * of 180 degrees are automatically compensated. The other valid\n> -                * rotations (Rot90 and Rot270) require transposition, which the\n> -                * camera sensor cannot perform, so leave them untouched.\n> -                */\n> -               if (propertyValue == 180 && supportFlips_)\n> -                       propertyValue = 0;\n>                 properties_.set(properties::Rotation, propertyValue);\n>         } else {\n>                 LOG(CameraSensor, Warning)\n>                         << \"Rotation control not available, default to 0 degrees\";\n> +               properties_.set(properties::Rotation, propertyValue);\n>                 rotationTransform_ = Transform::Identity;\n>         }\n>\n> diff --git a/src/libcamera/property_ids.yaml b/src/libcamera/property_ids.yaml\n> index 5bddafc29364..fb53081c1bd2 100644\n> --- a/src/libcamera/property_ids.yaml\n> +++ b/src/libcamera/property_ids.yaml\n> @@ -29,10 +29,10 @@ controls:\n>    - Rotation:\n>        type: int32_t\n>        description: |\n> -        The camera rotation is expressed as the angular difference in degrees\n> -        between two reference systems, one relative to the camera module, and\n> -        one defined on the external world scene to be captured when projected\n> -        on the image sensor pixel array.\n> +        The camera physical mounting rotation, expressed as the angular\n> +        difference in degrees between two reference systems, one relative to the\n> +        camera module, and one defined on the external world scene to be\n> +        captured when projected on the image sensor pixel array.\n>\n>          A camera sensor has a 2-dimensional reference system 'Rc' defined by\n>          its pixel array read-out order. The origin is set to the first pixel\n> --\n> 2.40.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 AEE9EBEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 17 Jul 2023 09:31:05 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BC36F628C0;\n\tMon, 17 Jul 2023 11:31:04 +0200 (CEST)","from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com\n\t[IPv6:2607:f8b0:4864:20::f33])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1240860381\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 17 Jul 2023 11:31:04 +0200 (CEST)","by mail-qv1-xf33.google.com with SMTP id\n\t6a1803df08f44-635eb3a1d93so30561046d6.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 17 Jul 2023 02:31:03 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1689586264;\n\tbh=PAFLbxMMyrFH8E3yWKoj1OV5LdMSjv5BYCDmWirJT84=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=GPBqqba75IHR+hIb8G3VYoNl99x2Hub4FZEDDqkiQTL32wXOQtHR8O7wG2IvV4dnM\n\t9fIAqCcuPlU8hTrsloxSTZH4NKYqK2DRH4syt08D6Al2Sm6SbkJfxclUx4d1iy3HBl\n\tHNKZCQ+oIi9agLDyao/GWCAS3lmL4OALfRimqwhT1yMYZeMI493DPKNXOS40VSBzSv\n\t5ZHN3UyDf0lb78d3LmL3tzyO/MOLM20Lyv8zZWjbSRx55xB89rx7qhgmp2j73/w3gM\n\tlh5CA6TXLKfXybPjVgm63FerszhdJXoagGRkoSm9ZUB6Iu1qNI6sX8TvHVFTI9rgxk\n\tsFteR8/IEyzfw==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1689586263; x=1692178263;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=E4ouT8pKY5vOiaie0BnkmlPxBc6khIOwXy8jNjQqFNI=;\n\tb=Lh5gKQ1UEFj9utPzYpYIf8HgS40Jb13RZjg9AnRViKRF+Qn9ucGGM5QwYNJ9s1qAaT\n\tGagbcAsdISn153AFgIaBPak39/1PEeZKt2jsnqsqy6eMqMLGKO/FnlqYBHABD2YaqTqF\n\tRABeEKsZVRzihI5CuYmfc6A548dcZLIzwlkotRILi8mmZ2nXazZ7bdM/ThgwPQ7VYlTx\n\tr678smrdhWOlu4wLsx+gyNCcCgP87BDIU5kKfC3XJoHHEzbDpGO1s2XdMf+O56fsiLih\n\tD41xxeQCm603OdNdDB4sIqDcq7OBdtFYr814KhRj+nbkhfEAU/PP4PiUoAFZAqOobymZ\n\tGSBw=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"Lh5gKQ1U\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20221208; t=1689586263; x=1692178263;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=E4ouT8pKY5vOiaie0BnkmlPxBc6khIOwXy8jNjQqFNI=;\n\tb=Ia/5IjHhAhFR3R5aBANFUfZYv4C7IRcIJnnSbQeNIRlRJ+W9KMjYvmaSYbzbjEbzKm\n\t+0fS4O/fPvLNRzDcLm13dLDazjPzSsqkcPnOmghdSTsE3L3aK0rfrhZWBKWgkMeRFijj\n\tM4jfG268P8/V08kuOnjK9QOkzVsZYGcV4/R1hcGUc4SiUgPuutsxttV4cWWRK5lPSoir\n\tsdvvY1ozAY0PTvgNU5HAinY0N9eeYcmp0UrGSq5v3uqlDiqYk6WuHEx4r4DwDEQzQ1bT\n\tiA++lfu0hhewjKenrw0Zl9XObMJMMFivJgN5NeeXQZVyn9ZlbarZG3xthGB3ySJ/EsSw\n\t792Q==","X-Gm-Message-State":"ABy/qLbhPxS/HgtMgzISF4yBCh2POGfJtsDOEQtmTUedZ87gSSYE1NGg\n\tZD18jDAjt5y/YZwK5/eFsftm/ygBoJLoSpA++lwJsjzAedyAVajlhEE=","X-Google-Smtp-Source":"APBJJlGKpF9ofnWFEZeySulwbJSnUAnD5CM6s3rJaoaRFlusgsK7exKMJdOsv6sjQbPtJQcHnCvJhQfiWawbjvU0OIY=","X-Received":"by 2002:a0c:f501:0:b0:635:dd30:8181 with SMTP id\n\tj1-20020a0cf501000000b00635dd308181mr11572554qvm.56.1689586262967;\n\tMon, 17 Jul 2023 02:31:02 -0700 (PDT)","MIME-Version":"1.0","References":"<20230714141549.11085-1-jacopo.mondi@ideasonboard.com>\n\t<20230714141549.11085-5-jacopo.mondi@ideasonboard.com>","In-Reply-To":"<20230714141549.11085-5-jacopo.mondi@ideasonboard.com>","Date":"Mon, 17 Jul 2023 10:30:52 +0100","Message-ID":"<CAHW6GYL9889nPf_A_kssibH3zPwm+XLv1BJ4TL6=n2zFqE-R4A@mail.gmail.com>","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v2 4/9] libcamera: properties: Make\n\t'Rotation' the mounting rotation","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":"David Plowman via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"David Plowman <david.plowman@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]