A frame descriptor for a Bayer frame type.


#include <camera/camera_api.h>
typedef struct  {
    uint64_t bufsize ;
    uint32_t height ;
    uint32_t width ;
    uint32_t stride ;
    camera_bayerformat_t format ;
    uint32_t packing ;
    uint32_t bpp ;
    bool le ;


uint64_t bufsize
The size of the frame in bytes.
uint32_t height
The height of the frame in pixels.
uint32_t width
The width of the frame in pixels.
uint32_t stride
The number of bytes from one row of pixels in memory to the next row of pixels in memory. Stride is often called pitch.
camera_bayerformat_t format
The format of the Bayer macro-pixel.
uint32_t packing
The inter-pixel distance, in bytes.
uint32_t bpp
The bits per pixel component inside the packing size.
bool le
The endianness of the packing. If le is true, bytes are packed little-endian, if le is false, bytes are packed big-endian.




Use this frame descriptor when CAMERA_FRAMETYPE_BAYER is used for the camera_frametype_t.

Each pixel in the Bayer frame is part of a Bayer macro-pixel. Each Bayer macro-pixel is made up of four colour components: one red, one blue, and two green. We refer to the colour components as pixels, and the group of four as a macro-pixel.

Each macro-pixel is stored across two lines in the frame. The first two pixels are stored contiguously on the first line. The stride separates the first pixel from the third, and the second pixel from the fourth.

Each pixel of the Bayer macro-pixel is stored in packing bits. If le is true, the lower bpp bits of packing contain colour information, if le is false, the higher bpp bits of packing contain colour information.

For example, le = true, bpp = 10, and packing = 16 describes a 10-bit Bayer frame such that each colour component is stored in the lower 10 bits of a 16-bit pixel. If format were CAMERA_BAYERFORMAT_RGGB, the Bayer macro-pixel would be stored like so:

Bit: 0123456789ABCDEF 0123456789ABCDEF Scanline n: RRRRRRRRRR000000 GGGGGGGGGG000000 = 32 bits Scanline n+1: GGGGGGGGGG000000 BBBBBBBBBB000000 = 32 bits