Cover Letter Detail
Show a cover letter.
GET /api/1.1/covers/9511/?format=api
{ "id": 9511, "url": "https://patchwork.libcamera.org/api/1.1/covers/9511/?format=api", "web_url": "https://patchwork.libcamera.org/cover/9511/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20200907164450.13082-1-david.plowman@raspberrypi.com>", "date": "2020-09-07T16:44:46", "name": "[libcamera-devel,RFC,0/4] Digital zoom", "submitter": { "id": 42, "url": "https://patchwork.libcamera.org/api/1.1/people/42/?format=api", "name": "David Plowman", "email": "david.plowman@raspberrypi.com" }, "mbox": "https://patchwork.libcamera.org/cover/9511/mbox/", "series": [ { "id": 1270, "url": "https://patchwork.libcamera.org/api/1.1/series/1270/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1270", "date": "2020-09-07T16:44:46", "name": "Digital zoom", "version": 1, "mbox": "https://patchwork.libcamera.org/series/1270/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/covers/9511/comments/", "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 09341BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 7 Sep 2020 16:44:58 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 827D662BDF;\n\tMon, 7 Sep 2020 18:44:57 +0200 (CEST)", "from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com\n\t[IPv6:2a00:1450:4864:20::32b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 52D6260372\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 7 Sep 2020 18:44:56 +0200 (CEST)", "by mail-wm1-x32b.google.com with SMTP id y15so2139173wmi.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 07 Sep 2020 09:44:56 -0700 (PDT)", "from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72])\n\tby smtp.gmail.com with ESMTPSA id\n\tv3sm27707033wmh.6.2020.09.07.09.44.54\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 07 Sep 2020 09:44:55 -0700 (PDT)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"YJq/WXqh\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=Yj6SmQyP5xG17/iMFzbXgzO8Vd4w1SmfSV3LfK1CnTc=;\n\tb=YJq/WXqhClk52m1QnoBB9qKHaswIIC5rTYdBKgz1m7cLNM4omeZPgU4gHix0SGMYOF\n\thw6Gq34qrqGfKq8ATMyS70Iedr2yYOZ9T7vwPCwMvfP3VI3GTqKWT2wvQNwTHJVKTTHl\n\t7h//f7pEIVWnfbnPxeDMN+mPK8EmmgxyFMKjUrpg7hLybylyjkgUz/SkitFJNZGbdgLd\n\toVhv1l7IJ7QO90LIvuxDOpb5Y5tk9CIvHzuywxlMhbL5WYId+pqK7cGdX4aPIVSAWbKl\n\tuuggjfya33MfCgHUzumJiw18X/F+SYGpf9zEsQE63vqFV651hpYsNM/P8/zht6r4YmX/\n\tvWHQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=Yj6SmQyP5xG17/iMFzbXgzO8Vd4w1SmfSV3LfK1CnTc=;\n\tb=DvyDWGXy+YZMw5I7Z+VGfNVaXxSbdGDvVdhq9RPqbRcROI3REu0FyeOAyGjj6Urqmc\n\tyGb9R6MfUMqjO+ZNjbs8Lg2u/MSG90OsGxFne/JIfLXnW9kDlbhElPIp/O232bEv03Lo\n\tEJcdQ10h/GRUAtHZPoEtKmvxeqEaGASzgrgJ0dl7LqLzVk+wSuT3T6FXqr1hZwKvxsmJ\n\tCY6OUEu+Uhbz30MLuNJuqpW2n5nL10gK80BckgX6oYfMUCWa9vQ+so7jlRCw4VuE72aa\n\t1eq6xd2mCVTyW+1kmlZ8dy8Qr0D2mW/nZfHlZGIix92/CJ7e16q5vlKXSpDbahBVDVbH\n\ttiRw==", "X-Gm-Message-State": "AOAM53246kZ7VYaiW2a2lUW36p/FWjv3C5IixgzQuQsiXvpsruU+I38J\n\t4kSGbY7EzFHMdZZ2wibL1XQDa88cancRqw==", "X-Google-Smtp-Source": "ABdhPJzCZHgVfxvUgY3MGEGKHgrQs58rcmjJ0Li3qUlyy6BqO/ybD3taSxP46l0gsWf3jVWsPI/+uw==", "X-Received": "by 2002:a1c:32c3:: with SMTP id y186mr185766wmy.15.1599497095488;\n\tMon, 07 Sep 2020 09:44:55 -0700 (PDT)", "From": "David Plowman <david.plowman@raspberrypi.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 7 Sep 2020 17:44:46 +0100", "Message-Id": "<20200907164450.13082-1-david.plowman@raspberrypi.com>", "X-Mailer": "git-send-email 2.20.1", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [RFC PATCH 0/4] Digital zoom", "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>", "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>" }, "content": "Hi everyone\n\nI wanted to return to the question of digital zoom. Rather than simply\nwriting a long email I've included an implementation that shows where\nI am. It's changed in the light of exchanges with Jacopo and others,\nand I would say it's \"for discussion\" at this point. Principally:\n\n1. I'd like users to have access to CameraSensorInfo::outputSize, and\nI'm using Camera::properties() to get it. Unfortunately it changes\nwith every camera mode, so will we have to do this differently?\n\n2. The terminology is a bit more Android-like. Because, why not?\n\n3. I'm no longer enforcing any particular method of cropping. But to\nmake life easier for applications I've added some geometry helpers. To\nunderstand the rationale behind these I've included some example code\nfurther down that I think an application might use.\n\nThis work is currently made up of 4 commits:\n\n1. The SensorOutputSize property.\n\n2. The SensorCrop control.\n\n3. The geometry helper functions.\n\n4. Implementation in the Raspberry Pi pipeline handler.\n\nExample Application Code\n\nAssume we have:\n\ncamera - pointer to the Camera object\nstreamCfg - reference to the StreamConfiguration of the output image\nrequest - pointer to a Request object\nzoomFactor - floating point zoom factor, >= 1\ndx - amount in pixels to pan left (-ve) or right (+ve)\ndy - amount in pixels to pan up (-ve) or down (+ve)\n\nYou'll want to understand the helper methods:\n\nSize Size::aspectRatioDown(const Size &ar) const\nReturns a letter/pillarboxed version of this size.\n\nSize operator/(const Size &size, float f)\nDownscale a Size object by f.\n\nRectangle Size::centre(const Rectangle ®ion, int offsetX = 0, int offsetY = 0) const\nReturns a Rectangle of this size centred at the same point as region,\noptionally with offsets.\n\nRectangle Rectangle::clamp(const Rectangle &boundary) const\nTranslates the rectangle so that no part of it lies outside boundary.\n\n1. Basic zooming into the centre\n\nSize area = camera->properties().get(properties::SensorOutputSize);\nSize size = area.aspectRatioDown(streamCfg.size) / zoomFactor;\nRectangle crop = size.centre(Rectangle(area));\nrequest->controls.set(controls::SensorCrop, crop);\n\n(I'm hoping this first one is easy enough to understand!)\n\n2. Zooming anywhere in the sensor output (even into parts of the image that\nwere not intially visible)\n\nSize area = camera->properties().get(properties::SensorOutputSize);\nSize size = area.aspectRatioDown(streamCfg.size) / zoomFactor;\nRectangle crop = size.centre(Rectangle(area), dx, dy).clamp(Rectangle(area));\nrequest->controls.set(controls::SensorCrop, crop);\n\n(As before, but we have offsets dx and dy to enable panning, so we \nmust also clamp the result to be sure it's within the sensor area.)\n\n3. Zooming as before, but not allowing you to pan into anything that\nwasn't initially visible\n\nSize area = camera->properties().get(properties::SensorOutputSize);\nRectangle maxCrop = area.aspectRatioDown(streamCfg.size).centre(area);\nSize size = maxCrop.size() / zoomFactor;\nRectangle crop = size.centre(maxCrop, dx, dy).clamp(maxCrop);\nrequest->controls.set(controls::SensorCrop, crop);\n\n(The subtle difference here is that we clamp the result against maxCrop,\nnot the full sensor area.)\n\n4. Android\n\nThis time we're given the \"crop\" (a Rectangle) that Android has requested. I\nthink Android only requires us to sort out the aspect ratio.\n\nSize size = crop.size().aspectRatioDown(streamCfg.size);\nrequest->controls.set(controls::SensorCrop, size.centre(crop));\n\n\nThat's as far as I've got. Thoughts and comments welcome!\n\nBest regards\nDavid\n\nDavid Plowman (4):\n libcamera: Add SensorOutputSize property\n libcamera: Add SensorCrop control\n libcamera: Add geometry helper functions\n libcamera: pipeline: raspberrypi: Implementation of digital zoom\n\n include/libcamera/geometry.h | 18 +++\n include/libcamera/ipa/raspberrypi.h | 1 +\n src/ipa/raspberrypi/raspberrypi.cpp | 7 +\n src/libcamera/camera_sensor.cpp | 3 +\n src/libcamera/control_ids.yaml | 9 ++\n src/libcamera/geometry.cpp | 129 ++++++++++++++++++\n .../pipeline/raspberrypi/raspberrypi.cpp | 41 ++++++\n src/libcamera/property_ids.yaml | 6 +\n 8 files changed, 214 insertions(+)" }