Zephyr API Documentation 4.1.99
A Scalable Open Source RTOS
|
|
4.1.99 |
The '|' characters separate the pixels or logical blocks, and spaces separate the bytes. More...
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. | |
Functions | |
static unsigned int | video_bits_per_pixel (uint32_t pixfmt) |
Get number of bits per pixel of a pixel format. | |
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_PIX_FMT_BGGR8 VIDEO_FOURCC('B', 'A', '8', '1') |
#define | VIDEO_PIX_FMT_GBRG8 VIDEO_FOURCC('G', 'B', 'R', 'G') |
#define | VIDEO_PIX_FMT_GRBG8 VIDEO_FOURCC('G', 'R', 'B', 'G') |
#define | VIDEO_PIX_FMT_RGGB8 VIDEO_FOURCC('R', 'G', 'G', 'B') |
#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') |
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_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_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_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_PIX_FMT_XRGB32 VIDEO_FOURCC('B', 'X', '2', '4') |
The first byte is empty (X) for each pixel. | |
YUV formats | |
Luminance (Y) and chrominance (U, V) channels. | |
#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_XYUV32 VIDEO_FOURCC('X', 'Y', 'U', 'V') |
The first byte is empty (X) for each pixel. | |
Compressed formats | |
#define | VIDEO_PIX_FMT_JPEG VIDEO_FOURCC('J', 'P', 'E', 'G') |
Both JPEG (single frame) and Motion-JPEG (MJPEG, multiple JPEG frames concatenated) | |
The '|' characters separate the pixels or logical blocks, and spaces separate the bytes.
The uppercase letter represents the most significant bit. The lowercase letters represent the rest of the bits.
#define VIDEO_FOURCC | ( | a, | |
b, | |||
c, | |||
d ) |
#define VIDEO_FOURCC_FROM_STR | ( | str | ) |
#include <zephyr/drivers/video.h>
Convert a four-character-string to a four-character-code.
Convert a string literal or variable into a four-character-code as defined by VIDEO_FOURCC.
str | String to be converted |
#define VIDEO_FOURCC_TO_STR | ( | fourcc | ) |
#include <zephyr/drivers/video.h>
Convert a four-character-code to a four-character-string.
Convert a four-character code as defined by VIDEO_FOURCC into a string that can be used anywhere, such as in debug logs with the s print formatter.
fourcc | The 32-bit four-character-code integer to be converted, in CPU-native endinaness. |
#define VIDEO_PIX_FMT_BGGR8 VIDEO_FOURCC('B', 'A', '8', '1') |
#include <zephyr/drivers/video.h>
#define VIDEO_PIX_FMT_GBRG8 VIDEO_FOURCC('G', 'B', 'R', 'G') |
#include <zephyr/drivers/video.h>
#define VIDEO_PIX_FMT_GRBG8 VIDEO_FOURCC('G', 'R', 'B', 'G') |
#include <zephyr/drivers/video.h>
#define VIDEO_PIX_FMT_GREY VIDEO_FOURCC('G', 'R', 'E', 'Y') |
#include <zephyr/drivers/video.h>
Same as Y8 (8-bit luma-only) following the standard FOURCC naming, or L8 in some graphics libraries.
#define VIDEO_PIX_FMT_JPEG VIDEO_FOURCC('J', 'P', 'E', 'G') |
#include <zephyr/drivers/video.h>
Both JPEG (single frame) and Motion-JPEG (MJPEG, multiple JPEG frames concatenated)
#define VIDEO_PIX_FMT_RGB565 VIDEO_FOURCC('R', 'G', 'B', 'P') |
#include <zephyr/drivers/video.h>
5 red bits [15:11], 6 green bits [10:5], 5 blue bits [4:0].
This 16-bit integer is then packed in little endian format over two bytes:
#define VIDEO_PIX_FMT_RGB565X VIDEO_FOURCC('R', 'G', 'B', 'R') |
#include <zephyr/drivers/video.h>
5 red bits [15:11], 6 green bits [10:5], 5 blue bits [4:0].
This 16-bit integer is then packed in big endian format over two bytes:
#define VIDEO_PIX_FMT_RGGB8 VIDEO_FOURCC('R', 'G', 'G', 'B') |
#include <zephyr/drivers/video.h>
#define VIDEO_PIX_FMT_SBGGR10P VIDEO_FOURCC('p', 'B', 'A', 'A') |
#include <zephyr/drivers/video.h>
#define VIDEO_PIX_FMT_SBGGR12P VIDEO_FOURCC('p', 'B', 'C', 'C') |
#include <zephyr/drivers/video.h>
#define VIDEO_PIX_FMT_SBGGR14P VIDEO_FOURCC('p', 'B', 'E', 'E') |
#include <zephyr/drivers/video.h>
#define VIDEO_PIX_FMT_SGBRG10P VIDEO_FOURCC('p', 'G', 'A', 'A') |
#include <zephyr/drivers/video.h>
#define VIDEO_PIX_FMT_SGBRG12P VIDEO_FOURCC('p', 'G', 'C', 'C') |
#include <zephyr/drivers/video.h>
#define VIDEO_PIX_FMT_SGBRG14P VIDEO_FOURCC('p', 'G', 'E', 'E') |
#include <zephyr/drivers/video.h>
#define VIDEO_PIX_FMT_SGRBG10P VIDEO_FOURCC('p', 'g', 'A', 'A') |
#include <zephyr/drivers/video.h>
#define VIDEO_PIX_FMT_SGRBG12P VIDEO_FOURCC('p', 'g', 'C', 'C') |
#include <zephyr/drivers/video.h>
#define VIDEO_PIX_FMT_SGRBG14P VIDEO_FOURCC('p', 'g', 'E', 'E') |
#include <zephyr/drivers/video.h>
#define VIDEO_PIX_FMT_SRGGB10P VIDEO_FOURCC('p', 'R', 'A', 'A') |
#include <zephyr/drivers/video.h>
#define VIDEO_PIX_FMT_SRGGB12P VIDEO_FOURCC('p', 'R', 'C', 'C') |
#include <zephyr/drivers/video.h>
#define VIDEO_PIX_FMT_SRGGB14P VIDEO_FOURCC('p', 'R', 'E', 'E') |
#include <zephyr/drivers/video.h>
#define VIDEO_PIX_FMT_XRGB32 VIDEO_FOURCC('B', 'X', '2', '4') |
#include <zephyr/drivers/video.h>
The first byte is empty (X) for each pixel.
#define VIDEO_PIX_FMT_XYUV32 VIDEO_FOURCC('X', 'Y', 'U', 'V') |
#include <zephyr/drivers/video.h>
The first byte is empty (X) for each pixel.
#define VIDEO_PIX_FMT_Y10P VIDEO_FOURCC('Y', '1', '0', 'P') |
#include <zephyr/drivers/video.h>
#define VIDEO_PIX_FMT_Y12P VIDEO_FOURCC('Y', '1', '2', 'P') |
#include <zephyr/drivers/video.h>
#define VIDEO_PIX_FMT_Y14P VIDEO_FOURCC('Y', '1', '4', 'P') |
#include <zephyr/drivers/video.h>
#define VIDEO_PIX_FMT_YUYV VIDEO_FOURCC('Y', 'U', 'Y', 'V') |
#include <zephyr/drivers/video.h>
There is either a missing channel per pixel, U or V.
The value is to be averaged over 2 pixels to get the value of individual pixel.
#include <zephyr/drivers/video.h>
Get number of bits per pixel of a pixel format.
pixfmt | FourCC pixel format value (Video pixel formats). |
0 | if the format is unhandled or if it is variable number of bits |
bit | size of one pixel for this format |