Implements the BitmapData native type. More...
#include <BitmapData_as.h>
Public Member Functions | |
| BitmapData_as (as_object *owner, std::auto_ptr< GnashImage > im, boost::uint32_t fillColor) | |
| 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) |
| Set a specified pixel to the specified color. | |
| void | setPixel32 (size_t x, size_t y, boost::uint32_t color) |
| 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 | dispose () |
| Free the bitmap data. | |
| 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. | |
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< GnashImage > | im, | |||
| boost::uint32_t | fillColor | |||
| ) |
Construct a BitmapData.
The constructor sets the fill colour and the immutable size of the bitmap, as well as whether it can handle transparency or not.
| 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.
| const CachedBitmap* gnash::BitmapData_as::bitmapInfo | ( | ) | const [inline] |
Referenced by gnash::Bitmap::construct().
| void gnash::BitmapData_as::dispose | ( | ) |
Free the bitmap data.
| bool gnash::BitmapData_as::disposed | ( | ) | const [inline] |
Whether the BitmapData has been disposed.
Referenced by gnash::Bitmap::Bitmap(), and getPixel().
| 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 gnash::for_each(), and gnash::DisplayObject::update().
| 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 gnash::GnashImage::argb_begin(), disposed(), height(), gnash::pixel_iterator< Iterator, Pixel >::toARGB(), and width().
| size_t gnash::BitmapData_as::height | ( | ) | const [inline] |
Return the height of the image.
Do not call if disposed!
References gnash::GnashImage::height().
Referenced by getPixel().
| void gnash::BitmapData_as::setPixel | ( | size_t | x, | |
| size_t | y, | |||
| boost::uint32_t | color | |||
| ) |
Set a specified pixel to the specified color.
Retains transparency value for BitmapDatas with transparency.
References gnash::for_each(), and gnash::GcResource::setReachable().
| void gnash::BitmapData_as::setPixel32 | ( | size_t | x, | |
| size_t | y, | |||
| boost::uint32_t | color | |||
| ) |
Set a specified pixel to the specified color.
| void gnash::BitmapData_as::setReachable | ( | ) | [virtual] |
Overrides Relay::setReachable().
Reimplemented from gnash::Relay.
Referenced by gnash::Bitmap::markReachableObjects().
| bool gnash::BitmapData_as::transparent | ( | ) | const [inline] |
References gnash::GNASH_IMAGE_RGBA.
| size_t gnash::BitmapData_as::width | ( | ) | const [inline] |
Return the width of the image.
Do not call if disposed!
References gnash::GnashImage::width().
Referenced by getPixel().
1.7.1