Panda3D
Loading...
Searching...
No Matches
videoTexture.h
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file videoTexture.h
10 * @author drose
11 * @date 2005-09-21
12 */
13
14#ifndef VIDEOTEXTURE_H
15#define VIDEOTEXTURE_H
16
17#include "pandabase.h"
18#include "texture.h"
19#include "animInterface.h"
20#include "clockObject.h"
21
22/**
23 * The base class for a family of animated Textures that take their input from
24 * a video source, such as a movie file. These Textures may be stopped,
25 * started, etc. using the AnimInterface controls, similar to an animated
26 * character.
27 */
28class EXPCL_PANDA_GOBJ VideoTexture : public Texture, public AnimInterface {
29protected:
30 VideoTexture(const std::string &name);
31 VideoTexture(const VideoTexture &copy);
32
33PUBLISHED:
34 virtual bool get_keep_ram_image() const;
35
36 INLINE int get_video_width() const;
37 INLINE int get_video_height() const;
38 MAKE_PROPERTY(video_width, get_video_width);
39 MAKE_PROPERTY(video_height, get_video_height);
40
41public:
42 virtual bool has_cull_callback() const;
43 virtual bool cull_callback(CullTraverser *trav, const CullTraverserData &data) const;
44
45protected:
46 void set_video_size(int video_width, int video_height);
47
48 virtual bool do_has_ram_image(const Texture::CData *cdata) const;
49
50 virtual void reconsider_dirty();
51 virtual Texture::CData *unlocked_ensure_ram_image(bool allow_compression);
52 virtual void do_reload_ram_image(Texture::CData *cdata, bool allow_compression);
53 virtual bool do_can_reload(const Texture::CData *cdata) const;
54
55 virtual bool do_adjust_this_size(const Texture::CData *cdata,
56 int &x_size, int &y_size, const std::string &name,
57 bool for_padding) const;
58
59 virtual void consider_update();
60 INLINE void clear_current_frame();
61 virtual void do_update_frame(Texture::CData *cdata_tex, int frame)=0;
62
63protected:
64 int _video_width;
65 int _video_height;
66 int _last_frame_update;
67 int _current_frame;
68
69public:
70 static TypeHandle get_class_type() {
71 return _type_handle;
72 }
73 static void init_type() {
74 Texture::init_type();
75 AnimInterface::init_type();
76 register_type(_type_handle, "VideoTexture",
77 Texture::get_class_type(),
78 AnimInterface::get_class_type());
79 }
80 virtual TypeHandle get_type() const {
81 return get_class_type();
82 }
83 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
84
85private:
86 static TypeHandle _type_handle;
87};
88
89#include "videoTexture.I"
90
91#endif
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the fundamental interface for things that have a play/loop/stop type interface for frame-base...
This collects together the pieces of data that are accumulated for each node while walking the scene ...
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-...
Definition texture.h:72
get_keep_ram_image
Returns the flag that indicates whether this Texture is eligible to have its main RAM copy of the tex...
Definition texture.h:473
virtual bool has_cull_callback() const
Should be overridden by derived classes to return true if cull_callback() has been defined.
Definition texture.cxx:2574
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...
Definition texture.cxx:2588
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
The base class for a family of animated Textures that take their input from a video source,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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.