Go to the documentation of this file.
21 #ifndef GNASH_ASOBJ_BITMAPDATA_H
22 #define GNASH_ASOBJ_BITMAPDATA_H
28 #include <boost/intrusive_ptr.hpp>
89 return data()->
width();
112 return _cachedBitmap.get();
127 _attachedObjects.push_back(obj);
146 return image::begin<image::ARGB>(*data());
152 return image::end<image::ARGB>(*data());
161 return _cachedBitmap.get() ? &_cachedBitmap->image() : _image.get();
167 boost::intrusive_ptr<CachedBitmap> _cachedBitmap;
169 std::unique_ptr<image::GnashImage> _image;
171 std::list<DisplayObject*> _attachedObjects;
bool isNativeType(const as_object *obj, T *&relay)
Check whether the object is an instance of a known type.
Definition: as_object.h:875
BitmapData_as::iterator pix
Definition: BitmapData_as.cpp:568
double toNumber(const as_value &v, const VM &vm)
Convert an as_value to a double.
Definition: VM.cpp:451
BitmapData_as(as_object *owner, std::unique_ptr< image::GnashImage > im)
Construct a BitmapData.
Definition: BitmapData_as.cpp:599
bool isNaN(const T &num)
Definition: GnashNumeric.h:62
bool toBool(const as_value &v, const VM &vm)
Convert an as_value to boolean type.
Definition: VM.cpp:445
@ height
Definition: klash_part.cpp:329
std::int32_t toInt(const as_value &v, const VM &vm)
AS2-compatible conversion to 32bit integer.
Definition: VM.cpp:463
size_t width() const
Get the image's width.
Definition: GnashImage.h:126
The base class for all ActionScript objects.
Definition: as_object.h:162
const CachedBitmap * bitmapInfo() const
Return the image data.
Definition: BitmapData_as.h:111
void registerBitmapDataNative(as_object &global)
Definition: BitmapData_as.cpp:673
Renderer * renderer() const
Definition: RunResources.h:112
as_object * toObject(const as_value &v, VM &vm)
Convert an as_value to an object.
Definition: VM.cpp:457
@ T
Definition: GnashKey.h:132
void log_debug(StringType msg, Args... args)
Definition: log.h:301
std::int32_t y
Definition: BitmapData_as.cpp:435
@ i
Definition: GnashKey.h:155
Definition: Renderer.h:563
#define LOG_ONCE(x)
Definition: log.h:49
#define _(String)
Definition: log.h:44
The AVM1 virtual machine.
Definition: VM.h:72
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
Renderer * renderer() const
Definition: Renderer.h:573
@ g
Definition: GnashKey.h:153
Base class for different types of bitmaps.
Definition: GnashImage.h:78
Base class for render handlers.
Definition: Renderer.h:189
@ s
Definition: GnashKey.h:165
@ n
Definition: GnashKey.h:160
@ PROP_WIDTH
Definition: namedStrings.h:130
#define __FUNCTION__
Definition: log.h:437
Global_as & getGlobal(const as_environment &env)
Definition: as_environment.cpp:651
A MovieClip is a container for DisplayObjects.
Definition: MovieClip.h:84
VM & getVM(const as_environment &env)
Definition: as_environment.h:222
#define UNUSED(x)
Definition: utility.h:113
as_value getMember(as_object &o, const ObjectURI &uri)
Get a member of an object using AS lookup rules.
Definition: as_object.h:756
bool init_destructive_property(const ObjectURI &uri, as_function &getter, int flags=PropFlags::dontEnum)
Initialize a destructive getter property.
Definition: as_object.cpp:720
@ CHANNEL_GREEN
Definition: BitmapData_as.h:69
as_object * createObject(const Global_as &gl)
Definition: Global_as.cpp:303
@ t
Definition: GnashKey.h:166
const VGfloat color[4]
Definition: testr_gtk.cpp:82
@ r
Definition: GnashKey.h:164
VGPaint fill
Definition: testr_gtk.cpp:86
FunctionArgs< as_value > Args
Definition: fn_call.h:121
void for_each(C &container, R(T::*pmf)(const A &), const A &arg)
Definition: Renderer_ogl.cpp:690
void draw(MovieClip &mc, const Transform &transform)
Draw a MovieClip to a BitmapData.
Definition: BitmapData_as.cpp:639
bool disposed() const
Whether the BitmapData has been disposed.
Definition: BitmapData_as.h:139
@ a
Definition: GnashKey.h:147
This is the base class for type-specific object data.
Definition: Relay.h:50
void updateObjects() const
Inform any attached objects that the data has changed.
Definition: BitmapData_as.cpp:623
const RunResources & getRunResources(const as_object &o)
Get the RunResources from an as_object.
Definition: as_object.cpp:1142
type
Definition: GnashKey.h:330
SWFMatrix toSWFMatrix(as_object &m)
Convert an object to a SWFMatrix.
Definition: ASConversions.cpp:45
The pixel_iterator class is a pixel-level adaptor for a GnashImage.
Definition: ImageIterators.h:126
#define IF_VERBOSE_ASCODING_ERRORS(x)
Definition: log.h:397
as_object * constructInstance(as_function &ctor, const as_environment &env, fn_call::Args &args)
Definition: as_function.cpp:47
@ h
Definition: GnashKey.h:154
image::pixel_iterator< image::ARGB > iterator
Definition: BitmapData_as.h:74
void registerNative(as_c_function_ptr fun, unsigned int x, unsigned int y)
Definition: VM.cpp:268
@ PROP_X
Definition: namedStrings.h:131
@ p
Definition: GnashKey.h:162
size_t height() const
Return the height of the image.
Definition: BitmapData_as.h:95
virtual void setReachable()
Overrides Relay::setReachable().
Definition: BitmapData_as.cpp:615
@ CHANNEL_RED
Definition: BitmapData_as.h:68
virtual void update()
Notify a change in the DisplayObject's appearance.
Definition: DisplayObject.h:667
Channel
Definition: BitmapData_as.h:67
T clamp(T i, T min, T max)
Definition: GnashNumeric.h:77
@ onlySWF8Up
Only visible by VM initialized for version 8 or higher.
Definition: PropFlags.h:54
@ j
Definition: GnashKey.h:156
iterator end() const
Return a BitmapData_as::iterator to a one-past-the end pixel.
Definition: BitmapData_as.h:150
virtual ~BitmapData_as()
Definition: BitmapData_as.h:82
void log_aserror(StringType msg, Args... args)
Definition: log.h:331
uri
Definition: test.py:12
void bitmapdata_class_init(as_object &where, const ObjectURI &uri)
Initialize the global BitmapData class.
Definition: BitmapData_as.cpp:664
@ c
Definition: GnashKey.h:149
@ CHANNEL_BLUE
Definition: BitmapData_as.h:70
@ PROP_uuPROTOuu
Definition: namedStrings.h:118
DisplayObject is the base class for all DisplayList objects.
Definition: DisplayObject.h:169
Implements the BitmapData native type.
Definition: BitmapData_as.h:64
@ source
Definition: klash_part.cpp:329
@ PROP_HEIGHT
Definition: namedStrings.h:78
SWFCxForm toCxForm(const ColorTransform_as &tr)
Convert a ColorTransform_as to a SWFCxForm record.
Definition: ASConversions.cpp:85
@ o
Definition: GnashKey.h:161
@ width
Definition: klash_part.cpp:329
void foreachArray(as_object &array, T &pred)
Definition: Array_as.h:78
void dispose()
Free the bitmap data.
Definition: BitmapData_as.cpp:630
void log_unimpl(StringType msg, Args... args)
Definition: log.h:289
@ PROP_Y
Definition: namedStrings.h:132
@ PROP_PROTOTYPE
Definition: namedStrings.h:87
@ u
Definition: GnashKey.h:167
A URI for describing as_objects.
Definition: ObjectURI.h:45
A CachedBitmap is created by the renderer in a format of its choosing.
Definition: CachedBitmap.h:38
std::int32_t x
Definition: BitmapData_as.cpp:434
as_object * findObject(const as_environment &ctx, const std::string &path, const as_environment::ScopeStack *scope)
Find the object referenced by the given path.
Definition: as_environment.cpp:116
@ b
Definition: GnashKey.h:148
@ e
Definition: GnashKey.h:151
@ TYPE_RGBA
Definition: GnashImage.h:50
size_t width() const
Return the width of the image.
Definition: BitmapData_as.h:87
bool transparent() const
Whether the BitmapData_as has transparency.
Definition: BitmapData_as.h:103
@ CHANNEL_ALPHA
Definition: BitmapData_as.h:71
size_t height() const
Get the image's width.
Definition: GnashImage.h:133
void attach(DisplayObject *obj)
Attach this BitmapData to an object.
Definition: BitmapData_as.h:126
void draw(Renderer &renderer, const Transform &xform)
Draw this MovieClip.
Definition: MovieClip.cpp:1195
void setReachable() const
Mark this resource as being reachable.
Definition: GC.h:92
iterator begin() const
Return a BitmapData_as::iterator to the first pixel in the data.
Definition: BitmapData_as.h:144