{"id":17889,"url":"https://patchwork.libcamera.org/api/1.1/patches/17889/?format=json","web_url":"https://patchwork.libcamera.org/patch/17889/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20221124121220.47000-4-jacopo@jmondi.org>","date":"2022-11-24T12:12:14","name":"[libcamera-devel,3/9] libcamera: bayer_format: Expand documentation","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"f14c51642a38949a993ec6a980c994f969c3c437","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/1.1/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/17889/mbox/","series":[{"id":3638,"url":"https://patchwork.libcamera.org/api/1.1/series/3638/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3638","date":"2022-11-24T12:12:11","name":"libcamera: camera_sensor: Centralize flips handling","version":1,"mbox":"https://patchwork.libcamera.org/series/3638/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/17889/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/17889/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 9177FBDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 24 Nov 2022 12:12:33 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 633CC63325;\n\tThu, 24 Nov 2022 13:12:33 +0100 (CET)","from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net\n\t[IPv6:2001:4b98:dc4:8::222])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 870E863319\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 24 Nov 2022 13:12:29 +0100 (CET)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id 9AEAA40004;\n\tThu, 24 Nov 2022 12:12:28 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1669291953;\n\tbh=cbKXWWxWYaYtfLqqRFZdvvo2THZ5IDkTdGBLyyy/Zuo=;\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:\n\tFrom;\n\tb=MIvrqVl4+NDUq2oCPpE94Wb6E4tmHykgxv3ADTtxilwRS0OAW9YGMoQwVCRSMR783\n\tSNZblvR1WV1RxOMxEsabADGO2vwV2xsx5u25FjOoX95asXGWBryG0R5ltJe8rHoYdt\n\tQnK8N+yQ5I9TAaVoUwPSxeEtMqPlKe+t0/iFJfgiZBFtTeHMTG5b+OkBinnT/hSaVM\n\tAiCvPxvoF05An8Wal4Y7wxRyLY/vOmlwYBB7/Qr23SHdkuohvSELd9GhXmWm0uqg57\n\tVoLkDUSZofO0NndugqSKSVJtQXj+zVgUu9Pght57p6Cl1LuCFT7IAcIB92Zdr65Nk7\n\tIjbLs5y3AhM5w==","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 24 Nov 2022 13:12:14 +0100","Message-Id":"<20221124121220.47000-4-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.38.1","In-Reply-To":"<20221124121220.47000-1-jacopo@jmondi.org>","References":"<20221124121220.47000-1-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 3/9] libcamera: bayer_format: Expand\n\tdocumentation","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@jmondi.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The current documentation of the BayerFormat::transform() function\nreports examples on the Bayer components ordering transformation for\nhorizontal flip (mirroring) but not for vertical flip or for the\ncombination of the two.\n\nIt might be useful to complete the documentation to eases understanding\nof the transform() function on a sensor's Bayer pattern.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/bayer_format.cpp | 20 +++++++++++++-------\n 1 file changed, 13 insertions(+), 7 deletions(-)","diff":"diff --git a/src/libcamera/bayer_format.cpp b/src/libcamera/bayer_format.cpp\nindex fdbc4af1dcc0..dd8109ba85c2 100644\n--- a/src/libcamera/bayer_format.cpp\n+++ b/src/libcamera/bayer_format.cpp\n@@ -367,11 +367,14 @@ BayerFormat BayerFormat::fromPixelFormat(PixelFormat format)\n  * \\brief Apply a transform to this BayerFormat\n  * \\param[in] t The transform to apply\n  *\n- * Appplying a transform to an image stored in a Bayer format affects the Bayer\n- * order. For example, performing a horizontal flip on the Bayer pattern\n- * RGGB causes the RG rows of pixels to become GR, and the GB rows to become BG.\n- * The transformed image would have a GRBG order. The bit depth and modifiers\n- * are not affected.\n+ * Applying a transform to an image stored in a Bayer format affects the Bayer\n+ * order. For example, performing a horizontal flip on the Bayer pattern RGGB\n+ * causes the RG rows of pixels to become GR, and the GB rows to become BG. The\n+ * transformed image would have a GRBG order. Performing a vertical flip on\n+ * the Bayer pattern RGGB causes the GB row to be read before the RG one and the\n+ * transformed image would have GBRG order. Applying both vertical and\n+ * horizontal flips on the Bayer patter RGGB results in transformed images with\n+ * BGGR order. The bit depth and modifiers are not affected.\n  *\n  * Horizontal and vertical flips are applied before transpose.\n  *\n@@ -386,8 +389,11 @@ BayerFormat BayerFormat::transform(Transform t) const\n \n \t/*\n \t * Observe that flipping bit 0 of the Order enum performs a horizontal\n-\t * mirror on the Bayer pattern (e.g. RGGB goes to GRBG). Similarly,\n-\t * flipping bit 1 performs a vertical mirror operation on it. Hence:\n+\t * mirror on the Bayer pattern (e.g. RG/GB goes to GR/BG). Similarly,\n+\t * flipping bit 1 performs a vertical mirror operation on it (e.g RG/GB\n+\t * goes to GB/RG). Applying both vertical and horizontal flips\n+\t * combines vertical and horizontal mirroring on the Bayer pattern\n+\t * (e.g. RG/GB goes to BG/GR). Hence:\n \t */\n \tif (!!(t & Transform::HFlip))\n \t\tresult.order = static_cast<Order>(result.order ^ 1);\n","prefixes":["libcamera-devel","3/9"]}