7#ifndef CORE_FXCRT_FX_COORDINATES_H_
8#define CORE_FXCRT_FX_COORDINATES_H_
12#include "core/fxcrt/span.h"
14template <
class BaseType>
19 :
x(new_x),
y(new_y) {}
24 return x == other
.x &&
y == other
.y;
27 return !(*
this == other);
53template <
class BaseType>
62 template <
typename OtherType>
65 static_cast<OtherType>(
height));
76 return !(*
this == other);
117template <
class BaseType>
131 :
CFX_PTemplate<BaseType>(point2.x - point1.x, point2.y - point1.y) {}
232 void Inflate(
float x,
float y);
239 void Deflate(
float x,
float y);
250 void Scale(
float fScale);
293 width(dst_size.width),
294 height(dst_size.height) {}
301 top(
static_cast<
float>(that
.top)),
344 width += off_left + off_right;
345 height += off_top + off_bottom;
363 width -= off_left + off_right;
364 height -= off_top + off_bottom;
396 void Union(
float x,
float y);
415 return !(rc1
== rc2);
450 :
a(a1),
b(b1),
c(c1),
d(d1),
e(e1),
f(f1) {}
457 return a == other
.a &&
b == other
.b &&
c == other
.c &&
d == other
.d &&
458 e == other
.e &&
f == other
.f;
469 *
this = *
this * other;
478 bool WillScale()
const {
return a != 1.0f ||
b != 0 ||
c != 0 ||
d != 1.0f; }
484 Translate(static_cast<
float>(x)
, static_cast<
float>(y)
);
490 void Scale(
float sx,
float sy);
491 void Rotate(
float fRadian);
void Deflate(const CFX_FloatRect &rt)
void Deflate(float other_left, float other_bottom, float other_right, float other_top)
FX_RECT ToRoundedFxRect() const
bool Contains(const CFX_PointF &point) const
CFX_FloatRect(const CFX_FloatRect &that)=default
CFX_FloatRect GetCenterSquare() const
constexpr CFX_FloatRect(float l, float b, float r, float t)
constexpr CFX_FloatRect()=default
FX_RECT GetClosestRect() const
bool operator==(const CFX_FloatRect &other) const
CFX_FloatRect(const FX_RECT &rect)
void UpdateRect(const CFX_PointF &point)
void Intersect(const CFX_FloatRect &other_rect)
void ScaleFromCenterPoint(float fScale)
void Inflate(float x, float y)
FX_RECT GetInnerRect() const
CFX_FloatRect & operator=(const CFX_FloatRect &that)=default
void Deflate(float x, float y)
bool Contains(const CFX_FloatRect &other_rect) const
FX_RECT GetOuterRect() const
void Inflate(const CFX_FloatRect &rt)
static CFX_FloatRect GetBBox(pdfium::span< const CFX_PointF > pPoints)
void Translate(float e, float f)
CFX_FloatRect GetDeflated(float x, float y) const
void Inflate(float other_left, float other_bottom, float other_right, float other_top)
void Union(const CFX_FloatRect &other_rect)
CFX_FloatRect(const CFX_PointF &point)
constexpr CFX_Matrix()=default
CFX_Matrix & operator=(const CFX_Matrix &other)=default
CFX_FloatRect TransformRect(const CFX_FloatRect &rect) const
float TransformDistance(float distance) const
CFX_Matrix & operator*=(const CFX_Matrix &other)
CFX_RectF TransformRect(const CFX_RectF &rect) const
void MatchRect(const CFX_FloatRect &dest, const CFX_FloatRect &src)
CFX_Matrix operator*(const CFX_Matrix &right) const
CFX_PointF Transform(const CFX_PointF &point) const
void Translate(int32_t x, int32_t y)
void TranslatePrepend(int32_t x, int32_t y)
CFX_FloatRect GetUnitRect() const
CFX_Matrix GetInverse() const
bool operator!=(const CFX_Matrix &other) const
void TranslatePrepend(float x, float y)
void Rotate(float fRadian)
constexpr CFX_Matrix(float a1, float b1, float c1, float d1, float e1, float f1)
void Scale(float sx, float sy)
void Translate(float x, float y)
void Concat(const CFX_Matrix &right)
bool operator==(const CFX_Matrix &other) const
float TransformXDistance(float dx) const
CFX_Matrix(const CFX_Matrix &other)=default
constexpr CFX_PTemplate(BaseType new_x, BaseType new_y)
CFX_PTemplate(const CFX_PTemplate &other)=default
CFX_PTemplate & operator-=(const CFX_PTemplate< BaseType > &obj)
constexpr CFX_PTemplate()=default
CFX_PTemplate operator+(const CFX_PTemplate &other) const
CFX_PTemplate operator-(const CFX_PTemplate &other) const
bool operator==(const CFX_PTemplate &other) const
bool operator!=(const CFX_PTemplate &other) const
CFX_PTemplate & operator+=(const CFX_PTemplate< BaseType > &obj)
CFX_PTemplate & operator=(const CFX_PTemplate &other)=default
void Union(const PointType &p)
CFX_RectF(const CFX_RectF &other)=default
void Offset(float dx, float dy)
CFX_FloatRect ToFloatRect() const
PointType BottomLeft() const
bool IntersectWith(const CFX_RectF &rt, float fEpsilon) const
PointType BottomRight() const
constexpr CFX_RectF()=default
friend bool operator==(const CFX_RectF &rc1, const CFX_RectF &rc2)
bool IsEmpty(float fEpsilon) const
void Inflate(float off_left, float off_top, float off_right, float off_bottom)
void Deflate(const CFX_RectF &rt)
CFX_RectF & operator+=(const PointType &p)
bool Contains(const CFX_RectF &rt) const
bool IntersectWith(const CFX_RectF &rt) const
void Intersect(const CFX_RectF &rt)
FX_RECT GetOuterRect() const
void Deflate(float off_left, float off_top, float off_right, float off_bottom)
friend bool operator!=(const CFX_RectF &rc1, const CFX_RectF &rc2)
void Inflate(const CFX_RectF &rt)
void Inflate(const PointType &p)
void Inflate(float x, float y)
CFX_RectF & operator=(const CFX_RectF &other)=default
CFX_RectF(const FX_RECT &that)
bool Contains(const PointType &p) const
CFX_RectF & operator-=(const PointType &p)
CFX_RectF(float dst_left, float dst_top, const SizeType &dst_size)
void Union(float x, float y)
void Deflate(const PointType &p)
CFX_RectF(const PointType &p, float dst_width, float dst_height)
PointType TopLeft() const
constexpr CFX_RectF(float dst_left, float dst_top, float dst_width, float dst_height)
void Union(const CFX_RectF &rt)
CFX_RectF(const PointType &p1, const SizeType &s2)
void Deflate(float x, float y)
PointType TopRight() const
bool operator!=(const CFX_STemplate &other) const
CFX_STemplate & operator/=(BaseType divisor)
bool operator==(const CFX_STemplate &other) const
constexpr CFX_STemplate(BaseType new_width, BaseType new_height)
CFX_STemplate & operator+=(const CFX_STemplate< BaseType > &obj)
CFX_STemplate< OtherType > As() const
constexpr CFX_STemplate()=default
CFX_STemplate & operator-=(const CFX_STemplate< BaseType > &obj)
CFX_STemplate(const CFX_STemplate &other)=default
CFX_STemplate operator+(const CFX_STemplate &other) const
CFX_STemplate operator-(const CFX_STemplate &other) const
CFX_STemplate operator*(BaseType factor) const
CFX_STemplate & operator*=(BaseType factor)
CFX_STemplate & operator=(const CFX_STemplate &other)=default
CFX_STemplate operator/(BaseType divisor) const
CFX_VTemplate(const CFX_VTemplate &other)
CFX_VTemplate(BaseType new_x, BaseType new_y)
CFX_VTemplate(const CFX_PTemplate< BaseType > &point1, const CFX_PTemplate< BaseType > &point2)
std::ostream & WritePoint(std::ostream &stream, const CFX_PointF &point)
std::ostream & WriteFloat(std::ostream &stream, float value)
std::ostream & WriteRect(std::ostream &stream, const CFX_FloatRect &rect)
std::ostream & WriteMatrix(std::ostream &stream, const CFX_Matrix &matrix)
CFX_VTemplate< float > CFX_VectorF
CFX_PTemplate< int32_t > CFX_Point
CFX_VTemplate< int32_t > CFX_Vector
CFX_PTemplate< int16_t > CFX_Point16
CFX_PTemplate< float > CFX_PointF
CFX_STemplate< float > CFX_SizeF
CFX_STemplate< int32_t > CFX_Size
void Offset(int dx, int dy)
FX_RECT & operator=(const FX_RECT &that)=default
bool operator==(const FX_RECT &src) const
constexpr FX_RECT()=default
FX_RECT(const FX_RECT &that)=default
void Intersect(int l, int t, int r, int b)
FX_RECT SwappedClipBox(int width, int height, bool bFlipX, bool bFlipY) const
bool Contains(int x, int y) const
void Intersect(const FX_RECT &src)
constexpr FX_RECT(int l, int t, int r, int b)