From patchwork Sat Jan 14 19:01:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 18109 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 195E2C3292 for ; Sat, 14 Jan 2023 19:01:56 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5E630625E6; Sat, 14 Jan 2023 20:01:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1673722915; bh=Zc0DY01v0mqDBgfRySrNg2kWg8llcEGHBbvGMqw/P9M=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=ZTHORwFFEHqsWq+hN1smD36ySa3Y1atzhU+nYx2oXHfsPeTowP8BjGfDoqi/j1LtB MKiYx8n7j7VeQHnc0XzLC6x/1NE/s6612Smf0hBYQBuTdw/4GgLyyg23xhG1rZSshc uIWRZlqWrD0f7Gp7rRlumKSMn+4rcciYHXpXJnXRLSS1fZuXyTO+LX9FEUK4z2UBDE rYkej28H6S/GopEFw+3MsGzkUd7rf6axiPwvRJiJxSG7d44RcFSMHOmCSTb3D+lN0S BmVr6Gtj2DTBd8LP523PoFDaSynZ4e/A+HO6VBByMukWw49LSdYo/OaHfDfbG5NC9T PSre2Hvl6/jEg== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E826B625D0 for ; Sat, 14 Jan 2023 20:01:53 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="siZzL3Ue"; dkim-atps=neutral Received: from uno.LocalDomain (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 0A7AA4D4; Sat, 14 Jan 2023 20:01:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1673722913; bh=Zc0DY01v0mqDBgfRySrNg2kWg8llcEGHBbvGMqw/P9M=; h=From:To:Cc:Subject:Date:From; b=siZzL3UeveAIyClAb+gZojGrptXh4hGptAqjy0ZPg/Q4yPu4WIoKdCGCP+jQUf2oi wVQk9INVHm1xUa3B+0ZVqajlmiJJI5tM7KlaSbMcyM4kaEGfcYCw/BNdazIJ7lmVHF fcB2DEIayQLgXquoCqeChLzXuNUEVW/JNCfDabu4= To: libcamera-devel@lists.libcamera.org Date: Sat, 14 Jan 2023 20:01:34 +0100 Message-Id: <20230114190135.19703-1-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/2] libcamera: bayer_format: Expand documentation X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jacopo Mondi via libcamera-devel From: Jacopo Mondi Reply-To: Jacopo Mondi Cc: Jacopo Mondi Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The current documentation of the BayerFormat::transform() function reports examples on the Bayer components ordering transformation for horizontal flip (mirroring) but not for vertical flip or for the combination of the two. It might be useful to complete the documentation to ease understanding of the transform() function on a sensor's Bayer pattern. Signed-off-by: Jacopo Mondi Reviewed-by: David Plowman Reviewed-by: Laurent Pinchart --- src/libcamera/bayer_format.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) -- 2.39.0 diff --git a/src/libcamera/bayer_format.cpp b/src/libcamera/bayer_format.cpp index f27cc1662d25..d2f6698a67ca 100644 --- a/src/libcamera/bayer_format.cpp +++ b/src/libcamera/bayer_format.cpp @@ -356,11 +356,14 @@ BayerFormat BayerFormat::fromPixelFormat(PixelFormat format) * \brief Apply a transform to this BayerFormat * \param[in] t The transform to apply * - * Appplying a transform to an image stored in a Bayer format affects the Bayer - * order. For example, performing a horizontal flip on the Bayer pattern - * RGGB causes the RG rows of pixels to become GR, and the GB rows to become BG. - * The transformed image would have a GRBG order. The bit depth and modifiers - * are not affected. + * Applying a transform to an image stored in a Bayer format affects the Bayer + * order. For example, performing an horizontal flip on the Bayer pattern RGGB + * causes the RG rows of pixels to become GR, and the GB rows to become BG. The + * transformed image would have a GRBG order. Performing a vertical flip on the + * Bayer pattern RGGB causes the GB rows to be read before the RG ones and the + * transformed image would have GBRG order. Applying both vertical and + * horizontal flips on the Bayer patter RGGB results in transformed images with + * BGGR order. The bit depth and modifiers are not affected. * * Horizontal and vertical flips are applied before transpose. * @@ -375,8 +378,11 @@ BayerFormat BayerFormat::transform(Transform t) const /* * Observe that flipping bit 0 of the Order enum performs a horizontal - * mirror on the Bayer pattern (e.g. RGGB goes to GRBG). Similarly, - * flipping bit 1 performs a vertical mirror operation on it. Hence: + * mirror on the Bayer pattern (e.g. RG/GB goes to GR/BG). Similarly, + * flipping bit 1 performs a vertical mirror operation on it (e.g RG/GB + * goes to GB/RG). Applying both vertical and horizontal flips + * combines vertical and horizontal mirroring on the Bayer pattern + * (e.g. RG/GB goes to BG/GR). Hence: */ if (!!(t & Transform::HFlip)) result.order = static_cast(result.order ^ 1); From patchwork Sat Jan 14 19:01:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 18110 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 50858C3293 for ; Sat, 14 Jan 2023 19:01:57 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0E220625D8; Sat, 14 Jan 2023 20:01:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1673722917; bh=zfvoRnfTXClKZjJpUtqg98Jmt0xliyJXn4yCX4b4ylU=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=T7uYsH8IdgwA04LsNpMESAyoV8RH33GMLEfGJwyaq7Krl+WDaHl7+wdAELDevu5DH oFvbt0ga/2bXTJ9lzNV7JpQSRPhvWujqL2mEW7jfuNoivO1BN9dgnrg64SDPCA4LvS 2/UsxA6NTWSMO0dglZLH5kgT9wS3v2E/mFiV9yqR6BFIFKyABViLkuLVaQUVho5pyk dl3ibCMyaAYsjyXJQJFUfw41rVNENDwraozw9hvSl/FF8+h73BIuIfDMBIOyunwDDZ bA1OhtiQ4R0ZLKzUS0V/tEgNs6fji5teTTw0oGqRVFTOvr3y8FKjU3yI1J4xSxQwlk NWQMmcyDDlnlg== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C64D3625D0 for ; Sat, 14 Jan 2023 20:01:54 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="M9vmB0Nn"; dkim-atps=neutral Received: from uno.LocalDomain (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 03E0B4DD; Sat, 14 Jan 2023 20:01:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1673722914; bh=zfvoRnfTXClKZjJpUtqg98Jmt0xliyJXn4yCX4b4ylU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M9vmB0Nnmee6vfXrUC+bwvBcGIy/vpD4wWR+GrYCd+nadkWrxXLWeLGGXTiE6e91b Sz0Q3qj9h7IXWDyD1DEXv1wXb1IpDEST021HHPFZpZr96BGtgv+c4iYK5Ol11bGXGz Z2VTHOCQQj/jZPv3O3TcaUARwDGQO7V3G2/IwXJo= To: libcamera-devel@lists.libcamera.org Date: Sat, 14 Jan 2023 20:01:35 +0100 Message-Id: <20230114190135.19703-2-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230114190135.19703-1-jacopo.mondi@ideasonboard.com> References: <20230114190135.19703-1-jacopo.mondi@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/2] libcamera: rkisp1: Re-sort includes X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jacopo Mondi via libcamera-devel From: Jacopo Mondi Reply-To: Jacopo Mondi Cc: Jacopo Mondi Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Comply with a checkstyle suggestion and separate inclusion directives. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index c27b3ef9bd8e..5bdb4d255f6a 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -23,11 +23,12 @@ #include #include #include +#include +#include + #include #include #include -#include -#include #include "libcamera/internal/camera.h" #include "libcamera/internal/camera_sensor.h"