Updated: October 28, 2024 |
Format for a region-of-interest (ROI) video data
#include <sensor/sensor_api.h>
typedef struct sensor_format_video_roi_t { uint32_t height; uint32_t width; uint32_t roi_height; uint32_t roi_width; uint32_t roi_x; uint32_t roi_y; sensor_format_t type; uint32_t stride[3]; int32_t offset[3]; } sensor_format_video_roi_t;
Stride is often called pitch.
This array of three values represents 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.
This array of three values represents 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.
Use this format when SENSOR_FORMAT_VIDEO_ROI is reported as the sensor_format_t.
The width and height fields describe the size of the buffer while roi_width and roi_height describe the size of the region of interest (ROI) inside this buffer. The roi_x and roi_y fields describe the offsets from the beginning of the buffer to the ROI, which we also call the image of interest. You should access only the image of interest within the buffer and ignore the rest of the buffer content.
The layout of the pixels within the buffer depends on the sensor_format_t reported in the type field, because this structure can accommodate multiple pixel layouts.