Panda3D
config_vision.cxx
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 config_vision.cxx
10  * @author rdb
11  * @date 2009-11-07
12  */
13 
14 #include "config_vision.h"
15 #include "openCVTexture.h"
16 #include "webcamVideo.h"
18 #include "webcamVideoOpenCV.h"
19 #include "webcamVideoCursorV4L.h"
20 #include "webcamVideoV4L.h"
21 
22 #include "pandaSystem.h"
23 #include "texturePool.h"
24 #include "dconfig.h"
25 
26 #if !defined(CPPPARSER) && !defined(LINK_ALL_STATIC) && !defined(BUILDING_VISION)
27  #error Buildsystem error: BUILDING_VISION not defined
28 #endif
29 
30 Configure(config_vision);
31 NotifyCategoryDef(vision, "");
32 
33 ConfigVariableBool v4l_blocking
34 ("v4l-blocking", false,
35  PRC_DESC("Set this to true if you want to block waiting for webcam frames."));
36 
37 ConfigureFn(config_vision) {
39 }
40 
41 /**
42  * Initializes the library. This must be called at least once before any of
43  * the functions or classes in this library can be used. Normally it will be
44  * called by the static initializers and need not be called explicitly, but
45  * special cases exist.
46  */
47 void
49  static bool initialized = false;
50  if (initialized) {
51  return;
52  }
53  initialized = true;
54 
55  WebcamVideo::init_type();
56 #ifdef HAVE_VIDEO4LINUX
57  WebcamVideoCursorV4L::init_type();
58  WebcamVideoV4L::init_type();
59 #endif
60 
61 #ifdef HAVE_OPENCV
62  WebcamVideoCursorOpenCV::init_type();
63  WebcamVideoOpenCV::init_type();
64 
65  OpenCVTexture::init_type();
66  OpenCVTexture::register_with_read_factory();
67 
69  ps->add_system("OpenCV");
70 
71 #ifndef HAVE_FFMPEG
73  ts->register_texture_type(OpenCVTexture::make_texture, "avi");
74 #endif
75 #endif
76 }
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
static PandaSystem * get_global_ptr()
Returns the global PandaSystem object.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_texture_type(MakeTextureFunc *func, const std::string &extensions)
Records a factory function that makes a Texture object of the appropriate type for one or more partic...
Definition: texturePool.cxx:53
This class is used as a namespace to group several global properties of Panda.
Definition: pandaSystem.h:26
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is a convenience class to specialize ConfigVariable as a boolean type.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void add_system(const std::string &system)
Intended for use by each subsystem to register itself at startup.
static TexturePool * get_global_ptr()
Initializes and/or returns the global pointer to the one TexturePool object in the system.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the preferred interface for loading textures from image files.
Definition: texturePool.h:37
void init_libvision()
Initializes the library.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.