camera_frame_roi_t

Updated: April 19, 2023

A frame descriptor for a region-of-interest (ROI) image frame type

Synopsis:

#include <camera/camera_api.h>
typedef struct {
    uint32_t height;
    uint32_t width;
    uint32_t roi_height;
    uint32_t roi_width;
    uint32_t roi_x;
    uint32_t roi_y;
    camera_frametype_t type;
    uint32_t stride[3];
    int32_t offset[3];
} camera_frame_roi_t;

Data:

uint32_t height
The height of the buffer, in pixels.
uint32_t width
The width of the buffer, in pixels.
uint32_t roi_height
The height of the image of interest, in pixels.
uint32_t roi_width
The width of the image of interest, in pixels.
uint32_t roi_x
The X offset inside of the buffer to the image of interest, in pixels.
uint32_t roi_y
The Y offset inside of the buffer to the image of interest, in pixels.
camera_frametype_t type
The type describing the layout of pixels within this buffer (see camera_frametype_t).
uint32_t stride[3]
The number of bytes, in memory, between the first pixel of a given row and the first pixel of the next row of a given plane.

Stride is often called pitch. This array has three stride values to represent the stride to use for each plane of the image. For images with pixel layout of less than three planes, the additional stride values can be ignored.

int32_t offset[3]
The number of bytes, in memory, between the first pixel of the buffer and the first pixel of a given plane.

This array has three offset values to represent the offset to use for each plane of the image. For images with pixel layout of less than three planes, the additional offset values can be ignored.

Library:

libcamapi

Description:

Use this frame descriptor when CAMERA_FRAMETYPE_ROI is reported as the camera_frametype_t in camera_buffer_t.

The width and height values in this structure describe the size of the buffer while the ROI width and ROI height values describe the size of the region (or image) of interest (ROI) inside this buffer. The roi_x and roi_y fields indicate the offset from the beginning of the buffer to find the ROI. The user should access only this region within the buffer and ignore the rest of its content.

The layout of the pixels within this buffer depends on the frame type reported in the type field, as this structure can accommodate multiple pixel layouts. See the description for the specified camera_frametype_t value to understand the pixel layout.