25 #ifndef _FXCRT_COORDINATES_ 26 #define _FXCRT_COORDINATES_ 43 template<
class BaseType>
233 #define CFX_FloatPoint CFX_PointF 236 template<
class baseType>
247 void Set(
const FXT_POINT &p1,
const FXT_POINT &p2) {
FXT_PSV::x = p2.x - p1.x,
FXT_PSV::y = p2.y - p1.y;}
264 FX_BOOL IsParallel(
const FXT_VECTOR &v)
const {
return IsParallel(v.x, v.y);}
265 FX_BOOL IsPerpendicular(baseType
x, baseType
y)
const {baseType t = DotProduct(
x,
y);
return FXSYS_fabs(t) < 0.0001f;}
266 FX_BOOL IsPerpendicular(
const FXT_VECTOR &v)
const {
return IsPerpendicular(v.x, v.y);}
280 friend FX_FLOAT Cosine(
const FXT_VECTOR &v1,
const FXT_VECTOR &v2)
282 FXSYS_assert(v1.SquareLength() != 0 && v2.SquareLength() != 0);
283 FX_FLOAT dotProduct = v1.DotProduct(v2);
286 friend FX_FLOAT ArcCosine(
const FXT_VECTOR &v1,
const FXT_VECTOR &v2)
290 friend FX_FLOAT SlopeAngle(
const FXT_VECTOR &v)
295 return v.y < 0 ? -fSlope : fSlope;
305 template<
class baseType>
314 void Set(baseType x, baseType y, baseType x1, baseType y1, baseType x2, baseType y2) {FXT_PARAL::x = x, FXT_PARAL::y = y, FXT_PARAL::x1 = x1, FXT_PARAL::y1 = y1, FXT_PARAL::x2 = x2, FXT_PARAL::y2 = y2;}
315 void Set(
const FXT_POINT &p,
const FXT_VECTOR &v1,
const FXT_VECTOR &v2) {FXT_PARAL::P(p), FXT_PARAL::V1(v1), FXT_PARAL::V2(v2);}
316 void Reset() {FXT_PARAL::x = FXT_PARAL::y = FXT_PARAL::x1 = FXT_PARAL::y1 = FXT_PARAL::x2 = FXT_PARAL::y2 = 0;}
318 CFX_PRLTemplate& operator += (
const FXT_POINT &p) {x += p.x; y += p.y;
return *
this;}
319 CFX_PRLTemplate& operator -= (
const FXT_POINT &p) {x -= p.x; y -= p.y;
return *
this;}
321 FXT_POINT P()
const {FXT_POINT p; p.x = x, p.y = y;
return p;}
322 void P(FXT_POINT p) {x = p.x, y = p.y;}
323 FXT_VECTOR V1()
const {FXT_VECTOR v; v.x = x1, v.y = y1;
return v;}
324 void V1(FXT_VECTOR v) {x1 = v.x, y1 = v.y;}
325 FXT_VECTOR V2()
const {FXT_VECTOR v; v.x = x2, v.y = y2;
return v;}
326 void V2(FXT_VECTOR v) {x2 = v.x, y2 = v.y;}
328 FX_BOOL IsEmpty()
const {
return V1().IsParallel(x2, y2);}
329 FX_BOOL IsRect()
const {
return V1().IsPerpendicular(x2, y2);}
330 FXT_SIZE Size()
const {FXT_SIZE s; s.x = V1().Length(); s.y = V2().Length();
return s;}
331 FXT_POINT Center()
const {
return (V1() + V2()) / 2 + P();}
332 FXT_POINT P1()
const {
return P();}
333 FXT_POINT P2()
const {
return P() + V1();}
334 FXT_POINT P3()
const {
return P() + V1() + V2();}
335 FXT_POINT P4()
const {
return P() + V2();}
349 template<
class baseType>
359 void Set(baseType left, baseType top, baseType width, baseType height) {FXT_RECT::left = left, FXT_RECT::top = top, FXT_RECT::width = width, FXT_RECT::height = height;}
360 void Set(baseType left, baseType top,
const FXT_SIZE &size) {FXT_RECT::left = left, FXT_RECT::top = top, FXT_RECT::Size(size);}
361 void Set(
const FXT_POINT &p, baseType width, baseType height) {TopLeft(p), FXT_RECT::width = width, FXT_RECT::height = height;}
362 void Set(
const FXT_POINT &p1,
const FXT_POINT &p2) {TopLeft(p1), FXT_RECT::width = p2.
x - p1.x, FXT_RECT::height = p2.y - p1.y, FXT_RECT::Normalize();}
363 void Set(
const FXT_POINT &p,
const FXT_VECTOR &v) {TopLeft(p), FXT_RECT::width = v.
x, FXT_RECT::height = v.y, FXT_RECT::Normalize();}
364 void Reset() {FXT_RECT::left = FXT_RECT::top = FXT_RECT::width = FXT_RECT::height = 0;}
366 FXT_RECT& operator += (
const FXT_POINT &p) {left += p.x, top += p.y;
return *
this;}
367 FXT_RECT& operator -= (
const FXT_POINT &p) {left -= p.x, top -= p.y;
return *
this;}
369 baseType right()
const {
return left + width;}
370 baseType bottom()
const {
return top + height;}
371 void Normalize() {
if (width < 0) {left += width; width = -width;}
if (height < 0) {top += height; height = -height;}}
372 void Offset(baseType dx, baseType dy) {left += dx; top += dy;}
373 void Inflate(baseType x, baseType y) {left -= x; width += x * 2; top -= y; height += y * 2;}
374 void Inflate(
const FXT_POINT &p) {Inflate(p.x, p.y);}
375 void Inflate(baseType left, baseType top, baseType right, baseType bottom) {FXT_RECT::left -= left; FXT_RECT::top -= top; FXT_RECT::width += left + right; FXT_RECT::height += top + bottom;}
376 void Inflate(
const FXT_RECT &rt) {Inflate(rt.left, rt.top, rt.left + rt.width, rt.top + rt.height);}
377 void Deflate(baseType x, baseType y) {left += x; width -= x * 2; top += y; height -= y * 2;}
378 void Deflate(
const FXT_POINT &p) {Deflate(p.x, p.y);}
379 void Deflate(baseType left, baseType top, baseType right, baseType bottom) {FXT_RECT::left += left; FXT_RECT::top += top; FXT_RECT::width -= left + right; FXT_RECT::height -= top + bottom;}
380 void Deflate(
const FXT_RECT &rt) {Deflate(rt.left, rt.top, rt.top + rt.width, rt.top + rt.height);}
381 FX_BOOL IsEmpty()
const {
return width <= 0 || height <= 0;}
382 FX_BOOL IsEmpty(
FX_FLOAT fEpsilon)
const {
return width <= fEpsilon || height <= fEpsilon;}
383 void Empty() {width = height = 0;}
384 FX_BOOL Contains(baseType x, baseType y)
const {
return x >= left && x < left + width && y >= top && y < top + height;}
385 FX_BOOL Contains(
const FXT_POINT &p)
const {
return Contains(p.x, p.y);}
386 FX_BOOL Contains(
const FXT_RECT &rt)
const {
return rt.left >= left && rt.right() <= right() && rt.top >= top && rt.bottom() <= bottom();}
387 baseType Width()
const {
return width;}
388 baseType Height()
const {
return height;}
389 FXT_SIZE Size()
const {FXT_SIZE size; size.Set(width, height);
return size;}
390 void Size(FXT_SIZE s) {width = s.x, height = s.y;}
391 FXT_POINT TopLeft()
const {FXT_POINT p; p.x = left; p.y = top;
return p;}
392 FXT_POINT TopRight()
const {FXT_POINT p; p.x = left + width; p.y = top;
return p;}
393 FXT_POINT BottomLeft()
const {FXT_POINT p; p.x = left; p.y = top + height;
return p;}
394 FXT_POINT BottomRight()
const {FXT_POINT p; p.x = left + width; p.y = top + height;
return p;}
395 void TopLeft(FXT_POINT tl) {left = tl.x; top = tl.y;}
396 void TopRight(FXT_POINT tr) {width = tr.x - left; top = tr.y;}
397 void BottomLeft(FXT_POINT bl) {left = bl.x; height = bl.y - top;}
398 void BottomRight(FXT_POINT br) {width = br.x - left; height = br.y - top;}
399 FXT_POINT Center()
const {FXT_POINT p; p.x = left + width / 2; p.y = top + height / 2;
return p;}
401 void GetParallelogram(FXT_PARAL &pg)
const {pg.x = left, pg.y = top; pg.x1 = width, pg.y1 = 0; pg.x2 = 0, pg.y2 = height;}
403 void Union(baseType x, baseType y)
405 baseType r = right(), b = bottom();
406 if (left > x) left = x;
408 if (top > y) top = y;
413 void Union(
const FXT_POINT &p) {Union(p.x, p.y);}
414 void Union(
const FXT_RECT &rt)
416 baseType r = right(), b = bottom();
417 if (left > rt.left) left = rt.left;
418 if (r < rt.right()) r = rt.right();
419 if (top > rt.top) top = rt.top;
420 if (b < rt.bottom()) b = rt.bottom();
424 void Intersect(
const FXT_RECT &rt)
426 baseType r = right(), b = bottom();
427 if (left < rt.left) left = rt.left;
428 if (r > rt.right()) r = rt.right();
429 if (top < rt.top) top = rt.top;
430 if (b > rt.bottom()) b = rt.bottom();
434 FX_BOOL IntersectWith(
const FXT_RECT &rt)
const 437 rect.Intersect(*
this);
438 return !rect.IsEmpty();
443 rect.Intersect(*
this);
444 return !rect.IsEmpty(fEpsilon);
447 friend FX_BOOL operator == (
const FXT_RECT &rc1,
const FXT_RECT &rc2) {
return rc1.left == rc2.left && rc1.top == rc2.top && rc1.width == rc2.width && rc1.height == rc2.height;}
448 friend FX_BOOL operator != (
const FXT_RECT &rc1,
const FXT_RECT &rc2) {
return rc1.left != rc2.left || rc1.top != rc2.top || rc1.width != rc2.width || rc1.height != rc2.height;}
451 baseType width, height;
470 template<
class baseType>
479 void Set(baseType left, baseType top, baseType width, baseType height) {FXT_RECT::left = left, FXT_RECT::top = top, FXT_RECT::width = width, FXT_RECT::height = height;}
480 void Set(baseType left, baseType top,
const FXT_SIZE &size) {FXT_RECT::left = left, FXT_RECT::top = top, FXT_RECT::Size(size);}
481 void Set(
const FXT_POINT &p, baseType width, baseType height) {FXT_RECT::TopLeft(p), FXT_RECT::width = width, FXT_RECT::height = height;}
482 void Set(
const FXT_POINT &p1,
const FXT_POINT &p2) {FXT_RECT::TopLeft(p1), FXT_RECT::width = p2.x - p1.x, FXT_RECT::height = p2.y - p1.y, FXT_RECT::Normalize();}
483 void Set(
const FXT_POINT &p,
const FXT_VECTOR &v) {FXT_RECT::TopLeft(p), FXT_RECT::width = v.x, FXT_RECT::height = v.y, FXT_RECT::Normalize();}
484 void SetRadius(
const FXT_POINT &p, baseType xRadius, baseType yRadius) {FXT_RECT::left = p.x - xRadius, FXT_RECT::top = p.y - yRadius, FXT_RECT::width = xRadius * 2, FXT_RECT::height = yRadius * 2;}
485 void Reset() {FXT_RECT::left = FXT_RECT::top = FXT_RECT::width = FXT_RECT::height = 0;}
487 FX_BOOL Contains(baseType x, baseType y)
const 489 x -= FXT_RECT::left + FXT_RECT::width / 2;
490 y -= FXT_RECT::top + FXT_RECT::height / 2;
493 FX_BOOL Contains(
const FXT_POINT &p)
const {
return Contains(p.x, p.y);}
494 FX_BOOL Contains(
const FXT_RECT &rt)
const {
return Contains(rt.TopLeft()) && Contains(rt.BottomRight());}
496 baseType XRadius()
const {
return FXT_RECT::width / 2;}
497 baseType YRadius()
const {
return FXT_RECT::height / 2;}
507 point.
x = fRadian * cosValue / d + FXT_RECT::left + a;
508 point.
y = fRadian * sinValue / d + FXT_RECT::top + b;
513 GetPointF(fRadian, p);
525 template<
class baseType>
534 void Set(baseType left, baseType top, baseType width, baseType height, baseType
xRadius, baseType
yRadius) {FXT_RECT::left = left, FXT_RECT::top = top, FXT_RECT::width = width, FXT_RECT::height = height,
FXT_RRECT::xRadius =
xRadius,
FXT_RRECT::yRadius =
yRadius;}
552 template<
class baseType>
562 void Set(baseType left, baseType top, baseType width, baseType height,
FX_FLOAT startAngle,
FX_FLOAT sweepAngle) {FXT_RECT::left = left, FXT_RECT::top = top, FXT_RECT::width = width, FXT_RECT::height = height,
FXT_ARC::startAngle =
startAngle,
FXT_ARC::sweepAngle =
sweepAngle;}
573 void EndPointF(
CFX_PointF &point)
const {FXT_ELLIPSE::GetPointF(EndAngle(), point);}
575 void EndPoint(
CFX_Point &point)
const {FXT_ELLIPSE::GetPoint(EndAngle(), point);}
623 FX_RECT(
int left1,
int top1,
int right1,
int bottom1)
1072 {
a = a1;
b = b1;
c = c1;
d = d1;
e = e1;
f = f1;}
1313 #ifdef _FXGE_IMAGERENDER_SHORTCUT_ 1314 const FX_INT32 GetRotation()
const;
1315 const FX_BOOL NeedTransform()
const;
1426 void TransformRect(
CFX_RectF &rect)
const;
1427 void TransformRect(
CFX_Rect &rect)
const;
1517 class CFX_Vector_3by1 :
public CFX_Object
1535 class CFX_Matrix_3by3 :
public CFX_Object
1538 CFX_Matrix_3by3():a(0.0f), b(0.0f), c(0.0f), d(0.0f), e(0.0f), f(0.0f), g(0.0f), h(0.0f), i(0.0f)
1542 a(a1), b(b1), c(c1), d(d1), e(e1), f(f1), g(g1), h(h1), i(i1)
1544 CFX_Matrix_3by3 Inverse();
1545 CFX_Matrix_3by3 Multiply(
const CFX_Matrix_3by3 &m);
1546 CFX_Vector_3by1 TransformVector(
const CFX_Vector_3by1 &v)
const;
1559 #define CFX_AffineMatrix CFX_Matrix 1562 #endif //_FXCRT_COORDINATES_ CFX_PSVTemplate(BaseType new_x, BaseType new_y)
Constructor, with parameters.
Definition: fx_coordinates.h:59
int top
The top.
Definition: fx_coordinates.h:599
CFX_PRLTemplate< FX_INT32 > CFX_Parallelogram
Type definition for parallelogram class for integer.
Definition: fx_coordinates.h:343
CFX_PSVTemplate()
Constructor.
Definition: fx_coordinates.h:52
void Set(BaseType x, BaseType y)
Set values.
Definition: fx_coordinates.h:75
static CFX_FloatRect GetBBox(const CFX_PointF *pPoints, int nPoints)
Get the bounding box of input points array.
FX_RECT GetOutterRect() const
Convert to an outer integer rectangle.
int bottom
The bottom.
Definition: fx_coordinates.h:603
void Normalize()
Normalize the rect. Make sure left <= right, top <= bottom.
int Width() const
Get the width of the rect.
Definition: fx_coordinates.h:631
void Intersect(int left1, int top1, int right1, int bottom1)
Intersect with a rect.
Definition: fx_coordinates.h:673
CFX_ArrayTemplate< CFX_FloatRect > CFX_RectArray
Rectangle array.
Definition: fx_coordinates.h:1043
void TransformRect(CFX_FloatRect &rect) const
Transform a rectangle and return a bounding rectangle. The result rectangle is always normalized...
Definition: fx_coordinates.h:1447
void TransformPoint(FX_FLOAT &x, FX_FLOAT &y) const
Transform point specified by x and y value.
void TranslateI(FX_INT32 x, FX_INT32 y, FX_BOOL bPrepended=false)
Translate the matrix. using integer value.
Definition: fx_coordinates.h:1232
int Height() const
Get the height of the rect.
Definition: fx_coordinates.h:638
void Transform(FX_FLOAT x, FX_FLOAT y, FX_FLOAT &x1, FX_FLOAT &y1) const
Transform a point.
Definition: fx_coordinates.h:1418
FX_RECT GetClosestRect() const
Get a closest integer rectangle.
BaseType x
Value x.
Definition: fx_coordinates.h:207
FX_BOOL Contains(const FX_RECT &other_rect) const
Check if current rectangle fully contains the other provided rectangle. That means to check if the ot...
Definition: fx_coordinates.h:722
CFX_ArrayTemplate< CFX_RectF > CFX_RectFArray
Type definition for rect array.
Definition: fx_coordinates.h:467
FX_RECT(int left1, int top1, int right1, int bottom1)
Construct a rect with left-top and right bottom corners.
Definition: fx_coordinates.h:623
int FXSYS_round(FX_FLOAT f)
Get nearest integer.
FX_FLOAT TransformYDistance(FX_FLOAT dy) const
Transform a y-distance.
CFX_RTemplate< FX_FLOAT > * FX_LPRECTF
Type definition for pointer to float rectangle.
Definition: fx_coordinates.h:461
CFX_ArrayTemplate< CFX_PointF > CFX_PointsF
Type definition for float point array.
Definition: fx_coordinates.h:222
FX_FLOAT b
The coefficient b.
Definition: fx_coordinates.h:1506
void Reset()
Reset current matrix.
Definition: fx_coordinates.h:1174
void Normalize()
Normalize the rect. Make sure left <= right, and bottom <= top.
CFX_RRTemplate< FX_FLOAT > CFX_RoundRectF
Type definition for round-corner rectangle class for float.
Definition: fx_coordinates.h:549
CFX_ArrayTemplate< CFX_Point > CFX_Points
Type definition for integer point array.
Definition: fx_coordinates.h:220
void Union(const FX_RECT &other_rect)
Union with a rect.
void Inflate(const CFX_FloatRect &rt)
Increases the width and height of the rectangle.
Definition: fx_coordinates.h:981
Definition: fx_coordinates.h:30
FX_FLOAT sweepAngle
Sweep angle to draw arc. Positive is counterclockwise from starting angle, in radian.
Definition: fx_coordinates.h:580
void Concat(FX_FLOAT a, FX_FLOAT b, FX_FLOAT c, FX_FLOAT d, FX_FLOAT e, FX_FLOAT f, FX_BOOL bPrepended=false)
Concatenate with another matrix.
#define FXSYS_sin
Calculate the sine of a floating-point number from a radian argument.
Definition: fx_system.h:1416
FX_BOOL IsScaled() const
Whether this matrix has scaling (or translating) only. No rotating.
CFX_PRLTemplate< FX_FLOAT > CFX_ParallelogramF
Type definition for parallelogram class for float.
Definition: fx_coordinates.h:345
int right
The right.
Definition: fx_coordinates.h:601
FX_FLOAT GetA() const
Get the coefficient a.
Definition: fx_coordinates.h:1465
CFX_ATemplate< FX_INT32 > CFX_Arc
Type definition for arc class for integer.
Definition: fx_coordinates.h:584
FX_BOOL operator!=(const FX_RECT &src) const
Compare(!=) operator overload. Compare two rectangles. Please make sure they are normalized first...
Definition: fx_coordinates.h:701
void SetIdentity()
Set the matrix to be an identity transformation matrix.
Definition: fx_coordinates.h:1126
FX_RECT GetInnerRect() const
Convert to an inner integer rectangle.
void Inflate(FX_FLOAT x, FX_FLOAT y)
Increases the width and height of the rectangle.
Definition: fx_coordinates.h:961
void Transform(const CFX_Matrix *pMatrix)
Transform a rectangle. The result rectangle is always normalized.
CFX_PSVTemplate< FX_FLOAT > * FX_LPPOINTF
Type definition for pointer to float point.
Definition: fx_coordinates.h:226
void InitRect(FX_FLOAT x, FX_FLOAT y)
Initialize the rectangle to a single point.
Definition: fx_coordinates.h:927
CFX_FloatRect(FX_FLOAT left1, FX_FLOAT bottom1, FX_FLOAT right1, FX_FLOAT top1)
Construct a rectangle with left-bottom and right-top corners.
Definition: fx_coordinates.h:779
CFX_PSVTemplate< FX_INT32 > CFX_Point
Type definition for point class for integer.
Definition: fx_coordinates.h:212
CFX_FloatRect()
Construct an empty rectangle.
Definition: fx_coordinates.h:769
FX_SHORT Left
The left.
Definition: fx_coordinates.h:750
CFX_Matrix()
Construct a identity transformation matrix.
Definition: fx_coordinates.h:1059
FX_FLOAT startAngle
Start angle to draw arc. Positive is counterclockwise, in radian.
Definition: fx_coordinates.h:578
FXT_PSV & operator*=(BaseType lamda)
Overload operator *=.
Definition: fx_coordinates.h:132
baseType xRadius
x radius of round corner. This must not exceed the half width.
Definition: fx_coordinates.h:541
void ConcatInverse(const CFX_Matrix &m, FX_BOOL bPrepended=false)
Concatenate the inverse of another matrix.
void Offset(int dx, int dy)
Shift the coordinates by delta value of x and y directions.
Definition: fx_coordinates.h:712
FX_FLOAT Width() const
Get the width of the rectangle.
Definition: fx_coordinates.h:944
int FX_INT32
32-bit signed integer.
Definition: fx_system.h:662
FX_BOOL IsInvertible() const
Determine whether a matrix is invertible or not.
void * FXSYS_memset32(void *dst, FX_INT32 v, size_t size)
Set buffer data to specified value.
void Union(const CFX_FloatRect &other_rect)
Union with a rect.
CFX_RTemplate< FX_INT32 > * FX_LPRECT
Type definition for pointer to integer rectangle.
Definition: fx_coordinates.h:459
FX_FLOAT GetXUnit() const
Get the x-direction unit size.
FX_SHORT Bottom
The bottom.
Definition: fx_coordinates.h:756
FX_FLOAT GetF() const
Get the coefficient f.
Definition: fx_coordinates.h:1500
int FX_BOOL
Boolean variable (should be TRUE or FALSE).
Definition: fx_system.h:670
FX_FLOAT GetYUnit() const
Get the y-direction unit size.
CFX_PSVTemplate< FX_FLOAT > const * FX_LPCPOINTF
Type definition for constant pointer to float point.
Definition: fx_coordinates.h:230
FXT_PSV & operator/=(BaseType lamda)
Overload operator /=.
Definition: fx_coordinates.h:140
FX_FLOAT c
The coefficient c.
Definition: fx_coordinates.h:1508
CFX_PSVTemplate< FX_INT32 > const * FX_LPCPOINT
Type definition for constant pointer to integer point.
Definition: fx_coordinates.h:228
FX_FLOAT a
The coefficient a.
Definition: fx_coordinates.h:1504
int Substract4(CFX_FloatRect &substract_rect, CFX_FloatRect *pRects)
Subtract a rectangle area from this rectangle. The result might be up to 4 rectangles. The number of result rectangles are returned. Caller must prepare enough rectangles (up to 4).
FX_BOOL IsEmpty() const
Verify whether the rect is empty.
Definition: fx_coordinates.h:801
CFX_ATemplate< FX_FLOAT > CFX_ArcF
Type definition for arc class for float.
Definition: fx_coordinates.h:586
CFX_RTemplate< FX_FLOAT > const * FX_LPCRECTF
Type definition for constant pointer to float rectangle.
Definition: fx_coordinates.h:465
FX_BOOL IsEmpty() const
Verify whether the rect is empty.
Definition: fx_coordinates.h:645
void Add(BaseType x, BaseType y)
Add values.
Definition: fx_coordinates.h:92
FX_FLOAT GetD() const
Get the coefficient d.
Definition: fx_coordinates.h:1486
FXT_PSV & operator-=(const FXT_PSV &obj)
Overload operator -=.
Definition: fx_coordinates.h:124
#define FXSYS_acos
Calculate the arccosine of a floating-point number, in radians.
Definition: fx_system.h:1411
void Reset()
Reset values to 0.
Definition: fx_coordinates.h:107
short FX_SHORT
Short integer (16 bits).
Definition: fx_system.h:654
void Transform(FX_FLOAT &x, FX_FLOAT &y) const
Transform a point.
Definition: fx_coordinates.h:1406
#define FXSYS_fabs
Calculate the absolute. FXSYS_fabs(x) means |x|.
Definition: fx_system.h:1386
FX_FLOAT GetC() const
Get the coefficient c.
Definition: fx_coordinates.h:1479
#define FXSYS_cos
Calculate the cosine of a floating-point number from a radian argument.
Definition: fx_system.h:1406
void Deflate(FX_FLOAT x, FX_FLOAT y)
Decreases the width and height of the rectangle.
Definition: fx_coordinates.h:991
int left
The left.
Definition: fx_coordinates.h:597
Definition: fx_basic.h:1287
CFX_PSVTemplate< FX_FLOAT > CFX_SizeF
Type definition for size class for float.
Definition: fx_coordinates.h:218
void SetReverse(const CFX_Matrix &m)
Set the coefficients of the inverse of another matrix to this matrix.
FX_FLOAT Height() const
Get the height of the rectangle.
Definition: fx_coordinates.h:951
FX_BOOL Is90Rotated() const
Whether this matrix has rotating of 90, or -90 degrees.
CFX_ETemplate< FX_INT32 > CFX_Ellipse
Type definition for ellipse class for integer.
Definition: fx_coordinates.h:520
CFX_FloatRect GetUnitRect() const
Get a bounding rectangle of the parallelogram composing two unit vectors.
void Translate(FX_FLOAT x, FX_FLOAT y, FX_BOOL bPrepended=false)
Translate the matrix.
float FX_FLOAT
32-bit floating-point number.
Definition: fx_system.h:664
void UpdateRect(FX_FLOAT x, FX_FLOAT y)
Update the rectangle to contain the specified point.
#define FXSYS_assert
Assertion.
Definition: fx_system.h:785
FXT_PSV & operator+=(const FXT_PSV &obj)
Overload operator +=.
Definition: fx_coordinates.h:116
FX_BOOL operator!=(const CFX_FloatRect &src) const
Compare(!=) operator overload. Compare two rectangles. Please make sure they are normalized first...
Definition: fx_coordinates.h:828
CFX_PSVTemplate< FX_INT32 > * FX_LPPOINT
Type definition for pointer to integer point.
Definition: fx_coordinates.h:224
Definition: fx_coordinates.h:33
void Set(FX_FLOAT a, FX_FLOAT b, FX_FLOAT c, FX_FLOAT d, FX_FLOAT e, FX_FLOAT f)
Change the coefficients in the matrix.
CFX_RTemplate< FX_INT32 > CFX_Rect
Type definition for rectangle class for integer.
Definition: fx_coordinates.h:455
Definition: fx_coordinates.h:594
FX_FLOAT GetUnitArea() const
Get area of the parallelogram composing two unit vectors.
void Inflate(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top)
Increases the width and height of the rectangle.
Definition: fx_coordinates.h:972
void RotateAt(FX_FLOAT fRadian, FX_FLOAT x, FX_FLOAT y, FX_BOOL bPrepended=false)
Rotate the matrix at a position.
FX_BOOL Contains(int x, int y) const
Check if current rectangle contains the provided point. That means to check if the provided point is ...
Definition: fx_coordinates.h:737
friend FXT_PSV operator/(const FXT_PSV &obj, BaseType lamda)
Overload operator /.
Definition: fx_coordinates.h:204
void Deflate(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top)
Decreases the width and height of the rectangle.
Definition: fx_coordinates.h:1002
friend FX_BOOL operator==(const FXT_PSV &obj1, const FXT_PSV &obj2)
Overload operator ==.
Definition: fx_coordinates.h:150
FX_SHORT Top
The top.
Definition: fx_coordinates.h:752
CFX_RTemplate< FX_INT32 > const * FX_LPCRECT
Type definition for constant pointer to integer rectangle.
Definition: fx_coordinates.h:463
void Copy(const CFX_Matrix &m)
Copy coefficients from another matrix.
Definition: fx_coordinates.h:1183
CFX_VTemplate< FX_FLOAT > CFX_VectorF
Vector class for float.
Definition: fx_coordinates.h:302
FX_FLOAT GetB() const
Get the coefficient b.
Definition: fx_coordinates.h:1472
friend FXT_PSV operator+(const FXT_PSV &obj1, const FXT_PSV &obj2)
Overload operator +.
Definition: fx_coordinates.h:168
FX_FLOAT f
The coefficient f.
Definition: fx_coordinates.h:1514
FX_FLOAT right
The right.
Definition: fx_coordinates.h:1035
FX_BOOL operator!=(const CFX_Matrix &src) const
Compare(!=) operator overload. Compare two matrixs.
Definition: fx_coordinates.h:1093
void Intersect(const CFX_FloatRect &other_rect)
Intersect with a rect.
void MatchRect(const CFX_FloatRect &dest, const CFX_FloatRect &src)
Get a matrix that transforms a source rectangle to dest rectangle.
FX_FLOAT TransformDistance(FX_FLOAT dx, FX_FLOAT dy) const
Transform distance specified by x and y value.
Definition: fx_coordinates.h:34
CFX_FloatRect(const FX_FLOAT *pArray)
Construct a rectangle with an array of left, bottom, right, top values.
Definition: fx_coordinates.h:786
CFX_PSVTemplate< FX_INT32 > CFX_Size
Type definition for size class for integer.
Definition: fx_coordinates.h:216
Definition: fx_coordinates.h:31
FX_FLOAT bottom
The bottom.
Definition: fx_coordinates.h:1037
void Intersect(const FX_RECT &src)
Intersect with a rect.
Definition: fx_coordinates.h:32
friend FX_BOOL operator!=(const FXT_PSV &obj1, const FXT_PSV &obj2)
Overload operator !=.
Definition: fx_coordinates.h:159
void Shear(FX_FLOAT fAlphaRadian, FX_FLOAT fBetaRadian, FX_BOOL bPrepended=false)
Shear the matrix.
FX_BOOL Contains(const CFX_FloatRect &other_rect) const
Check if current rectangle fully contains the other provided rectangle. That means to check if the ot...
Definition: fx_coordinates.h:36
CFX_PSVTemplate< FX_FLOAT > CFX_PointF
Type definition for point class for float.
Definition: fx_coordinates.h:214
FX_FLOAT left
The left.
Definition: fx_coordinates.h:1033
CFX_ETemplate< FX_FLOAT > CFX_EllipseF
Type definition for ellipse class for float.
Definition: fx_coordinates.h:522
Definition: fx_coordinates.h:35
void Reset()
Reset rectangle, set coordinates to 0.
Definition: fx_coordinates.h:837
friend FXT_PSV operator-(const FXT_PSV &obj1, const FXT_PSV &obj2)
Overload operator -.
Definition: fx_coordinates.h:177
friend FXT_PSV operator*(const FXT_PSV &obj, BaseType lamda)
Overload operator *.
Definition: fx_coordinates.h:186
void TransformRect(FX_RECT &rect) const
Transform a rectangle and return a bounding rectangle. The result rectangle is always normalized...
Definition: fx_coordinates.h:1455
void Rotate(FX_FLOAT fRadian, FX_BOOL bPrepended=false)
Rotate the matrix.
BaseType y
Value y.
Definition: fx_coordinates.h:209
FX_FLOAT TransformXDistance(FX_FLOAT dx) const
Transform a x-distance.
Definition: fx_coordinates.h:1053
void Set(const FXT_PSV &psv)
Set values.
Definition: fx_coordinates.h:83
#define FXSYS_sqrt
Calculate the square root. FXSYS_sqrt(x) means sqrt(x).
Definition: fx_system.h:1381
FX_BOOL operator==(const CFX_FloatRect &src) const
Compare(==) operator overload. Compare two rectangles. Please make sure they are normalized first...
Definition: fx_coordinates.h:817
FX_BOOL operator==(const CFX_Matrix &src) const
Compare(==) operator overload. Compare two matrixs.
Definition: fx_coordinates.h:1081
void Scale(FX_FLOAT sx, FX_FLOAT sy, FX_BOOL bPrepended=false)
Scale the matrix.
FX_FLOAT top
The top.
Definition: fx_coordinates.h:1039
FX_RECT()
Construct a rect not initialized.
Definition: fx_coordinates.h:608
FX_FLOAT GetE() const
Get the coefficient e.
Definition: fx_coordinates.h:1493
CFX_RRTemplate< FX_INT32 > CFX_RoundRect
Type definition for round-corner rectangle class for integer.
Definition: fx_coordinates.h:547
void Translate(FX_FLOAT e, FX_FLOAT f)
Translate rectangle.
Definition: fx_coordinates.h:1020
CFX_RTemplate< FX_FLOAT > CFX_RectF
Type definition for rectangle class for float.
Definition: fx_coordinates.h:457
baseType yRadius
y radius of round corner. This must not exceed the half height.
Definition: fx_coordinates.h:543
void Deflate(const CFX_FloatRect &rt)
Decreases the width and height of the rectangle.
Definition: fx_coordinates.h:1010
CFX_Matrix(FX_FLOAT a1, FX_FLOAT b1, FX_FLOAT c1, FX_FLOAT d1, FX_FLOAT e1, FX_FLOAT f1)
Construct a matrix with six input coefficients.
Definition: fx_coordinates.h:1071
CFX_PSVTemplate(const CFX_PSVTemplate &other)
Constructor, with another object.
Definition: fx_coordinates.h:65
Definition: fx_coordinates.h:763
FX_SHORT Right
The right.
Definition: fx_coordinates.h:754
FX_FLOAT d
The coefficient d.
Definition: fx_coordinates.h:1510
FX_BOOL IsIdentity() const
Determine whether a matrix is an identity transformation or not.
Definition: fx_coordinates.h:1190
FX_BOOL operator==(const FX_RECT &src) const
Compare(==) operator overload. Compare two rectangles. Please make sure they are normalized first...
Definition: fx_coordinates.h:691
Definition: fx_coordinates.h:747
FX_FLOAT e
The coefficient e.
Definition: fx_coordinates.h:1512
void Subtract(BaseType x, BaseType y)
Subtract values.
Definition: fx_coordinates.h:101
CFX_VTemplate< FX_INT32 > CFX_Vector
Vector class for integer.
Definition: fx_coordinates.h:300