Panda3D
Loading...
Searching...
No Matches
webcamVideo.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 webcamVideo.I
10 * @author jyelon
11 * @date 2007-11-01
12 */
13
14/**
15 * Returns the camera's size_x.
16 */
17INLINE int WebcamVideo::
18get_size_x() const {
19 return _size_x;
20}
21
22/**
23 * Returns the camera's size_y.
24 */
25INLINE int WebcamVideo::
26get_size_y() const {
27 return _size_y;
28}
29
30/**
31 * Returns the camera's framerate. This is a maximum theoretical: the actual
32 * performance will depend on the speed of the hardware.
33 */
34INLINE double WebcamVideo::
35get_fps() const {
36 return _fps;
37}
38
39/**
40 * Returns the camera's pixel format, as a FourCC code, if known.
41 */
42INLINE const std::string &WebcamVideo::
43get_pixel_format() const {
44 return _pixel_format;
45}
46
47/**
48 * Outputs the WebcamVideo. This function simply writes the name, size and
49 * FPS to the output stream.
50 */
51INLINE void WebcamVideo::
52output(std::ostream &out) const {
53 out << get_name() << ": " << get_size_x() << "x" << get_size_y();
54
55 if (!_pixel_format.empty()) {
56 out << " " << _pixel_format;
57 }
58
59 out << " @ " << get_fps() << "Hz";
60}
61
62INLINE std::ostream &operator << (std::ostream &out, const WebcamVideo &n) {
63 n.output(out);
64 return out;
65}
Allows you to open a webcam or other video capture device as a video stream.
Definition webcamVideo.h:23
void output(std::ostream &out) const
Outputs the WebcamVideo.
Definition webcamVideo.I:52
double get_fps() const
Returns the camera's framerate.
Definition webcamVideo.I:35
int get_size_y() const
Returns the camera's size_y.
Definition webcamVideo.I:26
int get_size_x() const
Returns the camera's size_x.
Definition webcamVideo.I:18
const std::string & get_pixel_format() const
Returns the camera's pixel format, as a FourCC code, if known.
Definition webcamVideo.I:43