Gnash
0.8.10
|
Rectangle class, see swf defined rectangle record. More...
#include <SWFRect.h>
Public Member Functions | |
SWFRect () | |
Construct a NULL rectangle. | |
SWFRect (int xmin, int ymin, int xmax, int ymax) | |
Construct a rectangle with given coordinates. | |
bool | is_null () const |
returns true if this is a NULL rectangle | |
void | set_null () |
set the rectangle to the NULL value | |
bool | is_world () const |
TODO: deprecate this 'world' concept. | |
void | set_world () |
set the rectangle to the WORLD value | |
boost::int32_t | width () const |
Return width of this rectangle in TWIPS. | |
boost::int32_t | height () const |
Return height of this rectangle in TWIPS. | |
boost::int32_t | get_x_min () const |
Get the x coordinate of the left-up corner. | |
boost::int32_t | get_x_max () const |
Get the x coordinate of the right-down corner. | |
boost::int32_t | get_y_min () const |
Get the y coordinate of the left-up corner. | |
boost::int32_t | get_y_max () const |
Get the y coordinate of the right-down corner. | |
bool | point_test (boost::int32_t x, boost::int32_t y) const |
Return true if the given point is inside this SWFRect. | |
void | set_to_point (boost::int32_t x, boost::int32_t y) |
Set ourself to bound the given point. | |
void | set_to_rect (boost::int32_t x1, boost::int32_t y1, boost::int32_t x2, boost::int32_t y2) |
void | expand_to_point (boost::int32_t x, boost::int32_t y) |
Expand this rectangle to enclose the given point. | |
void | enclose_transformed_rect (const SWFMatrix &m, const SWFRect &r) |
void | expand_to_circle (boost::int32_t x, boost::int32_t y, boost::int32_t radius) |
Expand this rectangle to enclose the given circle. | |
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. | |
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. | |
geometry::Range2d< boost::int32_t > | getRange () const |
Construct and return a Range2d object. | |
std::string | toString () const |
Return a string representation for this rectangle. | |
Static Public Attributes | |
static const boost::int32_t | rectNull = 0x80000000 |
static const boost::int32_t | rectMax = 0x7fffffff |
Friends | |
std::ostream & | operator<< (std::ostream &os, const SWFRect &SWFRect) |
Ouput operator. |
Rectangle class, see swf defined rectangle record.
gnash::SWFRect::SWFRect | ( | ) | [inline] |
Construct a NULL rectangle.
gnash::SWFRect::SWFRect | ( | int | xmin, |
int | ymin, | ||
int | xmax, | ||
int | ymax | ||
) | [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 assert, is_null(), gnash::geometry::Point2d::x, and gnash::geometry::Point2d::y.
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_min(), get_y_min(), get_x_max(), get_y_max(), gnash::SWFMatrix::transform(), set_to_point(), gnash::geometry::Point2d::x, and gnash::geometry::Point2d::y.
void gnash::SWFRect::expand_to_circle | ( | boost::int32_t | x, |
boost::int32_t | y, | ||
boost::int32_t | radius | ||
) | [inline] |
Expand this rectangle to enclose the given circle.
References assert, and is_null().
Referenced by gnash::DynamicShape::lineTo(), gnash::DynamicShape::curveTo(), and gnash::Path::expandBounds().
void gnash::SWFRect::expand_to_point | ( | boost::int32_t | x, |
boost::int32_t | y | ||
) | [inline] |
Expand this rectangle to enclose the given point.
References is_null(), and set_to_point().
Referenced by gnash::Path::expandBounds(), and gnash::SWFMatrix::transform().
void gnash::SWFRect::expand_to_rect | ( | const SWFRect & | r | ) |
Makes union of the given and the current SWFRect.
References is_null(), gnash::key::r, get_x_min(), get_y_min(), get_x_max(), and get_y_max().
Referenced by gnash::MorphShape::getBounds(), gnash::MovieClip::getBounds(), and gnash::TextField::add_invalidated_bounds().
Same as enclose_transformed_rect but expanding the current SWFRect instead of replacing it.
References is_null(), get_x_min(), get_y_min(), get_x_max(), get_y_max(), gnash::SWFMatrix::transform(), set_to_point(), gnash::geometry::Point2d::x, and gnash::geometry::Point2d::y.
Referenced by gnash::Bitmap::add_invalidated_bounds(), gnash::Button::getBounds(), gnash::DisplayObject::add_invalidated_bounds(), gnash::MovieClip::add_invalidated_bounds(), and gnash::Video::add_invalidated_bounds().
boost::int32_t gnash::SWFRect::get_x_max | ( | ) | const [inline] |
Get the x coordinate of the right-down corner.
References assert, and is_null().
Referenced by gnash::movie_root::display(), gnash::renderer::openvg::Renderer_ovg::world_to_pixel(), gnash::Renderer_cairo::world_to_pixel(), gnash::renderer::DirectFB::Renderer_DirectFB::world_to_pixel(), gnash::renderer::gles1::Renderer_gles1::world_to_pixel(), gnash::SWFMatrix::transform(), enclose_transformed_rect(), expand_to_rect(), expand_to_transformed_rect(), set_lerp(), gnash::TextField::display(), and gnash::TextField::setHeight().
boost::int32_t gnash::SWFRect::get_x_min | ( | ) | const [inline] |
Get the x coordinate of the left-up corner.
References assert, and is_null().
Referenced by gnash::movie_root::display(), gnash::renderer::openvg::Renderer_ovg::world_to_pixel(), gnash::Renderer_cairo::drawVideoFrame(), gnash::Renderer_cairo::world_to_pixel(), gnash::renderer::DirectFB::Renderer_DirectFB::world_to_pixel(), gnash::renderer::gles1::Renderer_gles1::world_to_pixel(), gnash::SWFMatrix::transform(), enclose_transformed_rect(), expand_to_rect(), expand_to_transformed_rect(), set_lerp(), gnash::TextField::display(), gnash::TextField::setWidth(), and gnash::TextField::setHeight().
boost::int32_t gnash::SWFRect::get_y_max | ( | ) | const [inline] |
Get the y coordinate of the right-down corner.
References assert, and is_null().
Referenced by gnash::movie_root::display(), gnash::renderer::openvg::Renderer_ovg::world_to_pixel(), gnash::Renderer_cairo::world_to_pixel(), gnash::renderer::DirectFB::Renderer_DirectFB::world_to_pixel(), gnash::renderer::gles1::Renderer_gles1::world_to_pixel(), gnash::SWFMatrix::transform(), enclose_transformed_rect(), expand_to_rect(), expand_to_transformed_rect(), set_lerp(), gnash::TextField::display(), and gnash::TextField::setWidth().
boost::int32_t gnash::SWFRect::get_y_min | ( | ) | const [inline] |
Get the y coordinate of the left-up corner.
References assert, and is_null().
Referenced by gnash::movie_root::display(), gnash::renderer::openvg::Renderer_ovg::world_to_pixel(), gnash::Renderer_cairo::drawVideoFrame(), gnash::Renderer_cairo::world_to_pixel(), gnash::renderer::DirectFB::Renderer_DirectFB::world_to_pixel(), gnash::renderer::gles1::Renderer_gles1::world_to_pixel(), gnash::SWFMatrix::transform(), enclose_transformed_rect(), expand_to_rect(), expand_to_transformed_rect(), set_lerp(), gnash::TextField::display(), gnash::TextField::setWidth(), and gnash::TextField::setHeight().
geometry::Range2d<boost::int32_t> gnash::SWFRect::getRange | ( | ) | const [inline] |
Construct and return a Range2d object.
References is_null(), gnash::geometry::nullRange, is_world(), and gnash::geometry::worldRange.
Referenced by gnash::Bitmap::add_invalidated_bounds(), gnash::DisplayObject::add_invalidated_bounds(), gnash::DisplayObject::boundsInClippingArea(), gnash::MovieClip::add_invalidated_bounds(), gnash::Renderer_cairo::drawVideoFrame(), gnash::TextField::add_invalidated_bounds(), and gnash::Video::add_invalidated_bounds().
boost::int32_t gnash::SWFRect::height | ( | ) | const [inline] |
Return height of this rectangle in TWIPS.
Referenced by gnash::BitmapMovieDefinition::get_height_pixels(), gnash::getHeight(), gnash::DisplayObject::setHeight(), gnash::Renderer_cairo::drawVideoFrame(), gnash::SWFMovieDefinition::get_height_pixels(), and gnash::TextField::display().
bool gnash::SWFRect::is_null | ( | ) | const [inline] |
returns true if this is a NULL rectangle
References rectNull.
Referenced by gnash::movie_root::display(), gnash::renderer::openvg::Renderer_ovg::world_to_pixel(), gnash::renderer::openvg::Renderer_ovg::drawGlyph(), gnash::renderer::DirectFB::Renderer_DirectFB::world_to_pixel(), gnash::renderer::gles1::Renderer_gles1::world_to_pixel(), gnash::SWFMatrix::transform(), gnash::SWFMovieDefinition::readHeader(), expand_to_rect(), expand_to_transformed_rect(), set_lerp(), clamp(), get_x_min(), get_x_max(), get_y_min(), get_y_max(), point_test(), expand_to_point(), expand_to_circle(), getRange(), and gnash::TextField::display().
bool gnash::SWFRect::is_world | ( | ) | const [inline] |
TODO: deprecate this 'world' concept.
References rectMax.
Referenced by gnash::renderer::openvg::Renderer_ovg::world_to_pixel(), gnash::renderer::DirectFB::Renderer_DirectFB::world_to_pixel(), gnash::renderer::gles1::Renderer_gles1::world_to_pixel(), and getRange().
bool gnash::SWFRect::point_test | ( | boost::int32_t | x, |
boost::int32_t | y | ||
) | const [inline] |
Return true if the given point is inside this SWFRect.
References is_null().
Referenced by gnash::DisplayObject::pointInBounds(), gnash::MorphShape::pointInShape(), gnash::TextField::topmostMouseEntity(), and gnash::TextField::pointInShape().
References assert, is_null(), get_x_min(), gnash::key::t, get_y_min(), get_x_max(), and get_y_max().
Referenced by gnash::SWF::ShapeRecord::setLerp().
void gnash::SWFRect::set_null | ( | ) | [inline] |
set the rectangle to the NULL value
References rectNull.
Referenced by gnash::SWF::ShapeRecord::clear(), and gnash::SWF::ShapeRecord::read().
void gnash::SWFRect::set_to_point | ( | boost::int32_t | x, |
boost::int32_t | y | ||
) | [inline] |
Set ourself to bound the given point.
Referenced by gnash::SWFMatrix::transform(), enclose_transformed_rect(), expand_to_transformed_rect(), and expand_to_point().
void gnash::SWFRect::set_to_rect | ( | boost::int32_t | x1, |
boost::int32_t | y1, | ||
boost::int32_t | x2, | ||
boost::int32_t | y2 | ||
) | [inline] |
Referenced by gnash::TextField::setWidth(), and gnash::TextField::setHeight().
void gnash::SWFRect::set_world | ( | ) | [inline] |
set the rectangle to the WORLD value
References rectMax.
Referenced by gnash::Gui::setInvalidatedRegions().
std::string gnash::SWFRect::toString | ( | ) | const |
Return a string representation for this rectangle.
Referenced by gnash::SWF::ShapeRecord::read().
boost::int32_t gnash::SWFRect::width | ( | ) | const [inline] |
Return width of this rectangle in TWIPS.
Referenced by gnash::BitmapMovieDefinition::get_width_pixels(), gnash::DisplayObject::setWidth(), gnash::Renderer_cairo::drawVideoFrame(), and gnash::SWFMovieDefinition::get_width_pixels().
std::ostream& operator<< | ( | std::ostream & | os, |
const SWFRect & | SWFRect | ||
) | [friend] |
Ouput operator.
const boost::int32_t gnash::SWFRect::rectMax = 0x7fffffff [static] |
Referenced by is_world(), and set_world().
const boost::int32_t gnash::SWFRect::rectNull = 0x80000000 [static] |
Referenced by is_null(), and set_null().