From patchwork Tue Dec 21 05:21:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 15196 X-Patchwork-Delegate: paul.elder@ideasonboard.com 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 074B7C3258 for ; Tue, 21 Dec 2021 05:21:42 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6AF3360900; Tue, 21 Dec 2021 06:21:41 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Sx4qrh7N"; dkim-atps=neutral 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 DBADC608E9 for ; Tue, 21 Dec 2021 06:21:38 +0100 (CET) Received: from pyrite.mediacom.info (unknown [IPv6:2604:2d80:ad90:fb00:96fd:8874:873:6c16]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E46A6FD2; Tue, 21 Dec 2021 06:21:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1640064098; bh=lvzxjxk8Y7gghV6xWsurAK6br6ca/jZZX4EQ/+9ClTo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Sx4qrh7N+TQ4I/mlgcmkF8NOMSfCU57MeFCgK/GCuowZfilnlItjBFkKfVDaq02RW sC7WBVLVUOBnb2yPRaxfG8AiEVQeK2IZ6MtEtCibxG/6n4s9q3AulLGkKilxbbdXXy EP61pMPF2I2YM0p+D39l03ObMbmLaKgyUSuarOYo= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Mon, 20 Dec 2021 23:21:15 -0600 Message-Id: <20211221052117.2665228-3-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211221052117.2665228-1-paul.elder@ideasonboard.com> References: <20211221052117.2665228-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/3] camera_sensor_properties: Add blackLevels 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 an entry to the sensor database for the static black levels. As these are approximate static values for the black levels, they can reasonably be tied to the sensor model. Thus add it to the sensor database. Bug: https://bugs.libcamera.org/show_bug.cgi?id=48 Signed-off-by: Paul Elder --- .../libcamera/internal/camera_sensor_properties.h | 2 ++ src/libcamera/camera_sensor.cpp | 1 + src/libcamera/camera_sensor_properties.cpp | 13 +++++++++++++ 3 files changed, 16 insertions(+) diff --git a/include/libcamera/internal/camera_sensor_properties.h b/include/libcamera/internal/camera_sensor_properties.h index 1ee3cb99..91826e2d 100644 --- a/include/libcamera/internal/camera_sensor_properties.h +++ b/include/libcamera/internal/camera_sensor_properties.h @@ -7,6 +7,7 @@ #pragma once +#include #include #include @@ -20,6 +21,7 @@ struct CameraSensorProperties { Size unitCellSize; std::map testPatternModes; + std::array blackLevels; }; } /* namespace libcamera */ diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp index c3999d35..f9dd00bb 100644 --- a/src/libcamera/camera_sensor.cpp +++ b/src/libcamera/camera_sensor.cpp @@ -306,6 +306,7 @@ void CameraSensor::initStaticProperties() /* Register the properties retrieved from the sensor database. */ properties_.set(properties::UnitCellSize, staticProps_->unitCellSize); + properties_.set(properties::SensorFixedBlackLevels, staticProps_->blackLevels); initTestPatternModes(); } diff --git a/src/libcamera/camera_sensor_properties.cpp b/src/libcamera/camera_sensor_properties.cpp index 48305ac4..d4485f45 100644 --- a/src/libcamera/camera_sensor_properties.cpp +++ b/src/libcamera/camera_sensor_properties.cpp @@ -41,6 +41,11 @@ LOG_DEFINE_CATEGORY(CameraSensorProperties) * \brief Map that associates the TestPattern control value with the indexes of * the corresponding sensor test pattern modes as returned by * V4L2_CID_TEST_PATTERN. + * + * \var CameraSensorProperties::blackLevels + * \brief Fixed black level offset for each of the four color filter + * arrangement (CFA) mosaic channels, specified in the same order as the order + * of color filters. */ /** @@ -69,6 +74,7 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen * 9: "Resolution Pattern" */ }, + .blackLevels = {}, } }, { "imx219", { .unitCellSize = { 1120, 1120 }, @@ -79,6 +85,7 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen { controls::draft::TestPatternModeColorBarsFadeToGray, 3 }, { controls::draft::TestPatternModePn9, 4 }, }, + .blackLevels = {}, } }, { "imx258", { .unitCellSize = { 1120, 1120 }, @@ -89,10 +96,12 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen { controls::draft::TestPatternModeColorBarsFadeToGray, 3 }, { controls::draft::TestPatternModePn9, 4 }, }, + .blackLevels = {}, } }, { "ov5647", { .unitCellSize = { 1400, 1400 }, .testPatternModes = {}, + .blackLevels = {}, } }, { "ov5670", { .unitCellSize = { 1120, 1120 }, @@ -100,6 +109,7 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen { controls::draft::TestPatternModeOff, 0 }, { controls::draft::TestPatternModeColorBars, 1 }, }, + .blackLevels = {}, } }, { "ov5693", { .unitCellSize = { 1400, 1400 }, @@ -112,6 +122,7 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen * Rolling Bar". */ }, + .blackLevels = {}, } }, { "ov8865", { .unitCellSize = { 1400, 1400 }, @@ -126,6 +137,7 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen * 5: "Color squares with rolling bar" */ }, + .blackLevels = {}, } }, { "ov13858", { .unitCellSize = { 1120, 1120 }, @@ -133,6 +145,7 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen { controls::draft::TestPatternModeOff, 0 }, { controls::draft::TestPatternModeColorBars, 1 }, }, + .blackLevels = {}, } }, };