Patch Detail
Show a patch.
GET /api/patches/16595/?format=api
{ "id": 16595, "url": "https://patchwork.libcamera.org/api/patches/16595/?format=api", "web_url": "https://patchwork.libcamera.org/patch/16595/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/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": "<20220712055609.14910-1-umang.jain@ideasonboard.com>", "date": "2022-07-12T05:56:09", "name": "[libcamera-devel] libcamera: ColorSpace: Helper to check for standard colorspaces", "commit_ref": null, "pull_url": null, "state": "rejected", "archived": false, "hash": "2a8d028d0f1575fac8f220ebafc31319cb795992", "submitter": { "id": 86, "url": "https://patchwork.libcamera.org/api/people/86/?format=api", "name": "Umang Jain", "email": "umang.jain@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/16595/mbox/", "series": [ { "id": 3273, "url": "https://patchwork.libcamera.org/api/series/3273/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3273", "date": "2022-07-12T05:56:09", "name": "[libcamera-devel] libcamera: ColorSpace: Helper to check for standard colorspaces", "version": 1, "mbox": "https://patchwork.libcamera.org/series/3273/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/16595/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/16595/checks/", "tags": {}, "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 1A67BBD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 12 Jul 2022 05:56:20 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4BBB763312;\n\tTue, 12 Jul 2022 07:56:19 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8C5F361FAF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 12 Jul 2022 07:56:17 +0200 (CEST)", "from perceval.ideasonboard.com (unknown\n\t[IPv6:2401:4900:1f3f:b3fb:3712:29bf:7855:376e])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C5D2C30B;\n\tTue, 12 Jul 2022 07:56:15 +0200 (CEST)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1657605379;\n\tbh=H7p48Uln+GR1zWvt2EVlJ9+Ivc7LakNdSODfRW9BX8I=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:Cc:From;\n\tb=oCgKmIVEM23uX4wwSDQrHGt4S+fcrTUu7ByEO13hGsaxuG4yQfkg1ONDpbcjVA36O\n\tp81wVOQ91sh5ZJct2HsbJF2/H1xj04A5AdZZ1pfjvF7KkdZ39tax07HOK/glYGsRpB\n\tP3J0pyhu0uO36WTZtqoVuahN87cNCLwVDt8RmzvlG56RRiX0CPkl8P3yaEJbOU9lXs\n\tR98vDLAgS4tS9VF2lB6KsluV78SlwJESVFAw8Ko/UwWANCRc8HV7OAafpTIQnC0yUF\n\tG/C6C4jQYOpw5/lgDblRSiBhbZP0tFuNn6qtXje2GFILIjCDjhXPVp9Rt/QmPCH/kV\n\tJ5FEO7TKIUTUQ==", "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1657605377;\n\tbh=H7p48Uln+GR1zWvt2EVlJ9+Ivc7LakNdSODfRW9BX8I=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=fArwARRTiYWvRTPFonqwDQeteA49+Ne0pLma5+XtvWG01Wj50CLX3CnBXFiTZ50Nb\n\tIAfnxDrzTtc+Je6TfgTpVHzzmWwRRDW26e3vSEu7ShnkaHm003IfJHZf0AuuOHsdd0\n\t1dNIwt/fug/DVypGPsKEaMd7Dfcf7xedgG8FyCUU=" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"fArwARRT\"; dkim-atps=neutral", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 12 Jul 2022 11:26:09 +0530", "Message-Id": "<20220712055609.14910-1-umang.jain@ideasonboard.com>", "X-Mailer": "git-send-email 2.31.1", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH] libcamera: ColorSpace: Helper to check\n\tfor standard colorspaces", "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>", "From": "Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>", "Reply-To": "Umang Jain <umang.jain@ideasonboard.com>", "Cc": "rishikeshdonadkar@gmail.com, nicolas.dufresne@collabora.com", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Provide a convenience helper to check is the given colorspace\nbelongs to a set of standard colorspace or not.\n\nSigned-off-by: Umang Jain <umang.jain@ideasonboard.com>\n---\n include/libcamera/color_space.h | 1 +\n src/libcamera/color_space.cpp | 31 +++++++++++++++++++++++++++++++\n 2 files changed, 32 insertions(+)", "diff": "diff --git a/include/libcamera/color_space.h b/include/libcamera/color_space.h\nindex 086c56c1..43786d2a 100644\n--- a/include/libcamera/color_space.h\n+++ b/include/libcamera/color_space.h\n@@ -59,6 +59,7 @@ public:\n \n \tstd::string toString() const;\n \tstatic std::string toString(const std::optional<ColorSpace> &colorSpace);\n+\tbool isStandardColorSpace();\n };\n \n bool operator==(const ColorSpace &lhs, const ColorSpace &rhs);\ndiff --git a/src/libcamera/color_space.cpp b/src/libcamera/color_space.cpp\nindex 895e5c8e..004346f5 100644\n--- a/src/libcamera/color_space.cpp\n+++ b/src/libcamera/color_space.cpp\n@@ -212,6 +212,37 @@ std::string ColorSpace::toString(const std::optional<ColorSpace> &colorSpace)\n \treturn colorSpace->toString();\n }\n \n+/**\n+ * brief Checks whether the colorspace is a standard colorspace or not\n+ *\n+ * This is convenience helper to check whether the given colorspace is\n+ * a standard colorspace or not.\n+ *\n+ * \\return True if it is a standard colorspace, false otherwise\n+ */\n+bool ColorSpace::isStandardColorSpace()\n+{\n+\tbool isStdColorSpace = false;\n+\n+\tstatic const std::vector<ColorSpace> stdColorSpaces = {\n+\t\tColorSpace::Raw,\n+\t\tColorSpace::Jpeg,\n+\t\tColorSpace::Srgb,\n+\t\tColorSpace::Smpte170m,\n+\t\tColorSpace::Rec709,\n+\t\tColorSpace::Rec2020\n+\t};\n+\n+\tauto it = std::find_if(stdColorSpaces.begin(), stdColorSpaces.end(),\n+\t\t\t [this](const auto &item) {\n+\t\t\t\t return *this == item;\n+\t\t\t });\n+\tif (it != stdColorSpaces.end())\n+\t\tisStdColorSpace = true;\n+\n+\treturn isStdColorSpace;\n+}\n+\n /**\n * \\var ColorSpace::primaries\n * \\brief The color primaries of this color space\n", "prefixes": [ "libcamera-devel" ] }