Go to the documentation of this file.
49 constexpr
static std::int32_t
rectNull = 0x80000000;
50 constexpr
static std::int32_t
rectMax = 0x7fffffff;
65 constexpr
SWFRect(
int xmin,
int ymin,
int xmax,
int ymax)
83 _xMin = _yMin = _xMax = _yMax =
rectNull;
89 return _xMin == (-
rectMax >> 9)
105 return _xMax - _xMin;
111 return _yMax - _yMin;
147 if (x < _xMin || x > _xMax || y < _yMin || y > _yMax) {
161 void set_to_rect(std::int32_t x1, std::int32_t y1, std::int32_t x2,
198 _xMin = std::min(_xMin,
x - radius);
199 _yMin = std::min(_yMin,
y - radius);
200 _xMax = std::max(_xMax,
x + radius);
201 _yMax = std::max(_yMax,
y + radius);
246 void expand_to(std::int32_t
x, std::int32_t
y)
248 _xMin = std::min(_xMin,
x);
249 _yMin = std::min(_yMin,
y);
250 _xMax = std::max(_xMax,
x);
251 _yMax = std::max(_yMax,
y);
266 <<
r.get_x_min() <<
","
267 <<
r.get_y_min() <<
","
268 <<
r.get_x_max() <<
","
269 <<
r.get_y_max() <<
")";
280 #endif // GNASH_RECT_H
2d Range template class
Definition: Range2d.h:78
void expand_to_point(std::int32_t x, std::int32_t y)
Expand this rectangle to enclose the given point.
Definition: SWFRect.h:171
void expand_to_circle(std::int32_t x, std::int32_t y, std::int32_t radius)
Expand this rectangle to enclose the given circle.
Definition: SWFRect.h:186
std::int32_t get_x_max() const
Get the x coordinate of the right-down corner.
Definition: SWFRect.h:122
geometry::Range2d< std::int32_t > getRange() const
Construct and return a Range2d object.
Definition: SWFRect.h:222
std::int32_t y
Definition: BitmapData_as.cpp:435
DSOEXPORT void expand_to_rect(const SWFRect &r)
Makes union of the given and the current SWFRect.
Definition: SWFRect.cpp:56
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
bool is_null() const
returns true if this is a NULL rectangle
Definition: SWFRect.h:75
std::int32_t get_y_max() const
Get the y coordinate of the right-down corner.
Definition: SWFRect.h:136
@ m
Definition: GnashKey.h:159
void set_to_rect(std::int32_t x1, std::int32_t y1, std::int32_t x2, std::int32_t y2)
Definition: SWFRect.h:161
@ worldRange
A WORLD range2d is a range including all points on the plane.
Definition: Range2d.h:52
bool is_world() const
TODO: deprecate this 'world' concept.
Definition: SWFRect.h:87
Rectangle class, see swf defined rectangle record.
Definition: SWFRect.h:45
@ t
Definition: GnashKey.h:166
@ r
Definition: GnashKey.h:164
void set_to_point(std::int32_t x, std::int32_t y)
Set ourself to bound the given point.
Definition: SWFRect.h:154
@ a
Definition: GnashKey.h:147
std::int32_t x
The x coordinate.
Definition: Point2d.h:43
std::int32_t get_x_min() const
Get the x coordinate of the left-up corner.
Definition: SWFRect.h:115
std::int32_t height() const
Return height of this rectangle in TWIPS.
Definition: SWFRect.h:109
void enclose_transformed_rect(const SWFMatrix &m, const SWFRect &r)
Definition: SWFRect.cpp:32
@ p
Definition: GnashKey.h:162
@ nullRange
A NULL range is a range enclosing NO points.
Definition: Range2d.h:43
Definition: SWFMatrix.h:54
void set_lerp(const SWFRect &a, const SWFRect &b, float t)
Definition: SWFRect.cpp:107
constexpr static std::int32_t rectMax
Definition: SWFRect.h:50
2D Point class
Definition: Point2d.h:39
constexpr SWFRect()
Construct a NULL rectangle.
Definition: SWFRect.h:56
void set_world()
set the rectangle to the WORLD value
Definition: SWFRect.h:96
constexpr static std::int32_t rectNull
Definition: SWFRect.h:49
friend std::ostream & operator<<(std::ostream &os, const SWFRect &SWFRect)
Ouput operator.
Definition: SWFRect.h:262
bool point_test(std::int32_t x, std::int32_t y) const
Return true if the given point is inside this SWFRect.
Definition: SWFRect.h:143
void clamp(geometry::Point2d &p) const
Make sure that the given point falls in this rectangle, modifying it's coordinates if needed.
Definition: SWFRect.cpp:120
std::int32_t width() const
Return width of this rectangle in TWIPS.
Definition: SWFRect.h:103
#define DSOEXPORT
Definition: dsodefs.h:55
std::int32_t y
The y coordinate.
Definition: Point2d.h:46
std::string toString() const
Return a string representation for this rectangle.
Definition: SWFRect.cpp:128
std::int32_t x
Definition: BitmapData_as.cpp:434
@ b
Definition: GnashKey.h:148
DSOEXPORT void expand_to_transformed_rect(const SWFMatrix &m, const SWFRect &r)
Definition: SWFRect.cpp:74
std::int32_t get_y_min() const
Get the y coordinate of the left-up corner.
Definition: SWFRect.h:129
void set_null()
set the rectangle to the NULL value
Definition: SWFRect.h:81
std::ostream & operator<<(std::ostream &o, const URL &u)
Definition: URL.cpp:447
constexpr SWFRect(int xmin, int ymin, int xmax, int ymax)
Construct a rectangle with given coordinates.
Definition: SWFRect.h:65