Skip to content

Commit bc3b0e2

Browse files
committed
drivers: video: introduce the RGB24 format
This introduces the RGB 24-bit format as defined in the Linux header <include/uapi/linux/videodev2.h>, including the bits-per-pixel size definition. Signed-off-by: Josuah Demangeon <me@josuah.net>
1 parent 760bcc6 commit bc3b0e2

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

include/zephyr/drivers/video.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,14 +906,23 @@ void video_closest_frmival(const struct device *dev, enum video_endpoint_id ep,
906906
#define VIDEO_PIX_FMT_RGB565 VIDEO_FOURCC('R', 'G', 'B', 'P')
907907

908908
/**
909-
* The first byte is empty (X) for each pixel.
909+
* The first byte is empty (X) for each channel.
910910
*
911911
* @verbatim
912912
* | Xxxxxxxx Rrrrrrrr Gggggggg Bbbbbbbb | ...
913913
* @endverbatim
914914
*/
915915
#define VIDEO_PIX_FMT_XRGB32 VIDEO_FOURCC('B', 'X', '2', '4')
916916

917+
/**
918+
* Red, Green, Blue, one byte per channel, 24-bits in total.
919+
*
920+
* @verbatim
921+
* | Rrrrrrrr Gggggggg Bbbbbbbb | ...
922+
* @endverbatim
923+
*/
924+
#define VIDEO_PIX_FMT_RGB24 VIDEO_FOURCC('R', 'G', 'B', '3')
925+
917926
/**
918927
* @}
919928
*/
@@ -980,6 +989,8 @@ static inline unsigned int video_bits_per_pixel(uint32_t pixfmt)
980989
case VIDEO_PIX_FMT_RGB565:
981990
case VIDEO_PIX_FMT_YUYV:
982991
return 16;
992+
case VIDEO_PIX_FMT_RGB24:
993+
return 24;
983994
case VIDEO_PIX_FMT_XRGB32:
984995
case VIDEO_PIX_FMT_XYUV32:
985996
return 32;

0 commit comments

Comments
 (0)