Go to the documentation of this file.
14 #ifndef MOVIETEXTURE_H
15 #define MOVIETEXTURE_H
33 class EXPCL_PANDA_GRUTIL MovieTexture :
public Texture {
35 explicit MovieTexture(
const std::string &name);
37 MovieTexture(
const MovieTexture ©) =
delete;
38 virtual ~MovieTexture();
40 INLINE
double get_video_length()
const;
41 INLINE
int get_video_width()
const;
42 INLINE
int get_video_height()
const;
50 void set_time(
double t);
51 double get_time()
const;
52 void set_loop(
bool enable);
53 bool get_loop()
const;
54 void set_loop_count(
int count);
55 int get_loop_count()
const;
56 void set_play_rate(
double play_rate);
57 double get_play_rate()
const;
58 bool is_playing()
const;
63 MAKE_PROPERTY(video_length, get_video_length);
64 MAKE_PROPERTY(video_width, get_video_width);
65 MAKE_PROPERTY(video_height, get_video_height);
67 MAKE_PROPERTY(time, get_time, set_time);
68 MAKE_PROPERTY(loop, get_loop, set_loop);
69 MAKE_PROPERTY(loop_count, get_loop_count, set_loop_count);
70 MAKE_PROPERTY(play_rate, get_play_rate, set_play_rate);
71 MAKE_PROPERTY(playing, is_playing);
76 static PT(
Texture) make_texture();
83 virtual PT(
Texture) make_copy_impl()
const;
84 void do_assign(CData *cdata, Texture::CData *cdata_tex,
const MovieTexture *copy,
85 const CData *cdata_copy,
const Texture::CData *cdata_copy_tex);
87 virtual void do_reload_ram_image(Texture::CData *cdata,
bool allow_compression);
89 virtual bool do_has_bam_rawdata(
const Texture::CData *cdata)
const;
90 virtual void do_get_bam_rawdata(Texture::CData *cdata);
91 virtual bool do_can_reload(
const Texture::CData *cdata)
const;
93 virtual bool do_adjust_this_size(
const Texture::CData *cdata,
94 int &x_size,
int &y_size,
const std::string &name,
95 bool for_padding)
const;
97 virtual bool do_read_one(Texture::CData *cdata,
99 int z,
int n,
int primary_file_num_channels,
int alpha_file_channel,
102 virtual bool do_load_one(Texture::CData *cdata,
103 const PNMImage &pnmimage,
const std::string &name,
105 virtual bool do_load_one(Texture::CData *cdata,
106 const PfmFile &pfm,
const std::string &name,
108 bool do_load_one(Texture::CData *cdata,
111 virtual void do_allocate_pages(Texture::CData *cdata);
125 class EXPCL_PANDA_GRUTIL CData :
public CycleData {
128 CData(
const CData ©);
131 return MovieTexture::get_class_type();
137 double _video_length;
149 int _true_loop_count;
156 void do_recalculate_image_properties(CData *cdata, Texture::CData *cdata_tex,
160 bool do_update_frames(
const CData *cdata)
const;
163 static void register_with_read_factory();
167 virtual void do_write_datagram_rawdata(Texture::CData *cdata,
BamWriter *manager,
Datagram &me);
170 virtual void finalize(
BamReader *manager);
176 static void init_type() {
177 Texture::init_type();
179 Texture::get_class_type());
182 return get_class_type();
184 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
A single page of data maintained by a PipelineCycler.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is our own Panda specialization on the default STL vector.
virtual TypeHandle get_parent_type() const
Returns the type of the container that owns the CycleData.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A class to retrieve the individual data elements previously stored in a Datagram.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling,...
Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-...
Specifies parameters that may be passed to the loader.
Base class for objects that can be written to and read from Bam files.
The name of this class derives from the fact that we originally implemented it as a layer on top of t...
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Defines a pfm file, a 2-d table of floating-point numbers, either 3-component or 1-component,...
TypeHandle is the identifier used to differentiate C++ class types.
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...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This template class calls PipelineCycler::read_unlocked(), and then provides a transparent read-only ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This collects together the pieces of data that are accumulated for each node while walking the scene ...
This is our own Panda specialization on the default STL list.
A MovieVideo is actually any source that provides a sequence of video frames.
virtual bool cull_callback(CullTraverser *trav, const CullTraverserData &data) const
If has_cull_callback() returns true, this function will be called during the cull traversal to perfor...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_keep_ram_image
Returns the flag that indicates whether this Texture is eligible to have its main RAM copy of the tex...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void ensure_loader_type(const Filename &filename)
May be called prior to calling read_txo() or any bam-related Texture- creating callback,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual int complete_pointers(TypedWritable **p_list, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
The name of a file, such as a texture file or an Egg file.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual bool has_cull_callback() const
Should be overridden by derived classes to return true if cull_callback() has been defined.