From patchwork Thu Jul 24 06:52:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Scally X-Patchwork-Id: 23920 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 B3627C3323 for ; Thu, 24 Jul 2025 06:53:26 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E31AB6908C; Thu, 24 Jul 2025 08:53:20 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="bCswFjzI"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2382169083 for ; Thu, 24 Jul 2025 08:53:15 +0200 (CEST) Received: from mail.ideasonboard.com (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 32A7F7F0; Thu, 24 Jul 2025 08:52:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1753339956; bh=5RAKvTIfp8RHT/B2l1kVT4fZU1T6Wk1qqcrv8/GTyvg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bCswFjzIT5llmBXM/+4ZIah7qDC5Fe/T3MTff2+RqVeDplw2mXvs4NqzWl9N9+Xyt QgYeIPYtn3bj6YCj6G2XPtOcBCIs75TuV8yBcwWKOVAq7Rj3cJSQ4+YKDfNnpEst1k JmeMBF3toSSI5muADrw/3gwYrVK0brjvuVcdbbZg= From: Daniel Scally To: libcamera-devel@lists.libcamera.org Cc: Daniel Scally Subject: [PATCH 03/10] libcamera: bayer_format: Add "NONE" to BayerFormat::Order enum Date: Thu, 24 Jul 2025 07:52:49 +0100 Message-Id: <20250724065256.75175-4-dan.scally@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250724065256.75175-1-dan.scally@ideasonboard.com> References: <20250724065256.75175-1-dan.scally@ideasonboard.com> MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add a NONE entry to BayerFormat::Order enumeration to denote pixel formats encoding bayer data but which do not correspond to a specific order. Signed-off-by: Daniel Scally Reviewed-by: Kieran Bingham --- include/libcamera/internal/bayer_format.h | 3 ++- src/libcamera/bayer_format.cpp | 3 +++ src/libcamera/sensor/camera_sensor_legacy.cpp | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/libcamera/internal/bayer_format.h b/include/libcamera/internal/bayer_format.h index 5c14bb5f..9b6b5b58 100644 --- a/include/libcamera/internal/bayer_format.h +++ b/include/libcamera/internal/bayer_format.h @@ -27,7 +27,8 @@ public: GBRG = 1, GRBG = 2, RGGB = 3, - MONO = 4 + MONO = 4, + NONE = 5 }; enum class Packing : uint16_t { diff --git a/src/libcamera/bayer_format.cpp b/src/libcamera/bayer_format.cpp index 3dab91fc..89fe10ed 100644 --- a/src/libcamera/bayer_format.cpp +++ b/src/libcamera/bayer_format.cpp @@ -49,6 +49,9 @@ namespace libcamera { * \brief R then G on the first row, G then B on the second row. * \var BayerFormat::MONO * \brief Monochrome image data, there is no colour filter array. + * \var BayerFormat::NONE + * \brief Bayer-formatted data but without a specific order, which will have to + * be discerned through other means. */ /** diff --git a/src/libcamera/sensor/camera_sensor_legacy.cpp b/src/libcamera/sensor/camera_sensor_legacy.cpp index 32989c19..232a8525 100644 --- a/src/libcamera/sensor/camera_sensor_legacy.cpp +++ b/src/libcamera/sensor/camera_sensor_legacy.cpp @@ -641,6 +641,12 @@ int CameraSensorLegacy::initProperties() case BayerFormat::MONO: cfa = properties::draft::MONO; break; + case BayerFormat::NONE: + LOG(CameraSensor, Warning) + << "Sensor declares no CFA pattern. This is extremely unlikely " + << "and should be investigated as a likely error."; + cfa = properties::draft::MONO; + break; } properties_.set(properties::draft::ColorFilterArrangement, cfa);