Lines Matching full:r2

73  * v4l2_rect_same_size() - return true if r1 has the same size as r2
75 * @r2: rectangle.
80 const struct v4l2_rect *r2) in v4l2_rect_same_size() argument
82 return r1->width == r2->width && r1->height == r2->height; in v4l2_rect_same_size()
86 * v4l2_rect_same_position() - return true if r1 has the same position as r2
88 * @r2: rectangle.
93 const struct v4l2_rect *r2) in v4l2_rect_same_position() argument
95 return r1->top == r2->top && r1->left == r2->left; in v4l2_rect_same_position()
99 * v4l2_rect_equal() - return true if r1 equals r2
101 * @r2: rectangle.
106 const struct v4l2_rect *r2) in v4l2_rect_equal() argument
108 return v4l2_rect_same_size(r1, r2) && v4l2_rect_same_position(r1, r2); in v4l2_rect_equal()
113 * @r: intersection of @r1 and @r2.
115 * @r2: rectangle.
119 const struct v4l2_rect *r2) in v4l2_rect_intersect() argument
123 r->top = max(r1->top, r2->top); in v4l2_rect_intersect()
124 r->left = max(r1->left, r2->left); in v4l2_rect_intersect()
125 bottom = min(r1->top + r1->height, r2->top + r2->height); in v4l2_rect_intersect()
126 right = min(r1->left + r1->width, r2->left + r2->width); in v4l2_rect_intersect()
159 * v4l2_rect_overlap() - do r1 and r2 overlap?
161 * @r2: rectangle.
163 * Returns true if @r1 and @r2 overlap.
166 const struct v4l2_rect *r2) in v4l2_rect_overlap() argument
169 * IF the left side of r1 is to the right of the right side of r2 OR in v4l2_rect_overlap()
170 * the left side of r2 is to the right of the right side of r1 THEN in v4l2_rect_overlap()
173 if (r1->left >= r2->left + r2->width || in v4l2_rect_overlap()
174 r2->left >= r1->left + r1->width) in v4l2_rect_overlap()
177 * IF the top side of r1 is below the bottom of r2 OR in v4l2_rect_overlap()
178 * the top side of r2 is below the bottom of r1 THEN in v4l2_rect_overlap()
181 if (r1->top >= r2->top + r2->height || in v4l2_rect_overlap()
182 r2->top >= r1->top + r1->height) in v4l2_rect_overlap()
188 * v4l2_rect_enclosed() - is r1 enclosed in r2?
190 * @r2: rectangle.
192 * Returns true if @r1 is enclosed in @r2.
195 struct v4l2_rect *r2) in v4l2_rect_enclosed() argument
197 if (r1->left < r2->left || r1->top < r2->top) in v4l2_rect_enclosed()
199 if (r1->left + r1->width > r2->left + r2->width) in v4l2_rect_enclosed()
201 if (r1->top + r1->height > r2->top + r2->height) in v4l2_rect_enclosed()