|
Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
|
Main header file for video format API. More...
#include <stdint.h>Go to the source code of this file.
Macros | |
| #define | VIDEO_FOURCC(a, b, c, d) |
| Four-character-code uniquely identifying the pixel format. | |
| #define | VIDEO_FOURCC_FROM_STR(str) |
| Convert a four-character-string to a four-character-code. | |
| #define | VIDEO_FOURCC_TO_STR(fourcc) |
| Convert a four-character-code to a four-character-string. | |
| #define | VIDEO_FMT_IS_GRAYSCALE(pixfmt) |
| Test if a fourcc is a grayscale format. | |
| #define | VIDEO_FMT_IS_BAYER(pixfmt) |
| Test if a fourcc is a Bayer format. | |
| #define | VIDEO_FMT_IS_RGB(pixfmt) |
| Test if a fourcc is an RGB format (bayer excluded). | |
| #define | VIDEO_FMT_IS_YUV(pixfmt) |
| Test if a fourcc is an YUV format. | |
| #define | VIDEO_FMT_IS_MIPI_PACKED(pixfmt) |
| Test if a fourcc is any of the MIPI-packed formats. | |
| #define | VIDEO_FMT_IS_PADDED(pixfmt) |
| Test if a fourcc is any of the MIPI-packed formats. | |
| #define | VIDEO_FMT_IS_SEMI_PLANAR(pixfmt) |
| Test if a fourcc is any of the semi-planar formats. | |
| #define | VIDEO_FMT_IS_FULL_PLANAR(pixfmt) |
| Test if a fourcc is any of the full-planar formats. | |
Bayer formats (R, G, B channels). | |
The full color information is spread over multiple pixels. When the format includes more than 8-bit per pixel, a strategy becomes needed to pack the bits over multiple bytes, as illustrated for each format. The number above the 'R', 'r', 'G', 'g', 'B', 'b' are hints about which pixel number the following bits belong to. | |
| #define | VIDEO_FOREACH_BAYER(X, ...) |
| Repeat a macro for every Bayer format, passed as first parameter. | |
| #define | VIDEO_FOREACH_BAYER_PADDED(X, ...) |
| Repeat a macro for every Bayer padded format, passed as first parameter. | |
| #define | VIDEO_PIX_FMT_SBGGR8P16 VIDEO_FOURCC('p', 'B', '8', '2') |
| 8-bit bayer format, split in two 4-bit blocks each zero-padded, little endian. | |
| #define | VIDEO_PIX_FMT_SGBRG8P16 VIDEO_FOURCC('p', 'G', '8', '2') |
| 8-bit bayer format, split in two 4-bit blocks each zero-padded, little endian. | |
| #define | VIDEO_PIX_FMT_SGRBG8P16 VIDEO_FOURCC('p', 'g', '8', '2') |
| 8-bit bayer format, split in two 4-bit blocks each zero-padded, little endian. | |
| #define | VIDEO_PIX_FMT_SRGGB8P16 VIDEO_FOURCC('p', 'R', '8', '2') |
| 8-bit bayer format, split in two 4-bit blocks each zero-padded, little endian. | |
| #define | VIDEO_FOREACH_BAYER_MIPI_PACKED(X, ...) |
| Repeat a macro for every Bayer MIPI-packed format, passed as first parameter. | |
| #define | VIDEO_PIX_FMT_SBGGR10P VIDEO_FOURCC('p', 'B', 'A', 'A') |
| #define | VIDEO_PIX_FMT_SGBRG10P VIDEO_FOURCC('p', 'G', 'A', 'A') |
| #define | VIDEO_PIX_FMT_SGRBG10P VIDEO_FOURCC('p', 'g', 'A', 'A') |
| #define | VIDEO_PIX_FMT_SRGGB10P VIDEO_FOURCC('p', 'R', 'A', 'A') |
| #define | VIDEO_PIX_FMT_SBGGR12P VIDEO_FOURCC('p', 'B', 'C', 'C') |
| #define | VIDEO_PIX_FMT_SGBRG12P VIDEO_FOURCC('p', 'G', 'C', 'C') |
| #define | VIDEO_PIX_FMT_SGRBG12P VIDEO_FOURCC('p', 'g', 'C', 'C') |
| #define | VIDEO_PIX_FMT_SRGGB12P VIDEO_FOURCC('p', 'R', 'C', 'C') |
| #define | VIDEO_PIX_FMT_SBGGR14P VIDEO_FOURCC('p', 'B', 'E', 'E') |
| #define | VIDEO_PIX_FMT_SGBRG14P VIDEO_FOURCC('p', 'G', 'E', 'E') |
| #define | VIDEO_PIX_FMT_SGRBG14P VIDEO_FOURCC('p', 'g', 'E', 'E') |
| #define | VIDEO_PIX_FMT_SRGGB14P VIDEO_FOURCC('p', 'R', 'E', 'E') |
| #define | VIDEO_FOREACH_BAYER_NON_PACKED(X, ...) |
| Repeat a macro for every Bayer non-packed format, passed as first parameter. | |
| #define | VIDEO_PIX_FMT_SBGGR8 VIDEO_FOURCC('B', 'A', '8', '1') |
| #define | VIDEO_PIX_FMT_SGBRG8 VIDEO_FOURCC('G', 'B', 'R', 'G') |
| #define | VIDEO_PIX_FMT_SGRBG8 VIDEO_FOURCC('G', 'R', 'B', 'G') |
| #define | VIDEO_PIX_FMT_SRGGB8 VIDEO_FOURCC('R', 'G', 'G', 'B') |
| #define | VIDEO_PIX_FMT_SBGGR10 VIDEO_FOURCC('B', 'G', '1', '0') |
| #define | VIDEO_PIX_FMT_SGBRG10 VIDEO_FOURCC('G', 'B', '1', '0') |
| #define | VIDEO_PIX_FMT_SGRBG10 VIDEO_FOURCC('B', 'A', '1', '0') |
| #define | VIDEO_PIX_FMT_SRGGB10 VIDEO_FOURCC('R', 'G', '1', '0') |
| #define | VIDEO_PIX_FMT_SBGGR12 VIDEO_FOURCC('B', 'G', '1', '2') |
| #define | VIDEO_PIX_FMT_SGBRG12 VIDEO_FOURCC('G', 'B', '1', '2') |
| #define | VIDEO_PIX_FMT_SGRBG12 VIDEO_FOURCC('B', 'A', '1', '2') |
| #define | VIDEO_PIX_FMT_SRGGB12 VIDEO_FOURCC('R', 'G', '1', '2') |
| #define | VIDEO_PIX_FMT_SBGGR14 VIDEO_FOURCC('B', 'G', '1', '4') |
| #define | VIDEO_PIX_FMT_SGBRG14 VIDEO_FOURCC('G', 'B', '1', '4') |
| #define | VIDEO_PIX_FMT_SGRBG14 VIDEO_FOURCC('G', 'R', '1', '4') |
| #define | VIDEO_PIX_FMT_SRGGB14 VIDEO_FOURCC('R', 'G', '1', '4') |
| #define | VIDEO_PIX_FMT_SBGGR16 VIDEO_FOURCC('B', 'Y', 'R', '2') |
| #define | VIDEO_PIX_FMT_SGBRG16 VIDEO_FOURCC('G', 'B', '1', '6') |
| #define | VIDEO_PIX_FMT_SGRBG16 VIDEO_FOURCC('G', 'R', '1', '6') |
| #define | VIDEO_PIX_FMT_SRGGB16 VIDEO_FOURCC('R', 'G', '1', '6') |
Grayscale formats | |
Luminance (Y) channel only, in various bit depth and packing. When the format includes more than 8-bit per pixel, a strategy becomes needed to pack the bits over multiple bytes, as illustrated for each format. The number above the 'Y', 'y' are hints about which pixel number the following bits belong to. | |
| #define | VIDEO_FOREACH_GRAYSCALE(X, ...) |
| Repeat a macro for every grayscale format, passed as first parameter. | |
| #define | VIDEO_FOREACH_GRAYSCALE_NON_PACKED(X, ...) |
| Repeat a macro for every grayscale non-packed format, passed as first parameter. | |
| #define | VIDEO_PIX_FMT_GREY VIDEO_FOURCC('G', 'R', 'E', 'Y') |
| Same as Y8 (8-bit luma-only) following the standard FOURCC naming, or L8 in some graphics libraries. | |
| #define | VIDEO_PIX_FMT_Y10 VIDEO_FOURCC('Y', '1', '0', ' ') |
| Little endian, with the 6 most significant bits set to Zero. | |
| #define | VIDEO_PIX_FMT_Y12 VIDEO_FOURCC('Y', '1', '2', ' ') |
| Little endian, with the 4 most significant bits set to Zero. | |
| #define | VIDEO_PIX_FMT_Y14 VIDEO_FOURCC('Y', '1', '4', ' ') |
| Little endian, with the 2 most significant bits set to Zero. | |
| #define | VIDEO_PIX_FMT_Y16 VIDEO_FOURCC('Y', '1', '6', ' ') |
| Little endian. | |
| #define | VIDEO_FOREACH_GRAYSCALE_PADDED(X, ...) |
| Repeat a macro for every grayscale padded format, passed as first parameter. | |
| #define | VIDEO_PIX_FMT_Y8P16 VIDEO_FOURCC('Y', '8', 'P', '2') |
| 8-bit luma-only split in two 4-bit blocks each zero-padded, little endian. | |
| #define | VIDEO_FOREACH_GRAYSCALE_MIPI_PACKED(X, ...) |
| Repeat a macro for every grayscale MIPI-packed format, passed as first parameter. | |
| #define | VIDEO_PIX_FMT_Y10P VIDEO_FOURCC('Y', '1', '0', 'P') |
| #define | VIDEO_PIX_FMT_Y12P VIDEO_FOURCC('Y', '1', '2', 'P') |
| #define | VIDEO_PIX_FMT_Y14P VIDEO_FOURCC('Y', '1', '4', 'P') |
RGB formats | |
Per-color (R, G, B) channels. | |
| #define | VIDEO_FOREACH_RGB(X, ...) |
| Repeat a macro for every RGB format, passed as first parameter. | |
| #define | VIDEO_FOREACH_RGB_PACKED(X, ...) |
| Repeat a macro for every RGB packed format, passed as first parameter. | |
| #define | VIDEO_PIX_FMT_RGB565X VIDEO_FOURCC('R', 'G', 'B', 'R') |
| 5 red bits [15:11], 6 green bits [10:5], 5 blue bits [4:0]. | |
| #define | VIDEO_PIX_FMT_RGB565 VIDEO_FOURCC('R', 'G', 'B', 'P') |
| 5 red bits [15:11], 6 green bits [10:5], 5 blue bits [4:0]. | |
| #define | VIDEO_FOREACH_RGB_NON_PACKED(X, ...) |
| Repeat a macro for every RGB non-packed format, passed as first parameter. | |
| #define | VIDEO_PIX_FMT_BGR24 VIDEO_FOURCC('B', 'G', 'R', '3') |
| 24 bit RGB format with 8 bit per component | |
| #define | VIDEO_PIX_FMT_RGB24 VIDEO_FOURCC('R', 'G', 'B', '3') |
| 24 bit RGB format with 8 bit per component | |
| #define | VIDEO_FOREACH_RGB_ALPHA(X, ...) |
| Repeat a macro for every RGB alpha format, passed as first parameter. | |
| #define | VIDEO_PIX_FMT_ARGB32 VIDEO_FOURCC('B', 'A', '2', '4') |
| The first byte is alpha (A) for each pixel. | |
| #define | VIDEO_PIX_FMT_BGRA32 VIDEO_FOURCC('A', 'R', '2', '4') |
| The last byte is alpha (A) for each pixel. | |
| #define | VIDEO_PIX_FMT_RGBA32 VIDEO_FOURCC('A', 'B', '2', '4') |
| The last byte is alpha (A) for each pixel. | |
| #define | VIDEO_PIX_FMT_ABGR32 VIDEO_FOURCC('R', 'A', '2', '4') |
| The first byte is alpha (A) for each pixel. | |
| #define | VIDEO_FOREACH_RGB_PADDED(X, ...) |
| Repeat a macro for every RGB padded format, passed as first parameter. | |
| #define | VIDEO_PIX_FMT_XRGB32 VIDEO_FOURCC('B', 'X', '2', '4') |
| The first byte is empty (X) for each pixel. | |
| #define | VIDEO_PIX_FMT_XBGR32 VIDEO_FOURCC('R', 'X', '2', '4') |
| The first byte is empty (X) for each pixel. | |
| #define | VIDEO_PIX_FMT_BGRX32 VIDEO_FOURCC('X', 'R', '2', '4') |
| The last byte is empty (X) for each pixel. | |
| #define | VIDEO_PIX_FMT_RGBX32 VIDEO_FOURCC('X', 'B', '2', '4') |
| The last byte is empty (X) for each pixel. | |
YUV formats | |
Luminance (Y) and chrominance (U, V) channels. | |
| #define | VIDEO_FOREACH_YUV(X, ...) |
| Repeat a macro for every YUV format, passed as first parameter. | |
| #define | VIDEO_FOREACH_YUV_NON_PLANAR(X, ...) |
| Repeat a macro for every YUV Non-Planar format, passed as first parameter. | |
| #define | VIDEO_PIX_FMT_YUYV VIDEO_FOURCC('Y', 'U', 'Y', 'V') |
| There is either a missing channel per pixel, U or V. | |
| #define | VIDEO_PIX_FMT_YVYU VIDEO_FOURCC('Y', 'V', 'Y', 'U') |
| #define | VIDEO_PIX_FMT_VYUY VIDEO_FOURCC('V', 'Y', 'U', 'Y') |
| #define | VIDEO_PIX_FMT_UYVY VIDEO_FOURCC('U', 'Y', 'V', 'Y') |
| #define | VIDEO_PIX_FMT_XYUV32 VIDEO_FOURCC('X', 'Y', 'U', 'V') |
| The first byte is empty (X) for each pixel. | |
| #define | VIDEO_PIX_FMT_YUV24 VIDEO_FOURCC('Y', 'U', 'V', '3') |
| 24 bit YUV format with 8 bit per component | |
| #define | VIDEO_FOREACH_YUV_SEMI_PLANAR(X, ...) |
| Repeat a macro for every YUV Semi-Planar format, passed as first parameter. | |
| #define | VIDEO_PIX_FMT_NV12 VIDEO_FOURCC('N', 'V', '1', '2') |
| Chroma (U/V) are subsampled horizontally and vertically. | |
| #define | VIDEO_PIX_FMT_NV21 VIDEO_FOURCC('N', 'V', '2', '1') |
| Chroma (U/V) are subsampled horizontally and vertically. | |
| #define | VIDEO_PIX_FMT_NV16 VIDEO_FOURCC('N', 'V', '1', '6') |
| Chroma (U/V) are subsampled horizontally. | |
| #define | VIDEO_PIX_FMT_NV61 VIDEO_FOURCC('N', 'V', '6', '1') |
| Chroma (U/V) are subsampled horizontally. | |
| #define | VIDEO_PIX_FMT_NV24 VIDEO_FOURCC('N', 'V', '2', '4') |
| Chroma (U/V) are not subsampled. | |
| #define | VIDEO_PIX_FMT_NV42 VIDEO_FOURCC('N', 'V', '4', '2') |
| Chroma (U/V) are not subsampled. | |
| #define | VIDEO_FOREACH_YUV_FULL_PLANAR(X, ...) |
| Repeat a macro for every YUV Full-Planar format, passed as first parameter. | |
| #define | VIDEO_PIX_FMT_YUV420 VIDEO_FOURCC('Y', 'U', '1', '2') |
| Chroma (U/V) are subsampled horizontally and vertically. | |
| #define | VIDEO_PIX_FMT_YVU420 VIDEO_FOURCC('Y', 'V', '1', '2') |
| Chroma (U/V) are subsampled horizontally and vertically. | |
Compressed formats | |
| #define | VIDEO_FOREACH_COMPRESSED(X, ...) |
| Repeat a macro for every compressed format, passed as first parameter. | |
| #define | VIDEO_PIX_FMT_JPEG VIDEO_FOURCC('J', 'P', 'E', 'G') |
| Both JPEG (single frame) and Motion-JPEG (MJPEG, multiple JPEG frames concatenated). | |
| #define | VIDEO_PIX_FMT_H264 VIDEO_FOURCC('H', '2', '6', '4') |
| H264 with start code. | |
| #define | VIDEO_PIX_FMT_H264_NO_SC VIDEO_FOURCC('A', 'V', 'C', '1') |
| H264 without start code. | |
| #define | VIDEO_PIX_FMT_PNG VIDEO_FOURCC('P', 'N', 'G', ' ') |
| PNG. | |
Functions | |
| static unsigned int | video_bits_per_pixel (uint32_t pixfmt) |
| Get number of bits per pixel of a pixel format. | |
Main header file for video format API.