From patchwork Fri Oct 23 10:21:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 10213 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 CBF0BC3D3C for ; Fri, 23 Oct 2020 10:22:05 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4C55561795; Fri, 23 Oct 2020 12:22:05 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="WR5tJVY+"; dkim-atps=neutral Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DE7D861417 for ; Fri, 23 Oct 2020 12:22:03 +0200 (CEST) Received: by mail-wm1-x32b.google.com with SMTP id k21so801530wmi.1 for ; Fri, 23 Oct 2020 03:22:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=o39mP0rfRnANJkpr9v7fOzyubAuMATIfjfZDwFvKM9Q=; b=WR5tJVY+hnWhIc1gcI0KeqB5HP2TTxn4z25BLAg4cTZ+MZOHx1bb18NPZOHR8spI6Q EtDvmGY6VzhStHwKHSV+YSYQAnQIbNPNyX0q8+EdZ+fwwxuzvsGalf1G62s82LUlm5GZ ug9uGXXW6gy5lVyBFzHna7DMgKAUSEevNYLMU70HW9J7X29ykv0MTnzfNWeXMpsCU+SK r0Z0UGPFBaL2TdUJ0DDfmnT+w71ZuO0p/LjuXA3cUK9/3XrxmCe+5kmhWdJ6kAeqv0X9 0DQqprCGRlRzfGXVByQvFqKGIn5y++fen3AmB7nQDHYceNldzMQCT0FG8gzEWJYj+KRD e1RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=o39mP0rfRnANJkpr9v7fOzyubAuMATIfjfZDwFvKM9Q=; b=Xt4MuIVESjRSLSIoUv104UN6/pJs2sWZPJ6qSJeKBdmCB6hVMH5ZgWFHsHBppp724v P0+cRGU5VBaCUA17AFdaWnTjgaR+EyMittewyV3GHTtufCMBJ8zKTWUwUX8kOA8LvJ0L c/rKfllhmB4UnuOH+E8lvf9f4Zrfne7+1ybK8hiVGRj47nsUAHmbSWirD9S8TEp3Rd+7 CMJX/1A6/4N2QWkLgNwyY9BVJornmlpYXWgMveNt3EniLL2nPbDmf62L7gzKbrqUSjaG J38LJkqFLtz6nYNNxudZ7Uv/F5Sd/9ppMAcMQXcAUcModo02KbE75KczdrNLoQeP1OyA qt0Q== X-Gm-Message-State: AOAM533e61CRgicRcDysBu/+Zj3FAjA5mNt63PLAkT4w+AN+3w0V++13 woY4FfJUAn0qL8YJv9Iu02Si7IvsPXN1jQ== X-Google-Smtp-Source: ABdhPJzpsnjg6+UKpXgRdx86h1fVdaiJPcgsVhhmPYAT+RSTn+W7UMfwr0BABPj43KsQ9M3+aCR8fg== X-Received: by 2002:a1c:dd05:: with SMTP id u5mr1658740wmg.56.1603448523322; Fri, 23 Oct 2020 03:22:03 -0700 (PDT) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id r128sm2477831wma.20.2020.10.23.03.22.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Oct 2020 03:22:02 -0700 (PDT) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Fri, 23 Oct 2020 11:21:54 +0100 Message-Id: <20201023102159.26274-1-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 0/5] Digital zoom 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" Hi everyone Thanks for the reviews and comments, latest version of digital zoom patches attached. I reordered the first couple because the ScalerCrop control seems more fundamental now, so it seemed slightly better before the ScalerCropMaximum one. Don't think it matters much. The main differences are: 1 and 2. These are now the control then the property, as described. 3. Initialisation of the ScalerCropMaximum property is now in the RPi pipeline handler, and to zero values (isNull is our friend). 4. Geometry helpers - a bit more renaming, as usual. I found I had to keep some of the casts because widths and heights tend to be unsigned ints (not just ints). There's a Rectangle::topLeft() function and you now translate by a Point (I'll live with my discomfort on that one). That Rectangle scaling function is now described as a "non-uniform scaling", I think that's something familiar to most people. I agree it was confusing before (I'd described it by the way I used it, rather than what it was), but I think a non-unifrom scaling is clearer than a homothety (actually I had some difficulties with that too). 5. RPi implementation. I fill in the ScalerCrop in the metadata directly now, when the metadata returns from the IPA (which just ignores it). I thought I'd get this lot out there first. In the meantime I'll work on some geometry tests and include them either in the next round or as a separate patch. Thanks and best regards David David Plowman (5): libcamera: Add ScalerCrop control libcamera: Add SensorCropMaximum property libcamera: raspberrypi: Initialise the SensorCropMaximum property libcamera: Add geometry helper functions libcamera: pipeline: raspberrypi: Implementation of digital zoom include/libcamera/geometry.h | 52 +++ include/libcamera/ipa/raspberrypi.h | 1 + src/ipa/raspberrypi/raspberrypi.cpp | 5 + src/libcamera/control_ids.yaml | 13 + src/libcamera/geometry.cpp | 307 ++++++++++++++++++ .../pipeline/raspberrypi/raspberrypi.cpp | 89 ++++- src/libcamera/property_ids.yaml | 14 + 7 files changed, 465 insertions(+), 16 deletions(-)