[{"id":20604,"web_url":"https://patchwork.libcamera.org/comment/20604/","msgid":"<163542361606.2498920.8603731867629091272@Monstersaurus>","date":"2021-10-28T12:20:16","subject":"Re: [libcamera-devel] [PATCH v4 04/10] libcamera: bayer_format:\n\tTurn BayerFormat::Packing into scoped enum","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Naushir Patuck (2021-10-28 09:46:40)\n> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> \n> The unscoped enum BayerFormat::Packing leads to usage of the ambiguous\n> BayerFormat::None enumerator. Turn the enumeration into a scoped enum to\n> force usage of BayerFormat::Packing::None, and drop the now redundant\n> \"Packed\" suffix for the CSI2 and IPU3 packing.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> Reviewed-off-by: Naushir Patuck <naush@raspberrypi.com>\n\nI assume this is the same as the version Laurent posted. If so I gave\nthis so it can come over to this one.\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\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> diff --git a/include/libcamera/internal/bayer_format.h b/include/libcamera/internal/bayer_format.h\n> index 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>                 MONO = 4\n>         };\n>  \n> -       enum Packing : uint16_t {\n> +       enum class Packing : uint16_t {\n>                 None = 0,\n> -               CSI2Packed = 1,\n> -               IPU3Packed = 2,\n> +               CSI2 = 1,\n> +               IPU3 = 2,\n>         };\n>  \n>         constexpr BayerFormat()\n> diff --git a/src/libcamera/bayer_format.cpp b/src/libcamera/bayer_format.cpp\n> index 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> -       { { BayerFormat::BGGR, 8, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SBGGR8) },\n> -       { { BayerFormat::GBRG, 8, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGBRG8) },\n> -       { { BayerFormat::GRBG, 8, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG8) },\n> -       { { BayerFormat::RGGB, 8, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB8) },\n> -       { { BayerFormat::BGGR, 10, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SBGGR10) },\n> -       { { BayerFormat::GBRG, 10, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGBRG10) },\n> -       { { BayerFormat::GRBG, 10, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG10) },\n> -       { { BayerFormat::RGGB, 10, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB10) },\n> -       { { BayerFormat::BGGR, 10, BayerFormat::CSI2Packed }, V4L2PixelFormat(V4L2_PIX_FMT_SBGGR10P) },\n> -       { { BayerFormat::GBRG, 10, BayerFormat::CSI2Packed }, V4L2PixelFormat(V4L2_PIX_FMT_SGBRG10P) },\n> -       { { BayerFormat::GRBG, 10, BayerFormat::CSI2Packed }, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG10P) },\n> -       { { BayerFormat::RGGB, 10, BayerFormat::CSI2Packed }, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB10P) },\n> -       { { BayerFormat::BGGR, 10, BayerFormat::IPU3Packed }, V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SBGGR10) },\n> -       { { BayerFormat::GBRG, 10, BayerFormat::IPU3Packed }, V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SGBRG10) },\n> -       { { BayerFormat::GRBG, 10, BayerFormat::IPU3Packed }, V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SGRBG10) },\n> -       { { BayerFormat::RGGB, 10, BayerFormat::IPU3Packed }, V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SRGGB10) },\n> -       { { BayerFormat::BGGR, 12, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SBGGR12) },\n> -       { { BayerFormat::GBRG, 12, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGBRG12) },\n> -       { { BayerFormat::GRBG, 12, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG12) },\n> -       { { BayerFormat::RGGB, 12, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB12) },\n> -       { { BayerFormat::BGGR, 12, BayerFormat::CSI2Packed }, V4L2PixelFormat(V4L2_PIX_FMT_SBGGR12P) },\n> -       { { BayerFormat::GBRG, 12, BayerFormat::CSI2Packed }, V4L2PixelFormat(V4L2_PIX_FMT_SGBRG12P) },\n> -       { { BayerFormat::GRBG, 12, BayerFormat::CSI2Packed }, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG12P) },\n> -       { { BayerFormat::RGGB, 12, BayerFormat::CSI2Packed }, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB12P) },\n> -       { { BayerFormat::BGGR, 16, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SBGGR16) },\n> -       { { BayerFormat::GBRG, 16, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGBRG16) },\n> -       { { BayerFormat::GRBG, 16, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG16) },\n> -       { { BayerFormat::RGGB, 16, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB16) },\n> -       { { BayerFormat::MONO, 8, BayerFormat::None }, V4L2PixelFormat(V4L2_PIX_FMT_GREY) },\n> -       { { BayerFormat::MONO, 10, BayerFormat::CSI2Packed }, V4L2PixelFormat(V4L2_PIX_FMT_Y10P) },\n> +       { { BayerFormat::BGGR, 8, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SBGGR8) },\n> +       { { BayerFormat::GBRG, 8, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGBRG8) },\n> +       { { BayerFormat::GRBG, 8, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG8) },\n> +       { { BayerFormat::RGGB, 8, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB8) },\n> +       { { BayerFormat::BGGR, 10, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SBGGR10) },\n> +       { { BayerFormat::GBRG, 10, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGBRG10) },\n> +       { { BayerFormat::GRBG, 10, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG10) },\n> +       { { BayerFormat::RGGB, 10, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB10) },\n> +       { { BayerFormat::BGGR, 10, BayerFormat::Packing::CSI2 }, V4L2PixelFormat(V4L2_PIX_FMT_SBGGR10P) },\n> +       { { BayerFormat::GBRG, 10, BayerFormat::Packing::CSI2 }, V4L2PixelFormat(V4L2_PIX_FMT_SGBRG10P) },\n> +       { { BayerFormat::GRBG, 10, BayerFormat::Packing::CSI2 }, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG10P) },\n> +       { { BayerFormat::RGGB, 10, BayerFormat::Packing::CSI2 }, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB10P) },\n> +       { { BayerFormat::BGGR, 10, BayerFormat::Packing::IPU3 }, V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SBGGR10) },\n> +       { { BayerFormat::GBRG, 10, BayerFormat::Packing::IPU3 }, V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SGBRG10) },\n> +       { { BayerFormat::GRBG, 10, BayerFormat::Packing::IPU3 }, V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SGRBG10) },\n> +       { { BayerFormat::RGGB, 10, BayerFormat::Packing::IPU3 }, V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SRGGB10) },\n> +       { { BayerFormat::BGGR, 12, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SBGGR12) },\n> +       { { BayerFormat::GBRG, 12, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGBRG12) },\n> +       { { BayerFormat::GRBG, 12, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG12) },\n> +       { { BayerFormat::RGGB, 12, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB12) },\n> +       { { BayerFormat::BGGR, 12, BayerFormat::Packing::CSI2 }, V4L2PixelFormat(V4L2_PIX_FMT_SBGGR12P) },\n> +       { { BayerFormat::GBRG, 12, BayerFormat::Packing::CSI2 }, V4L2PixelFormat(V4L2_PIX_FMT_SGBRG12P) },\n> +       { { BayerFormat::GRBG, 12, BayerFormat::Packing::CSI2 }, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG12P) },\n> +       { { BayerFormat::RGGB, 12, BayerFormat::Packing::CSI2 }, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB12P) },\n> +       { { BayerFormat::BGGR, 16, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SBGGR16) },\n> +       { { BayerFormat::GBRG, 16, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGBRG16) },\n> +       { { BayerFormat::GRBG, 16, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG16) },\n> +       { { BayerFormat::RGGB, 16, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB16) },\n> +       { { BayerFormat::MONO, 8, BayerFormat::Packing::None }, V4L2PixelFormat(V4L2_PIX_FMT_GREY) },\n> +       { { BayerFormat::MONO, 10, BayerFormat::Packing::CSI2 }, V4L2PixelFormat(V4L2_PIX_FMT_Y10P) },\n>  };\n>  \n>  const std::unordered_map<unsigned int, BayerFormat> mbusCodeToBayer{\n> -       { MEDIA_BUS_FMT_SBGGR8_1X8, { BayerFormat::BGGR, 8, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SGBRG8_1X8, { BayerFormat::GBRG, 8, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SGRBG8_1X8, { BayerFormat::GRBG, 8, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SRGGB8_1X8, { BayerFormat::RGGB, 8, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8, { BayerFormat::BGGR, 8, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8, { BayerFormat::GBRG, 8, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8, { BayerFormat::GRBG, 8, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8, { BayerFormat::RGGB, 8, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8, { BayerFormat::BGGR, 8, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8, { BayerFormat::GBRG, 8, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, { BayerFormat::GRBG, 8, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8, { BayerFormat::RGGB, 8, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE, { BayerFormat::BGGR, 10, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE, { BayerFormat::BGGR, 10, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE, { BayerFormat::BGGR, 10, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE, { BayerFormat::BGGR, 10, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SBGGR10_1X10, { BayerFormat::BGGR, 10, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SGBRG10_1X10, { BayerFormat::GBRG, 10, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SGRBG10_1X10, { BayerFormat::GRBG, 10, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SRGGB10_1X10, { BayerFormat::RGGB, 10, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SBGGR12_1X12, { BayerFormat::BGGR, 12, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SGBRG12_1X12, { BayerFormat::GBRG, 12, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SGRBG12_1X12, { BayerFormat::GRBG, 12, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SRGGB12_1X12, { BayerFormat::RGGB, 12, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SBGGR14_1X14, { BayerFormat::BGGR, 14, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SGBRG14_1X14, { BayerFormat::GBRG, 14, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SGRBG14_1X14, { BayerFormat::GRBG, 14, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SRGGB14_1X14, { BayerFormat::RGGB, 14, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SBGGR16_1X16, { BayerFormat::BGGR, 16, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SGBRG16_1X16, { BayerFormat::GBRG, 16, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SGRBG16_1X16, { BayerFormat::GRBG, 16, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_SRGGB16_1X16, { BayerFormat::RGGB, 16, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_Y8_1X8, { BayerFormat::MONO, 8, BayerFormat::None } },\n> -       { MEDIA_BUS_FMT_Y10_1X10, { BayerFormat::MONO, 10, BayerFormat::None } },\n> +       { MEDIA_BUS_FMT_SBGGR8_1X8, { BayerFormat::BGGR, 8, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SGBRG8_1X8, { BayerFormat::GBRG, 8, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SGRBG8_1X8, { BayerFormat::GRBG, 8, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SRGGB8_1X8, { BayerFormat::RGGB, 8, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8, { BayerFormat::BGGR, 8, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8, { BayerFormat::GBRG, 8, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8, { BayerFormat::GRBG, 8, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8, { BayerFormat::RGGB, 8, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8, { BayerFormat::BGGR, 8, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8, { BayerFormat::GBRG, 8, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, { BayerFormat::GRBG, 8, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8, { BayerFormat::RGGB, 8, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE, { BayerFormat::BGGR, 10, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE, { BayerFormat::BGGR, 10, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE, { BayerFormat::BGGR, 10, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE, { BayerFormat::BGGR, 10, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SBGGR10_1X10, { BayerFormat::BGGR, 10, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SGBRG10_1X10, { BayerFormat::GBRG, 10, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SGRBG10_1X10, { BayerFormat::GRBG, 10, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SRGGB10_1X10, { BayerFormat::RGGB, 10, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SBGGR12_1X12, { BayerFormat::BGGR, 12, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SGBRG12_1X12, { BayerFormat::GBRG, 12, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SGRBG12_1X12, { BayerFormat::GRBG, 12, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SRGGB12_1X12, { BayerFormat::RGGB, 12, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SBGGR14_1X14, { BayerFormat::BGGR, 14, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SGBRG14_1X14, { BayerFormat::GBRG, 14, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SGRBG14_1X14, { BayerFormat::GRBG, 14, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SRGGB14_1X14, { BayerFormat::RGGB, 14, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SBGGR16_1X16, { BayerFormat::BGGR, 16, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SGBRG16_1X16, { BayerFormat::GBRG, 16, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SGRBG16_1X16, { BayerFormat::GRBG, 16, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_SRGGB16_1X16, { BayerFormat::RGGB, 16, BayerFormat::Packing::None } },\n> +       { MEDIA_BUS_FMT_Y8_1X8, { BayerFormat::MONO, 8, BayerFormat::Packing::None } },\n> +       { 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>         result += \"-\" + std::to_string(bitDepth);\n>  \n> -       if (packing == CSI2Packed)\n> +       if (packing == Packing::CSI2)\n>                 result += \"-CSI2P\";\n> -       else if (packing == IPU3Packed)\n> +       else if (packing == Packing::IPU3)\n>                 result += \"-IPU3P\";\n>  \n>         return result;\n> diff --git a/test/bayer-format.cpp b/test/bayer-format.cpp\n> index e396ee83ca91..135bcb5214c8 100644\n> --- a/test/bayer-format.cpp\n> +++ b/test/bayer-format.cpp\n> @@ -30,7 +30,7 @@ protected:\n>                 }\n>  \n>                 /* A correct Bayer format has to be valid. */\n> -               bayerFmt = BayerFormat(BayerFormat::BGGR, 8, BayerFormat::None);\n> +               bayerFmt = BayerFormat(BayerFormat::BGGR, 8, BayerFormat::Packing::None);\n>                 if (!bayerFmt.isValid()) {\n>                         cerr << \"A correct BayerFormat has to be valid.\"\n>                              << endl;\n> @@ -41,9 +41,9 @@ protected:\n>                  * Two bayer formats created with the same order and bit depth\n>                  * have to be equal.\n>                  */\n> -               bayerFmt = BayerFormat(BayerFormat::BGGR, 8, BayerFormat::None);\n> +               bayerFmt = BayerFormat(BayerFormat::BGGR, 8, BayerFormat::Packing::None);\n>                 BayerFormat bayerFmtExpect = BayerFormat(BayerFormat::BGGR, 8,\n> -                                                        BayerFormat::None);\n> +                                                        BayerFormat::Packing::None);\n>                 if (bayerFmt != bayerFmtExpect) {\n>                         cerr << \"Comparison of identical formats failed.\"\n>                              << endl;\n> @@ -54,9 +54,9 @@ protected:\n>                  * Two Bayer formats created with the same order but with a\n>                  * different bitDepth are not equal.\n>                  */\n> -               bayerFmt = BayerFormat(BayerFormat::BGGR, 8, BayerFormat::None);\n> +               bayerFmt = BayerFormat(BayerFormat::BGGR, 8, BayerFormat::Packing::None);\n>                 bayerFmtExpect = BayerFormat(BayerFormat::BGGR, 12,\n> -                                            BayerFormat::None);\n> +                                            BayerFormat::Packing::None);\n>                 if (bayerFmt == bayerFmtExpect) {\n>                         cerr << \"Comparison of different formats failed.\"\n>                              << endl;\n> @@ -96,7 +96,7 @@ protected:\n>                  * to a Bayer format.\n>                  */\n>                 bayerFmtExpect = BayerFormat(BayerFormat::BGGR, 8,\n> -                                            BayerFormat::None);\n> +                                            BayerFormat::Packing::None);\n>                 v4l2Fmt = V4L2PixelFormat(V4L2_PIX_FMT_SBGGR8);\n>                 bayerFmt = BayerFormat::fromV4L2PixelFormat(v4l2Fmt);\n>                 if (bayerFmt != bayerFmtExpect) {\n> @@ -123,7 +123,7 @@ protected:\n>                  * Test if a valid Bayer format can be converted to a\n>                  * string representation.\n>                  */\n> -               bayerFmt = BayerFormat(BayerFormat::BGGR, 8, BayerFormat::None);\n> +               bayerFmt = BayerFormat(BayerFormat::BGGR, 8, BayerFormat::Packing::None);\n>                 if (bayerFmt.toString() != \"BGGR-8\") {\n>                         cerr << \"String representation != 'BGGR-8' (got: '\"\n>                              << bayerFmt.toString() << \"' ) \" << endl;\n> @@ -145,9 +145,9 @@ protected:\n>                  * Perform a horizontal Flip and make sure that the\n>                  * order is adjusted accordingly.\n>                  */\n> -               bayerFmt = BayerFormat(BayerFormat::BGGR, 8, BayerFormat::None);\n> +               bayerFmt = BayerFormat(BayerFormat::BGGR, 8, BayerFormat::Packing::None);\n>                 bayerFmtExpect = BayerFormat(BayerFormat::GBRG, 8,\n> -                                            BayerFormat::None);\n> +                                            BayerFormat::Packing::None);\n>                 BayerFormat hFlipFmt = bayerFmt.transform(Transform::HFlip);\n>                 if (hFlipFmt != bayerFmtExpect) {\n>                         cerr << \"Horizontal flip of 'BGGR-8' should result in '\"\n> @@ -160,9 +160,9 @@ protected:\n>                  * Perform a vertical Flip and make sure that\n>                  * the order is adjusted accordingly.\n>                  */\n> -               bayerFmt = BayerFormat(BayerFormat::BGGR, 8, BayerFormat::None);\n> +               bayerFmt = BayerFormat(BayerFormat::BGGR, 8, BayerFormat::Packing::None);\n>                 bayerFmtExpect = BayerFormat(BayerFormat::GRBG, 8,\n> -                                            BayerFormat::None);\n> +                                            BayerFormat::Packing::None);\n>                 BayerFormat vFlipFmt = bayerFmt.transform(Transform::VFlip);\n>                 if (vFlipFmt != bayerFmtExpect) {\n>                         cerr << \"Vertical flip of 'BGGR-8' should result in '\"\n> @@ -176,7 +176,7 @@ protected:\n>                  * pixels on the bottom left to top right diagonal and make\n>                  * sure, that it doesn't change.\n>                  */\n> -               bayerFmt = BayerFormat(BayerFormat::BGGR, 8, BayerFormat::None);\n> +               bayerFmt = BayerFormat(BayerFormat::BGGR, 8, BayerFormat::Packing::None);\n>                 BayerFormat transposeFmt = bayerFmt.transform(\n>                         Transform::Transpose);\n>                 if (transposeFmt != bayerFmt) {\n> @@ -192,9 +192,9 @@ protected:\n>                  * on the bottom left to top right diagonal and make sure\n>                  * that their positions are switched.\n>                  */\n> -               bayerFmt = BayerFormat(BayerFormat::GBRG, 8, BayerFormat::None);\n> +               bayerFmt = BayerFormat(BayerFormat::GBRG, 8, BayerFormat::Packing::None);\n>                 bayerFmtExpect = BayerFormat(BayerFormat::GRBG, 8,\n> -                                            BayerFormat::None);\n> +                                            BayerFormat::Packing::None);\n>                 transposeFmt = bayerFmt.transform(Transform::Transpose);\n>                 if (transposeFmt != bayerFmtExpect) {\n>                         cerr << \"Transpose with the red & blue pixels on the \"\n> -- \n> 2.25.1\n>","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 862F1BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 28 Oct 2021 12:20:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3D2FD600BC;\n\tThu, 28 Oct 2021 14:20:20 +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 49BAD600B5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 28 Oct 2021 14:20:19 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id EC9EB513;\n\tThu, 28 Oct 2021 14:20:18 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"lRUQbKG3\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1635423619;\n\tbh=VsqEbge4ZQjmni5fjIFB8ftvMYNWA9fp7gHBgN+q0og=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=lRUQbKG3zWnw+i+5S+XUtI8xLdqB0ImLwiEwvaApkq1LA6B2I42ElvZOhtfL+ZSGR\n\t8Ax4oI4Tpq80e907hcbJlxT09hE6Sujj+vtGSyPlJz1zDTOICKMgqRKi4x+wv/vcRJ\n\tKvkJqWEdqEfpb2fyIeu1/LhLOcu8sAAPHEjw7r9w=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20211028084646.453775-5-naush@raspberrypi.com>","References":"<20211028084646.453775-1-naush@raspberrypi.com>\n\t<20211028084646.453775-5-naush@raspberrypi.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Naushir Patuck <naush@raspberrypi.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 28 Oct 2021 13:20:16 +0100","Message-ID":"<163542361606.2498920.8603731867629091272@Monstersaurus>","User-Agent":"alot/0.9.1","Subject":"Re: [libcamera-devel] [PATCH v4 04/10] libcamera: bayer_format:\n\tTurn BayerFormat::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>"}}]