| #Topic IRect |
| #Alias IRect_Reference |
| |
| #Struct SkIRect |
| |
| SkIRect holds four 32 bit integer coordinates for a rectangle |
| |
| #Topic Overview |
| |
| #Subtopic Subtopics |
| #ToDo manually add subtopics ## |
| #Table |
| #Legend |
| # topics # description ## |
| #Legend ## |
| #Table ## |
| ## |
| |
| #Subtopic Operators |
| #Table |
| #Legend |
| # description # function ## |
| #Legend ## |
| # friend bool operator!=(const SkIRect& a, const SkIRect& b) # ## |
| # friend bool operator==(const SkIRect& a, const SkIRect& b) # ## |
| #Table ## |
| #Subtopic ## |
| |
| #Subtopic Member_Functions |
| #Table |
| #Legend |
| # description # function ## |
| #Legend ## |
| # EmptyIRect # ## |
| # Intersects # ## |
| # IntersectsNoEmptyCheck # ## |
| # MakeEmpty # ## |
| # MakeLTRB # ## |
| # MakeLargest # ## |
| # MakeSize # ## |
| # MakeWH # ## |
| # MakeXYWH # ## |
| # bottom # ## |
| # centerX # ## |
| # centerY # ## |
| # contains # ## |
| # containsNoEmptyCheck # ## |
| # height # ## |
| # inset # ## |
| # intersect # ## |
| # intersectNoEmptyCheck # ## |
| # is16Bit # ## |
| # isEmpty # ## |
| # isLargest # ## |
| # join # ## |
| # left # ## |
| # makeInset # ## |
| # makeOffset # ## |
| # makeOutset # ## |
| # makeSorted # ## |
| # offset # ## |
| # offsetTo # ## |
| # outset # ## |
| # quickReject # ## |
| # right # ## |
| # set # ## |
| # setEmpty # ## |
| # setLTRB # ## |
| # setLargest # ## |
| # setLargestInverted # ## |
| # setXYWH # ## |
| # size # ## |
| # sort # ## |
| # top # ## |
| # width # ## |
| # x # ## |
| # y # ## |
| #Table ## |
| #Subtopic ## |
| |
| #Topic ## |
| |
| #Member int32_t fLeft |
| ## |
| |
| #Member int32_t fTop |
| ## |
| |
| #Member int32_t fRight |
| ## |
| |
| #Member int32_t fBottom |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method static SkIRect SK_WARN_UNUSED_RESULT MakeEmpty() |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method static SkIRect SK_WARN_UNUSED_RESULT MakeLargest() |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method static SkIRect SK_WARN_UNUSED_RESULT MakeWH(int32_t w, int32_t h) |
| |
| #Param w incomplete ## |
| #Param h incomplete ## |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method static SkIRect SK_WARN_UNUSED_RESULT MakeSize(const SkISize& size) |
| |
| #Param size incomplete ## |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method static SkIRect SK_WARN_UNUSED_RESULT MakeLTRB(int32_t l, int32_t t, int32_t r, int32_t b) |
| |
| #Param l incomplete ## |
| #Param t incomplete ## |
| #Param r incomplete ## |
| #Param b incomplete ## |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method static SkIRect SK_WARN_UNUSED_RESULT MakeXYWH(int32_t x, int32_t y, int32_t w, int32_t h) |
| |
| #Param x incomplete ## |
| #Param y incomplete ## |
| #Param w incomplete ## |
| #Param h incomplete ## |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method int left() const |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method int top() const |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method int right() const |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method int bottom() const |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method int x() const |
| |
| return the left edge of the rectangle |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method int y() const |
| |
| return the top edge of the rectangle |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method int width() const |
| |
| Returns the rectangle width. This does not check for a valid rectangle |
| (i.e. left <= right) so the result may be negative. |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method int height() const |
| |
| Returns the rectangle height. This does not check for a valid rectangle |
| (i.e. top <= bottom) so the result may be negative. |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method SkISize size() const |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method int centerX() const |
| |
| Since the center of an integer rectangle may fall on a factional value, this |
| method is defined to return (right + left) >> 1. |
| This is a specific "truncation" of the average, which is different than |
| (right + left) / 2 when the sum is negative. |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method int centerY() const |
| |
| Since the center of an integer rectangle may fall on a factional value, this |
| method is defined to return (bottom + top) >> 1. |
| This is a specific "truncation" of the average, which is different than |
| (bottom + top) / 2 when the sum is negative. |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method bool isEmpty() const |
| |
| Return true if the rectangle width or height are <= 0 |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method bool isLargest() const |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method friend bool operator==(const SkIRect& a, const SkIRect& b) |
| |
| #Param a incomplete ## |
| #Param b incomplete ## |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method friend bool operator!=(const SkIRect& a, const SkIRect& b) |
| |
| #Param a incomplete ## |
| #Param b incomplete ## |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method bool is16Bit() const |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method void setEmpty() |
| |
| Set the rectangle to (0,0,0,0) |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method void set(int32_t left, int32_t top, int32_t right, int32_t bottom) |
| |
| #Param left incomplete ## |
| #Param top incomplete ## |
| #Param right incomplete ## |
| #Param bottom incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method void setLTRB(int32_t left, int32_t top, int32_t right, int32_t bottom) |
| |
| alias for set(l, t, r, b) |
| |
| #Param left incomplete ## |
| #Param top incomplete ## |
| #Param right incomplete ## |
| #Param bottom incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method void setXYWH(int32_t x, int32_t y, int32_t width, int32_t height) |
| |
| #Param x incomplete ## |
| #Param y incomplete ## |
| #Param width incomplete ## |
| #Param height incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method void setLargest() |
| |
| Sets rectangle left and top to most negative value, and sets |
| right and bottom to most positive value. |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method void setLargestInverted() |
| |
| Sets rectangle left and top to most positive value, and sets |
| right and bottom to most negative value. |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method SkIRect makeOffset(int32_t dx, int32_t dy) const |
| |
| Return a new IRect, built as an offset of this rectangle. |
| |
| #Param dx incomplete ## |
| #Param dy incomplete ## |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method SkIRect makeInset(int32_t dx, int32_t dy) const |
| |
| Return a new IRect, built as an inset of this rectangle. |
| |
| #Param dx incomplete ## |
| #Param dy incomplete ## |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method SkIRect makeOutset(int32_t dx, int32_t dy) const |
| |
| Return a new Rect, built as an outset of this rectangle. |
| |
| #Param dx incomplete ## |
| #Param dy incomplete ## |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method void offset(int32_t dx, int32_t dy) |
| |
| Offset set the rectangle by adding dx to its left and right, |
| and adding dy to its top and bottom. |
| |
| #Param dx incomplete ## |
| #Param dy incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method void offset(const SkIPoint& delta) |
| |
| #Param delta incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method void offsetTo(int32_t newX, int32_t newY) |
| |
| Offset this rectangle such its new x() and y() will equal newX and newY. |
| |
| #Param newX incomplete ## |
| #Param newY incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method void inset(int32_t dx, int32_t dy) |
| |
| Inset the rectangle by (dx,dy). If dx is positive, then the sides are moved inwards, |
| making the rectangle narrower. If dx is negative, then the sides are moved outwards, |
| making the rectangle wider. The same holds true for dy and the top and bottom. |
| |
| #Param dx incomplete ## |
| #Param dy incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method void outset(int32_t dx, int32_t dy) |
| |
| Outset the rectangle by (dx,dy). If dx is positive, then the sides are |
| moved outwards, making the rectangle wider. If dx is negative, then the |
| sides are moved inwards, making the rectangle narrower. The same holds |
| true for dy and the top and bottom. |
| |
| #Param dx incomplete ## |
| #Param dy incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method bool quickReject(int l, int t, int r, int b) const |
| |
| #Param l incomplete ## |
| #Param t incomplete ## |
| #Param r incomplete ## |
| #Param b incomplete ## |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method bool contains(int32_t x, int32_t y) const |
| |
| Returns true if (x,y) is inside the rectangle and the rectangle is not |
| empty. The left and top are considered to be inside, while the right |
| and bottom are not. Thus for the rectangle (0, 0, 5, 10), the |
| points (0,0) and (0,9) are inside, while (-1,0) and (5,9) are not. |
| |
| #Param x incomplete ## |
| #Param y incomplete ## |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method bool contains(int32_t left, int32_t top, int32_t right, int32_t bottom) const |
| |
| Returns true if the 4 specified sides of a rectangle are inside or equal to this rectangle. |
| If either rectangle is empty, contains() returns false. |
| |
| #Param left incomplete ## |
| #Param top incomplete ## |
| #Param right incomplete ## |
| #Param bottom incomplete ## |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method bool contains(const SkIRect& r) const |
| |
| Returns true if the specified rectangle r is inside or equal to this rectangle. |
| |
| #Param r incomplete ## |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method bool contains(const SkRect& r) const |
| |
| Returns true if the specified rectangle r is inside or equal to this rectangle. |
| |
| #Param r incomplete ## |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method bool containsNoEmptyCheck(int32_t left, int32_t top, |
| int32_t right, int32_t bottom) const |
| |
| Return true if this rectangle contains the specified rectangle. |
| For speed, this method does not check if either this or the specified |
| rectangles are empty, and if either is, its return value is undefined. |
| In the debugging build however, we assert that both this and the |
| specified rectangles are non-empty. |
| |
| #Param left incomplete ## |
| #Param top incomplete ## |
| #Param right incomplete ## |
| #Param bottom incomplete ## |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method bool containsNoEmptyCheck(const SkIRect& r) const |
| |
| #Param r incomplete ## |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method bool intersect(const SkIRect& r) |
| |
| If r intersects this rectangle, return true and set this rectangle to that |
| intersection, otherwise return false and do not change this rectangle. |
| If either rectangle is empty, do nothing and return false. |
| |
| #Param r incomplete ## |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method bool SK_WARN_UNUSED_RESULT intersect(const SkIRect& a, const SkIRect& b) |
| |
| If rectangles a and b intersect, return true and set this rectangle to |
| that intersection, otherwise return false and do not change this |
| rectangle. If either rectangle is empty, do nothing and return false. |
| |
| #Param a incomplete ## |
| #Param b incomplete ## |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method bool SK_WARN_UNUSED_RESULT intersectNoEmptyCheck(const SkIRect& a, const SkIRect& b) |
| |
| If rectangles a and b intersect, return true and set this rectangle to |
| that intersection, otherwise return false and do not change this |
| rectangle. For speed, no check to see if a or b are empty is performed. |
| If either is, then the return result is undefined. In the debug build, |
| we assert that both rectangles are non-empty. |
| |
| #Param a incomplete ## |
| #Param b incomplete ## |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method bool intersect(int32_t left, int32_t top, int32_t right, int32_t bottom) |
| |
| If the rectangle specified by left,top,right,bottom intersects this rectangle, |
| return true and set this rectangle to that intersection, |
| otherwise return false and do not change this rectangle. |
| If either rectangle is empty, do nothing and return false. |
| |
| #Param left incomplete ## |
| #Param top incomplete ## |
| #Param right incomplete ## |
| #Param bottom incomplete ## |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method static bool Intersects(const SkIRect& a, const SkIRect& b) |
| |
| Returns true if a and b are not empty, and they intersect |
| |
| #Param a incomplete ## |
| #Param b incomplete ## |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method static bool IntersectsNoEmptyCheck(const SkIRect& a, const SkIRect& b) |
| |
| Returns true if a and b intersect. debug-asserts that neither are empty. |
| |
| #Param a incomplete ## |
| #Param b incomplete ## |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method void join(int32_t left, int32_t top, int32_t right, int32_t bottom) |
| |
| Update this rectangle to enclose itself and the specified rectangle. |
| If this rectangle is empty, just set it to the specified rectangle. If the specified |
| rectangle is empty, do nothing. |
| |
| #Param left incomplete ## |
| #Param top incomplete ## |
| #Param right incomplete ## |
| #Param bottom incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method void join(const SkIRect& r) |
| |
| Update this rectangle to enclose itself and the specified rectangle. |
| If this rectangle is empty, just set it to the specified rectangle. If the specified |
| rectangle is empty, do nothing. |
| |
| #Param r incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method void sort() |
| |
| Swap top/bottom or left/right if there are flipped. |
| This can be called if the edges are computed separately, |
| and may have crossed over each other. |
| When this returns, left <= right && top <= bottom |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method SkIRect makeSorted() const |
| |
| Return a new Rect that is the sorted version of this rectangle (left <= right, top <= bottom). |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| # ------------------------------------------------------------------------------ |
| |
| #Method static const SkIRect& SK_WARN_UNUSED_RESULT EmptyIRect() |
| |
| #Return incomplete ## |
| |
| #Example |
| // incomplete |
| ## |
| |
| #ToDo incomplete ## |
| |
| ## |
| |
| #Struct SkIRect ## |
| |
| #Topic IRect ## |