Patch Detail
Show a patch.
GET /api/1.1/patches/14366/?format=api
{ "id": 14366, "url": "https://patchwork.libcamera.org/api/1.1/patches/14366/?format=api", "web_url": "https://patchwork.libcamera.org/patch/14366/", "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": "<20211027123619.16640-1-laurent.pinchart@ideasonboard.com>", "date": "2021-10-27T12:36:19", "name": "[libcamera-devel] libcamera: bayer_format: Turn BayerFormat::Packing into scoped enum", "commit_ref": "364ae3b78d3f0fc18c9bf1c2c3ee9fee1d80e68a", "pull_url": null, "state": "accepted", "archived": false, "hash": "5cf6058404dae4f09f2d943dc37e217a987f0d1c", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/14366/mbox/", "series": [ { "id": 2663, "url": "https://patchwork.libcamera.org/api/1.1/series/2663/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2663", "date": "2021-10-27T12:36:19", "name": "[libcamera-devel] libcamera: bayer_format: Turn BayerFormat::Packing into scoped enum", "version": 1, "mbox": "https://patchwork.libcamera.org/series/2663/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/14366/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/14366/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 DC826BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 27 Oct 2021 12:36:47 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3F5D76487F;\n\tWed, 27 Oct 2021 14:36:47 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0A84360123\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Oct 2021 14:36:46 +0200 (CEST)", "from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7D2FF596;\n\tWed, 27 Oct 2021 14:36:45 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"aNbM+AAg\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1635338205;\n\tbh=ONsGDRZhHHlOZeiI78KdFgbjO4//ziROW4C2oBOCZmM=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=aNbM+AAg6I/t6KcJ/yCDZpYWR9wlMthK4tl3yfjaZXjgZ9J1ZucM22Suf3kfj4B9j\n\tNIAq/pEtAVmzYC5W798a6ZzjXN1VPA6hNxL0/dvRy91j6GdeRzJVgrVRG/+kdxab2c\n\thMpnm+6z+KHlVTFI+z/6oW3BtW5MmJGFaGHNbmmA=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Wed, 27 Oct 2021 15:36:19 +0300", "Message-Id": "<20211027123619.16640-1-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.32.0", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH] libcamera: bayer_format: Turn\n\tBayerFormat::Packing into scoped enum", "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>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "The unscoped enum BayerFormat::Packing leads to usage of the ambiguous\nBayerFormat::None enumerator. Turn the enumeration into a scoped enum to\nforce usage of BayerFormat::Packing::None, and drop the now redundant\n\"Packed\" suffix for the CSI2 and IPU3 packing.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/internal/bayer_format.h | 6 +-\n src/libcamera/bayer_format.cpp | 138 +++++++++++-----------\n test/bayer-format.cpp | 28 ++---\n 3 files changed, 86 insertions(+), 86 deletions(-)\n\n\nbase-commit: 4d4694cd9f4ea73586dcb75d19905a1860356d9f", "diff": "diff --git a/include/libcamera/internal/bayer_format.h b/include/libcamera/internal/bayer_format.h\nindex 723382d4168d..d9a56d744a25 100644\n--- a/include/libcamera/internal/bayer_format.h\n+++ b/include/libcamera/internal/bayer_format.h\n@@ -27,10 +27,10 @@ public:\n \t\tMONO = 4\n \t};\n \n-\tenum Packing : uint16_t {\n+\tenum class Packing : uint16_t {\n \t\tNone = 0,\n-\t\tCSI2Packed = 1,\n-\t\tIPU3Packed = 2,\n+\t\tCSI2 = 1,\n+\t\tIPU3 = 2,\n \t};\n \n \tconstexpr BayerFormat()\ndiff --git a/src/libcamera/bayer_format.cpp b/src/libcamera/bayer_format.cpp\nindex 11355f144f66..1c1e849a7e31 100644\n--- a/src/libcamera/bayer_format.cpp\n+++ b/src/libcamera/bayer_format.cpp\n@@ -53,11 +53,11 @@ namespace libcamera {\n * \\enum BayerFormat::Packing\n * \\brief Different types of packing that can be applied to a BayerFormat\n *\n- * \\var BayerFormat::None\n+ * \\var BayerFormat::Packing::None\n * \\brief No packing\n- * \\var BayerFormat::CSI2Packed\n+ * \\var BayerFormat::Packing::CSI2\n * \\brief Format uses MIPI CSI-2 style packing\n- * \\var BayerFormat::IPU3Packed\n+ * \\var BayerFormat::Packing::IPU3\n * \\brief Format uses IPU3 style packing\n */\n \n@@ -85,73 +85,73 @@ struct BayerFormatComparator {\n };\n \n const std::map<BayerFormat, V4L2PixelFormat, BayerFormatComparator> bayerToV4l2{\n-\t{ { BayerFormat::BGGR, 8, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SBGGR8) },\n-\t{ { BayerFormat::GBRG, 8, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGBRG8) },\n-\t{ { BayerFormat::GRBG, 8, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG8) },\n-\t{ { BayerFormat::RGGB, 8, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB8) },\n-\t{ { BayerFormat::BGGR, 10, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SBGGR10) },\n-\t{ { BayerFormat::GBRG, 10, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGBRG10) },\n-\t{ { BayerFormat::GRBG, 10, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG10) },\n-\t{ { BayerFormat::RGGB, 10, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB10) },\n-\t{ { BayerFormat::BGGR, 10, BayerFormat::CSI2Packed }, V4L2PixelFormat(V4L2_PIX_FMT_SBGGR10P) },\n-\t{ { BayerFormat::GBRG, 10, BayerFormat::CSI2Packed }, V4L2PixelFormat(V4L2_PIX_FMT_SGBRG10P) },\n-\t{ { BayerFormat::GRBG, 10, BayerFormat::CSI2Packed }, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG10P) },\n-\t{ { BayerFormat::RGGB, 10, BayerFormat::CSI2Packed }, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB10P) },\n-\t{ { BayerFormat::BGGR, 10, BayerFormat::IPU3Packed }, V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SBGGR10) },\n-\t{ { BayerFormat::GBRG, 10, BayerFormat::IPU3Packed }, V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SGBRG10) },\n-\t{ { BayerFormat::GRBG, 10, BayerFormat::IPU3Packed }, V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SGRBG10) },\n-\t{ { BayerFormat::RGGB, 10, BayerFormat::IPU3Packed }, V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SRGGB10) },\n-\t{ { BayerFormat::BGGR, 12, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SBGGR12) },\n-\t{ { BayerFormat::GBRG, 12, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGBRG12) },\n-\t{ { BayerFormat::GRBG, 12, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG12) },\n-\t{ { BayerFormat::RGGB, 12, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB12) },\n-\t{ { BayerFormat::BGGR, 12, BayerFormat::CSI2Packed }, V4L2PixelFormat(V4L2_PIX_FMT_SBGGR12P) },\n-\t{ { BayerFormat::GBRG, 12, BayerFormat::CSI2Packed }, V4L2PixelFormat(V4L2_PIX_FMT_SGBRG12P) },\n-\t{ { BayerFormat::GRBG, 12, BayerFormat::CSI2Packed }, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG12P) },\n-\t{ { BayerFormat::RGGB, 12, BayerFormat::CSI2Packed }, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB12P) },\n-\t{ { BayerFormat::BGGR, 16, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SBGGR16) },\n-\t{ { BayerFormat::GBRG, 16, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGBRG16) },\n-\t{ { BayerFormat::GRBG, 16, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG16) },\n-\t{ { BayerFormat::RGGB, 16, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB16) },\n-\t{ { BayerFormat::MONO, 8, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_GREY) },\n-\t{ { BayerFormat::MONO, 10, BayerFormat::CSI2Packed }, V4L2PixelFormat(V4L2_PIX_FMT_Y10P) },\n+\t{ { BayerFormat::BGGR, 8, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SBGGR8) },\n+\t{ { BayerFormat::GBRG, 8, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGBRG8) },\n+\t{ { BayerFormat::GRBG, 8, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG8) },\n+\t{ { BayerFormat::RGGB, 8, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB8) },\n+\t{ { BayerFormat::BGGR, 10, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SBGGR10) },\n+\t{ { BayerFormat::GBRG, 10, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGBRG10) },\n+\t{ { BayerFormat::GRBG, 10, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG10) },\n+\t{ { BayerFormat::RGGB, 10, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB10) },\n+\t{ { BayerFormat::BGGR, 10, BayerFormat::Packing::CSI2 }, V4L2PixelFormat(V4L2_PIX_FMT_SBGGR10P) },\n+\t{ { BayerFormat::GBRG, 10, BayerFormat::Packing::CSI2 }, V4L2PixelFormat(V4L2_PIX_FMT_SGBRG10P) },\n+\t{ { BayerFormat::GRBG, 10, BayerFormat::Packing::CSI2 }, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG10P) },\n+\t{ { BayerFormat::RGGB, 10, BayerFormat::Packing::CSI2 }, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB10P) },\n+\t{ { BayerFormat::BGGR, 10, BayerFormat::Packing::IPU3 }, V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SBGGR10) },\n+\t{ { BayerFormat::GBRG, 10, BayerFormat::Packing::IPU3 }, V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SGBRG10) },\n+\t{ { BayerFormat::GRBG, 10, BayerFormat::Packing::IPU3 }, V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SGRBG10) },\n+\t{ { BayerFormat::RGGB, 10, BayerFormat::Packing::IPU3 }, V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SRGGB10) },\n+\t{ { BayerFormat::BGGR, 12, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SBGGR12) },\n+\t{ { BayerFormat::GBRG, 12, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGBRG12) },\n+\t{ { BayerFormat::GRBG, 12, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG12) },\n+\t{ { BayerFormat::RGGB, 12, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB12) },\n+\t{ { BayerFormat::BGGR, 12, BayerFormat::Packing::CSI2 }, V4L2PixelFormat(V4L2_PIX_FMT_SBGGR12P) },\n+\t{ { BayerFormat::GBRG, 12, BayerFormat::Packing::CSI2 }, V4L2PixelFormat(V4L2_PIX_FMT_SGBRG12P) },\n+\t{ { BayerFormat::GRBG, 12, BayerFormat::Packing::CSI2 }, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG12P) },\n+\t{ { BayerFormat::RGGB, 12, BayerFormat::Packing::CSI2 }, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB12P) },\n+\t{ { BayerFormat::BGGR, 16, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SBGGR16) },\n+\t{ { BayerFormat::GBRG, 16, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGBRG16) },\n+\t{ { BayerFormat::GRBG, 16, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG16) },\n+\t{ { BayerFormat::RGGB, 16, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB16) },\n+\t{ { BayerFormat::MONO, 8, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_GREY) },\n+\t{ { BayerFormat::MONO, 10, BayerFormat::Packing::CSI2 }, V4L2PixelFormat(V4L2_PIX_FMT_Y10P) },\n };\n \n const std::unordered_map<unsigned int, BayerFormat> mbusCodeToBayer{\n-\t{ MEDIA_BUS_FMT_SBGGR8_1X8, { BayerFormat::BGGR, 8, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SGBRG8_1X8, { BayerFormat::GBRG, 8, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SGRBG8_1X8, { BayerFormat::GRBG, 8, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SRGGB8_1X8, { BayerFormat::RGGB, 8, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8, { BayerFormat::BGGR, 8, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8, { BayerFormat::GBRG, 8, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8, { BayerFormat::GRBG, 8, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8, { BayerFormat::RGGB, 8, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8, { BayerFormat::BGGR, 8, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8, { BayerFormat::GBRG, 8, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, { BayerFormat::GRBG, 8, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8, { BayerFormat::RGGB, 8, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE, { BayerFormat::BGGR, 10, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE, { BayerFormat::BGGR, 10, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE, { BayerFormat::BGGR, 10, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE, { BayerFormat::BGGR, 10, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SBGGR10_1X10, { BayerFormat::BGGR, 10, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SGBRG10_1X10, { BayerFormat::GBRG, 10, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SGRBG10_1X10, { BayerFormat::GRBG, 10, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SRGGB10_1X10, { BayerFormat::RGGB, 10, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SBGGR12_1X12, { BayerFormat::BGGR, 12, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SGBRG12_1X12, { BayerFormat::GBRG, 12, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SGRBG12_1X12, { BayerFormat::GRBG, 12, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SRGGB12_1X12, { BayerFormat::RGGB, 12, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SBGGR14_1X14, { BayerFormat::BGGR, 14, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SGBRG14_1X14, { BayerFormat::GBRG, 14, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SGRBG14_1X14, { BayerFormat::GRBG, 14, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SRGGB14_1X14, { BayerFormat::RGGB, 14, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SBGGR16_1X16, { BayerFormat::BGGR, 16, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SGBRG16_1X16, { BayerFormat::GBRG, 16, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SGRBG16_1X16, { BayerFormat::GRBG, 16, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_SRGGB16_1X16, { BayerFormat::RGGB, 16, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_Y8_1X8, { BayerFormat::MONO, 8, BayerFormat::None } },\n-\t{ MEDIA_BUS_FMT_Y10_1X10, { BayerFormat::MONO, 10, BayerFormat::None } },\n+\t{ MEDIA_BUS_FMT_SBGGR8_1X8, { BayerFormat::BGGR, 8, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SGBRG8_1X8, { BayerFormat::GBRG, 8, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SGRBG8_1X8, { BayerFormat::GRBG, 8, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SRGGB8_1X8, { BayerFormat::RGGB, 8, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8, { BayerFormat::BGGR, 8, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8, { BayerFormat::GBRG, 8, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8, { BayerFormat::GRBG, 8, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8, { BayerFormat::RGGB, 8, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8, { BayerFormat::BGGR, 8, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8, { BayerFormat::GBRG, 8, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, { BayerFormat::GRBG, 8, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8, { BayerFormat::RGGB, 8, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE, { BayerFormat::BGGR, 10, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE, { BayerFormat::BGGR, 10, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE, { BayerFormat::BGGR, 10, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE, { BayerFormat::BGGR, 10, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SBGGR10_1X10, { BayerFormat::BGGR, 10, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SGBRG10_1X10, { BayerFormat::GBRG, 10, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SGRBG10_1X10, { BayerFormat::GRBG, 10, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SRGGB10_1X10, { BayerFormat::RGGB, 10, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SBGGR12_1X12, { BayerFormat::BGGR, 12, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SGBRG12_1X12, { BayerFormat::GBRG, 12, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SGRBG12_1X12, { BayerFormat::GRBG, 12, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SRGGB12_1X12, { BayerFormat::RGGB, 12, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SBGGR14_1X14, { BayerFormat::BGGR, 14, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SGBRG14_1X14, { BayerFormat::GBRG, 14, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SGRBG14_1X14, { BayerFormat::GRBG, 14, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SRGGB14_1X14, { BayerFormat::RGGB, 14, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SBGGR16_1X16, { BayerFormat::BGGR, 16, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SGBRG16_1X16, { BayerFormat::GBRG, 16, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SGRBG16_1X16, { BayerFormat::GRBG, 16, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_SRGGB16_1X16, { BayerFormat::RGGB, 16, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_Y8_1X8, { BayerFormat::MONO, 8, BayerFormat::Packing::None } },\n+\t{ MEDIA_BUS_FMT_Y10_1X10, { BayerFormat::MONO, 10, BayerFormat::Packing::None } },\n };\n \n } /* namespace */\n@@ -214,9 +214,9 @@ std::string BayerFormat::toString() const\n \n \tresult += \"-\" + std::to_string(bitDepth);\n \n-\tif (packing == CSI2Packed)\n+\tif (packing == Packing::CSI2)\n \t\tresult += \"-CSI2P\";\n-\telse if (packing == IPU3Packed)\n+\telse if (packing == Packing::IPU3)\n \t\tresult += \"-IPU3P\";\n \n \treturn result;\ndiff --git a/test/bayer-format.cpp b/test/bayer-format.cpp\nindex e396ee83ca91..135bcb5214c8 100644\n--- a/test/bayer-format.cpp\n+++ b/test/bayer-format.cpp\n@@ -30,7 +30,7 @@ protected:\n \t\t}\n \n \t\t/* A correct Bayer format has to be valid. */\n-\t\tbayerFmt = BayerFormat(BayerFormat::BGGR, 8, BayerFormat::None);\n+\t\tbayerFmt = BayerFormat(BayerFormat::BGGR, 8, BayerFormat::Packing::None);\n \t\tif (!bayerFmt.isValid()) {\n \t\t\tcerr << \"A correct BayerFormat has to be valid.\"\n \t\t\t << endl;\n@@ -41,9 +41,9 @@ protected:\n \t\t * Two bayer formats created with the same order and bit depth\n \t\t * have to be equal.\n \t\t */\n-\t\tbayerFmt = BayerFormat(BayerFormat::BGGR, 8, BayerFormat::None);\n+\t\tbayerFmt = BayerFormat(BayerFormat::BGGR, 8, BayerFormat::Packing::None);\n \t\tBayerFormat bayerFmtExpect = BayerFormat(BayerFormat::BGGR, 8,\n-\t\t\t\t\t\t\t BayerFormat::None);\n+\t\t\t\t\t\t\t BayerFormat::Packing::None);\n \t\tif (bayerFmt != bayerFmtExpect) {\n \t\t\tcerr << \"Comparison of identical formats failed.\"\n \t\t\t << endl;\n@@ -54,9 +54,9 @@ protected:\n \t\t * Two Bayer formats created with the same order but with a\n \t\t * different bitDepth are not equal.\n \t\t */\n-\t\tbayerFmt = BayerFormat(BayerFormat::BGGR, 8, BayerFormat::None);\n+\t\tbayerFmt = BayerFormat(BayerFormat::BGGR, 8, BayerFormat::Packing::None);\n \t\tbayerFmtExpect = BayerFormat(BayerFormat::BGGR, 12,\n-\t\t\t\t\t BayerFormat::None);\n+\t\t\t\t\t BayerFormat::Packing::None);\n \t\tif (bayerFmt == bayerFmtExpect) {\n \t\t\tcerr << \"Comparison of different formats failed.\"\n \t\t\t << endl;\n@@ -96,7 +96,7 @@ protected:\n \t\t * to a Bayer format.\n \t\t */\n \t\tbayerFmtExpect = BayerFormat(BayerFormat::BGGR, 8,\n-\t\t\t\t\t BayerFormat::None);\n+\t\t\t\t\t BayerFormat::Packing::None);\n \t\tv4l2Fmt = V4L2PixelFormat(V4L2_PIX_FMT_SBGGR8);\n \t\tbayerFmt = BayerFormat::fromV4L2PixelFormat(v4l2Fmt);\n \t\tif (bayerFmt != bayerFmtExpect) {\n@@ -123,7 +123,7 @@ protected:\n \t\t * Test if a valid Bayer format can be converted to a\n \t\t * string representation.\n \t\t */\n-\t\tbayerFmt = BayerFormat(BayerFormat::BGGR, 8, BayerFormat::None);\n+\t\tbayerFmt = BayerFormat(BayerFormat::BGGR, 8, BayerFormat::Packing::None);\n \t\tif (bayerFmt.toString() != \"BGGR-8\") {\n \t\t\tcerr << \"String representation != 'BGGR-8' (got: '\"\n \t\t\t << bayerFmt.toString() << \"' ) \" << endl;\n@@ -145,9 +145,9 @@ protected:\n \t\t * Perform a horizontal Flip and make sure that the\n \t\t * order is adjusted accordingly.\n \t\t */\n-\t\tbayerFmt = BayerFormat(BayerFormat::BGGR, 8, BayerFormat::None);\n+\t\tbayerFmt = BayerFormat(BayerFormat::BGGR, 8, BayerFormat::Packing::None);\n \t\tbayerFmtExpect = BayerFormat(BayerFormat::GBRG, 8,\n-\t\t\t\t\t BayerFormat::None);\n+\t\t\t\t\t BayerFormat::Packing::None);\n \t\tBayerFormat hFlipFmt = bayerFmt.transform(Transform::HFlip);\n \t\tif (hFlipFmt != bayerFmtExpect) {\n \t\t\tcerr << \"Horizontal flip of 'BGGR-8' should result in '\"\n@@ -160,9 +160,9 @@ protected:\n \t\t * Perform a vertical Flip and make sure that\n \t\t * the order is adjusted accordingly.\n \t\t */\n-\t\tbayerFmt = BayerFormat(BayerFormat::BGGR, 8, BayerFormat::None);\n+\t\tbayerFmt = BayerFormat(BayerFormat::BGGR, 8, BayerFormat::Packing::None);\n \t\tbayerFmtExpect = BayerFormat(BayerFormat::GRBG, 8,\n-\t\t\t\t\t BayerFormat::None);\n+\t\t\t\t\t BayerFormat::Packing::None);\n \t\tBayerFormat vFlipFmt = bayerFmt.transform(Transform::VFlip);\n \t\tif (vFlipFmt != bayerFmtExpect) {\n \t\t\tcerr << \"Vertical flip of 'BGGR-8' should result in '\"\n@@ -176,7 +176,7 @@ protected:\n \t\t * pixels on the bottom left to top right diagonal and make\n \t\t * sure, that it doesn't change.\n \t\t */\n-\t\tbayerFmt = BayerFormat(BayerFormat::BGGR, 8, BayerFormat::None);\n+\t\tbayerFmt = BayerFormat(BayerFormat::BGGR, 8, BayerFormat::Packing::None);\n \t\tBayerFormat transposeFmt = bayerFmt.transform(\n \t\t\tTransform::Transpose);\n \t\tif (transposeFmt != bayerFmt) {\n@@ -192,9 +192,9 @@ protected:\n \t\t * on the bottom left to top right diagonal and make sure\n \t\t * that their positions are switched.\n \t\t */\n-\t\tbayerFmt = BayerFormat(BayerFormat::GBRG, 8, BayerFormat::None);\n+\t\tbayerFmt = BayerFormat(BayerFormat::GBRG, 8, BayerFormat::Packing::None);\n \t\tbayerFmtExpect = BayerFormat(BayerFormat::GRBG, 8,\n-\t\t\t\t\t BayerFormat::None);\n+\t\t\t\t\t BayerFormat::Packing::None);\n \t\ttransposeFmt = bayerFmt.transform(Transform::Transpose);\n \t\tif (transposeFmt != bayerFmtExpect) {\n \t\t\tcerr << \"Transpose with the red & blue pixels on the \"\n", "prefixes": [ "libcamera-devel" ] }