Skip to content

Commit d4e596d

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 <[email protected]>
1 parent 6f761c8 commit d4e596d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

include/zephyr/drivers/video.h

+11
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,15 @@ void video_closest_frmival(const struct device *dev, enum video_endpoint_id ep,
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)