From patchwork Fri Dec 6 14:52:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 22218 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 A2AC1BF415 for ; Fri, 6 Dec 2024 14:52:53 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 680666615F; Fri, 6 Dec 2024 15:52:53 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="g0GFToL6"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6CF0A6614C for ; Fri, 6 Dec 2024 15:52:50 +0100 (CET) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:3543:aebe:e043:ef86]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CBFAB641; Fri, 6 Dec 2024 15:52:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1733496740; bh=OD6S88E9NiwAvWE9IB9CFpL4roYQ0zm9YER3Y/+TXgM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g0GFToL6UZd87UCIuSneaxSXEHU8wgU4BpACscwPkKjodUQtodEhFT4wsaAGsG1Mg Cpd5MPSYE0s2ZdXvz/rzhOg0gHh+rlbE3t5glWVIxrtp7bIXaOh1UgDDhpVaCL8Ytm EQkeNtsf/B6UwtUdhPCPvNAfueLIXKA5JOmbO9dc= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug , Paul Elder Subject: [PATCH v5 1/8] libcamera: controls: Update the ColourTemperature control to be writable Date: Fri, 6 Dec 2024 15:52:21 +0100 Message-ID: <20241206145242.827886-2-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241206145242.827886-1-stefan.klug@ideasonboard.com> References: <20241206145242.827886-1-stefan.klug@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" For manual control it is helpful to be able to specify a fixed colour temperature. It also provides an easy way to apply the temperature specific CCMs and colour gains that are contained in the tuning files. Document this and update the control dependencies. Signed-off-by: Stefan Klug Reviewed-by: Paul Elder Reviewed-by: Kieran Bingham --- Changes in v5: - Improve documentation --- src/libcamera/control_ids_core.yaml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/libcamera/control_ids_core.yaml b/src/libcamera/control_ids_core.yaml index d45cf8e56187..3795f7169911 100644 --- a/src/libcamera/control_ids_core.yaml +++ b/src/libcamera/control_ids_core.yaml @@ -283,7 +283,19 @@ controls: description: | Enable or disable the AWB. + When AWB is enabled, the algorithm estimates the colour temperature of + the scene, and computes colour gains and the colour correction matrix + automatically. The computed colour temperate, gains and correction + matrix are reported in metadata. The corresponding controls are ignored + if set in a request. + + When AWB is disabled, the colour temperature, gains and correction + matrix are not updated automatically and can be set manually in + requests. + + \sa ColourCorrectionMatrix \sa ColourGains + \sa ColourTemperature # AwbMode needs further attention: # - Auto-generate max enum value. @@ -341,14 +353,25 @@ controls: ColourGains can only be applied in a Request when the AWB is disabled. \sa AwbEnable + \sa ColourTemperature size: [2] - ColourTemperature: type: int32_t description: | - Report the estimate of the colour temperature for the frame, in kelvin. + Report the current estimate of the colour temperature, in kelvin, for + this frame. An implementation may allow this control to be set when AWB + is disabled. In that case ColourGains and the ColourCorrectionMatrix get + set accordingly. If ColourGains and ColourTemperature are specified at + the same time, ColourGains takes precedence. The same applies to + ColourCorrectionMatrix. + + The metadata will only report measured colour temperature values when + available, even if set manually. - The ColourTemperature control can only be returned in metadata. + \sa AwbEnable + \sa ColourCorrectionMatrix + \sa ColourGains - Saturation: type: float @@ -405,6 +428,8 @@ controls: stored in conventional reading order in an array of 9 floating point values. + \sa AwbEnable + \sa ColourTemperature size: [3,3] - ScalerCrop: