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

A "movie" definition for a bitmap file. More...

#include <BitmapMovieDefinition.h>

Inheritance diagram for gnash::BitmapMovieDefinition:
gnash::movie_definition gnash::SWF::DefinitionTag gnash::SWF::ControlTag gnash::ref_counted

Public Member Functions

 BitmapMovieDefinition (std::unique_ptr< image::GnashImage > image, Renderer *renderer, std::string url)
 Construct a BitmapMovieDefinition for the given image (rgb) More...
 
virtual DisplayObjectcreateDisplayObject (Global_as &, DisplayObject *) const
 Create a DisplayObject with the given parent. More...
 
virtual int get_version () const
 
virtual size_t get_width_pixels () const
 Frame width in pixels. More...
 
virtual size_t get_height_pixels () const
 Frame height in pixels. More...
 
virtual size_t get_frame_count () const
 
virtual float get_frame_rate () const
 
virtual const SWFRectget_frame_size () const
 Return size of frame, in TWIPS. More...
 
virtual size_t get_bytes_loaded () const
 Return number of bytes loaded. More...
 
virtual size_t get_bytes_total () const
 Return total number of bytes which composed this movie. More...
 
virtual MoviecreateMovie (Global_as &gl, DisplayObject *parent=nullptr)
 Create a playable Movie from this def. More...
 
virtual const std::string & get_url () const
 Return the URL of the SWF stream this definition has been read from. More...
 
size_t get_loading_frame () const
 Returns 1 based index. Ex: if 1 then 1st frame as been fully loaded. More...
 
const CachedBitmapbitmap () const
 
- Public Member Functions inherited from gnash::movie_definition
virtual void incrementLoadedFrames ()
 
virtual const PlayListgetPlaylist (size_t) const
 Return the list of execute tags for given frame number. More...
 
virtual void importResources (boost::intrusive_ptr< movie_definition >, const Imports &)
 Import resources. More...
 
virtual DefinitionTaggetDefinitionTag (std::uint16_t) const
 Get a DisplayObject from the dictionary. More...
 
virtual bool get_labeled_frame (const std::string &, size_t &) const
 Get 0-based index of the frame with given label. More...
 
virtual void addDisplayObject (std::uint16_t, DefinitionTag *)
 Add a DefinitionTag with given ID to the CharactersDictionary. More...
 
virtual void add_font (int, boost::intrusive_ptr< Font >)
 Add a font DisplayObject with given ID to the CharacterDictionary. More...
 
virtual Fontget_font (int) const
 Return the font with given DisplayObject id. More...
 
virtual Fontget_font (const std::string &, bool, bool) const
 Find a font from the movie (not shared) lib. More...
 
virtual void addControlTag (boost::intrusive_ptr< SWF::ControlTag >)
 Add an ControlTag to this movie_definition's playlist. More...
 
virtual void add_frame_name (const std::string &)
 Labels the frame currently being loaded with the given name. More...
 
virtual void set_jpeg_loader (std::unique_ptr< image::JpegInput >)
 
virtual image::JpegInputget_jpeg_loader () const
 Get the jpeg input loader, to load a DefineBits image (one without table info). More...
 
virtual CachedBitmapgetBitmap (int) const
 Get a bitmap from the bitmap dictionary. More...
 
virtual void addBitmap (int, boost::intrusive_ptr< CachedBitmap >)
 Add a bitmap DisplayObject in the dictionary, with the specified DisplayObject id. More...
 
virtual sound_sampleget_sound_sample (int) const
 Get the sound sample with given ID. More...
 
virtual void add_sound_sample (int, sound_sample *)
 Add a sound sample DisplayObject in the dictionary, with the specified DisplayObject id. More...
 
virtual void set_loading_sound_stream_id (int)
 Set the currently being loaded sound stream. More...
 
virtual int get_loading_sound_stream_id () const
 Get the currently being loaded sound stream, if any. More...
 
virtual void registerExport (const std::string &, std::uint16_t)
 Register a symbol to refer to a character id. More...
 
virtual std::uint16_t exportID (const std::string &) const
 Get the id that corresponds to a symbol. More...
 
virtual void setAS3 ()
 Set whether the SWFMovie should use AVM2 or AVM1. More...
 
virtual bool isAS3 () const
 True if the SWFMovie should use AVM2. More...
 
virtual bool completeLoad ()
 
virtual bool ensure_frame_loaded (size_t) const
 Ensure that frame number 'framenum' (1-based offset) has been loaded (load on demand). More...
 
- Public Member Functions inherited from gnash::SWF::DefinitionTag
virtual ~DefinitionTag ()
 
virtual DSOTEXPORT void executeState (MovieClip *m, DisplayList &) const
 Executing a DefinitionTag adds its id to list of known characters. More...
 
std::uint16_t id () const
 The immutable id of the DefinitionTag. More...
 
- Public Member Functions inherited from gnash::SWF::ControlTag
virtual ~ControlTag ()
 
virtual void executeActions (MovieClip *, DisplayList &) const
 Execute Action tags. More...
 
- Public Member Functions inherited from gnash::ref_counted
 ref_counted ()
 
 ref_counted (const ref_counted &)
 
void add_ref () const
 
void drop_ref () const
 
long get_ref_count () const
 

Additional Inherited Members

- Public Types inherited from gnash::movie_definition
typedef std::vector< boost::intrusive_ptr< SWF::ControlTag > > PlayList
 
typedef std::pair< int, std::string > ImportSpec
 
typedef std::vector< ImportSpecImports
 
- Public Types inherited from gnash::SWF::ControlTag
enum  Type { TAG_ACTION = 1 << 0, TAG_DLIST = 1 << 1 }
 Type of ControlTag. More...
 
- Protected Member Functions inherited from gnash::movie_definition
 movie_definition (std::uint16_t id=0)
 
virtual ~movie_definition ()
 
- Protected Member Functions inherited from gnash::SWF::DefinitionTag
 DefinitionTag (std::uint16_t id)
 
- Protected Member Functions inherited from gnash::ref_counted
virtual ~ref_counted ()
 

Detailed Description

A "movie" definition for a bitmap file.

The createMovie function will return a BitmapMovie

Constructor & Destructor Documentation

§ BitmapMovieDefinition()

gnash::BitmapMovieDefinition::BitmapMovieDefinition ( std::unique_ptr< image::GnashImage image,
Renderer renderer,
std::string  url 
)

Construct a BitmapMovieDefinition for the given image (rgb)

Will be initialized with the following values

  • SWF version 6
  • Framesize extracted from image
  • Single frame (unlabeled)
  • 12 FPS
  • image->size() bytes (for get_bytes_loaded()/get_bytes_total())
  • provided url

Member Function Documentation

§ bitmap()

const CachedBitmap* gnash::BitmapMovieDefinition::bitmap ( ) const
inline

§ createDisplayObject()

DisplayObject * gnash::BitmapMovieDefinition::createDisplayObject ( Global_as gl,
DisplayObject parent 
) const
virtual

Create a DisplayObject with the given parent.

This function will determine the correct prototype and associated object using the passed global.

Parameters
glThe global object used to set prototype and associated object. Calling this function creates a new DisplayObject from the DefinitionTag and adds it as a child of the specified parent DisplayObject.

Implements gnash::SWF::DefinitionTag.

§ createMovie()

Movie * gnash::BitmapMovieDefinition::createMovie ( Global_as gl,
DisplayObject parent = nullptr 
)
virtual

Create a playable Movie from this def.

Reimplemented from gnash::movie_definition.

References gnash::NSV::CLASS_MOVIE_CLIP, gnash::getObjectWithPrototype(), and gnash::key::o.

§ get_bytes_loaded()

virtual size_t gnash::BitmapMovieDefinition::get_bytes_loaded ( ) const
inlinevirtual

Return number of bytes loaded.

Since no progressive load is implemented yet we'll always return total bytes here..

Implements gnash::movie_definition.

§ get_bytes_total()

virtual size_t gnash::BitmapMovieDefinition::get_bytes_total ( ) const
inlinevirtual

Return total number of bytes which composed this movie.

We actually cheat, and return the image size here...

Implements gnash::movie_definition.

§ get_frame_count()

virtual size_t gnash::BitmapMovieDefinition::get_frame_count ( ) const
inlinevirtual

§ get_frame_rate()

virtual float gnash::BitmapMovieDefinition::get_frame_rate ( ) const
inlinevirtual

§ get_frame_size()

virtual const SWFRect& gnash::BitmapMovieDefinition::get_frame_size ( ) const
inlinevirtual

Return size of frame, in TWIPS.

Implements gnash::movie_definition.

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

§ get_height_pixels()

virtual size_t gnash::BitmapMovieDefinition::get_height_pixels ( ) const
inlinevirtual

Frame height in pixels.

The frame size is in twips and may be rounded up.

Implements gnash::movie_definition.

References gnash::twipsToPixels().

Referenced by gnash::BitmapMovie::heightPixels().

§ get_loading_frame()

size_t gnash::BitmapMovieDefinition::get_loading_frame ( ) const
inlinevirtual

Returns 1 based index. Ex: if 1 then 1st frame as been fully loaded.

Implements gnash::movie_definition.

§ get_url()

virtual const std::string& gnash::BitmapMovieDefinition::get_url ( ) const
inlinevirtual

Return the URL of the SWF stream this definition has been read from.

Implements gnash::movie_definition.

Referenced by gnash::BitmapMovie::url().

§ get_version()

virtual int gnash::BitmapMovieDefinition::get_version ( ) const
inlinevirtual

§ get_width_pixels()

virtual size_t gnash::BitmapMovieDefinition::get_width_pixels ( ) const
inlinevirtual

Frame width in pixels.

The frame size is in twips and may be rounded up.

Implements gnash::movie_definition.

References gnash::twipsToPixels().

Referenced by gnash::BitmapMovie::widthPixels().


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