From patchwork Thu Oct 29 13:26:23 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ray Strode X-Patchwork-Id: 28693 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 4235AC324C for ; Thu, 29 Oct 2026 13:27:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id EB98C690A1; Thu, 29 Oct 2026 14:26:59 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="aWCO0Inc"; dkim-atps=neutral Received: from mail-vs1-xe2b.google.com (mail-vs1-xe2b.google.com [IPv6:2607:f8b0:4864:20::e2b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 90B1D68E07 for ; Thu, 29 Oct 2026 14:26:58 +0100 (CET) Received: by mail-vs1-xe2b.google.com with SMTP id ada2fe7eead31-7d06763335aso97992137.2 for ; Thu, 29 Oct 2026 06:26:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793280417; x=1793885217; 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=zh8mCc3S85t3QNibQ+vsW6Os+PVjwfEdCMMDzh9ZqG4=; b=aWCO0Incw7jjdwHpwusHw2sMtk2aOmpUn8KtcXo5Ip6SAanqLNLpTTA3xEOusfOKLu B4mU3FXbyUDKx/NQrBrPuiEqoJoP1ECNJcsa+N8aocrbaG3C6l8gPhZSViRKZePaJCIM 2DbJ/C8//xUSrrYJqlCjKCvuUOLT/7jtoRkH9tzj9tBs3G9ojsE7A9F8c2vc1NUluggw mlUgKj68ecWOMU6Z10TYh1eyp3eMM7qpa+FkysKcEUKN1rliI2MYmOEONJQO883nWAzM AbXP+U6zObS1tOnVn97up2Zz/aB9tVFtn49TyFS5jAffvsOwIEgXimq38/bJxj9JF26x n/Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793280417; x=1793885217; 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=zh8mCc3S85t3QNibQ+vsW6Os+PVjwfEdCMMDzh9ZqG4=; b=wnaQlaeUMOQOIvkad+TxyjgaGhAwqcL5zcDfduF+cyRhiOAiV4oKrQZOnfG1uXMAdC qhblxIfORFa1rbvqAyVTmyYLOWXJY8CXesLgWY4ZARoj677RXOS30RKoNVUcTTvqvIP6 dKePDv2CM+9NPLkj7CFmikfzYdUToFiotAeItH/GsNVVATEX3kPf1BJUDsvQ4g2VWMQG ohZFpPuh5UHrewS9UFIraHgWrIvqDIe3/nM59oarLhy7F5rb5W2mvm7J455KJfEtFCDf oWM26s6LIdT/4f+2GAPqoCowbWOFPgJivC0/3hVC1elwSlH/WZW1+czIvf7CNnY6qiXQ 4Smg== X-Gm-Message-State: AFq9FYJV4vA19U443WjswWSFHdq/nEn4IL6amQSLoFTqVV6QvzBn2V+r GULjZQoXsmkmDExcFPMEM9W6OD9Sa+RuIUn3p27JfxymvwTQYadlVA0P5jEoNStDA4o= X-Gm-Gg: AYBFou2Sxj0l5jDQ6s0Oft2CVO5f+xyidNWlwAaHdA4fLLeQJKbo6zdfnc8l377Tqpz uesNBnmmJaIbOEscrWXUGYghzCPYg4s/ylL4edia3/iGwLuzF4TqYd1OIiHh87WY5nvETQ//Wrl YR7pdwW73yEgTEn4JDQcMF+j+es4NCU6BNwJhav1VFF7suavbhAYgCTJeD3x/HGItHmW9gZuM0N iz8Ntb4gzQSRK9ATUKtHjcEwrRSqmIz7yc319tIcIxTFeLq1nZaG7Yzp6bymTH11hN6TGMkKozf I/oPCPRElpP6Xx0fp5Etlqlb6WsR351AQ+y9OORG3xzCfubtnCNmOiJDO/BBjPsS7D+czmhTR2N wN07dlR/RtCkgBAD9L7QwB3sMxsE9gzlMBlqohDd49VrwSoMxbiVQdE7JQpABNbDcZ6RtZUm24b l8VylGoMv0fUF5pMM8Z9ly6yiXLtYQ8vcYpJgayc8LKzCxatLUDtcX+elRevdUc8NdY7ZZ9chpB L+WAYCONjo6dlQToB7HCfAz67WCB20MvfiSSw+V+KVeZRdMvct642TWWUFYJwxQQQf+vYLgcztz 9MVbcz2JArqrzt+zNv5IGZv+PWASrHMFK5saVJGHG9h2Q62lKAh9NqBL X-Received: by 2002:a05:6102:6f09:b0:7cc:b055:f75b with SMTP id ada2fe7eead31-7d03a629bbdmr1827406137.32.1793280415891; Thu, 29 Oct 2026 06:26:55 -0700 (PDT) Received: from localhost ([144.121.52.163]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-99125931983sm9476046241.2.2026.10.29.06.26.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2026 06:26:53 -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 v4 1/9] libcamera: Document ScalerCrop in physical pixel-array coordinates Date: Thu, 29 Oct 2026 09:26:23 -0400 Message-ID: <20261029132631.370507-2-halfline@gmail.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261029132631.370507-1-halfline@gmail.com> References: <20261016202818.1405645-1-halfline@gmail.com> <20261029132631.370507-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 The ScalerCrop documentation describes its origin relative to an active area, while pipelines report physical pixel-array coordinates. The ScalerCropMaximum description also refers to the active pixel array. Describe both rectangles relative to PixelArrayArea, with coordinates and dimensions in native sensor pixels. 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(-) base-commit: b174b52cb8700320b20cd3a5cb275107f908e0c1 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.