From patchwork Fri Aug 21 15:56:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 9348 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 81FE6BE173 for ; Fri, 21 Aug 2020 15:57:05 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 988FD620D6; Fri, 21 Aug 2020 17:57:04 +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="o4V+HaR4"; dkim-atps=neutral Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CC28360383 for ; Fri, 21 Aug 2020 17:57:02 +0200 (CEST) Received: by mail-wm1-x332.google.com with SMTP id p14so2401230wmg.1 for ; Fri, 21 Aug 2020 08:57:02 -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=YglxDJdogXz2ctaY3bq0Lb1aXaeHP2cNz/4ZKmf+hbA=; b=o4V+HaR4MdxxvxrFxu9ALkVpbFTBrrMqtZczLVjTmO6smv9gFLksCxER0LMFjyznzP iRnqlOgYPAEJFKDiyGPxIuwE7AU13dC09PeRqNv6dz+ANBeW/MXDq50NzQjdUpKMlHGS uBdjZzdhS5uHfocq/ht7vs2Ne5d62+gUy9pQmFSBJtVsp8+GNdHznhDNfIKo8xwe68fj QAQKqspm+87SGEaEYl3j8XE9VK6M8mfg5Nz30ojw6axtODjxDgOvOvjXDTA27hg4fQp0 ySyQzlCTyOarOoWxVjVeoA0SIdfgeetuAVlgbfPqn4zhrHFmzQ/Ctb0d3NJf5XtZTMgO xm4g== 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=YglxDJdogXz2ctaY3bq0Lb1aXaeHP2cNz/4ZKmf+hbA=; b=TJdY9TYdQbOHK7bGLdC9nM7FjDRKuk8MBVaKFKVcfqX7XzpsKbtID2w9Auu8eXxcUY 14vC7Qq6JkSduCG/zdYStC/aWX0Psk47B+QmTsYUitLxHdFP1JPVjajdZOrcTA/HVTVw go720gtrbapYgBS2KV/Zz9Q8uklb7hCrS2ZceN+IZdIQw+7pZonFgBLXcS9JtZy0IbqB ruVdOdqpPT7DajxzGnV7UcIhkN7N5zf7K9ZfBtoTLyxKSpAMsPRmFzUb9FuQn5UFE/EA P3Cq/UqHmEk1r/CLixC0/7kp/liWa54xsoZ+Qn/pX1F20toN32zbS47eO6N37vORDk6A vR7g== X-Gm-Message-State: AOAM530oilKIJC3c1JFCL3zpweuZ3eEcwC6liRDjXx1eMFhct88spJEF e9RT6xvIctMRwhbSwlQ/f5wHQfIK/YXnJA== X-Google-Smtp-Source: ABdhPJy33cvAtz/3lTJm7nMVaFkuDS8DEEtvh70Dvzm+2VkJZjpeJQRJxZ0mYiGx08WY1Z5MeDXs1A== X-Received: by 2002:a1c:4944:: with SMTP id w65mr4314466wma.169.1598025421964; Fri, 21 Aug 2020 08:57:01 -0700 (PDT) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id l11sm5627385wme.11.2020.08.21.08.57.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Aug 2020 08:57:01 -0700 (PDT) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Fri, 21 Aug 2020 16:56:36 +0100 Message-Id: <20200821155641.11839-1-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 0/5] 2D transforms 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 the latest version of the implementation of 2D transforms, taking feedback on board and adding the missing documentation. It's set out in the same 5 commits as before, and the functionality is basically identical, just a couple of changes to point out. Firstly, in the third patch there was a question about what to do if the camera is listed as having a rotation that's not 0 or 180 degrees. If a 90/270 rotation is found, the code will expect a user transform to be specified that "undoes" the transposition. If the combined rotation and user transform _doesn't_ undo the transposition, then the user transform will be "adjusted" so that it does. If there's a non-90-degree rotation (it seems to be possible, if a bit hard to imagine), I wasn't sure what to do about that. Failing would seem unhelpful as there's nothing the application can do to make it work. There's no "adjustment" we can perform to make it valid. So I've ended up printing a warning and ignoring the rotation. Under the circumstances maybe that's the most reasonable thing to do? Finally, the documentation ran into a Doxygen problem with strongly-typed enums. The table of enumeration values simply vanishes, so instead I've just included that as text in the description. It's easy to change if the Doxygen situation improves. I think that's everything! Improvements - especially to the new documentation - welcome as always. Thanks and best regards David David Plowman (5): libcamera: Add Transform enum to represet 2D plane transforms. libcamera: Add user Transform to CameraConfiguration libcamera: raspberrypi: Set camera flips correctly from user transform libcamera: raspberrypi: Plumb user transform through to IPA libcamera: ipa: raspberrypi: ALSC: Handle user transform include/libcamera/camera.h | 3 + include/libcamera/meson.build | 1 + include/libcamera/transform.h | 73 +++++ src/ipa/raspberrypi/controller/camera_mode.h | 4 + src/ipa/raspberrypi/controller/rpi/alsc.cpp | 13 +- src/ipa/raspberrypi/raspberrypi.cpp | 48 +-- src/libcamera/camera.cpp | 16 +- src/libcamera/meson.build | 1 + src/libcamera/pipeline/ipu3/ipu3.cpp | 5 + .../pipeline/raspberrypi/raspberrypi.cpp | 40 ++- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 5 + src/libcamera/pipeline/simple/simple.cpp | 5 + src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 5 + src/libcamera/pipeline/vimc/vimc.cpp | 5 + src/libcamera/transform.cpp | 301 ++++++++++++++++++ 15 files changed, 499 insertions(+), 26 deletions(-) create mode 100644 include/libcamera/transform.h create mode 100644 src/libcamera/transform.cpp