• Home
  • Raw
  • Download

Lines Matching refs:Rect

27 class Rect {
29 AI Rect() = default;
30 AI Rect(float l, float t, float r, float b) : fVals(NegateBotRight({l,t,r,b})) {} in Rect() function
31 AI Rect(float2 topLeft, float2 botRight) : fVals(topLeft, -botRight) {} in Rect() function
32 AI Rect(const SkRect& r) : fVals(NegateBotRight(float4::Load(r.asScalars()))) {} in Rect() function
34 AI static Rect XYWH(float x, float y, float w, float h) { in XYWH()
35 return Rect(x, y, x + w, y + h); in XYWH()
37 AI static Rect XYWH(float2 topLeft, float2 size) { in XYWH()
38 return Rect(topLeft, topLeft + size); in XYWH()
40 AI static Rect WH(float w, float h) { in WH()
41 return Rect(0, 0, w, h); in WH()
43 AI static Rect WH(float2 size) { in WH()
44 return Rect(float2(0), size); in WH()
46 AI static Rect Point(float2 p) { in Point()
47 return Rect(p, p); in Point()
49 AI static Rect FromVals(float4 vals) { // vals.zw must already be negated. in FromVals()
50 return Rect(vals); in FromVals()
54 AI static Rect Infinite() { in Infinite()
58 AI static Rect InfiniteInverted() { in InfiniteInverted()
62 AI bool operator==(Rect rect) const { return all(fVals == rect.fVals); }
63 AI bool operator!=(Rect rect) const { return any(fVals != rect.fVals); }
111 AI ComplementRect(Rect rect) : fVals(-rect.fVals.zwxy()) {} in ComplementRect()
116 AI bool contains(Rect rect) const { return all(fVals <= rect.fVals); } in contains()
121 AI Rect makeRoundIn() const { return ceil(fVals); } in makeRoundIn()
122 AI Rect makeRoundOut() const { return floor(fVals); } in makeRoundOut()
123 AI Rect makeInset(float inset) const { return fVals + inset; } in makeInset()
124 AI Rect makeInset(float2 inset) const { return fVals + inset.xyxy(); } in makeInset()
125 AI Rect makeOutset(float outset) const { return fVals - outset; } in makeOutset()
126 AI Rect makeOutset(float2 outset) const { return fVals - outset.xyxy(); } in makeOutset()
127 AI Rect makeOffset(float2 offset) const { return fVals + float4(offset, -offset); } in makeOffset()
128 AI Rect makeJoin(Rect rect) const { return min(fVals, rect.fVals); } in makeJoin()
129 AI Rect makeIntersect(Rect rect) const { return max(fVals, rect.fVals); } in makeIntersect()
130 AI Rect makeSorted() const { return min(fVals, -fVals.zwxy()); } in makeSorted()
132 AI Rect& roundIn() { return *this = this->makeRoundIn(); } in roundIn()
133 AI Rect& roundOut() { return *this = this->makeRoundOut(); } in roundOut()
134 AI Rect& inset(float inset) { return *this = this->makeInset(inset); } in inset()
135 AI Rect& inset(float2 inset) { return *this = this->makeInset(inset); } in inset()
136 AI Rect& outset(float outset) { return *this = this->makeOutset(outset); } in outset()
137 AI Rect& outset(float2 outset) { return *this = this->makeOutset(outset); } in outset()
138 AI Rect& offset(float2 offset) { return *this = this->makeOffset(offset); } in offset()
139 AI Rect& join(Rect rect) { return *this = this->makeJoin(rect); } in join()
140 AI Rect& intersect(Rect rect) { return *this = this->makeIntersect(rect); } in intersect()
141 AI Rect& sort() { return *this = this->makeSorted(); } in sort()
148 AI Rect(float4 vals) : fVals(vals) {} // vals.zw must already be negated. in Rect() function