Lines Matching refs: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)
82 return r1->width == r2->width && r1->height == r2->height;
86 * v4l2_rect_same_position() - return true if r1 has the same position as r2
88 * @r2: rectangle.
93 const struct v4l2_rect *r2)
95 return r1->top == r2->top && r1->left == r2->left;
99 * v4l2_rect_equal() - return true if r1 equals r2
101 * @r2: rectangle.
106 const struct v4l2_rect *r2)
108 return v4l2_rect_same_size(r1, r2) && v4l2_rect_same_position(r1, r2);
113 * @r: intersection of @r1 and @r2.
115 * @r2: rectangle.
119 const struct v4l2_rect *r2)
123 r->top = max(r1->top, r2->top);
124 r->left = max(r1->left, r2->left);
125 bottom = min(r1->top + r1->height, r2->top + r2->height);
126 right = min(r1->left + r1->width, r2->left + r2->width);
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)
169 * IF the left side of r1 is to the right of the right side of r2 OR
170 * the left side of r2 is to the right of the right side of r1 THEN
173 if (r1->left >= r2->left + r2->width ||
174 r2->left >= r1->left + r1->width)
177 * IF the top side of r1 is below the bottom of r2 OR
178 * the top side of r2 is below the bottom of r1 THEN
181 if (r1->top >= r2->top + r2->height ||
182 r2->top >= r1->top + r1->height)
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)
197 if (r1->left < r2->left || r1->top < r2->top)
199 if (r1->left + r1->width > r2->left + r2->width)
201 if (r1->top + r1->height > r2->top + r2->height)