Gnash 0.8.10dev
|
Implements the BitmapData native type. More...
#include <BitmapData_as.h>
Public Types | |
typedef image::pixel_iterator < image::ARGB > | iterator |
Public Member Functions | |
BitmapData_as (as_object *owner, std::auto_ptr< image::GnashImage > im) | |
Construct a BitmapData. | |
virtual | ~BitmapData_as () |
size_t | width () const |
Return the width of the image. | |
size_t | height () const |
Return the height of the image. | |
bool | transparent () const |
const CachedBitmap * | bitmapInfo () const |
void | setPixel (size_t x, size_t y, boost::uint32_t color) const |
Set a specified pixel to the specified color. | |
void | setPixel32 (size_t x, size_t y, boost::uint32_t color) const |
Set a specified pixel to the specified color. | |
boost::uint32_t | getPixel (size_t x, size_t y) const |
Returns the value of the pixel at (x, y). | |
void | fillRect (int x, int y, int w, int h, boost::uint32_t color) |
Fill the bitmap with a colour starting at x, y. | |
void | floodFill (size_t x, size_t y, boost::uint32_t old, boost::uint32_t fill) |
void | dispose () |
Free the bitmap data. | |
void | draw (MovieClip &mc, const Transform &transform) |
Draw a MovieClip to a BitmapData. | |
void | attach (DisplayObject *obj) |
Attach this BitmapData to an object. | |
virtual void | setReachable () |
Overrides Relay::setReachable(). | |
bool | disposed () const |
Whether the BitmapData has been disposed. | |
iterator | begin () const |
iterator | end () const |
void | updateObjects () |
Inform any attached objects that the data has changed. |
Implements the BitmapData native type.
All functions can be called if the BitmapData has been disposed. Callers do not need to check.
gnash::BitmapData_as::BitmapData_as | ( | as_object * | owner, |
std::auto_ptr< image::GnashImage > | im | ||
) |
Construct a BitmapData.
The constructor sets the immutable size of the bitmap, as well as whether it can handle transparency or not.
References assert, gnash::getRunResources(), gnash::key::r, and gnash::RunResources::renderer().
virtual gnash::BitmapData_as::~BitmapData_as | ( | ) | [inline, virtual] |
void gnash::BitmapData_as::attach | ( | DisplayObject * | obj | ) | [inline] |
Attach this BitmapData to an object.
This may be either as a fill or an attached Bitmap.
Referenced by gnash::Bitmap::construct().
iterator gnash::BitmapData_as::begin | ( | ) | const [inline] |
References assert, and disposed().
Referenced by fillRect().
const CachedBitmap* gnash::BitmapData_as::bitmapInfo | ( | ) | const [inline] |
void gnash::BitmapData_as::dispose | ( | ) |
Free the bitmap data.
References updateObjects().
bool gnash::BitmapData_as::disposed | ( | ) | const [inline] |
Whether the BitmapData has been disposed.
Referenced by begin(), gnash::Bitmap::Bitmap(), draw(), end(), fillRect(), getPixel(), setPixel(), setPixel32(), and gnash::Bitmap::update().
Draw a MovieClip to a BitmapData.
References _, disposed(), gnash::MovieClip::draw(), gnash::getRunResources(), gnash::Renderer::Internal::renderer(), gnash::RunResources::renderer(), and updateObjects().
iterator gnash::BitmapData_as::end | ( | ) | const [inline] |
References assert, and disposed().
Referenced by fillRect(), and floodFill().
void gnash::BitmapData_as::fillRect | ( | int | x, |
int | y, | ||
int | w, | ||
int | h, | ||
boost::uint32_t | color | ||
) |
Fill the bitmap with a colour starting at x, y.
Negative values are handled correctly.
References assert, begin(), disposed(), gnash::key::e, end(), gnash::key::h, updateObjects(), and width().
void gnash::BitmapData_as::floodFill | ( | size_t | x, |
size_t | y, | ||
boost::uint32_t | old, | ||
boost::uint32_t | fill | ||
) |
References assert, end(), height(), gnash::key::p, pix, transparent(), updateObjects(), width(), x, and y.
boost::uint32_t gnash::BitmapData_as::getPixel | ( | size_t | x, |
size_t | y | ||
) | const |
Returns the value of the pixel at (x, y).
Returns 0 if the pixel is out of range or the image has been disposed.
References disposed(), height(), and width().
size_t gnash::BitmapData_as::height | ( | ) | const [inline] |
Return the height of the image.
Do not call if disposed!
References assert, and gnash::image::GnashImage::height().
Referenced by floodFill(), getPixel(), setPixel(), and setPixel32().
void gnash::BitmapData_as::setPixel | ( | size_t | x, |
size_t | y, | ||
boost::uint32_t | color | ||
) | const |
Set a specified pixel to the specified color.
Retains transparency value for BitmapDatas with transparency.
References disposed(), height(), and width().
void gnash::BitmapData_as::setPixel32 | ( | size_t | x, |
size_t | y, | ||
boost::uint32_t | color | ||
) | const |
Set a specified pixel to the specified color.
References disposed(), height(), and width().
void gnash::BitmapData_as::setReachable | ( | ) | [virtual] |
Overrides Relay::setReachable().
Reimplemented from gnash::Relay.
References gnash::for_each(), and gnash::GcResource::setReachable().
Referenced by gnash::Bitmap::markReachableObjects().
bool gnash::BitmapData_as::transparent | ( | ) | const [inline] |
References assert, and gnash::image::TYPE_RGBA.
Referenced by floodFill().
void gnash::BitmapData_as::updateObjects | ( | ) |
Inform any attached objects that the data has changed.
References gnash::for_each(), and gnash::DisplayObject::update().
Referenced by dispose(), draw(), fillRect(), and floodFill().
size_t gnash::BitmapData_as::width | ( | ) | const [inline] |
Return the width of the image.
Do not call if disposed!
References assert, and gnash::image::GnashImage::width().
Referenced by fillRect(), floodFill(), getPixel(), setPixel(), and setPixel32().