Panda3D
movieTexture.I
1 // Filename: movieTexture.I
2 // Created by: jyelon (01Aug2007)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: MovieTexture::get_video_length
18 // Access: Published
19 // Description: Returns the length of the video.
20 ////////////////////////////////////////////////////////////////////
21 INLINE double MovieTexture::
22 get_video_length() const {
23  CDReader cdata(_cycler);
24  return cdata->_video_length;
25 }
26 
27 ////////////////////////////////////////////////////////////////////
28 // Function: MovieTexture::get_video_width
29 // Access: Published
30 // Description: Returns the width in texels of the source video
31 // stream. This is not necessarily the width of the
32 // actual texture, since the texture may have been
33 // expanded to raise it to a power of 2.
34 ////////////////////////////////////////////////////////////////////
35 INLINE int MovieTexture::
36 get_video_width() const {
37  CDReader cdata(_cycler);
38  return cdata->_video_width;
39 }
40 
41 ////////////////////////////////////////////////////////////////////
42 // Function: MovieTexture::get_video_height
43 // Access: Published
44 // Description: Returns the height in texels of the source video
45 // stream. This is not necessarily the height of the
46 // actual texture, since the texture may have been
47 // expanded to raise it to a power of 2.
48 ////////////////////////////////////////////////////////////////////
49 INLINE int MovieTexture::
50 get_video_height() const {
51  CDReader cdata(_cycler);
52  return cdata->_video_height;
53 }
54 
55 ////////////////////////////////////////////////////////////////////
56 // Function: MovieTexture::get_color_cursor
57 // Access: Published
58 // Description: Returns the MovieVideoCursor that is feeding the
59 // color channels for the indicated page, where 0 <=
60 // page < get_num_pages().
61 ////////////////////////////////////////////////////////////////////
62 INLINE MovieVideoCursor *MovieTexture::
63 get_color_cursor(int page) {
64  CDReader cdata(_cycler);
65  nassertr(page >= 0 && page < (int)cdata->_pages.size(), NULL);
66  return cdata->_pages[page]._color;
67 }
68 
69 ////////////////////////////////////////////////////////////////////
70 // Function: MovieTexture::get_alpha_cursor
71 // Access: Published
72 // Description: Returns the MovieVideoCursor that is feeding the
73 // alpha channel for the indicated page, where 0 <=
74 // page < get_num_pages().
75 ////////////////////////////////////////////////////////////////////
76 INLINE MovieVideoCursor *MovieTexture::
77 get_alpha_cursor(int page) {
78  CDReader cdata(_cycler);
79  nassertr(page >= 0 && page < (int)cdata->_pages.size(), NULL);
80  return cdata->_pages[page]._alpha;
81 }
82 
A MovieVideo is actually any source that provides a sequence of video frames.