Gnash
0.8.11dev
|
Rectangle class, see swf defined rectangle record. More...
#include <SWFRect.h>
Public Member Functions | |
constexpr | SWFRect () |
Construct a NULL rectangle. More... | |
constexpr | SWFRect (int xmin, int ymin, int xmax, int ymax) |
Construct a rectangle with given coordinates. More... | |
bool | is_null () const |
returns true if this is a NULL rectangle More... | |
void | set_null () |
set the rectangle to the NULL value More... | |
bool | is_world () const |
TODO: deprecate this 'world' concept. More... | |
void | set_world () |
set the rectangle to the WORLD value More... | |
std::int32_t | width () const |
Return width of this rectangle in TWIPS. More... | |
std::int32_t | height () const |
Return height of this rectangle in TWIPS. More... | |
std::int32_t | get_x_min () const |
Get the x coordinate of the left-up corner. More... | |
std::int32_t | get_x_max () const |
Get the x coordinate of the right-down corner. More... | |
std::int32_t | get_y_min () const |
Get the y coordinate of the left-up corner. More... | |
std::int32_t | get_y_max () const |
Get the y coordinate of the right-down corner. More... | |
bool | point_test (std::int32_t x, std::int32_t y) const |
Return true if the given point is inside this SWFRect. More... | |
void | set_to_point (std::int32_t x, std::int32_t y) |
Set ourself to bound the given point. More... | |
void | set_to_rect (std::int32_t x1, std::int32_t y1, std::int32_t x2, std::int32_t y2) |
void | expand_to_point (std::int32_t x, std::int32_t y) |
Expand this rectangle to enclose the given point. More... | |
void | enclose_transformed_rect (const SWFMatrix &m, const SWFRect &r) |
void | expand_to_circle (std::int32_t x, std::int32_t y, std::int32_t radius) |
Expand this rectangle to enclose the given circle. More... | |
DSOEXPORT void | expand_to_transformed_rect (const SWFMatrix &m, const SWFRect &r) |
DSOEXPORT void | expand_to_rect (const SWFRect &r) |
Makes union of the given and the current SWFRect. More... | |
void | set_lerp (const SWFRect &a, const SWFRect &b, float t) |
void | clamp (geometry::Point2d &p) const |
Make sure that the given point falls in this rectangle, modifying it's coordinates if needed. More... | |
geometry::Range2d< std::int32_t > | getRange () const |
Construct and return a Range2d object. More... | |
std::string | toString () const |
Return a string representation for this rectangle. More... | |
Static Public Attributes | |
static constexpr std::int32_t | rectNull = 0x80000000 |
static constexpr std::int32_t | rectMax = 0x7fffffff |
Friends | |
std::ostream & | operator<< (std::ostream &os, const SWFRect &SWFRect) |
Ouput operator. More... | |
Rectangle class, see swf defined rectangle record.
|
inline |
Construct a NULL rectangle.
|
inline |
Construct a rectangle with given coordinates.
void gnash::SWFRect::clamp | ( | geometry::Point2d & | p | ) | const |
Make sure that the given point falls in this rectangle, modifying it's coordinates if needed.
References is_null(), gnash::geometry::Point2d::x, and gnash::geometry::Point2d::y.
Referenced by gnash::movie_root::setDragState().
Set ourself to bound a rectangle that has been transformed by m. This is an axial bound of an oriented (and/or sheared, scaled, etc) box.
References get_x_max(), get_x_min(), get_y_max(), get_y_min(), set_to_point(), gnash::SWFMatrix::transform(), gnash::geometry::Point2d::x, and gnash::geometry::Point2d::y.
Referenced by gnash::movie_root::setDragState().
|
inline |
Expand this rectangle to enclose the given circle.
References gnash::key::a, gnash::key::b, gnash::clamp(), DSOEXPORT, gnash::key::p, and gnash::key::t.
Referenced by gnash::DynamicShape::curveTo(), gnash::Path::expandBounds(), and gnash::DynamicShape::lineTo().
|
inline |
Expand this rectangle to enclose the given point.
References gnash::key::m, and gnash::key::r.
Referenced by gnash::Path::expandBounds(), gnash::TextField::setFont(), and gnash::SWFMatrix::transform().
void gnash::SWFRect::expand_to_rect | ( | const SWFRect & | r | ) |
Makes union of the given and the current SWFRect.
References get_x_max(), get_x_min(), get_y_max(), get_y_min(), is_null(), and gnash::key::r.
Referenced by gnash::TextField::add_invalidated_bounds(), gnash::MorphShape::getBounds(), and gnash::MovieClip::getBounds().
Same as enclose_transformed_rect but expanding the current SWFRect instead of replacing it.
References get_x_max(), get_x_min(), get_y_max(), get_y_min(), is_null(), set_to_point(), gnash::SWFMatrix::transform(), gnash::geometry::Point2d::x, and gnash::geometry::Point2d::y.
Referenced by gnash::Bitmap::add_invalidated_bounds(), gnash::Video::add_invalidated_bounds(), gnash::MovieClip::add_invalidated_bounds(), gnash::DisplayObject::add_invalidated_bounds(), and gnash::Button::getBounds().
|
inline |
Get the x coordinate of the right-down corner.
Referenced by gnash::TextField::display(), gnash::movie_root::display(), enclose_transformed_rect(), expand_to_rect(), expand_to_transformed_rect(), gnash::operator<<(), set_lerp(), gnash::TextField::setFont(), gnash::TextField::setHeight(), gnash::SWFMatrix::transform(), gnash::Renderer_cairo::world_to_pixel(), gnash::renderer::DirectFB::Renderer_DirectFB::world_to_pixel(), gnash::renderer::openvg::Renderer_ovg::world_to_pixel(), and gnash::renderer::gles1::Renderer_gles1::world_to_pixel().
|
inline |
Get the x coordinate of the left-up corner.
Referenced by gnash::TextField::display(), gnash::movie_root::display(), gnash::Renderer_cairo::drawVideoFrame(), enclose_transformed_rect(), expand_to_rect(), expand_to_transformed_rect(), gnash::operator<<(), set_lerp(), gnash::TextField::setFont(), gnash::TextField::setHeight(), gnash::TextField::setWidth(), gnash::SWFMatrix::transform(), gnash::Renderer_cairo::world_to_pixel(), gnash::renderer::DirectFB::Renderer_DirectFB::world_to_pixel(), gnash::renderer::openvg::Renderer_ovg::world_to_pixel(), and gnash::renderer::gles1::Renderer_gles1::world_to_pixel().
|
inline |
Get the y coordinate of the right-down corner.
Referenced by gnash::TextField::display(), gnash::movie_root::display(), enclose_transformed_rect(), expand_to_rect(), expand_to_transformed_rect(), gnash::operator<<(), set_lerp(), gnash::TextField::setWidth(), gnash::SWFMatrix::transform(), gnash::Renderer_cairo::world_to_pixel(), gnash::renderer::DirectFB::Renderer_DirectFB::world_to_pixel(), gnash::renderer::openvg::Renderer_ovg::world_to_pixel(), and gnash::renderer::gles1::Renderer_gles1::world_to_pixel().
|
inline |
Get the y coordinate of the left-up corner.
Referenced by gnash::TextField::display(), gnash::movie_root::display(), gnash::Renderer_cairo::drawVideoFrame(), enclose_transformed_rect(), expand_to_rect(), expand_to_transformed_rect(), gnash::operator<<(), set_lerp(), gnash::TextField::setHeight(), gnash::TextField::setWidth(), gnash::SWFMatrix::transform(), gnash::Renderer_cairo::world_to_pixel(), gnash::renderer::DirectFB::Renderer_DirectFB::world_to_pixel(), gnash::renderer::openvg::Renderer_ovg::world_to_pixel(), and gnash::renderer::gles1::Renderer_gles1::world_to_pixel().
|
inline |
Construct and return a Range2d object.
References gnash::geometry::nullRange, gnash::toString(), gnash::geometry::worldRange, x, and y.
Referenced by gnash::Bitmap::add_invalidated_bounds(), gnash::Video::add_invalidated_bounds(), gnash::TextField::add_invalidated_bounds(), gnash::MovieClip::add_invalidated_bounds(), gnash::DisplayObject::add_invalidated_bounds(), gnash::DisplayObject::boundsInClippingArea(), gnash::Renderer_cairo::drawVideoFrame(), and gnash::registerMovieClipNative().
|
inline |
Return height of this rectangle in TWIPS.
Referenced by gnash::DisplayObject::boundsInClippingArea(), gnash::TextField::display(), gnash::Renderer_cairo::drawVideoFrame(), gnash::getHeight(), gnash::registerTextFieldNative(), gnash::TextField::setFont(), and gnash::DisplayObject::setHeight().
|
inline |
returns true if this is a NULL rectangle
Referenced by clamp(), gnash::TextField::display(), gnash::movie_root::display(), gnash::renderer::openvg::Renderer_ovg::drawGlyph(), gnash::Renderer_cairo::drawGlyph(), expand_to_rect(), expand_to_transformed_rect(), gnash::operator<<(), gnash::SWFMovieDefinition::readHeader(), set_lerp(), gnash::SWFMatrix::transform(), gnash::renderer::DirectFB::Renderer_DirectFB::world_to_pixel(), gnash::renderer::openvg::Renderer_ovg::world_to_pixel(), and gnash::renderer::gles1::Renderer_gles1::world_to_pixel().
|
inline |
TODO: deprecate this 'world' concept.
Referenced by gnash::renderer::DirectFB::Renderer_DirectFB::world_to_pixel(), gnash::renderer::openvg::Renderer_ovg::world_to_pixel(), and gnash::renderer::gles1::Renderer_gles1::world_to_pixel().
|
inline |
Return true if the given point is inside this SWFRect.
Referenced by gnash::DisplayObject::pointInBounds(), gnash::MorphShape::pointInShape(), gnash::TextField::pointInShape(), gnash::MovieClip::pointInVisibleShape(), and gnash::TextField::topmostMouseEntity().
References get_x_max(), get_x_min(), get_y_max(), get_y_min(), is_null(), and gnash::key::t.
|
inline |
set the rectangle to the NULL value
|
inline |
Set ourself to bound the given point.
Referenced by enclose_transformed_rect(), expand_to_transformed_rect(), and gnash::SWFMatrix::transform().
|
inline |
Referenced by gnash::TextField::setFont(), gnash::TextField::setHeight(), and gnash::TextField::setWidth().
|
inline |
set the rectangle to the WORLD value
Referenced by gnash::Gui::setInvalidatedRegions().
std::string gnash::SWFRect::toString | ( | ) | const |
Return a string representation for this rectangle.
|
inline |
Return width of this rectangle in TWIPS.
Referenced by gnash::DisplayObject::boundsInClippingArea(), gnash::Renderer_cairo::drawVideoFrame(), gnash::registerTextFieldNative(), gnash::TextField::setFont(), gnash::TextField::setTextFormat(), gnash::DisplayObject::setWidth(), and gnash::DisplayObject::MaskRenderer::~MaskRenderer().
|
friend |
Ouput operator.
|
static |
|
static |