From patchwork Tue Sep 22 10:03: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: 9698 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 A003EBF01C for ; Tue, 22 Sep 2020 10:04:08 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4D4E462FD4; Tue, 22 Sep 2020 12:04:08 +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="GluTM2oD"; 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 1847560365 for ; Tue, 22 Sep 2020 12:04:07 +0200 (CEST) Received: by mail-wm1-x32b.google.com with SMTP id s13so2683712wmh.4 for ; Tue, 22 Sep 2020 03:04:07 -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=JMhQVsv8+bmjyKMVH+ha/KKKDITF+q3834DDRpNcmq0=; b=GluTM2oDCgDU/DFCaUSuSG9afClgPolsh3ljh9q8maeybPGVXIPGvUI6J5EqQ3qkXY 0bDDrLEf+l5l3MBbZntPQ0J9ES7vVm6jZ8xivTlm4jBTr/RZzd6ji9Zc9kskoGctDyqX m5aklMxF76S713gC1+Jgl0osipG3xfP4qspFFzTCsr3YGb1FVP1uYG9nats2y974y+PY tIEWH1VL8Q7GzvcbO/KzFdE32ku1jxbHhBXTf31l+8XhmqbauzeLnXWiauu+QkWwKWOQ g50haF4xb4h7/bdahZGsCe0DW9VzjDRfws0MheZLmKn5MVRCcwufIIynGQWfa4CasNt4 3/NA== 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=JMhQVsv8+bmjyKMVH+ha/KKKDITF+q3834DDRpNcmq0=; b=UhFEjaCiIqFaczXleY5elefedTj0CnkPBf0XY84lOMhzKQ9VuXPndkj310Ntg3J648 uDyF3io1nKqoaka4b0S2WRFSbgGcNPwJ6bnvmp4bv/WogzOSe787v5tFehSbpEVVQeMh 3ZLLrKbusLMLsGRPjhF10HalnuKYBrB8GAl+/Q7UUvkysHr0J4T2iZy0LwadRxobGiNs eF8rZsazQpUoWt4e+7Z2mPgoiC5LZnRHA2gk2kMmNZ0w8UxBCnrd765Offqg1zpSPOli mlqLpTwEXQCU/F3Xmh4A+Turnf7sNMKoBl7w7ISQjWgR/+VwLdVcU7+nPUkBp8MBeMWr b2ZA== X-Gm-Message-State: AOAM531WJfx/B5jYyg2v6oFfauGJsy2B+BC8Om+5YGXujK03GovaRIti wDl2A35KzwoEUYgKTCMntl3nqsrDm3CSrg== X-Google-Smtp-Source: ABdhPJwmBs0fTaloQo5J8fQ9++VqffCzZrlTVAURzYzU/jM+YMoIaAkHK81ctv0FLVQc8DdXKVj3mA== X-Received: by 2002:a1c:4e08:: with SMTP id g8mr122500wmh.53.1600769046460; Tue, 22 Sep 2020 03:04:06 -0700 (PDT) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id g14sm26369595wrv.25.2020.09.22.03.04.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2020 03:04:05 -0700 (PDT) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Tue, 22 Sep 2020 11:03:54 +0100 Message-Id: <20200922100400.30766-1-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/6] 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 Here's an attempt at a workable digital zoom implementation, following the lines of my previous set of patches plus all of Jacopo's suggestions (unless I missed any!). The differences from last time are: * The first patch has been broken up and now only adds the SensorOutputSize property. A new second patch initialises it (now to non-zero values). The initialisation within the RPi pipeline handler has been moved to the later patch that contains the RPi implementation. Now all the patches except that RPi specific one are "RPi-free". * The SensorCrop control has been renamed again!! This time it's IspCrop. * I've renamed and updated the documentation for those geometry helper functions. * There's a new final patch where I've added a command line parameter to qcam that lets you set the digital zoom. I don't mind whether we do or don't use this patch, but I thought it might be helpful when other pipelines want to implement digital zoom. I don't do anything "clever" like worry about aspect ratios or anything, you just get what you request. One final question on all this. I wrote some sample application code in my previous discussion which I think would be helpful to include somewhere. Otherwise it's quite a difficult leap from the function-level documentation to the "proper" way to use them. What do people think? Where might something like that go? Thanks and best regards David David Plowman (6): libcamera: Add SensorOutputSize property libcamera: Initialise the SensorOutputSize property libcamera: Add IspCrop control libcamera: Add geometry helper functions libcamera: pipeline: raspberrypi: Implementation of digital zoom qcam: Add command line option to test IspCrop control include/libcamera/geometry.h | 20 +++ include/libcamera/ipa/raspberrypi.h | 1 + src/ipa/raspberrypi/raspberrypi.cpp | 7 + src/libcamera/camera_sensor.cpp | 6 + src/libcamera/control_ids.yaml | 9 ++ src/libcamera/geometry.cpp | 131 ++++++++++++++++++ .../pipeline/raspberrypi/raspberrypi.cpp | 47 +++++++ src/libcamera/property_ids.yaml | 12 ++ src/qcam/main.cpp | 3 + src/qcam/main_window.cpp | 20 +++ src/qcam/main_window.h | 1 + 11 files changed, 257 insertions(+)