Skip to content

Commit f980f35

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 27dd9cc commit f980f35

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
@@ -924,14 +924,23 @@ void video_closest_frmival(const struct device *dev, enum video_endpoint_id ep,
924924
#define VIDEO_PIX_FMT_RGB565 VIDEO_FOURCC('R', 'G', 'B', 'P')
925925

926926
/**
927-
* The first byte is empty (X) for each pixel.
927+
* The first byte is empty (X) for each channel.
928928
*
929929
* @verbatim
930930
* | Xxxxxxxx Rrrrrrrr Gggggggg Bbbbbbbb | ...
931931
* @endverbatim
932932
*/
933933
#define VIDEO_PIX_FMT_XRGB32 VIDEO_FOURCC('B', 'X', '2', '4')
934934

935+
/**
936+
* Red, Green, Blue, one byte per channel, 24-bits in total.
937+
*
938+
* @verbatim
939+
* | Rrrrrrrr Gggggggg Bbbbbbbb | ...
940+
* @endverbatim
941+
*/
942+
#define VIDEO_PIX_FMT_RGB24 VIDEO_FOURCC('R', 'G', 'B', '3')
943+
935944
/**
936945
* @}
937946
*/
@@ -998,6 +1007,8 @@ static inline unsigned int video_bits_per_pixel(uint32_t pixfmt)
9981007
case VIDEO_PIX_FMT_RGB565:
9991008
case VIDEO_PIX_FMT_YUYV:
10001009
return 16;
1010+
case VIDEO_PIX_FMT_RGB24:
1011+
return 24;
10011012
case VIDEO_PIX_FMT_XRGB32:
10021013
case VIDEO_PIX_FMT_XYUV32:
10031014
return 32;

0 commit comments

Comments
 (0)