Skip to content

Commit ef6a2e2

Browse files
committed
drivers: video: formats: add grayscale formats
Add the grayscale formats in the same packing as defined by MIPI. Signed-off-by: Josuah Demangeon <[email protected]>
1 parent 2229400 commit ef6a2e2

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

include/zephyr/drivers/video.h

+50
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,56 @@ void video_closest_frmival(const struct device *dev, enum video_endpoint_id ep,
10051005
*/
10061006
#define VIDEO_PIX_FMT_SRGGB14P VIDEO_FOURCC('p', 'R', 'E', 'E')
10071007

1008+
/**
1009+
* @}
1010+
*/
1011+
1012+
/**
1013+
* @name Grayscale formats
1014+
* Luminance (Y) channel only, in various bit depth and packing.
1015+
*
1016+
* When the format includes more than 8-bit per pixel, a strategy becomes needed to pack
1017+
* the bits over multiple bytes, as illustrated for each format.
1018+
*
1019+
* The number above the 'Y', 'y' are hints about which pixel number the following bits belong to.
1020+
*
1021+
* @{
1022+
*/
1023+
1024+
/**
1025+
* @verbatim
1026+
* 0 1 2 3
1027+
* | Yyyyyyyy | Yyyyyyyy | Yyyyyyyy | Yyyyyyyy | ...
1028+
* @endverbatim
1029+
*/
1030+
#define VIDEO_PIX_FMT_GREY VIDEO_FOURCC('G', 'R', 'E', 'Y')
1031+
1032+
/**
1033+
* @verbatim
1034+
* 0 1 2 3 0 1 2 3
1035+
* | Yyyyyyyy | Yyyyyyyy | Yyyyyyyy | Yyyyyyyy | yyyyyyyy | ...
1036+
* @endverbatim
1037+
*/
1038+
#define VIDEO_PIX_FMT_Y10P VIDEO_FOURCC('Y', '1', '0', 'P')
1039+
1040+
/**
1041+
* @verbatim
1042+
* 0 1 1 0 2 3 3 2
1043+
* | Yyyyyyyy | Yyyyyyyy | yyyyyyyy | Yyyyyyyy | Yyyyyyyy | yyyyyyyy | ...
1044+
* | Yyyyyyyy | Yyyyyyyy | yyyyyyyy | Yyyyyyyy | Yyyyyyyy | yyyyyyyy | ...
1045+
* @endverbatim
1046+
*/
1047+
#define VIDEO_PIX_FMT_Y12P VIDEO_FOURCC('Y', '1', '2', 'P')
1048+
1049+
/**
1050+
* @verbatim
1051+
* 0 1 2 3 1 0 2 1 3 2
1052+
* | Yyyyyyyy | Yyyyyyyy | Yyyyyyyy | Yyyyyyyy | yyyyyyyy | yyyyyyyy | yyyyyyyy | ...
1053+
* | Yyyyyyyy | Yyyyyyyy | Yyyyyyyy | Yyyyyyyy | yyyyyyyy | yyyyyyyy | yyyyyyyy | ...
1054+
* @endverbatim
1055+
*/
1056+
#define VIDEO_PIX_FMT_Y14P VIDEO_FOURCC('Y', '1', '4', 'P')
1057+
10081058
/**
10091059
* @}
10101060
*/

0 commit comments

Comments
 (0)