Gnash  0.8.11dev
Public Types | Public Member Functions | List of all members
gnash::BitmapData_as Class Reference

Implements the BitmapData native type. More...

#include <BitmapData_as.h>

Inheritance diagram for gnash::BitmapData_as:
gnash::Relay

Public Types

enum  Channel { CHANNEL_RED = 1, CHANNEL_GREEN = 2, CHANNEL_BLUE = 4, CHANNEL_ALPHA = 8 }
 
typedef image::pixel_iterator< image::ARGBiterator
 

Public Member Functions

 BitmapData_as (as_object *owner, std::unique_ptr< image::GnashImage > im)
 Construct a BitmapData. More...
 
virtual ~BitmapData_as ()
 
size_t width () const
 Return the width of the image. More...
 
size_t height () const
 Return the height of the image. More...
 
bool transparent () const
 Whether the BitmapData_as has transparency. More...
 
const CachedBitmapbitmapInfo () const
 Return the image data. More...
 
void dispose ()
 Free the bitmap data. More...
 
void draw (MovieClip &mc, const Transform &transform)
 Draw a MovieClip to a BitmapData. More...
 
void attach (DisplayObject *obj)
 Attach this BitmapData to an object. More...
 
virtual void setReachable ()
 Overrides Relay::setReachable(). More...
 
bool disposed () const
 Whether the BitmapData has been disposed. More...
 
iterator begin () const
 Return a BitmapData_as::iterator to the first pixel in the data. More...
 
iterator end () const
 Return a BitmapData_as::iterator to a one-past-the end pixel. More...
 
void updateObjects () const
 Inform any attached objects that the data has changed. More...
 
- Public Member Functions inherited from gnash::Relay
virtual ~Relay ()=0
 
virtual void clean ()
 Handle any cleanup necessary before the Relay is destroyed. More...
 

Detailed Description

Implements the BitmapData native type.

This class gives access to a Bitmap that may be attached to a MovieClip and rendered directly. The underlying data may therefore be stored in a Renderer, for instance, and only retrieved from there when a BitmapData instance requires access to it. Because this retrieval can be expensive, it is advisable not to call member functions frequently, but rather to access the data through iterators. To facilitate this, iterators are random access. There is also overhead to calling functions such as width() and height(), again because the image data is retrieve from the Renderer. The size is immutable, so these dimensions can safely be cached.

Member Typedef Documentation

§ iterator

Member Enumeration Documentation

§ Channel

Enumerator
CHANNEL_RED 
CHANNEL_GREEN 
CHANNEL_BLUE 
CHANNEL_ALPHA 

Constructor & Destructor Documentation

§ BitmapData_as()

gnash::BitmapData_as::BitmapData_as ( as_object owner,
std::unique_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 gnash::getRunResources(), gnash::key::r, and gnash::RunResources::renderer().

Referenced by gnash::registerBitmapDataNative().

§ ~BitmapData_as()

virtual gnash::BitmapData_as::~BitmapData_as ( )
inlinevirtual

Member Function Documentation

§ attach()

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().

§ begin()

iterator gnash::BitmapData_as::begin ( ) const
inline

Return a BitmapData_as::iterator to the first pixel in the data.

References data.

Referenced by gnash::registerBitmapDataNative().

§ bitmapInfo()

const CachedBitmap* gnash::BitmapData_as::bitmapInfo ( ) const
inline

Return the image data.

This is only for use by containes

Referenced by gnash::Bitmap::~Bitmap().

§ dispose()

void gnash::BitmapData_as::dispose ( )

Free the bitmap data.

This potentially frees the data.

References updateObjects().

Referenced by gnash::registerBitmapDataNative().

§ disposed()

bool gnash::BitmapData_as::disposed ( ) const
inline

Whether the BitmapData has been disposed.

Any callers requiring access to the data or any properties should check that this is false first. Particularly width(), height(), transparent(), begin(), end() may only be called if the BitmapData_as has not been disposed.

References data.

Referenced by draw(), gnash::registerBitmapDataNative(), and gnash::Bitmap::update().

§ draw()

void gnash::BitmapData_as::draw ( MovieClip mc,
const Transform transform 
)

§ end()

iterator gnash::BitmapData_as::end ( ) const
inline

Return a BitmapData_as::iterator to a one-past-the end pixel.

References data.

Referenced by gnash::registerBitmapDataNative().

§ height()

size_t gnash::BitmapData_as::height ( ) const
inline

Return the height of the image.

Do not call if disposed!

References data.

Referenced by gnash::registerBitmapDataNative().

§ setReachable()

void gnash::BitmapData_as::setReachable ( )
virtual

§ transparent()

bool gnash::BitmapData_as::transparent ( ) const
inline

Whether the BitmapData_as has transparency.

Do not call if disposed!

References data, and gnash::image::TYPE_RGBA.

Referenced by gnash::registerBitmapDataNative().

§ updateObjects()

void gnash::BitmapData_as::updateObjects ( ) const

Inform any attached objects that the data has changed.

References gnash::renderer::opengl::for_each(), and gnash::DisplayObject::update().

Referenced by dispose(), draw(), and gnash::registerBitmapDataNative().

§ width()

size_t gnash::BitmapData_as::width ( ) const
inline

Return the width of the image.

Do not call if disposed!

References data.

Referenced by gnash::registerBitmapDataNative().


The documentation for this class was generated from the following files: