struct <a href='SkIRect_Reference#SkIRect'>SkIRect</a> { int32_t <a href='#SkIRect_fLeft'>fLeft</a>; int32_t <a href='#SkIRect_fTop'>fTop</a>; int32_t <a href='#SkIRect_fRight'>fRight</a>; int32_t <a href='#SkIRect_fBottom'>fBottom</a>; static constexpr <a href='SkIRect_Reference#SkIRect'>SkIRect</a> <a href='#SkIRect_MakeEmpty'>MakeEmpty</a>(); static constexpr <a href='SkIRect_Reference#SkIRect'>SkIRect</a> <a href='#SkIRect_MakeWH'>MakeWH</a>(int32_t w, int32_t h); static constexpr <a href='SkIRect_Reference#SkIRect'>SkIRect</a> <a href='#SkIRect_MakeSize'>MakeSize</a>(const <a href='undocumented#SkISize'>SkISize</a>& <a href='undocumented#Size'>size</a>); static constexpr <a href='SkIRect_Reference#SkIRect'>SkIRect</a> <a href='#SkIRect_MakeLTRB'>MakeLTRB</a>(int32_t l, int32_t t, int32_t r, int32_t b); static constexpr <a href='SkIRect_Reference#SkIRect'>SkIRect</a> <a href='#SkIRect_MakeXYWH'>MakeXYWH</a>(int32_t x, int32_t y, int32_t w, int32_t h); int32_t <a href='#SkIRect_left'>left()</a> const; int32_t <a href='#SkIRect_top'>top()</a> const; int32_t <a href='#SkIRect_right'>right()</a> const; int32_t <a href='#SkIRect_bottom'>bottom()</a> const; int32_t <a href='#SkIRect_x'>x()</a> const; int32_t <a href='#SkIRect_y'>y()</a> const; int32_t <a href='#SkIRect_width'>width()</a> const; int32_t <a href='#SkIRect_height'>height()</a> const; <a href='undocumented#SkISize'>SkISize</a> <a href='#SkIRect_size'>size()</a> const; int64_t <a href='#SkIRect_width64'>width64</a>() const; int64_t <a href='#SkIRect_height64'>height64</a>() const; bool <a href='#SkIRect_isEmpty64'>isEmpty64</a>() const; bool <a href='#SkIRect_isEmpty'>isEmpty</a>() const; friend bool <a href='#SkIRect_equal_operator'>operator==</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& a, const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& b); friend bool <a href='#SkIRect_notequal_operator'>operator!=</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& a, const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& b); void <a href='#SkIRect_setEmpty'>setEmpty</a>(); void <a href='#SkIRect_set'>set</a>(int32_t left, int32_t top, int32_t right, int32_t bottom); void <a href='#SkIRect_setLTRB'>setLTRB</a>(int32_t left, int32_t top, int32_t right, int32_t bottom); void <a href='#SkIRect_setXYWH'>setXYWH</a>(int32_t x, int32_t y, int32_t width, int32_t height); <a href='SkIRect_Reference#SkIRect'>SkIRect</a> <a href='#SkIRect_makeOffset'>makeOffset</a>(int32_t dx, int32_t dy) const; <a href='SkIRect_Reference#SkIRect'>SkIRect</a> <a href='#SkIRect_makeInset'>makeInset</a>(int32_t dx, int32_t dy) const; <a href='SkIRect_Reference#SkIRect'>SkIRect</a> <a href='#SkIRect_makeOutset'>makeOutset</a>(int32_t dx, int32_t dy) const; void <a href='#SkIRect_offset'>offset</a>(int32_t dx, int32_t dy); void <a href='#SkIRect_offset'>offset</a>(const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& delta); void <a href='#SkIRect_offsetTo'>offsetTo</a>(int32_t newX, int32_t newY); void <a href='#SkIRect_inset'>inset</a>(int32_t dx, int32_t dy); void <a href='#SkIRect_outset'>outset</a>(int32_t dx, int32_t dy); void <a href='#SkIRect_adjust'>adjust</a>(int32_t dL, int32_t dT, int32_t dR, int32_t dB); bool <a href='#SkIRect_contains'>contains</a>(int32_t x, int32_t y) const; bool <a href='#SkIRect_contains'>contains</a>(int32_t left, int32_t top, int32_t right, int32_t bottom) const; bool <a href='#SkIRect_contains'>contains</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& r) const; bool <a href='#SkIRect_contains'>contains</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& r) const; bool <a href='#SkIRect_containsNoEmptyCheck'>containsNoEmptyCheck</a>(int32_t left, int32_t top, int32_t right, int32_t bottom) const; bool <a href='#SkIRect_containsNoEmptyCheck'>containsNoEmptyCheck</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& r) const; bool <a href='#SkIRect_intersect'>intersect</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& r); bool <a href='#SkIRect_intersectNoEmptyCheck'>intersectNoEmptyCheck</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& a, const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& b); bool <a href='#SkIRect_intersect'>intersect</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& a, const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& b); bool <a href='#SkIRect_intersect'>intersect</a>(int32_t left, int32_t top, int32_t right, int32_t bottom); static bool <a href='#SkIRect_Intersects'>Intersects</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& a, const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& b); static bool <a href='#SkIRect_IntersectsNoEmptyCheck'>IntersectsNoEmptyCheck</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& a, const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& b); void <a href='#SkIRect_join'>join</a>(int32_t left, int32_t top, int32_t right, int32_t bottom); void <a href='#SkIRect_join'>join</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& r); void <a href='#SkIRect_sort'>sort()</a>; <a href='SkIRect_Reference#SkIRect'>SkIRect</a> <a href='#SkIRect_makeSorted'>makeSorted</a>() const; static const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& <a href='#SkIRect_EmptyIRect'>EmptyIRect</a>(); };
SkIRect holds four 32-bit integer coordinates describing the upper and lower bounds of a rectangle. SkIRect may be created from outer bounds or from position, width, and height. SkIRect describes an area; if its right is less than or equal to its left, or if its bottom is less than or equal to its top, it is considered empty.
static constexpr <a href='SkIRect_Reference#SkIRect'>SkIRect</a> <a href='#SkIRect_MakeEmpty'>MakeEmpty</a>()
Returns constructed SkIRect set to (0, 0, 0, 0). Many other rectangles are empty; if left is equal to or greater than right, or if top is equal to or greater than bottom. Setting all members to zero is a convenience, but does not designate a special empty rectangle.
bounds (0, 0, 0, 0)
MakeEmpty isEmpty: true offset rect isEmpty: true inset rect isEmpty: true outset rect isEmpty: false
EmptyIRect isEmpty setEmpty SkRect::MakeEmpty
static constexpr <a href='SkIRect_Reference#SkIRect'>SkIRect</a> <a href='#SkIRect_MakeWH'>MakeWH</a>(int32_t w, int32_t h)
Returns constructed SkIRect set to (0, 0, w, h). Does not validate input; w or h may be negative.
bounds (0, 0, w, h)
all equal
MakeSize MakeXYWH SkRect::MakeWH SkRect::MakeIWH
static constexpr <a href='SkIRect_Reference#SkIRect'>SkIRect</a> <a href='#SkIRect_MakeSize'>MakeSize</a>(const <a href='undocumented#SkISize'>SkISize</a>& <a href='undocumented#Size'>size</a>)
Returns constructed SkIRect set to (0, 0, size.width(), size.height()). Does not validate input; size.width() or size.height() may be negative.
bounds (0, 0, size.width(), size.height())
round width: 26 height: 36 floor width: 25 height: 35
MakeWH MakeXYWH SkRect::Make SkRect::MakeIWH
static constexpr <a href='SkIRect_Reference#SkIRect'>SkIRect</a> <a href='#SkIRect_MakeLTRB'>MakeLTRB</a>(int32_t l, int32_t t, int32_t r, int32_t b)
Returns constructed SkIRect set to (l, t, r, b). Does not sort input; SkIRect may result in fLeft greater than fRight, or fTop greater than fBottom.
bounds (l, t, r, b)
rect: 5, 35, 15, 25 isEmpty: true rect: 5, 25, 15, 35 isEmpty: false
MakeXYWH SkRect::MakeLTRB
static constexpr <a href='SkIRect_Reference#SkIRect'>SkIRect</a> <a href='#SkIRect_MakeXYWH'>MakeXYWH</a>(int32_t x, int32_t y, int32_t w, int32_t h)
Returns constructed SkIRect set to: (x, y, x + w, y + h). Does not validate input; w or h may be negative.
bounds at (x, y) with width w and height h
rect: 5, 35, -10, 60 isEmpty: true rect: -10, 35, 5, 60 isEmpty: false
MakeLTRB SkRect::MakeXYWH
int32_t <a href='#SkIRect_left'>left()</a>const
Returns left edge of SkIRect, if sorted. Call sort() to reverse fLeft and fRight if needed.
fLeft
unsorted.fLeft: 15 unsorted.left(): 15 sorted.fLeft: 10 sorted.left(): 10
fLeft x() SkRect::left()
int32_t <a href='#SkIRect_top'>top()</a>const
Returns top edge of SkIRect, if sorted. Call isEmpty() to see if SkIRect may be invalid, and sort() to reverse fTop and fBottom if needed.
fTop
unsorted.fTop: 25 unsorted.top(): 25 sorted.fTop: 5 sorted.top(): 5
fTop y() SkRect::top()
int32_t <a href='#SkIRect_right'>right()</a>const
Returns right edge of SkIRect, if sorted. Call sort() to reverse fLeft and fRight if needed.
fRight
unsorted.fRight: 10 unsorted.right(): 10 sorted.fRight: 15 sorted.right(): 15
fRight SkRect::right()
int32_t <a href='#SkIRect_bottom'>bottom()</a>const
Returns bottom edge of SkIRect, if sorted. Call isEmpty() to see if SkIRect may be invalid, and sort() to reverse fTop and fBottom if needed.
fBottom
unsorted.fBottom: 5 unsorted.bottom(): 5 sorted.fBottom: 25 sorted.bottom(): 25
fBottom SkRect::bottom()
int32_t <a href='#SkIRect_x'>x()</a>const
Returns left edge of SkIRect, if sorted. Call isEmpty() to see if SkIRect may be invalid, and sort() to reverse fLeft and fRight if needed.
fLeft
unsorted.fLeft: 15 unsorted.x(): 15 sorted.fLeft: 10 sorted.x(): 10
fLeft left() y() SkRect::x()
int32_t <a href='#SkIRect_y'>y()</a>const
Returns top edge of SkIRect, if sorted. Call isEmpty() to see if SkIRect may be invalid, and sort() to reverse fTop and fBottom if needed.
fTop
unsorted.fTop: 25 unsorted.y(): 25 sorted.fTop: 5 sorted.y(): 5
fTop top() x() SkRect::y()
int32_t <a href='#SkIRect_width'>width()</a>const
Returns span on the x-axis. This does not check if SkIRect is sorted, or if result fits in 32-bit signed integer; result may be negative.
fRight minus fLeft
unsorted width: -5 large width: -5
height() width64() height64() SkRect::width()
int64_t <a href='#SkIRect_width64'>width64</a>()const
Returns span on the x-axis. This does not check if SkIRect is sorted, so the result may be negative. This is safer than calling width() since width() might overflow in its calculation.
fRight minus fLeft cast to int64_t
width: -5 width64: 4294967291
width() height() height64() SkRect::width()
int32_t <a href='#SkIRect_height'>height()</a>const
Returns span on the y-axis. This does not check if SkIRect is sorted, or if result fits in 32-bit signed integer; result may be negative.
fBottom minus fTop
unsorted height: -5 large height: -5
width() SkRect::height()
int64_t <a href='#SkIRect_height64'>height64</a>()const
Returns span on the y-axis. This does not check if SkIRect is sorted, so the result may be negative. This is safer than calling height() since height() might overflow in its calculation.
fBottom minus fTop cast to int64_t
height: -5 height64: 4294967291
width() height() width64() SkRect::height()
<a href='undocumented#SkISize'>SkISize</a> <a href='#SkIRect_size'>size()</a>const
Returns spans on the x-axis and y-axis. This does not check if SkIRect is sorted, or if result fits in 32-bit signed integer; result may be negative.
SkISize (width, height)
original rect: 20, 30, 40, 50 size: 20, 20 offset rect: 40, 50, 60, 70 size: 20, 20 outset rect: 20, 30, 80, 90 size: 60, 60
height() width() MakeSize
bool <a href='#SkIRect_isEmpty'>isEmpty</a>()const
Returns true if width() or height() are zero or negative.
true if width() or height() are zero or negative
rect: {20, 40, 10, 50} is empty
sorted: {10, 40, 20, 50} is not empty
rect: {20, 40, 20, 50} is empty
sorted: {20, 40, 20, 50} is empty
EmptyIRect MakeEmpty sort SkRect::isEmpty
bool <a href='#SkIRect_isEmpty64'>isEmpty64</a>()const
Returns true if fLeft is equal to or greater than fRight, or if fTop is equal to or greater than fBottom. Call sort() to reverse rectangles with negative width64() or height64().
true if width64() or height64() are zero or negative
rect: {20, 40, 10, 50} is empty
sorted: {10, 40, 20, 50} is not empty
rect: {20, 40, 20, 50} is empty
sorted: {20, 40, 20, 50} is empty
EmptyIRect MakeEmpty sort SkRect::isEmpty
bool <a href='#SkIRect_equal_operator'>operator==</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& a, const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& b)
Returns true if all members in a: fLeft, fTop, fRight, and fBottom; are identical to corresponding members in b.
true if members are equal
test == sorted
operator!=(const SkIRect& a, const SkIRect& b)
bool <a href='#SkIRect_notequal_operator'>operator!=</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& a, const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& b)
Returns true if any member in a: fLeft, fTop, fRight, and fBottom; is not identical to the corresponding member in b.
true if members are not equal
test != sorted
operator==(const SkIRect& a, const SkIRect& b)
void <a href='#SkIRect_setEmpty'>setEmpty</a>()
Sets SkIRect to (0, 0, 0, 0).
Many other rectangles are empty; if left is equal to or greater than right, or if top is equal to or greater than bottom. Setting all members to zero is a convenience, but does not designate a special empty rectangle.
rect: {3, 4, 1, 2} is empty
rect: {0, 0, 0, 0} is empty
MakeEmpty SkRect::setEmpty
void set(int32_t left, int32_t top, int32_t right, int32_t bottom)
Sets SkIRect to (left, top, right, bottom). left and right are not sorted; left is not necessarily less than right. top and bottom are not sorted; top is not necessarily less than bottom.
rect1: {3, 4, 1, 2}
rect2: {3, 4, 1, 2}
setLTRB setXYWH SkRect::set
void <a href='#SkIRect_setLTRB'>setLTRB</a>(int32_t left, int32_t top, int32_t right, int32_t bottom)
Sets SkIRect to (left, top, right, bottom). left and right are not sorted; left is not necessarily less than right. top and bottom are not sorted; top is not necessarily less than bottom.
rect1: {3, 4, 1, 2}
rect2: {3, 4, 1, 2}
set setXYWH SkRect::setLTRB
void <a href='#SkIRect_setXYWH'>setXYWH</a>(int32_t x, int32_t y, int32_t width, int32_t height)
Sets IRect to: (x, y, x + width, y + height). Does not validate input; width or height may be negative.
rect: 5, 35, -10, 60 isEmpty: true rect: -10, 35, 5, 60 isEmpty: false
MakeXYWH setLTRB set SkRect::setXYWH
<a href='SkIRect_Reference#SkIRect'>SkIRect</a> <a href='#SkIRect_makeOffset'>makeOffset</a>(int32_t dx, int32_t dy)const
Returns SkIRect offset by (dx, dy).
If dx is negative, SkIRect returned is moved to the left. If dx is positive, SkIRect returned is moved to the right. If dy is negative, SkIRect returned is moved upward. If dy is positive, SkIRect returned is moved downward.
SkIRect offset by dx and dy, with original width and height
rect: 10, 50, 20, 60 isEmpty: false rect: 25, 82, 35, 92 isEmpty: false
offset() makeInset makeOutset SkRect::makeOffset
<a href='SkIRect_Reference#SkIRect'>SkIRect</a> <a href='#SkIRect_makeInset'>makeInset</a>(int32_t dx, int32_t dy)const
Returns SkIRect, inset by (dx, dy).
If dx is negative, SkIRect returned is wider. If dx is positive, SkIRect returned is narrower. If dy is negative, SkIRect returned is taller. If dy is positive, SkIRect returned is shorter.
SkIRect inset symmetrically left and right, top and bottom
rect: 10, 50, 20, 60 isEmpty: false rect: 25, 82, 5, 28 isEmpty: true
inset() makeOffset makeOutset SkRect::makeInset
<a href='SkIRect_Reference#SkIRect'>SkIRect</a> <a href='#SkIRect_makeOutset'>makeOutset</a>(int32_t dx, int32_t dy)const
Returns SkIRect, outset by (dx, dy).
If dx is negative, SkIRect returned is narrower. If dx is positive, SkIRect returned is wider. If dy is negative, SkIRect returned is shorter. If dy is positive, SkIRect returned is taller.
SkIRect outset symmetrically left and right, top and bottom
rect: 10, 50, 20, 60 isEmpty: false rect: -5, 18, 35, 92 isEmpty: false
outset() makeOffset makeInset SkRect::makeOutset
void offset(int32_t dx, int32_t dy)
Offsets SkIRect by adding dx to fLeft, fRight; and by adding dy to fTop, fBottom.
If dx is negative, moves SkIRect returned to the left. If dx is positive, moves SkIRect returned to the right. If dy is negative, moves SkIRect returned upward. If dy is positive, moves SkIRect returned downward.
rect: 15, 27, 55, 86
offsetTo makeOffset SkRect::offset
void offset(const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& delta)
Offsets SkIRect by adding delta.fX to fLeft, fRight; and by adding delta.fY to fTop, fBottom.
If delta.fX is negative, moves SkIRect returned to the left. If delta.fX is positive, moves SkIRect returned to the right. If delta.fY is negative, moves SkIRect returned upward. If delta.fY is positive, moves SkIRect returned downward.
rect: 15, 27, 55, 86
offsetTo makeOffset SkRect::offset
void <a href='#SkIRect_offsetTo'>offsetTo</a>(int32_t newX, int32_t newY)
Offsets SkIRect so that fLeft equals newX, and fTop equals newY. width and height are unchanged.
rect: 15, 27, 55, 86
offset makeOffset setXYWH SkRect::offsetTo
void inset(int32_t dx, int32_t dy)
Insets SkIRect by (dx,dy).
If dx is positive, makes SkIRect narrower. If dx is negative, makes SkIRect wider. If dy is positive, makes SkIRect shorter. If dy is negative, makes SkIRect taller.
rect: 15, 27, 45, 60
outset makeInset SkRect::inset
void outset(int32_t dx, int32_t dy)
Outsets SkIRect by (dx, dy).
If dx is positive, makes SkIRect wider. If dx is negative, makes SkIRect narrower. If dy is positive, makes SkIRect taller. If dy is negative, makes SkIRect shorter.
rect: 5, 1, 55, 86
inset makeOutset SkRect::outset
IRects intersect when they enclose a common area. To intersect, each of the pair must describe area; fLeft is less than fRight, and fTop is less than fBottom; SkIRect::isEmpty() returns false. The intersection of IRect pair can be described by: (max(a.fLeft, b.fLeft), max(a.fTop, b.fTop), min(a.fRight, b.fRight), min(a.fBottom, b.fBottom)).
The intersection is only meaningful if the resulting IRect is not empty and describes an area: fLeft is less than fRight, and fTop is less than fBottom.
void <a href='#SkIRect_adjust'>adjust</a>(int32_t dL, int32_t dT, int32_t dR, int32_t dB)
Adjusts SkIRect by adding dL to fLeft, dT to fTop, dR to fRight, and dB to fBottom.
If dL is positive, narrows SkIRect on the left. If negative, widens it on the left. If dT is positive, shrinks SkIRect on the top. If negative, lengthens it on the top. If dR is positive, narrows SkIRect on the right. If negative, widens it on the right. If dB is positive, shrinks SkIRect on the bottom. If negative, lengthens it on the bottom.
The resulting SkIRect is not checked for validity. Thus, if the resulting SkIRect left is greater than right, the SkIRect will be considered empty. Call sort() after this call if that is not the desired behavior.
rect: 10, 10, 20, 20
inset outset
bool contains(int32_t x, int32_t y)const
Returns true if: fLeft <= x < fRight && fTop <= y < fBottom. Returns false if IRect is empty.
Considers input to describe constructed IRect: (x, y, x + 1, y + 1) and returns true if constructed area is completely enclosed by IRect area.
true if (x, y) is inside IRect
rect: (30, 50, 40, 60) contains (30, 50) rect: (30, 50, 40, 60) does not contain (40, 50) rect: (30, 50, 40, 60) does not contain (30, 60)
containsNoEmptyCheck SkRect::contains
bool contains(int32_t left, int32_t top, int32_t right, int32_t bottom)const
Constructs SkIRect to intersect from (left, top, right, bottom). Does not sort construction.
Returns true if SkIRect contains construction. Returns false if SkIRect is empty or construction is empty.
true if all sides of SkIRect are outside construction
rect: (30, 50, 40, 60) contains (30, 50, 31, 51) rect: (30, 50, 40, 60) does not contain (39, 49, 40, 50) rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
containsNoEmptyCheck SkRect::contains
bool contains(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& r)const
Returns true if SkIRect contains r. Returns false if SkIRect is empty or r is empty.
SkIRect contains r when SkIRect area completely includes r area.
true if all sides of SkIRect are outside r
rect: (30, 50, 40, 60) contains (30, 50, 31, 51) rect: (30, 50, 40, 60) does not contain (39, 49, 40, 50) rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
containsNoEmptyCheck SkRect::contains
bool contains(const <a href='SkRect_Reference#SkRect'>SkRect</a>& r)const
Returns true if SkIRect contains r. Returns false if SkIRect is empty or r is empty.
SkIRect contains r when SkIRect area completely includes r area.
true if all sides of SkIRect are outside r
rect: (30, 50, 40, 60) contains (30, 50, 31, 51) rect: (30, 50, 40, 60) does not contain (39, 49, 40, 50) rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
containsNoEmptyCheck SkRect::contains
bool <a href='#SkIRect_containsNoEmptyCheck'>containsNoEmptyCheck</a>(int32_t left, int32_t top, int32_t right, int32_t bottom)const
Constructs SkIRect from (left, top, right, bottom). Does not sort construction.
Returns true if SkIRect contains construction. Asserts if SkIRect is empty or construction is empty, and if SK_DEBUG is defined.
Return is undefined if SkIRect is empty or construction is empty.
true if all sides of SkIRect are outside construction
rect: (30, 50, 40, 60) contains (30, 50, 31, 51) rect: (30, 50, 40, 60) does not contain (39, 49, 40, 50) rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
contains SkRect::contains
bool <a href='#SkIRect_containsNoEmptyCheck'>containsNoEmptyCheck</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& r)const
Returns true if SkIRect contains construction. Asserts if SkIRect is empty or construction is empty, and if SK_DEBUG is defined.
Return is undefined if SkIRect is empty or construction is empty.
true if all sides of SkIRect are outside r
rect: (30, 50, 40, 60) contains (30, 50, 31, 51) rect: (30, 50, 40, 60) does not contain (39, 49, 40, 50) rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
contains SkRect::contains
bool intersect(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& r)
Returns true if SkIRect intersects r, and sets SkIRect to intersection. Returns false if SkIRect does not intersect r, and leaves SkIRect unchanged.
Returns false if either r or SkIRect is empty, leaving SkIRect unchanged.
true if r and SkIRect have area in common
intersection: 30, 60, 50, 80
Intersects intersectNoEmptyCheck join SkRect::intersect
bool intersect(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& a, const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& b)
Returns true if a intersects b, and sets SkIRect to intersection. Returns false if a does not intersect b, and leaves SkIRect unchanged.
Returns false if either a or b is empty, leaving SkIRect unchanged.
true if a and b have area in common
intersection: 30, 60, 50, 80
Intersects intersectNoEmptyCheck join SkRect::intersect
bool <a href='#SkIRect_intersectNoEmptyCheck'>intersectNoEmptyCheck</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& a, const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& b)
Returns true if a intersects b, and sets SkIRect to intersection. Returns false if a does not intersect b, and leaves SkIRect unchanged.
Asserts if either a or b is empty, and if SK_DEBUG is defined.
true if a and b have area in common
intersection: 30, 60, 50, 80
Intersects intersect join SkRect::intersect
bool intersect(int32_t left, int32_t top, int32_t right, int32_t bottom)
Constructs SkIRect to intersect from (left, top, right, bottom). Does not sort construction.
Returns true if SkIRect intersects construction, and sets SkIRect to intersection. Returns false if SkIRect does not intersect construction, and leaves SkIRect unchanged.
Returns false if either construction or SkIRect is empty, leaving SkIRect unchanged.
true if construction and SkIRect have area in common
intersection: 30, 60, 50, 80
intersectNoEmptyCheck Intersects join SkRect::intersect
static bool <a href='#SkIRect_Intersects'>Intersects</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& a, const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& b)
Returns true if a intersects b. Returns false if either a or b is empty, or do not intersect.
true if a and b have area in common
intersection
IntersectsNoEmptyCheck intersect SkRect::intersect
static bool <a href='#SkIRect_IntersectsNoEmptyCheck'>IntersectsNoEmptyCheck</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& a, const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& b)
Returns true if a intersects b. Asserts if either a or b is empty, and if SK_DEBUG is defined.
true if a and b have area in common
intersection
Intersects intersect SkRect::intersect
void join(int32_t left, int32_t top, int32_t right, int32_t bottom)
Constructs SkIRect to intersect from (left, top, right, bottom). Does not sort construction.
Sets SkIRect to the union of itself and the construction.
Has no effect if construction is empty. Otherwise, if SkIRect is empty, sets SkIRect to construction.
join: 10, 20, 55, 65
set SkRect::join
void join(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& r)
Sets SkIRect to the union of itself and r.
Has no effect if r is empty. Otherwise, if SkIRect is empty, sets SkIRect to r.
join: 10, 20, 55, 65
set SkRect::join
void <a href='#SkIRect_sort'>sort()</a>
Swaps fLeft and fRight if fLeft is greater than fRight; and swaps fTop and fBottom if fTop is greater than fBottom. Result may be empty, and width() and height() will be zero or positive.
rect: 30, 50, 20, 10 sorted: 20, 10, 30, 50
makeSorted SkRect::sort
<a href='SkIRect_Reference#SkIRect'>SkIRect</a> <a href='#SkIRect_makeSorted'>makeSorted</a>()const
Returns SkIRect with fLeft and fRight swapped if fLeft is greater than fRight; and with fTop and fBottom swapped if fTop is greater than fBottom. Result may be empty; and width() and height() will be zero or positive.
sorted SkIRect
rect: 30, 50, 20, 10 sorted: 20, 10, 30, 50
sort SkRect::makeSorted
static const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& <a href='#SkIRect_EmptyIRect'>EmptyIRect</a>()
Returns a reference to immutable empty SkIRect, set to (0, 0, 0, 0).
global SkIRect set to all zeroes
rect: 0, 0, 0, 0
MakeEmpty