From patchwork Thu Oct 29 15:20:49 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ray Strode X-Patchwork-Id: 28705 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 93D8CC324C for ; Thu, 29 Oct 2026 15:21:28 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 46D6D690C5; Thu, 29 Oct 2026 16:21:28 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="a6rEGwEO"; dkim-atps=neutral Received: from mail-ua1-x934.google.com (mail-ua1-x934.google.com [IPv6:2607:f8b0:4864:20::934]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 44791690A0 for ; Thu, 29 Oct 2026 16:21:26 +0100 (CET) Received: by mail-ua1-x934.google.com with SMTP id a1e0cc1a2514c-9909e82513fso627503241.0 for ; Thu, 29 Oct 2026 08:21:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793287285; x=1793892085; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=IHti+fr/IQIHe4qZjtG5cAOj1d6oafxj1ukP7XMpcBs=; b=a6rEGwEObclmKiy4Qqy+ZM5UY94qQzyZ4iBxfeV0aXl4wK9Qyk+tRd3Zi8IHoMtn+q sKLpIfgBOVLIKtVa+A/mSSEckezPYF9Sy94zj22n2xsmh9GCvbDwCmsUpb9BL92BABEi rjpm1AyyUfErzDp1bOaZxJNXaQBZp5+jZNG7J9Ul773OvFVRhRgpV0/yDbEgsOWv6bc4 EMyxOs+oiIfE/V2Uehixam4ywdZhXpNwuLNRo1T2UtkO1C7kXZ7uiZxLBCh0xgcQnaQ2 9c5RdWNLx9F2RAw9cxvNvTWCCduQgjLI/U3P5XAVqPxnAQaIFTY4pIRZN5BuPZWiFO+a D2kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793287285; x=1793892085; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=IHti+fr/IQIHe4qZjtG5cAOj1d6oafxj1ukP7XMpcBs=; b=GPh749HENxK27NVSLkkd3OaivUFM9vlO8APpxx24tXR8CF3PlWOsPaperJIUx+ZTJ5 3j1FbFglDOfu6u5az+dSCMV2GCsxEsOb5dXY9De3K+JAcXQxtHGoUfvwwh8iyheheufu ndE1bAdu1DExO8ukTKOS2eMShk00ukl5C2fLk16il0KlhvkRqdtEQjcDOeGZcup4UUEm GIHFhZWaYuhX+01u5rCv1R0Gz3EcOF3ioXvoHbGbApDc6uWJp4FQNtnYJ+rTQjKJA45S I4AdXXizsqfrYVwmKt+xU4dvpZnD7/4MouCwX+1msAaEdvYI3GP/+D5tb30WRlue2AHy elJw== X-Gm-Message-State: AFq9FYKAPov7yCHrUtAf8AzjItc33500B07dM2kVDXnbVeaRgPfBecYr Y20DqTEO2a8DL9bJC2JuzP3LxbuRVW0Zn6GGt3epi1fh4V4AVJoCb26kXWIqn3sE/XE= X-Gm-Gg: AYBFou3e3+eiBz9ibZ3jMqnLTGK8k4Oxt7XgeA560jKRn1ncF9OqYpO3qGWj9xOeIcx ZjIM/2xdHAXVlwjE1h+9DZKJE2Wyfe31GpLgFD6TdRuO8zb0NlP6mvM5emfYmVRg9+ONXOSiE6F gs66vPQsq6rv2alzat6SI047T6FPFpKZcZPwtqenjCeKwCZlD7ZjCpVXFIHM8xoWXsGeY+h+Rmt saxb7dWsJT7VnpBQk+kx+uCHEzxppo0IkAW6+C69GkNJ8lkJX6FZazxU5hWCBUec6VqKON40cFY MQZaXOM1YwQLugyF1H60vsLVWprSzU8CpG4aWgNadMYvK/vOSkRRBXXuIog0gMp2R4GA14YW2n3 Xz8FPgk2EqMQ2837aID89+UK53nVZHwpScSK3Orc5nDEzLn/bR5njKbMfAjO7UOamqoWREViKwx OhAfx/FBw9TR4A0E81z7kOWFMCOAkXp85KZ6JdH35agYcOPqpGlPRHDQDxn2TdyBkHsOXQaEYPs ISoFbZwYB3YgY6Bg4iyijIiH6h0xwwNiNP7ZXuRLqz4KKParHrKHwtE1XrMepcrfjrXO4zTaTPF mhmhDOCMUAKkfp7ZzPJ8zeCjBuRudoUSO6HjueaHM+CHzXyGawM+lotF7w== X-Received: by 2002:a05:6102:4194:b0:7b4:9eba:69dd with SMTP id ada2fe7eead31-7d0543c880dmr909387137.45.1793287284941; Thu, 29 Oct 2026 08:21:24 -0700 (PDT) Received: from localhost ([144.121.52.163]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-991f74e5e22sm206563241.4.2026.10.29.08.21.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2026 08:21:23 -0700 (PDT) From: Ray Strode To: libcamera-devel@lists.libcamera.org Cc: kieran.bingham@ideasonboard.com, bod.linux@nxsw.ie, laurent.pinchart@ideasonboard.com, stefan.klug@ideasonboard.com, martincarvalho@gmail.com Subject: [PATCH v5 02/11] libcamera: Document ScalerCrop in physical pixel-array coordinates Date: Thu, 29 Oct 2026 11:20:49 -0400 Message-ID: <20261029152058.896209-3-halfline@gmail.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261029152058.896209-1-halfline@gmail.com> References: <20261029152058.896209-1-halfline@gmail.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" From: Ray Strode This commit documents ScalerCrop and ScalerCropMaximum in physical pixel-array coordinates. The existing descriptions refer to the active pixel array, while pipelines use native sensor pixels relative to PixelArrayArea. Reported-by: Stefan Klug Signed-off-by: Ray Strode --- src/libcamera/control_ids_core.yaml | 7 +++---- src/libcamera/property_ids_core.yaml | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/libcamera/control_ids_core.yaml b/src/libcamera/control_ids_core.yaml index 73643e7e..5c33db5f 100644 --- a/src/libcamera/control_ids_core.yaml +++ b/src/libcamera/control_ids_core.yaml @@ -668,64 +668,63 @@ controls: method of combination is platform dependent. In this respect, it is not necessarily aimed at providing a way to implement a focus algorithm by the application, rather an indication of how in-focus a frame is. - ColourCorrectionMatrix: type: float direction: inout description: | The 3x3 matrix that converts camera RGB to sRGB within the imaging pipeline. This should describe the matrix that is used after pixels have been white-balanced, but before any gamma transformation. The 3x3 matrix is stored in conventional reading order in an array of 9 floating point values. ColourCorrectionMatrix can only be applied in a Request when the AWB is disabled. \sa AwbEnable \sa ColourTemperature size: [3,3] - ScalerCrop: type: Rectangle direction: inout description: | Sets the image portion that will be scaled to form the whole of the final output image. - The (x,y) location of this rectangle is relative to the - PixelArrayActiveAreas that is being used. The units remain native - sensor pixels, even if the sensor is being used in a binning or - skipping mode. + The rectangle is expressed in native sensor pixels relative to the + properties::PixelArrayArea rectangle, even if the sensor is being used + in a binning or skipping mode. This control is only present when the pipeline supports scaling. Its maximum valid value is given by the properties::ScalerCropMaximum property, and the two can be used to implement digital zoom. - DigitalGain: type: float direction: inout description: | Digital gain value applied during the processing steps applied to the image as captured from the sensor. The global digital gain factor is applied to all the colour channels of the RAW image. Different pipeline models are free to specify how the global gain factor applies to each separate channel. If an imaging pipeline applies digital gain in distinct processing steps, this value indicates their total sum. Pipelines are free to decide how to adjust each processing step to respect the received gain factor and shall report their total value in the request metadata. - FrameDuration: type: int64_t direction: out description: | The instantaneous frame duration from start of frame exposure to start of next exposure, expressed in microseconds. diff --git a/src/libcamera/property_ids_core.yaml b/src/libcamera/property_ids_core.yaml index 171af2a3..f3b4a4aa 100644 --- a/src/libcamera/property_ids_core.yaml +++ b/src/libcamera/property_ids_core.yaml @@ -560,62 +560,62 @@ controls: | |//////| | | y2 o+---+------+---+| | ||///|//////|///|| | PixelArrayArea.height y3 o+---+------+---+| | | |//////| | | y4 o +------+ | | +----+------+----+ / The property reports two rectangles PixelArrayActiveAreas = ((x2, y1, x3 - x2 + 1, y4 - y1 + 1), (x1, y2, x4 - x1 + 1, y3 - y2 + 1)) The first rectangle describes the maximum field-of-view of all image formats in the 4:3 resolutions, while the second one describes the maximum field of view for all image formats in the 16:9 resolutions. Multiple rectangles shall only be reported when the sensor can't capture the pixels in the corner regions. If all the pixels in the (x1,y1) - (x4,y4) area can be captured, the PixelArrayActiveAreas property shall contains the single rectangle (x1,y1) - (x4,y4). \todo Rename this property to ActiveAreas once we will have property categories (i.e. Properties::PixelArray::ActiveAreas) - ScalerCropMaximum: type: Rectangle description: | The maximum valid rectangle for the controls::ScalerCrop control. This reflects the minimum mandatory cropping applied in the camera sensor and - the rest of the pipeline. Just as the ScalerCrop control, it defines a - rectangle taken from the sensor's active pixel array. + the rest of the pipeline. The rectangle is expressed in native sensor + pixels relative to the PixelArrayArea rectangle. This property is valid only after the camera has been successfully configured and its value may change whenever a new configuration is applied. \todo Turn this property into a "maximum control value" for the ScalerCrop control once "dynamic" controls have been implemented. - SensorSensitivity: type: float description: | The relative sensitivity of the chosen sensor mode. Some sensors have readout modes with different sensitivities. For example, a binned camera mode might, with the same exposure and gains, produce twice the signal level of the full resolution readout. This would be signalled by the binned mode, when it is chosen, indicating a value here that is twice that of the full resolution mode. This value will be valid after the configure method has returned successfully. - SystemDevices: type: int64_t size: [n] description: | A list of integer values of type dev_t denoting the major and minor device numbers of the underlying devices used in the operation of this camera. Different cameras may report identical devices.