V4L2 rect helper functions
v4l2_rect_set_size_to() #
void copy the width/height values.
Parameters
struct v4l2_rect *r: rect whose width and height fields will be setconst struct v4l2_rect *size: rect containing the width and height fields you need.
v4l2_rect_set_min_size() #
void width and height of r should be >= min_size.
Parameters
struct v4l2_rect *r: rect whose width and height will be modifiedconst struct v4l2_rect *min_size: rect containing the minimal width and height
v4l2_rect_set_max_size() #
void width and height of r should be <= max_size
Parameters
struct v4l2_rect *r: rect whose width and height will be modifiedconst struct v4l2_rect *max_size: rect containing the maximum width and height
v4l2_rect_map_inside() #
void r should be inside boundary.
Parameters
struct v4l2_rect *r: rect that will be modifiedconst struct v4l2_rect *boundary: rect containing the boundary for r
v4l2_rect_same_size() #
bool return true if r1 has the same size as r2
Parameters
const struct v4l2_rect *r1: rectangle.const struct v4l2_rect *r2: rectangle.
Description
Return true if both rectangles have the same size.
v4l2_rect_same_position() #
bool return true if r1 has the same position as r2
Parameters
const struct v4l2_rect *r1: rectangle.const struct v4l2_rect *r2: rectangle.
Description
Return true if both rectangles have the same position
v4l2_rect_equal() #
bool return true if r1 equals r2
Parameters
const struct v4l2_rect *r1: rectangle.const struct v4l2_rect *r2: rectangle.
Description
Return true if both rectangles have the same size and position.
v4l2_rect_intersect() #
void calculate the intersection of two rects.
Parameters
struct v4l2_rect *r: intersection of r1 and r2.const struct v4l2_rect *r1: rectangle.const struct v4l2_rect *r2: rectangle.
v4l2_rect_scale() #
void scale rect r by to/from
Parameters
struct v4l2_rect *r: rect to be scaled.const struct v4l2_rect *from: from rectangle.const struct v4l2_rect *to: to rectangle.
Description
This scales rectangle r horizontally by to->width / from->width and vertically by to->height / from->height.
Typically r is a rectangle inside from and you want the rectangle as it would appear after scaling from to to. So the resulting r will be the scaled rectangle inside to.
v4l2_rect_overlap() #
bool do r1 and r2 overlap?
Parameters
const struct v4l2_rect *r1: rectangle.const struct v4l2_rect *r2: rectangle.
Description
Returns true if r1 and r2 overlap.
v4l2_rect_enclosed() #
bool is r1 enclosed in r2?
Parameters
struct v4l2_rect *r1: rectangle.struct v4l2_rect *r2: rectangle.
Description
Returns true if r1 is enclosed in r2.