15 #ifndef MOVIETEXTURE_H
16 #define MOVIETEXTURE_H
18 #include "pandabase.h"
22 #include "movieVideo.h"
23 #include "movieVideoCursor.h"
24 #include "audioSound.h"
25 #include "pipelineCycler.h"
26 #include "cycleData.h"
27 #include "cycleDataWriter.h"
28 #include "cycleDataReader.h"
35 class EXPCL_PANDA_GRUTIL MovieTexture :
public Texture {
37 MovieTexture(
const string &name);
40 MovieTexture(
const MovieTexture ©);
42 virtual ~MovieTexture();
44 INLINE
double get_video_length()
const;
45 INLINE
int get_video_width()
const;
46 INLINE
int get_video_height()
const;
54 void set_time(
double t);
55 double get_time()
const;
56 void set_loop(
bool enable);
57 bool get_loop()
const;
58 void set_loop_count(
int count);
59 int get_loop_count()
const;
60 void set_play_rate(
double play_rate);
61 double get_play_rate()
const;
62 bool is_playing()
const;
69 static PT(
Texture) make_texture();
70 virtual
bool has_cull_callback() const;
76 virtual PT(
Texture) make_copy_impl();
77 void do_assign(CData *cdata,
Texture::CData *cdata_tex, const MovieTexture *copy,
78 const CData *cdata_copy, const
Texture::CData *cdata_copy_tex);
80 virtual
void do_reload_ram_image(
Texture::CData *cdata,
bool allow_compression);
81 virtual
bool get_keep_ram_image() const;
82 virtual
bool do_has_bam_rawdata(const
Texture::CData *cdata) const;
83 virtual
void do_get_bam_rawdata(
Texture::CData *cdata);
84 virtual
bool do_can_reload(const
Texture::CData *cdata) const;
86 virtual
bool do_adjust_this_size(const
Texture::CData *cdata,
87 int &x_size,
int &y_size, const
string &name,
88 bool for_padding) const;
90 virtual
bool do_read_one(
Texture::CData *cdata,
92 int z,
int n,
int primary_file_num_channels,
int alpha_file_channel,
95 virtual
bool do_load_one(
Texture::CData *cdata,
96 const
PNMImage &pnmimage, const
string &name,
98 bool do_load_one(
Texture::CData *cdata,
101 virtual
void do_allocate_pages(
Texture::CData *cdata);
113 typedef
pvector<VideoPage> Pages;
115 class EXPCL_PANDA_GRUTIL CData : public
CycleData {
118 CData(
const CData ©);
119 virtual CycleData *make_copy()
const;
121 return MovieTexture::get_class_type();
127 double _video_length;
139 int _true_loop_count;
146 void do_recalculate_image_properties(CData *cdata,
Texture::CData *cdata_tex,
150 bool do_update_frames(const CData *cdata) const;
153 static
void register_with_read_factory();
160 virtual
void finalize(
BamReader *manager);
166 static void init_type() {
167 Texture::init_type();
168 register_type(_type_handle,
"MovieTexture",
169 Texture::get_class_type());
172 return get_class_type();
174 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
180 #include "movieTexture.I"
virtual void ensure_loader_type(const Filename &filename)
May be called prior to calling read_txo() or any bam-related Texture-creating callback, to ensure that the proper dynamic libraries for a Texture of the current class type, and the indicated filename, have been already loaded.
This class maintains different copies of a page of data between stages of the graphics pipeline (or a...
The name of this class derives from the fact that we originally implemented it as a layer on top of t...
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Specifies parameters that may be passed to the loader.
A single page of data maintained by a PipelineCycler.
Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-...
Base class for objects that can be written to and read from Bam files.
This collects together the pieces of data that are accumulated for each node while walking the scene ...
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
This is our own Panda specialization on the default STL list.
This template class calls PipelineCycler::read_unlocked(), and then provides a transparent read-only ...
This is our own Panda specialization on the default STL vector.
The name of a file, such as a texture file or an Egg file.
An instance of this class is written to the front of a Bam or Txo file to make the file a cached inst...
A MovieVideo is actually any source that provides a sequence of video frames.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
This template class calls PipelineCycler::write() in the constructor and PipelineCycler::release_writ...
A MovieVideo is actually any source that provides a sequence of video frames.
A class to retrieve the individual data elements previously stored in a Datagram. ...
TypeHandle is the identifier used to differentiate C++ class types.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling...