From patchwork Mon Sep 27 12:33:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 13950 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 17C45BDC71 for ; Mon, 27 Sep 2021 12:33:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8C4ED6918B; Mon, 27 Sep 2021 14:33:32 +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="YhcjZnFB"; dkim-atps=neutral Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C9A4B6012C for ; Mon, 27 Sep 2021 14:33:31 +0200 (CEST) Received: by mail-wr1-x42f.google.com with SMTP id t8so51740548wrq.4 for ; Mon, 27 Sep 2021 05:33:31 -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=FS+IYhyJZmSrtTPPrRrSg55s4YRIZXXAV2b741FCGc4=; b=YhcjZnFBt2UBW3mJliCCWr/uNz+Gn+8+pZrrJHR3gLC1dVl96F2a60J+2X0ScI4DPa nLIk1Do+ikYDBCzob01kK1o7qRifVTKQ2f23iBpSPrqs64cwHd6vxA2tKB7JcQ0KrQNf 1bKyd0LPgBPYnu4FxSJdGcDBJH3qaqKfRN2djExrQOhMUGIbFn0GrcO1g4JNdaQZaxRc qKcfBEwAxnIFVf6Oby/d6pXU1RTl7EAiHGmgX2phY2taosxPy3udpChLWxXYXL1Zb03u LyeiCpwklOPl/Eg9Ot5qGO8ZEAGCHh6N7ojwiDy4eoIQwFnpK7+pKED2cJhOFUaJ/OYt t09g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FS+IYhyJZmSrtTPPrRrSg55s4YRIZXXAV2b741FCGc4=; b=yzLim2cdUkLyhqmsw4JoOvGydbFxhAeGSfDDHuVbZaml7euaPwinhNKMcw26jso2SI YuvJLIhhAN/uCY6t8NiATftKfmR3HSdigJCqZcqtCqf/JhT3dNDBh9Hxyr/rtbxwNulx gwcrQNc4HquIRZ62Z0HBpiopWhnuJLB0b632osS737/Rs/YrUipVsmmfFd/L9CiVNS5G 5GqGaR2rsnu8R+N/Z8Omko81C/qQ8/dR9CyLz6792E/C5kEpfN50drHRDig2Nl3Ts2Zh KTCXPJHPRbzQ5iVQQte8CtNFlCRU7nucf+gXbbKIGHO+kNdf/vj392BRUrEvUjs67SwL P/Tw== X-Gm-Message-State: AOAM533dAj+MGApAps1TsQ9wZoPlEMslzd5ePJFcVJc4aEjthMTR8NFN RhTptQqc3cWAWAOK/3UzTyELCu35ZwtU3rs8 X-Google-Smtp-Source: ABdhPJzWJ9n/fz+5vSkrZIWPDEbZaDigTXESy9JG7hLa7LRcH4GgWfa4/aqMSF1f4tjZ0ZqatuTEOA== X-Received: by 2002:a5d:59ad:: with SMTP id p13mr27495983wrr.253.1632746011259; Mon, 27 Sep 2021 05:33:31 -0700 (PDT) Received: from pi4-davidp.pitowers.org ([2a00:1098:3142:14:1ce1:9965:4328:89c4]) by smtp.gmail.com with ESMTPSA id r9sm16285110wru.2.2021.09.27.05.33.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Sep 2021 05:33:31 -0700 (PDT) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Mon, 27 Sep 2021 13:33:24 +0100 Message-Id: <20210927123327.14554-1-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 0/3] Colour spaces 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 again Thanks for all the feedback on the previous version. There's not really any change in functionality here though I have in the main taken people's suggestions on board. Just a few notes on some of that: * I've de-inlined some code. I've left operator!= inline, though, as there seemed to be some precedent for that. * I haven't replaced that vector by a map because it would require us to have an ordering for ColorSpaces (operator< etc.). I seem to recall inventing arbitrary orderings in the past, I guess it depends which approach we dislike least... thoughts? * The ColorSpace now gets updated after a tryFormat. Thanks for pointing that out. One final question in relation to this: I was hoping not to list every last colour space variant that exists in V4L2, mostly because many of them seem quite esoteric to me. Or would we rather simply mirror everything in V4L2 straight away? Thanks! David David Plowman (3): libcamera: Add ColorSpace class libcamera: Support passing ColorSpaces to V4L2 drivers libcamera: pipeline: raspberrypi: Support colour spaces include/libcamera/color_space.h | 83 +++++++ include/libcamera/internal/v4l2_videodevice.h | 2 + include/libcamera/meson.build | 1 + include/libcamera/stream.h | 3 + src/libcamera/color_space.cpp | 207 ++++++++++++++++++ src/libcamera/meson.build | 1 + .../pipeline/raspberrypi/raspberrypi.cpp | 84 +++++++ src/libcamera/v4l2_videodevice.cpp | 119 ++++++++++ 8 files changed, 500 insertions(+) create mode 100644 include/libcamera/color_space.h create mode 100644 src/libcamera/color_space.cpp