#include <Bitmap.h>
Public Member Functions | |
Bitmap (movie_root &mr, as_object *object, BitmapData_as *bd, DisplayObject *parent) | |
Construct a Bitmap character from a BitmapData. | |
Bitmap (movie_root &mr, as_object *object, const BitmapMovieDefinition *def, DisplayObject *parent) | |
Construct a Bitmap character from a loaded image. | |
virtual | ~Bitmap () |
virtual void | update () |
Notify the Bitmap that it's been updated during ActionScript execution. | |
virtual void | add_invalidated_bounds (InvalidatedRanges &ranges, bool force) |
Add the DisplayObject's invalidated bounds *to* the given ranges list. | |
virtual void | display (Renderer &renderer) |
Display this Bitmap. | |
virtual SWFRect | getBounds () const |
Get the bounds of the Bitmap. | |
virtual bool | pointInShape (boost::int32_t x, boost::int32_t y) const |
Test whether a point is in the Bitmap's bounds. | |
virtual void | construct (as_object *init=0) |
Called when the object is placed on stage. | |
Protected Member Functions | |
void | markReachableObjects () const |
A Bitmap DisplayObject. This is not AS-referencable, but can be removed and placed using depths like normal DisplayObjects. This can be constructed dynamically from a BitmapData, or non-dynamically as part of a BitmapMovie. For non-dynamic Bitmap DisplayObjects, the bitmap data never changes. The update() function is called once on stage placement. For dynamic Bitmap DisplayObjects, the attached BitmapData_as should call update() whenever the data changes. This Bitmap registers itself with the BitmapData_as on stage placement.
gnash::Bitmap::Bitmap | ( | movie_root & | mr, | |
as_object * | object, | |||
BitmapData_as * | bd, | |||
DisplayObject * | parent | |||
) |
gnash::Bitmap::Bitmap | ( | movie_root & | mr, | |
as_object * | object, | |||
const BitmapMovieDefinition * | def, | |||
DisplayObject * | parent | |||
) |
Construct a Bitmap character from a loaded image.
References _height, _width, gnash::BitmapData_as::disposed(), and gnash::pixelsToTwips().
gnash::Bitmap::~Bitmap | ( | ) | [virtual] |
References gnash::BitmapMovieDefinition::get_frame_size().
void gnash::Bitmap::add_invalidated_bounds | ( | InvalidatedRanges & | ranges, | |
bool | force | |||
) | [virtual] |
Add the DisplayObject's invalidated bounds *to* the given ranges list.
NOTE that this method should include the bounds that it covered the last time clear_invalidated() was called, as those need to be rerendered as well (to clear the region previously occupied by this DisplayObject).
That's why it returns the *union* of old_invalidated_ranges and the current bounds. The function is also used internally by set_invalidated() to update m_old_invalidated_ranges itself (you may notice some kind of circular reference), but that's no problem since old_invalidated_ranges is NULL during that call.
It is used to determine what area needs to be re-rendered. The coordinates are world coordinates (in TWIPS). Only instances with _invalidated flag set are checked unless force is set.
Reimplemented from gnash::DisplayObject.
void gnash::Bitmap::construct | ( | as_object * | init = 0 |
) | [virtual] |
Called when the object is placed on stage.
Reimplemented from gnash::DisplayObject.
References gnash::BitmapData_as::bitmapInfo().
Referenced by gnash::BitmapMovie::BitmapMovie().
void gnash::Bitmap::display | ( | Renderer & | renderer | ) | [virtual] |
Display this Bitmap.
Don't display cleared Bitmaps.
Implements gnash::DisplayObject.
References gnash::DisplayObject::pointInBounds().
SWFRect gnash::Bitmap::getBounds | ( | ) | const [virtual] |
Get the bounds of the Bitmap.
Implements gnash::DisplayObject.
void gnash::Bitmap::markReachableObjects | ( | ) | const [inline, protected] |
References gnash::BitmapData_as::setReachable().
bool gnash::Bitmap::pointInShape | ( | boost::int32_t | x, | |
boost::int32_t | y | |||
) | const [virtual] |
Test whether a point is in the Bitmap's bounds.
Implements gnash::DisplayObject.
void gnash::Bitmap::update | ( | ) | [virtual] |
Notify the Bitmap that it's been updated during ActionScript execution.
Nothing to do for disposed bitmaps.
Reimplemented from gnash::DisplayObject.
References gnash::DynamicShape::getBounds().