[{"id":13400,"web_url":"https://patchwork.libcamera.org/comment/13400/","msgid":"<20201022061425.GM3942@pendragon.ideasonboard.com>","date":"2020-10-22T06:14:25","subject":"Re: [libcamera-devel] [PATCH v4 3/5] libcamera: Add ScalerCrop\n\tcontrol","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi David,\n\nThank you for the patch.\n\nOn Mon, Oct 19, 2020 at 01:51:54PM +0100, David Plowman wrote:\n> The ScalerCrop control selects how much of the sensor's output image\n> will be scaled to form the output image. It can be used to implement\n> digital zoom.\n> \n> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> ---\n>  src/libcamera/control_ids.yaml  | 12 ++++++++++++\n>  src/libcamera/property_ids.yaml |  5 ++++-\n>  2 files changed, 16 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml\n> index 4c415545..c6fbcd56 100644\n> --- a/src/libcamera/control_ids.yaml\n> +++ b/src/libcamera/control_ids.yaml\n> @@ -284,4 +284,16 @@ controls:\n>          order in an array of 9 floating point values.\n>  \n>        size: [3x3]\n> +\n> +  - ScalerCrop:\n> +      type: Rectangle\n> +      description: |\n> +        Sets the image portion that will be scaled up to form the whole of\n\nScaled up or down, isn't it ?\n\n> +        the final output image. The selection rectangle is expressed in the\n> +        sensor's native pixels and defined relative to the size of the frame\n> +        described by the ScalerCropMaximum property.\n\nI find it a bit confusing to define this property relatively to its\nmaximum value (and that won't work anymore when ScalerCropMaximum gets\nreplaced by dynamic ControlInfo). How about already defining it\nrelatively to PixelArrayActiveArea ? Maybe something along the lines of\n\n        The rectangle is expressed in the sensor's native pixels, relatively to\n        the properties::PixelArrayActiveArea property.\n\n\nI think we should move here the third paragraph from the documentation\nof SensorCropMaximum.\n\n> +\n> +        This control can be used to implement digital zoom.\n> +\n> +        \\sa properties::ScalerCropMaximum\n\nMaybe\n\n        The maximum valid value for this control is reported by the\n\tproperties::ScalerCropMaximum property.\n\nDoxygen should then automatically generate a link, you wouldn't need the\n\\sa.\n\n>  ...\n> diff --git a/src/libcamera/property_ids.yaml b/src/libcamera/property_ids.yaml\n> index 022cf65d..2d0fe9d3 100644\n> --- a/src/libcamera/property_ids.yaml\n> +++ b/src/libcamera/property_ids.yaml\n> @@ -678,7 +678,10 @@ controls:\n>  \n>          This property is valid only after the Camera has been successfully\n>          configured and its value changes whenever a new configuration is\n> -        applied.\n> +        applied. It can be used to implement digital zoom in conjunction with\n> +        the ScalerCrop control.\n\nWe could keep the mention of digital zoom in the documentation of\nScalerCrop only. What I would however add here is that this property is\npresent if and only if the ScalerCrop control is supported.\n\n> +\n> +        \\sa controls::ScalerCrop\n>  \n>          \\todo Turn this property into a \"maximum control value\" for the\n>          ScalerCrop control once \"dynamic\" controls have been implemented.","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id F0035BDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 22 Oct 2020 06:15:13 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 52EC961059;\n\tThu, 22 Oct 2020 08:15:13 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2483E6034F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 22 Oct 2020 08:15:12 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 93C2053;\n\tThu, 22 Oct 2020 08:15:11 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"lKl2pipC\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1603347311;\n\tbh=slX/xqGvT16zRF1witHg1ZhDyST3z3n8IZWWWZxNOwY=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=lKl2pipCFt4UFOXuDYOpIK+pM2yQWySq4YZs8YQ9BR0Kukrmoq/jSFrydCAE9IRl5\n\tov3qo2SVTNHw5ZwRR+zS2Mm0VqaKsfdRsMKBF0f7RmcTb7OKb/IKJodGE4JEPmZFDS\n\tnlZMWEuITSaLUTYDd9cCdhwmjgSSIKIFLirThAsE=","Date":"Thu, 22 Oct 2020 09:14:25 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"David Plowman <david.plowman@raspberrypi.com>","Message-ID":"<20201022061425.GM3942@pendragon.ideasonboard.com>","References":"<20201019125156.26751-1-david.plowman@raspberrypi.com>\n\t<20201019125156.26751-4-david.plowman@raspberrypi.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20201019125156.26751-4-david.plowman@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH v4 3/5] libcamera: Add ScalerCrop\n\tcontrol","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]