26 VideoTexture(
const std::string &name) :
31 cdata->_compression = CM_off;
36 _last_frame_update = 0;
47 _video_width(copy._video_width),
48 _video_height(copy._video_height),
49 _last_frame_update(copy._last_frame_update),
50 _current_frame(copy._current_frame)
100 set_video_size(
int video_width,
int video_height) {
101 _video_width = video_width;
102 _video_height = video_height;
106 do_set_pad_size(cdata,
107 std::max(cdata->_x_size - _video_width, 0),
108 std::max(cdata->_y_size - _video_height, 0),
117 do_has_ram_image(
const Texture::CData *cdata)
const {
119 if (this_frame != _last_frame_update) {
122 return !cdata->_ram_images.empty() && !cdata->_ram_images[0]._image.empty();
149 Texture::CData *VideoTexture::
150 unlocked_ensure_ram_image(
bool allow_compression) {
154 Texture::CData *cdata = Texture::_cycler.
write_upstream(
false, current_thread);
164 do_reload_ram_image(Texture::CData *cdata,
bool) {
174 do_can_reload(
const Texture::CData *cdata)
const {
183 do_adjust_this_size(
const Texture::CData *cdata_tex,
184 int &x_size,
int &y_size,
const std::string &name,
185 bool for_padding)
const {
186 AutoTextureScale ats = do_get_auto_texture_scale(cdata_tex);
187 if (ats != ATS_none) {
191 return adjust_size(x_size, y_size, name, for_padding, ats);
200 if (this_frame != _last_frame_update) {
202 if (_current_frame != frame) {
204 do_update_frame(cdata, frame);
205 _current_frame = frame;
207 _last_frame_update = this_frame;
static ClockObject * get_global_clock()
Returns a pointer to the global ClockObject.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void set_orig_file_size(int x, int y, int z=1)
Specifies the size of the texture as it exists in its original disk file, before any Panda scaling.
This collects together the pieces of data that are accumulated for each node while walking the scene ...
The base class for a family of animated Textures that take their input from a video source,...
This is the fundamental interface for things that have a play/loop/stop type interface for frame-base...
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...
get_current_thread
Returns a pointer to the currently-executing Thread object.
get_frame_count
Returns the number of times tick() has been called since the ClockObject was created,...
virtual bool has_cull_callback() const
Should be overridden by derived classes to return true if cull_callback() has been defined.
This template class calls PipelineCycler::write() in the constructor and PipelineCycler::release_writ...
get_frame
Returns the current integer frame number.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A thread; that is, a lightweight process.
CycleDataType * write_upstream(bool force_to_0, Thread *current_thread)
See PipelineCyclerBase::write_upstream().
static bool adjust_size(int &x_size, int &y_size, const std::string &name, bool for_padding, AutoTextureScale auto_texture_scale=ATS_unspecified)
Computes the proper size of the texture, based on the original size, the filename,...
TypeHandle is the identifier used to differentiate C++ class types.
virtual bool get_keep_ram_image() const
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.
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling,...