Panda3D
Loading...
Searching...
No Matches
movieTexture.I
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 movieTexture.I
10 * @author jyelon
11 * @date 2007-08-01
12 */
13
14/**
15 * Returns the length of the video.
16 */
17INLINE double MovieTexture::
18get_video_length() const {
19 CDReader cdata(_cycler);
20 return cdata->_video_length;
21}
22
23/**
24 * Returns the width in texels of the source video stream. This is not
25 * necessarily the width of the actual texture, since the texture may have
26 * been expanded to raise it to a power of 2.
27 */
28INLINE int MovieTexture::
29get_video_width() const {
30 CDReader cdata(_cycler);
31 return cdata->_video_width;
32}
33
34/**
35 * Returns the height in texels of the source video stream. This is not
36 * necessarily the height of the actual texture, since the texture may have
37 * been expanded to raise it to a power of 2.
38 */
39INLINE int MovieTexture::
40get_video_height() const {
41 CDReader cdata(_cycler);
42 return cdata->_video_height;
43}
44
45/**
46 * Returns the MovieVideoCursor that is feeding the color channels for the
47 * indicated page, where 0 <= page < get_num_pages().
48 */
49INLINE MovieVideoCursor *MovieTexture::
50get_color_cursor(int page) {
51 CDReader cdata(_cycler);
52 nassertr(page >= 0 && page < (int)cdata->_pages.size(), nullptr);
53 return cdata->_pages[page]._color;
54}
55
56/**
57 * Returns the MovieVideoCursor that is feeding the alpha channel for the
58 * indicated page, where 0 <= page < get_num_pages().
59 */
60INLINE MovieVideoCursor *MovieTexture::
61get_alpha_cursor(int page) {
62 CDReader cdata(_cycler);
63 nassertr(page >= 0 && page < (int)cdata->_pages.size(), nullptr);
64 return cdata->_pages[page]._alpha;
65}
A MovieVideo is actually any source that provides a sequence of video frames.