{"id":9443,"url":"https://patchwork.libcamera.org/api/covers/9443/?format=json","web_url":"https://patchwork.libcamera.org/cover/9443/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20200902104410.7569-1-david.plowman@raspberrypi.com>","date":"2020-09-02T10:44:02","name":"[libcamera-devel,v6,0/8] 2D transforms","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/?format=json","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"mbox":"https://patchwork.libcamera.org/cover/9443/mbox/","series":[{"id":1256,"url":"https://patchwork.libcamera.org/api/series/1256/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1256","date":"2020-09-02T10:44:02","name":"2D transforms","version":6,"mbox":"https://patchwork.libcamera.org/series/1256/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/9443/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 A06A7BF019\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  2 Sep 2020 10:44:18 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6DD41629A3;\n\tWed,  2 Sep 2020 12:44:18 +0200 (CEST)","from mail-wr1-x435.google.com (mail-wr1-x435.google.com\n\t[IPv6:2a00:1450:4864:20::435])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 819D4628EE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  2 Sep 2020 12:44:16 +0200 (CEST)","by mail-wr1-x435.google.com with SMTP id c18so4688501wrm.9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 02 Sep 2020 03:44:16 -0700 (PDT)","from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72])\n\tby smtp.gmail.com with ESMTPSA id\n\tm3sm5583062wmb.26.2020.09.02.03.44.15\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 02 Sep 2020 03:44:15 -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=\"g/hScoOE\"; 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=Q668yEp4JKcNCeXSdxOZyYE0+wNdHoGwDTyfQND9EYQ=;\n\tb=g/hScoOERsjG6M4fvd64dc0jd2RxmX4LYoYRG5L3sbwU7K+8A4fmA/VoBo3QB4T8Fn\n\tjBHEcEpykBsxuF6WJtn+6NpcAnqv/tTxuyp321hEDckTvrm+7HndXOT5A+23370hzciA\n\tSyjAX39I94i6xEk44XwfIjqznTh5QmTta2l31bm1K92s6YPD7LMpjJIli/LF5aJCP6mG\n\tm0MbdRixJnEwjqb7zYUnyavUEYOtzOKoIJttUhX3GA0v4kXaT4wvmEyK4PE+qIUBBJXC\n\tDLYu7XDAs/4d6etwzopUHZODn+IwHzBR1tikeAsb7c/oYwMiSX3Xr7AVcaYgwIHU7XoN\n\t9THg==","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=Q668yEp4JKcNCeXSdxOZyYE0+wNdHoGwDTyfQND9EYQ=;\n\tb=GPZOXOTpT4XQWCRvcuQ0zaVH0HsyMkz/f/tVDRk+oGVhj1fnCOnewxgIIF4nGPpsOZ\n\t9YALDjc83Bqk4v+k0q3P/fmqID9gE/GULhwp16HFtizq/kItHq5kM/sZq9iT3N8TtZUG\n\t1c8P5SyCYotVdPl35dTNXXTfj4NBU/j668gKq+S/kpBfqIOGj5FUIuSECB1XAP8Sdw85\n\t++h3D1l7CNP9TjMeTC+uuEQ4yTcDUUI/cdZH+AEm1yRTIoiU+5Z7Jhd6BFFtrLO4wmCK\n\tSZwc3NhMCiI3lruLpsSWvnzSND0g5Kqe30zFo2wbEDDon9zp8NoQD7ptLmtZs0mSO8J+\n\tbXxg==","X-Gm-Message-State":"AOAM532ryE6qOegkMTsyhYLS9ER13+gVhmYvVFIDB5WwO5j0Kbrh3UbL\n\t7VRwtVLFWaF6y2lFZS/aCrRfzUHfQ4AHQw==","X-Google-Smtp-Source":"ABdhPJyqyw6VKuF83W4WlfrKnGWdsnOweSWh/EU23ufqlu9KykmuisqK9ThsnJ6JT2Tb0lNp8A/pkA==","X-Received":"by 2002:a05:6000:11c5:: with SMTP id\n\ti5mr6720722wrx.18.1599043455726; \n\tWed, 02 Sep 2020 03:44:15 -0700 (PDT)","From":"David Plowman <david.plowman@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed,  2 Sep 2020 11:44:02 +0100","Message-Id":"<20200902104410.7569-1-david.plowman@raspberrypi.com>","X-Mailer":"git-send-email 2.20.1","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v6 0/8] 2D transforms","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\nAnother version of 2D transforms! There's actually been a bit more\nchurn than I wanted because I liked the suggestion that was made of\nstoring the \"native\" Bayer order (with no transforms) at startup, and\nthen applying transforms to that. Unfortunately I found the various\npixel formats rather difficult to work with (as the Bayer information\nis opaque in the encoding) so I decided to add a BayerFormat class to\nmake everything explicit.\n\nSo there's a bit of a hit converting to the BayerFormat and back out\nagain, but once you're there it's easy to transform them without\nhaving to worry about the bit depth or packing.\n\nWith this change, the original method of transforming Bayer\nV4L2PixelFormats is redundant, so I've dropped it.  Anyway, see what\nyou think.\n\nThis leaves the following commits:\n\n1. Revert the same commit as before. Unchanged.\n\n2. Rename the queryCtrl() method to controlInfo(). I've made it a\nconst function too, but otherwise this commit unchanged.\n\n3. Add Transform enum. Unchanged apart from adding operator~.\n\n4. This commit replaces the previous V4L2PixelFormat one and adds a\nBayerFormat type instead.\n\n5. Add user Transform to CameraConfiguration. Unchanged.\n\n6. Set flips correctly in RPi pipeline handler. Apart from the new\nclass in commit #4, the other significant changes are here. I guess I\nhave a bit of a question about how you find the \"native\" Bayer order -\nis there any circumstance where a sensor might return different Bayer\norders in different modes (even when the transform doesn't change)?\n\n7 and 8. Unchanged.\n\nThanks and best regards\nDavid\n\nDavid Plowman (8):\n  libcamera: pipeline: raspberrypi: Revert \"Set sensor default\n    orientation before configure()\"\n  libcamera: Allow access to v4l2_query_ext_ctrl structure for a V4L2\n    control\n  libcamera: Add Transform enum to represent 2D plane transforms.\n  libcamera: Add BayerFormat type\n  libcamera: Add user Transform to CameraConfiguration\n  libcamera: raspberrypi: Set camera flips correctly from user transform\n  libcamera: raspberrypi: Plumb user transform through to IPA\n  libcamera: ipa: raspberrypi: ALSC: Handle user transform\n\n include/libcamera/camera.h                    |   3 +\n include/libcamera/internal/bayer_format.h     |  63 ++++\n include/libcamera/internal/v4l2_device.h      |   2 +\n include/libcamera/meson.build                 |   1 +\n include/libcamera/transform.h                 |  78 +++++\n src/ipa/raspberrypi/controller/camera_mode.h  |   4 +\n src/ipa/raspberrypi/controller/rpi/alsc.cpp   |  13 +-\n src/ipa/raspberrypi/raspberrypi.cpp           |  48 +--\n src/libcamera/bayer_format.cpp                | 223 ++++++++++++\n src/libcamera/camera.cpp                      |  16 +-\n src/libcamera/meson.build                     |   2 +\n src/libcamera/pipeline/ipu3/ipu3.cpp          |   5 +\n .../pipeline/raspberrypi/raspberrypi.cpp      | 152 ++++++++-\n src/libcamera/pipeline/rkisp1/rkisp1.cpp      |   5 +\n src/libcamera/pipeline/simple/simple.cpp      |   5 +\n src/libcamera/pipeline/uvcvideo/uvcvideo.cpp  |   5 +\n src/libcamera/pipeline/vimc/vimc.cpp          |   5 +\n src/libcamera/transform.cpp                   | 322 ++++++++++++++++++\n src/libcamera/v4l2_device.cpp                 |  15 +\n 19 files changed, 933 insertions(+), 34 deletions(-)\n create mode 100644 include/libcamera/internal/bayer_format.h\n create mode 100644 include/libcamera/transform.h\n create mode 100644 src/libcamera/bayer_format.cpp\n create mode 100644 src/libcamera/transform.cpp"}