<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 27 Oct 2021 at 14:10, Laurent Pinchart <<a href="mailto:laurent.pinchart@ideasonboard.com">laurent.pinchart@ideasonboard.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Naush,<br>
<br>
On Wed, Oct 27, 2021 at 01:48:09PM +0100, Naushir Patuck wrote:<br>
> On Wed, 27 Oct 2021 at 13:36, Laurent Pinchart wrote:<br>
> <br>
> > The unscoped enum BayerFormat::Packing leads to usage of the ambiguous<br>
> > BayerFormat::None enumerator. Turn the enumeration into a scoped enum to<br>
> > force usage of BayerFormat::Packing::None, and drop the now redundant<br>
> > "Packed" suffix for the CSI2 and IPU3 packing.<br>
> ><br>
> > Signed-off-by: Laurent Pinchart <<a href="mailto:laurent.pinchart@ideasonboard.com" target="_blank">laurent.pinchart@ideasonboard.com</a>><br>
> <br>
> This is going to conflict badly with my series :-)<br>
<br>
Guess what gave me the idea ? :-)<br>
<br>
> I definitely prefer scoped enums, but do you think we ought to do the<br>
> same with the Order enum in this change?<br>
<br>
It's less ambiguous for the Order, but I wouldn't mind. I can send a v2<br>
with that change.<br></blockquote><div><br></div><div>Great, I'll wait for that and add it to this series.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> ---<br>
> >  include/libcamera/internal/bayer_format.h |   6 +-<br>
> >  src/libcamera/bayer_format.cpp            | 138 +++++++++++-----------<br>
> >  test/bayer-format.cpp                     |  28 ++---<br>
> >  3 files changed, 86 insertions(+), 86 deletions(-)<br>
> ><br>
> > diff --git a/include/libcamera/internal/bayer_format.h<br>
> > b/include/libcamera/internal/bayer_format.h<br>
> > index 723382d4168d..d9a56d744a25 100644<br>
> > --- a/include/libcamera/internal/bayer_format.h<br>
> > +++ b/include/libcamera/internal/bayer_format.h<br>
> > @@ -27,10 +27,10 @@ public:<br>
> >                 MONO = 4<br>
> >         };<br>
> ><br>
> > -       enum Packing : uint16_t {<br>
> > +       enum class Packing : uint16_t {<br>
> >                 None = 0,<br>
> > -               CSI2Packed = 1,<br>
> > -               IPU3Packed = 2,<br>
> > +               CSI2 = 1,<br>
> > +               IPU3 = 2,<br>
> >         };<br>
> ><br>
> >         constexpr BayerFormat()<br>
> > diff --git a/src/libcamera/bayer_format.cpp<br>
> > b/src/libcamera/bayer_format.cpp<br>
> > index 11355f144f66..1c1e849a7e31 100644<br>
> > --- a/src/libcamera/bayer_format.cpp<br>
> > +++ b/src/libcamera/bayer_format.cpp<br>
> > @@ -53,11 +53,11 @@ namespace libcamera {<br>
> >   * \enum BayerFormat::Packing<br>
> >   * \brief Different types of packing that can be applied to a BayerFormat<br>
> >   *<br>
> > - * \var BayerFormat::None<br>
> > + * \var BayerFormat::Packing::None<br>
> >   * \brief No packing<br>
> > - * \var BayerFormat::CSI2Packed<br>
> > + * \var BayerFormat::Packing::CSI2<br>
> >   * \brief Format uses MIPI CSI-2 style packing<br>
> > - * \var BayerFormat::IPU3Packed<br>
> > + * \var BayerFormat::Packing::IPU3<br>
> >   * \brief Format uses IPU3 style packing<br>
> >   */<br>
> ><br>
> > @@ -85,73 +85,73 @@ struct BayerFormatComparator {<br>
> >  };<br>
> ><br>
> >  const std::map<BayerFormat, V4L2PixelFormat, BayerFormatComparator><br>
> > bayerToV4l2{<br>
> > -       { { BayerFormat::BGGR, 8, BayerFormat::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SBGGR8) },<br>
> > -       { { BayerFormat::GBRG, 8, BayerFormat::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SGBRG8) },<br>
> > -       { { BayerFormat::GRBG, 8, BayerFormat::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SGRBG8) },<br>
> > -       { { BayerFormat::RGGB, 8, BayerFormat::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SRGGB8) },<br>
> > -       { { BayerFormat::BGGR, 10, BayerFormat::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SBGGR10) },<br>
> > -       { { BayerFormat::GBRG, 10, BayerFormat::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SGBRG10) },<br>
> > -       { { BayerFormat::GRBG, 10, BayerFormat::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SGRBG10) },<br>
> > -       { { BayerFormat::RGGB, 10, BayerFormat::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SRGGB10) },<br>
> > -       { { BayerFormat::BGGR, 10, BayerFormat::CSI2Packed },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SBGGR10P) },<br>
> > -       { { BayerFormat::GBRG, 10, BayerFormat::CSI2Packed },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SGBRG10P) },<br>
> > -       { { BayerFormat::GRBG, 10, BayerFormat::CSI2Packed },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SGRBG10P) },<br>
> > -       { { BayerFormat::RGGB, 10, BayerFormat::CSI2Packed },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SRGGB10P) },<br>
> > -       { { BayerFormat::BGGR, 10, BayerFormat::IPU3Packed },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SBGGR10) },<br>
> > -       { { BayerFormat::GBRG, 10, BayerFormat::IPU3Packed },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SGBRG10) },<br>
> > -       { { BayerFormat::GRBG, 10, BayerFormat::IPU3Packed },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SGRBG10) },<br>
> > -       { { BayerFormat::RGGB, 10, BayerFormat::IPU3Packed },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SRGGB10) },<br>
> > -       { { BayerFormat::BGGR, 12, BayerFormat::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SBGGR12) },<br>
> > -       { { BayerFormat::GBRG, 12, BayerFormat::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SGBRG12) },<br>
> > -       { { BayerFormat::GRBG, 12, BayerFormat::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SGRBG12) },<br>
> > -       { { BayerFormat::RGGB, 12, BayerFormat::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SRGGB12) },<br>
> > -       { { BayerFormat::BGGR, 12, BayerFormat::CSI2Packed },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SBGGR12P) },<br>
> > -       { { BayerFormat::GBRG, 12, BayerFormat::CSI2Packed },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SGBRG12P) },<br>
> > -       { { BayerFormat::GRBG, 12, BayerFormat::CSI2Packed },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SGRBG12P) },<br>
> > -       { { BayerFormat::RGGB, 12, BayerFormat::CSI2Packed },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SRGGB12P) },<br>
> > -       { { BayerFormat::BGGR, 16, BayerFormat::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SBGGR16) },<br>
> > -       { { BayerFormat::GBRG, 16, BayerFormat::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SGBRG16) },<br>
> > -       { { BayerFormat::GRBG, 16, BayerFormat::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SGRBG16) },<br>
> > -       { { BayerFormat::RGGB, 16, BayerFormat::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SRGGB16) },<br>
> > -       { { BayerFormat::MONO, 8, BayerFormat::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_GREY) },<br>
> > -       { { BayerFormat::MONO, 10, BayerFormat::CSI2Packed },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_Y10P) },<br>
> > +       { { BayerFormat::BGGR, 8, BayerFormat::Packing::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SBGGR8) },<br>
> > +       { { BayerFormat::GBRG, 8, BayerFormat::Packing::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SGBRG8) },<br>
> > +       { { BayerFormat::GRBG, 8, BayerFormat::Packing::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SGRBG8) },<br>
> > +       { { BayerFormat::RGGB, 8, BayerFormat::Packing::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SRGGB8) },<br>
> > +       { { BayerFormat::BGGR, 10, BayerFormat::Packing::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SBGGR10) },<br>
> > +       { { BayerFormat::GBRG, 10, BayerFormat::Packing::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SGBRG10) },<br>
> > +       { { BayerFormat::GRBG, 10, BayerFormat::Packing::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SGRBG10) },<br>
> > +       { { BayerFormat::RGGB, 10, BayerFormat::Packing::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SRGGB10) },<br>
> > +       { { BayerFormat::BGGR, 10, BayerFormat::Packing::CSI2 },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SBGGR10P) },<br>
> > +       { { BayerFormat::GBRG, 10, BayerFormat::Packing::CSI2 },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SGBRG10P) },<br>
> > +       { { BayerFormat::GRBG, 10, BayerFormat::Packing::CSI2 },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SGRBG10P) },<br>
> > +       { { BayerFormat::RGGB, 10, BayerFormat::Packing::CSI2 },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SRGGB10P) },<br>
> > +       { { BayerFormat::BGGR, 10, BayerFormat::Packing::IPU3 },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SBGGR10) },<br>
> > +       { { BayerFormat::GBRG, 10, BayerFormat::Packing::IPU3 },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SGBRG10) },<br>
> > +       { { BayerFormat::GRBG, 10, BayerFormat::Packing::IPU3 },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SGRBG10) },<br>
> > +       { { BayerFormat::RGGB, 10, BayerFormat::Packing::IPU3 },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SRGGB10) },<br>
> > +       { { BayerFormat::BGGR, 12, BayerFormat::Packing::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SBGGR12) },<br>
> > +       { { BayerFormat::GBRG, 12, BayerFormat::Packing::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SGBRG12) },<br>
> > +       { { BayerFormat::GRBG, 12, BayerFormat::Packing::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SGRBG12) },<br>
> > +       { { BayerFormat::RGGB, 12, BayerFormat::Packing::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SRGGB12) },<br>
> > +       { { BayerFormat::BGGR, 12, BayerFormat::Packing::CSI2 },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SBGGR12P) },<br>
> > +       { { BayerFormat::GBRG, 12, BayerFormat::Packing::CSI2 },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SGBRG12P) },<br>
> > +       { { BayerFormat::GRBG, 12, BayerFormat::Packing::CSI2 },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SGRBG12P) },<br>
> > +       { { BayerFormat::RGGB, 12, BayerFormat::Packing::CSI2 },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SRGGB12P) },<br>
> > +       { { BayerFormat::BGGR, 16, BayerFormat::Packing::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SBGGR16) },<br>
> > +       { { BayerFormat::GBRG, 16, BayerFormat::Packing::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SGBRG16) },<br>
> > +       { { BayerFormat::GRBG, 16, BayerFormat::Packing::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SGRBG16) },<br>
> > +       { { BayerFormat::RGGB, 16, BayerFormat::Packing::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_SRGGB16) },<br>
> > +       { { BayerFormat::MONO, 8, BayerFormat::Packing::None },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_GREY) },<br>
> > +       { { BayerFormat::MONO, 10, BayerFormat::Packing::CSI2 },<br>
> > V4L2PixelFormat(V4L2_PIX_FMT_Y10P) },<br>
> >  };<br>
> ><br>
> >  const std::unordered_map<unsigned int, BayerFormat> mbusCodeToBayer{<br>
> > -       { MEDIA_BUS_FMT_SBGGR8_1X8, { BayerFormat::BGGR, 8,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SGBRG8_1X8, { BayerFormat::GBRG, 8,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SGRBG8_1X8, { BayerFormat::GRBG, 8,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SRGGB8_1X8, { BayerFormat::RGGB, 8,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8, { BayerFormat::BGGR, 8,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8, { BayerFormat::GBRG, 8,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8, { BayerFormat::GRBG, 8,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8, { BayerFormat::RGGB, 8,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8, { BayerFormat::BGGR, 8,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8, { BayerFormat::GBRG, 8,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, { BayerFormat::GRBG, 8,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8, { BayerFormat::RGGB, 8,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE, { BayerFormat::BGGR, 10,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE, { BayerFormat::BGGR, 10,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE, { BayerFormat::BGGR, 10,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE, { BayerFormat::BGGR, 10,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SBGGR10_1X10, { BayerFormat::BGGR, 10,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SGBRG10_1X10, { BayerFormat::GBRG, 10,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SGRBG10_1X10, { BayerFormat::GRBG, 10,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SRGGB10_1X10, { BayerFormat::RGGB, 10,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SBGGR12_1X12, { BayerFormat::BGGR, 12,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SGBRG12_1X12, { BayerFormat::GBRG, 12,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SGRBG12_1X12, { BayerFormat::GRBG, 12,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SRGGB12_1X12, { BayerFormat::RGGB, 12,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SBGGR14_1X14, { BayerFormat::BGGR, 14,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SGBRG14_1X14, { BayerFormat::GBRG, 14,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SGRBG14_1X14, { BayerFormat::GRBG, 14,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SRGGB14_1X14, { BayerFormat::RGGB, 14,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SBGGR16_1X16, { BayerFormat::BGGR, 16,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SGBRG16_1X16, { BayerFormat::GBRG, 16,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SGRBG16_1X16, { BayerFormat::GRBG, 16,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_SRGGB16_1X16, { BayerFormat::RGGB, 16,<br>
> > BayerFormat::None } },<br>
> > -       { MEDIA_BUS_FMT_Y8_1X8, { BayerFormat::MONO, 8, BayerFormat::None<br>
> > } },<br>
> > -       { MEDIA_BUS_FMT_Y10_1X10, { BayerFormat::MONO, 10,<br>
> > BayerFormat::None } },<br>
> > +       { MEDIA_BUS_FMT_SBGGR8_1X8, { BayerFormat::BGGR, 8,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SGBRG8_1X8, { BayerFormat::GBRG, 8,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SGRBG8_1X8, { BayerFormat::GRBG, 8,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SRGGB8_1X8, { BayerFormat::RGGB, 8,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8, { BayerFormat::BGGR, 8,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8, { BayerFormat::GBRG, 8,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8, { BayerFormat::GRBG, 8,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8, { BayerFormat::RGGB, 8,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8, { BayerFormat::BGGR, 8,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8, { BayerFormat::GBRG, 8,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, { BayerFormat::GRBG, 8,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8, { BayerFormat::RGGB, 8,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE, { BayerFormat::BGGR, 10,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE, { BayerFormat::BGGR, 10,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE, { BayerFormat::BGGR, 10,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE, { BayerFormat::BGGR, 10,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SBGGR10_1X10, { BayerFormat::BGGR, 10,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SGBRG10_1X10, { BayerFormat::GBRG, 10,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SGRBG10_1X10, { BayerFormat::GRBG, 10,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SRGGB10_1X10, { BayerFormat::RGGB, 10,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SBGGR12_1X12, { BayerFormat::BGGR, 12,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SGBRG12_1X12, { BayerFormat::GBRG, 12,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SGRBG12_1X12, { BayerFormat::GRBG, 12,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SRGGB12_1X12, { BayerFormat::RGGB, 12,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SBGGR14_1X14, { BayerFormat::BGGR, 14,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SGBRG14_1X14, { BayerFormat::GBRG, 14,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SGRBG14_1X14, { BayerFormat::GRBG, 14,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SRGGB14_1X14, { BayerFormat::RGGB, 14,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SBGGR16_1X16, { BayerFormat::BGGR, 16,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SGBRG16_1X16, { BayerFormat::GBRG, 16,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SGRBG16_1X16, { BayerFormat::GRBG, 16,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_SRGGB16_1X16, { BayerFormat::RGGB, 16,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_Y8_1X8, { BayerFormat::MONO, 8,<br>
> > BayerFormat::Packing::None } },<br>
> > +       { MEDIA_BUS_FMT_Y10_1X10, { BayerFormat::MONO, 10,<br>
> > BayerFormat::Packing::None } },<br>
> >  };<br>
> ><br>
> >  } /* namespace */<br>
> > @@ -214,9 +214,9 @@ std::string BayerFormat::toString() const<br>
> ><br>
> >         result += "-" + std::to_string(bitDepth);<br>
> ><br>
> > -       if (packing == CSI2Packed)<br>
> > +       if (packing == Packing::CSI2)<br>
> >                 result += "-CSI2P";<br>
> > -       else if (packing == IPU3Packed)<br>
> > +       else if (packing == Packing::IPU3)<br>
> >                 result += "-IPU3P";<br>
> ><br>
> >         return result;<br>
> > diff --git a/test/bayer-format.cpp b/test/bayer-format.cpp<br>
> > index e396ee83ca91..135bcb5214c8 100644<br>
> > --- a/test/bayer-format.cpp<br>
> > +++ b/test/bayer-format.cpp<br>
> > @@ -30,7 +30,7 @@ protected:<br>
> >                 }<br>
> ><br>
> >                 /* A correct Bayer format has to be valid. */<br>
> > -               bayerFmt = BayerFormat(BayerFormat::BGGR, 8,<br>
> > BayerFormat::None);<br>
> > +               bayerFmt = BayerFormat(BayerFormat::BGGR, 8,<br>
> > BayerFormat::Packing::None);<br>
> >                 if (!bayerFmt.isValid()) {<br>
> >                         cerr << "A correct BayerFormat has to be valid."<br>
> >                              << endl;<br>
> > @@ -41,9 +41,9 @@ protected:<br>
> >                  * Two bayer formats created with the same order and bit<br>
> > depth<br>
> >                  * have to be equal.<br>
> >                  */<br>
> > -               bayerFmt = BayerFormat(BayerFormat::BGGR, 8,<br>
> > BayerFormat::None);<br>
> > +               bayerFmt = BayerFormat(BayerFormat::BGGR, 8,<br>
> > BayerFormat::Packing::None);<br>
> >                 BayerFormat bayerFmtExpect =<br>
> > BayerFormat(BayerFormat::BGGR, 8,<br>
> > -<br>
> > BayerFormat::None);<br>
> > +<br>
> > BayerFormat::Packing::None);<br>
> >                 if (bayerFmt != bayerFmtExpect) {<br>
> >                         cerr << "Comparison of identical formats failed."<br>
> >                              << endl;<br>
> > @@ -54,9 +54,9 @@ protected:<br>
> >                  * Two Bayer formats created with the same order but with a<br>
> >                  * different bitDepth are not equal.<br>
> >                  */<br>
> > -               bayerFmt = BayerFormat(BayerFormat::BGGR, 8,<br>
> > BayerFormat::None);<br>
> > +               bayerFmt = BayerFormat(BayerFormat::BGGR, 8,<br>
> > BayerFormat::Packing::None);<br>
> >                 bayerFmtExpect = BayerFormat(BayerFormat::BGGR, 12,<br>
> > -                                            BayerFormat::None);<br>
> > +                                            BayerFormat::Packing::None);<br>
> >                 if (bayerFmt == bayerFmtExpect) {<br>
> >                         cerr << "Comparison of different formats failed."<br>
> >                              << endl;<br>
> > @@ -96,7 +96,7 @@ protected:<br>
> >                  * to a Bayer format.<br>
> >                  */<br>
> >                 bayerFmtExpect = BayerFormat(BayerFormat::BGGR, 8,<br>
> > -                                            BayerFormat::None);<br>
> > +                                            BayerFormat::Packing::None);<br>
> >                 v4l2Fmt = V4L2PixelFormat(V4L2_PIX_FMT_SBGGR8);<br>
> >                 bayerFmt = BayerFormat::fromV4L2PixelFormat(v4l2Fmt);<br>
> >                 if (bayerFmt != bayerFmtExpect) {<br>
> > @@ -123,7 +123,7 @@ protected:<br>
> >                  * Test if a valid Bayer format can be converted to a<br>
> >                  * string representation.<br>
> >                  */<br>
> > -               bayerFmt = BayerFormat(BayerFormat::BGGR, 8,<br>
> > BayerFormat::None);<br>
> > +               bayerFmt = BayerFormat(BayerFormat::BGGR, 8,<br>
> > BayerFormat::Packing::None);<br>
> >                 if (bayerFmt.toString() != "BGGR-8") {<br>
> >                         cerr << "String representation != 'BGGR-8' (got: '"<br>
> >                              << bayerFmt.toString() << "' ) " << endl;<br>
> > @@ -145,9 +145,9 @@ protected:<br>
> >                  * Perform a horizontal Flip and make sure that the<br>
> >                  * order is adjusted accordingly.<br>
> >                  */<br>
> > -               bayerFmt = BayerFormat(BayerFormat::BGGR, 8,<br>
> > BayerFormat::None);<br>
> > +               bayerFmt = BayerFormat(BayerFormat::BGGR, 8,<br>
> > BayerFormat::Packing::None);<br>
> >                 bayerFmtExpect = BayerFormat(BayerFormat::GBRG, 8,<br>
> > -                                            BayerFormat::None);<br>
> > +                                            BayerFormat::Packing::None);<br>
> >                 BayerFormat hFlipFmt =<br>
> > bayerFmt.transform(Transform::HFlip);<br>
> >                 if (hFlipFmt != bayerFmtExpect) {<br>
> >                         cerr << "Horizontal flip of 'BGGR-8' should result<br>
> > in '"<br>
> > @@ -160,9 +160,9 @@ protected:<br>
> >                  * Perform a vertical Flip and make sure that<br>
> >                  * the order is adjusted accordingly.<br>
> >                  */<br>
> > -               bayerFmt = BayerFormat(BayerFormat::BGGR, 8,<br>
> > BayerFormat::None);<br>
> > +               bayerFmt = BayerFormat(BayerFormat::BGGR, 8,<br>
> > BayerFormat::Packing::None);<br>
> >                 bayerFmtExpect = BayerFormat(BayerFormat::GRBG, 8,<br>
> > -                                            BayerFormat::None);<br>
> > +                                            BayerFormat::Packing::None);<br>
> >                 BayerFormat vFlipFmt =<br>
> > bayerFmt.transform(Transform::VFlip);<br>
> >                 if (vFlipFmt != bayerFmtExpect) {<br>
> >                         cerr << "Vertical flip of 'BGGR-8' should result<br>
> > in '"<br>
> > @@ -176,7 +176,7 @@ protected:<br>
> >                  * pixels on the bottom left to top right diagonal and make<br>
> >                  * sure, that it doesn't change.<br>
> >                  */<br>
> > -               bayerFmt = BayerFormat(BayerFormat::BGGR, 8,<br>
> > BayerFormat::None);<br>
> > +               bayerFmt = BayerFormat(BayerFormat::BGGR, 8,<br>
> > BayerFormat::Packing::None);<br>
> >                 BayerFormat transposeFmt = bayerFmt.transform(<br>
> >                         Transform::Transpose);<br>
> >                 if (transposeFmt != bayerFmt) {<br>
> > @@ -192,9 +192,9 @@ protected:<br>
> >                  * on the bottom left to top right diagonal and make sure<br>
> >                  * that their positions are switched.<br>
> >                  */<br>
> > -               bayerFmt = BayerFormat(BayerFormat::GBRG, 8,<br>
> > BayerFormat::None);<br>
> > +               bayerFmt = BayerFormat(BayerFormat::GBRG, 8,<br>
> > BayerFormat::Packing::None);<br>
> >                 bayerFmtExpect = BayerFormat(BayerFormat::GRBG, 8,<br>
> > -                                            BayerFormat::None);<br>
> > +                                            BayerFormat::Packing::None);<br>
> >                 transposeFmt = bayerFmt.transform(Transform::Transpose);<br>
> >                 if (transposeFmt != bayerFmtExpect) {<br>
> >                         cerr << "Transpose with the red & blue pixels on<br>
> > the "<br>
> ><br>
> > base-commit: 4d4694cd9f4ea73586dcb75d19905a1860356d9f<br>
<br>
-- <br>
Regards,<br>
<br>
Laurent Pinchart<br>
</blockquote></div></div>