32 template<
typename T>
class MatrixAffine2;
40 RectT( T aX1, T aY1, T aX2, T aY2 ) {
41 set( aX1, aY1, aX2, aY2 );
48 void set( T aX1, T aY1, T aX2, T aY2 );
134 return o <<
"(" << rect.x1 <<
", " << rect.y1 <<
")-(" << rect.x2 <<
", " << rect.y2 <<
")";
147 : mSrcRect( 0, 0, 0, 0 ), mDstRect( 0, 0, 0, 0 ) {}
149 : mSrcRect( aSrcRect ), mDstRect( aDstRect ) {}
156 Rectf mSrcRect, mDstRect;
159 extern void getClippedScaledRects(
const Area &srcSurfaceBounds,
const Rectf &srcRect,
const Area &dstSurfaceBounds,
const Area &dstArea,
Rectf *resultSrcRect, Area *resultDstRect );
GLuint GLenum matrix
Definition: GLee.h:10032
T x2
Definition: Rect.h:130
void set(T aX1, T aY1, T aX2, T aY2)
Definition: Rect.cpp:50
RectT scaled(T scale) const
Definition: Rect.cpp:190
T getAspectRatio() const
Definition: Rect.h:52
const RectT< T > operator/(T s) const
Definition: Rect.h:117
static RectT zero()
Constructs a rectangle with all values initialized to zero.
Definition: Rect.h:128
RectT inflated(const Vec2< T > &amount) const
Definition: Rect.cpp:131
RectT()
Definition: Rect.h:37
RectT< double > Rectd
Definition: Rect.h:140
RectT transformCopy(const class MatrixAffine2< T > &matrix) const
Returns a copy of the Rect transformed by matrix. Represents the bounding box of the transformed Rect...
Definition: Rect.cpp:202
RectT(T aX1, T aY1, T aX2, T aY2)
Definition: Rect.h:40
const RectT< T > operator+(const Vec2< T > &o) const
Definition: Rect.h:114
T x
Definition: Vector.h:71
T getX2() const
Definition: Rect.h:94
RectT< T > & operator/=(T s)
Definition: Rect.h:125
RectMapping(const Rectf &aSrcRect, const Rectf &aDstRect)
Definition: Rect.h:148
GLfloat GLfloat v1
Definition: GLee.h:2445
bool contains(const Vec2< Y > &pt) const
Is a point pt inside the rectangle.
Definition: Rect.h:80
Vec2< T > getSize() const
Definition: Rect.h:102
RectT getCenteredFit(const RectT &other, bool expand) const
Definition: Rect.cpp:297
Vec2< T > getLowerRight() const
Definition: Rect.h:99
const RectT< T > operator-(const RectT< T > &rhs) const
Definition: Rect.h:120
RectT< T > & operator+=(const Vec2< T > &o)
Definition: Rect.h:122
RectT getClipBy(const RectT &clip) const
Definition: Rect.cpp:105
void offsetCenterTo(const Vec2< T > ¢er)
Translates the rectangle so that its center is at center.
Definition: Rect.h:66
RectT< T > & operator-=(const Vec2< T > &o)
Definition: Rect.h:123
void canonicalize()
Definition: Rect.cpp:59
RectMapping()
Definition: Rect.h:146
T getHeight() const
Definition: Rect.h:51
T distanceSquared(const Vec2< T > &pt) const
Returns the squared distance between the point pt and the rectangle. Points inside the rectangle retu...
Definition: Rect.cpp:242
GLfloat GLfloat GLfloat v2
Definition: GLee.h:2451
RectT(const Vec2< T > &v1, const Vec2< T > &v2)
Definition: Rect.h:43
Area getInteriorArea() const
Definition: Rect.cpp:288
GLintptr offset
Definition: GLee.h:2095
T calcArea() const
Definition: Rect.h:53
T getY2() const
Definition: Rect.h:95
T getY1() const
Definition: Rect.h:93
Vec2< T > getCenter() const
Definition: Rect.h:101
T getX1() const
Definition: Rect.h:92
void offset(const Vec2< T > &offset)
Definition: Rect.cpp:113
T y
Definition: Vector.h:71
Vec2< T > getUpperRight() const
Definition: Rect.h:98
Vec2< T > closestPoint(const Vec2< T > &pt) const
Returns the nearest point on the Rect rect. Points inside the rectangle return pt.
Definition: Rect.cpp:254
Vec2< T > getUpperLeft() const
Definition: Rect.h:97
bool intersects(const RectT &rect) const
Returns whether rect intersects with this.
Definition: Rect.cpp:218
Represents a two dimensional affine transformation.
Definition: MatrixAffine2.h:38
const RectT< T > operator*(T s) const
Definition: Rect.h:116
T x1
Definition: Rect.h:130
void inflate(const Vec2< T > &amount)
Definition: Rect.cpp:122
void getClippedScaledRects(const Area &srcSurfaceBounds, const Rectf &srcRect, const Area &dstSurfaceBounds, const Area &dstArea, Rectf *resultSrcRect, Area *resultDstRect)
Definition: Rect.cpp:358
const RectT< T > operator+(const RectT< T > &rhs) const
Definition: Rect.h:119
RectT< float > Rectf
Definition: Rect.h:139
void include(const Vec2< T > &point)
Definition: Rect.cpp:265
RectT scaledCentered(T scale) const
Definition: Rect.cpp:163
friend std::ostream & operator<<(std::ostream &o, const RectT &rect)
Definition: Rect.h:132
GLsizei const GLfloat * points
Definition: GLee.h:6298
T getWidth() const
Definition: Rect.h:50
RectT canonicalized() const
Definition: Rect.cpp:75
T y2
Definition: Rect.h:130
T y1
Definition: Rect.h:130
void clipBy(const RectT &clip)
Definition: Rect.cpp:83
GLenum GLenum GLenum GLenum GLenum scale
Definition: GLee.h:8937
GLdouble s
Definition: GLee.h:1378
RectT< T > & operator*=(T s)
Definition: Rect.h:124
const RectT< T > operator-(const Vec2< T > &o) const
Definition: Rect.h:115
T distance(const Vec2< T > &pt) const
Returns the distance between the point pt and the rectangle. Points inside the rectangle return 0...
Definition: Rect.cpp:227
RectT getOffset(const Vec2< T > &off) const
Definition: Rect.h:62
void scaleCentered(const Vec2< T > &scale)
Definition: Rect.cpp:139
void scale(T scale)
Definition: Rect.cpp:172
Vec2f map(const Vec2f &srcPoint) const
Definition: Rect.cpp:340
Vec2< T > getLowerLeft() const
Definition: Rect.h:100