Zephyr API Documentation 4.1.99
A Scalable Open Source RTOS
|
|
4.1.99 |
The | characters separate the pixels, 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. | |
#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') |
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, 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>
* | Bbbbbbbb | Gggggggg | Bbbbbbbb | Gggggggg | Bbbbbbbb | Gggggggg | ... * | Gggggggg | Rrrrrrrr | Gggggggg | Rrrrrrrr | Gggggggg | Rrrrrrrr | ... *
#define VIDEO_PIX_FMT_GBRG8 VIDEO_FOURCC('G', 'B', 'R', 'G') |
#include <zephyr/drivers/video.h>
* | Gggggggg | Bbbbbbbb | Gggggggg | Bbbbbbbb | Gggggggg | Bbbbbbbb | ... * | Rrrrrrrr | Gggggggg | Rrrrrrrr | Gggggggg | Rrrrrrrr | Gggggggg | ... *
#define VIDEO_PIX_FMT_GRBG8 VIDEO_FOURCC('G', 'R', 'B', 'G') |
#include <zephyr/drivers/video.h>
* | Gggggggg | Rrrrrrrr | Gggggggg | Rrrrrrrr | Gggggggg | Rrrrrrrr | ... * | Bbbbbbbb | Gggggggg | Bbbbbbbb | Gggggggg | Bbbbbbbb | Gggggggg | ... *
#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:
* 7......0 15.....8 * | gggBbbbb RrrrrGgg | ... *
#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:
* 15.....8 7......0 * | RrrrrGgg gggBbbbb | ... *
#define VIDEO_PIX_FMT_RGGB8 VIDEO_FOURCC('R', 'G', 'G', 'B') |
#include <zephyr/drivers/video.h>
* | Rrrrrrrr | Gggggggg | Rrrrrrrr | Gggggggg | Rrrrrrrr | Gggggggg | ... * | Gggggggg | Bbbbbbbb | Gggggggg | Bbbbbbbb | Gggggggg | Bbbbbbbb | ... *
#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.
* | Xxxxxxxx Rrrrrrrr Gggggggg Bbbbbbbb | ... *
#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.
* | Xxxxxxxx Yyyyyyyy Uuuuuuuu Vvvvvvvv | ... *
#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.
* | Yyyyyyyy Uuuuuuuu | Yyyyyyyy Vvvvvvvv | ... *
#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 |