[{"id":38983,"web_url":"https://patchwork.libcamera.org/comment/38983/","msgid":"<178041503794.66229.14626181372145996771@localhost>","date":"2026-06-02T15:43:57","subject":"Re: [PATCH 0/2] pipeline: simple: Add ScalerCrop reporting","submitter":{"id":184,"url":"https://patchwork.libcamera.org/api/people/184/","name":"Stefan Klug","email":"stefan.klug@ideasonboard.com"},"content":"Hi Kieran,\n\nQuoting Kieran Bingham (2026-05-07 17:25:32)\n> While the Simple Pipeline handler doesn't support ScalerCrop, it can be\n> beneficial to report the ScalerCropMaximum and the ScalerCrop metadata\n> anyway as applications can use this information to determine the\n> positioning of the pixels captured in respect to the active area.\n> \n> This series reports the AnalogCrop as the ScalerCropMaximum in the\n> camera properties, and also as the the ScalerCrop in each completed\n> frame metadata.\n> \n> I'm curious on opinions if we should have more specific names for\n> reporting this metadata when theres' not actually a ScalerCrop\n> involved... \n\nI think that would be beneficial.\n\nMy proposal would be to add a PixelArray property of type Rectangle.\nThis would complement PixelArraySize [1] by also specifying the offset.\n\nThe documentation of PixelArrayActiveAreas [2] even mentions the\n\"PixelArraySize rectangle\" which could then become the \"PixelArray\nrectangle\".\n\nThis series uses the analog crop rectangle for the ScalerCrop. I fear\nthis is not according to documentation the same way as it is on rkisp1.\nIn both cases we report ScalerCrop relative to the physical pixel array\nand not relative to the libcamera \"PixelArraySize\" (effectively we would\nneed to set the offset to 0 in this case to comply with the docs.) But\nthen we'd need the above mentioned PixelArray property to get the offset\nin physical world.  I don't know how right or wrong other platforms are\n(especially Rpi), but it ties into the rectangles discussion.\n\nSo question is: Merge this in even though it is as wrong as rkisp1 or\nclarify the proper behavior first (I have a slight hope that other\nplatforms do the same mistake as rkisp1) and we could change the docs to\nsay ScalerCrop references the physical array...\n\n[1] https://docs.libcamera.org/master/internal-api/namespacelibcamera_1_1properties.html#aac88aeb6478c1f8528cc08521486dae3 \n[2] https://docs.libcamera.org/master/internal-api/namespacelibcamera_1_1properties.html#acec5675f79b6c456aca72c7532a263a4\n\n> \n> With this series, it's possible to view the bounding rectangles and crop\n> positions of the selected modes in camshark.\n\nIn my sklug/next branch I reworked the rectangle drawing. It might make\nsense to double check with the current version. My expectation is that\nthe ScalerCrop is as big as PixelArraySize, but offset from it.\n\nBest regards,\nStefan\n\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n> Kieran Bingham (2):\n>       pipeline: simple: Report ScalerCropMaximum camera property\n>       pipeline: simple: Report the ScalerCrop\n> \n>  src/libcamera/pipeline/simple/simple.cpp | 13 +++++++++++++\n>  1 file changed, 13 insertions(+)\n> ---\n> base-commit: 183e37362f57ff3ce7493abf0bc6f1b57b931f55\n> change-id: 20260507-kbingham-simple-scaler-crop-60b506e2bc4c\n> \n> Best regards,\n> -- \n> --\n> Kieran\n>","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 AA024BDCBC\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  2 Jun 2026 15:44:03 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8833263138;\n\tTue,  2 Jun 2026 17:44:02 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 934FF61754\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  2 Jun 2026 17:44:00 +0200 (CEST)","from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:a238:bd09:2239:cb8b])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2927A78C;\n\tTue,  2 Jun 2026 17:43:37 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"tOLSr3pH\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1780415017;\n\tbh=sa+Z+R2WL02R4hfWMcGfciYdPnCNv45xxvJY1GHAboM=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=tOLSr3pH7o8huR1PNMIHBEGBpky7vj0frmHMcucLVvkAgQF2myyUtZA4jF9vUEIDb\n\tGJyPdpjjMqFd2rgGUqC9dfFemJ+tvxIdN9GVq2w9MBzR/T4QrjEmL+tVk9TXkwdn3X\n\t/Z0hswG+40wZ1Kt9D7WBQNQHaN+U/okDlohWJ5rU=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20260507-kbingham-simple-scaler-crop-v1-0-7a5af1948565@ideasonboard.com>","References":"<20260507-kbingham-simple-scaler-crop-v1-0-7a5af1948565@ideasonboard.com>","Subject":"Re: [PATCH 0/2] pipeline: simple: Add ScalerCrop reporting","From":"Stefan Klug <stefan.klug@ideasonboard.com>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Tue, 02 Jun 2026 17:43:57 +0200","Message-ID":"<178041503794.66229.14626181372145996771@localhost>","User-Agent":"alot/0.12.dev43+g2cacc0d03","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]