libcamera: Add support for RGB565 format
Add support for RGB565 format. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
7855dc922f
commit
d9295552b1
3 changed files with 14 additions and 0 deletions
|
@ -233,6 +233,16 @@ const PixelFormatInfo pixelFormatInfoInvalid{};
|
||||||
|
|
||||||
const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
|
const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
|
||||||
/* RGB formats. */
|
/* RGB formats. */
|
||||||
|
{ formats::RGB565, {
|
||||||
|
.name = "RGB565",
|
||||||
|
.format = formats::RGB565,
|
||||||
|
.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_RGB565),
|
||||||
|
.bitsPerPixel = 16,
|
||||||
|
.colourEncoding = PixelFormatInfo::ColourEncodingRGB,
|
||||||
|
.packed = false,
|
||||||
|
.pixelsPerGroup = 1,
|
||||||
|
.planes = {{ { 3, 1 }, { 0, 0 }, { 0, 0 } }},
|
||||||
|
} },
|
||||||
{ formats::BGR888, {
|
{ formats::BGR888, {
|
||||||
.name = "BGR888",
|
.name = "BGR888",
|
||||||
.format = formats::BGR888,
|
.format = formats::BGR888,
|
||||||
|
|
|
@ -8,6 +8,9 @@ formats:
|
||||||
- R8:
|
- R8:
|
||||||
fourcc: DRM_FORMAT_R8
|
fourcc: DRM_FORMAT_R8
|
||||||
|
|
||||||
|
- RGB565:
|
||||||
|
fourcc: DRM_FORMAT_RGB565
|
||||||
|
|
||||||
- RGB888:
|
- RGB888:
|
||||||
fourcc: DRM_FORMAT_RGB888
|
fourcc: DRM_FORMAT_RGB888
|
||||||
- BGR888:
|
- BGR888:
|
||||||
|
|
|
@ -45,6 +45,7 @@ namespace {
|
||||||
|
|
||||||
const std::map<V4L2PixelFormat, PixelFormat> vpf2pf{
|
const std::map<V4L2PixelFormat, PixelFormat> vpf2pf{
|
||||||
/* RGB formats. */
|
/* RGB formats. */
|
||||||
|
{ V4L2PixelFormat(V4L2_PIX_FMT_RGB565), formats::RGB565 },
|
||||||
{ V4L2PixelFormat(V4L2_PIX_FMT_RGB24), formats::BGR888 },
|
{ V4L2PixelFormat(V4L2_PIX_FMT_RGB24), formats::BGR888 },
|
||||||
{ V4L2PixelFormat(V4L2_PIX_FMT_BGR24), formats::RGB888 },
|
{ V4L2PixelFormat(V4L2_PIX_FMT_BGR24), formats::RGB888 },
|
||||||
{ V4L2PixelFormat(V4L2_PIX_FMT_RGBA32), formats::ABGR8888 },
|
{ V4L2PixelFormat(V4L2_PIX_FMT_RGBA32), formats::ABGR8888 },
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue