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);
88 virtual bool get_keep_ram_image()
const;
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();}
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.
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.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual TypeHandle get_parent_type() const
Returns the type of the container that owns the CycleData.
This collects together the pieces of data that are accumulated for each node while walking the scene ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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.
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...
The name of a file, such as a texture file or an Egg file.
Defines a pfm file, a 2-d table of floating-point numbers, either 3-component or 1-component,...
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
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().
This template class calls PipelineCycler::write() in the constructor and PipelineCycler::release_writ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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 ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling,...
virtual bool has_cull_callback() const
Should be overridden by derived classes to return true if cull_callback() has been defined.