Image Component Library (ICL)
DC.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLIO/src/ICLIO/DC.h **
10 ** Module : ICLIO **
11 ** Authors: Christof Elbrechter **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 #include <dc1394/control.h>
32 #include <dc1394/conversions.h>
33 #include <ICLCore/Types.h>
34 #include <ICLUtils/Size.h>
35 #include <string>
36 #include <vector>
37 
38 
39 
40 namespace icl{
42  namespace core{ class ImgBase; }
45  namespace io{
47  class DCDevice;
48  class DCDeviceOptions;
51  namespace dc{
53 
55  std::string to_string(dc1394video_mode_t vm);
56 
58  std::string to_string(dc1394framerate_t fr);
59 
61  std::string to_string(dc1394color_filter_t f);
62 
64  std::string to_string(dc1394bayer_method_t bm);
65 
67  std::string to_string(dc1394feature_t f);
68 
70  dc1394video_mode_t videomode_from_string(const std::string &s);
71 
73  dc1394framerate_t framerate_from_string(const std::string &s);
74 
76  dc1394bayer_method_t bayermethod_from_string(const std::string &s);
77 
79  dc1394feature_t feature_from_string(const std::string &s);
80 
82  const std::vector<std::string> &getListOfAllFeatures();
83 
85  void initialize_dc_cam(dc1394camera_t *c, int nDMABuffers, DCDeviceOptions *options);
86 
88  void release_dc_cam(dc1394camera_t *c);
89 
91  void set_streaming(dc1394camera_t* c, bool on);
92 
94 
98  dc1394video_frame_t *get_newest_frame(dc1394camera_t* c);
99 
101 
102  dc1394video_frame_t *get_a_frame(dc1394camera_t* c);
103 
104 
105 
107 
109  void extract_image_to(dc1394video_frame_t *f,
110  dc1394color_filter_t bayerLayout,
111  core::ImgBase **ppoDst,
112  const utils::Size &desiredSizeHint,
113  core::format desiredFormatHint,
114  core::depth desiredDepthHint,
115  std::vector<icl8u> &dataBuffer,
116  dc1394bayer_method_t bayerMethod);
117 
119 
120  void extract_image_to_2(dc1394video_frame_t *f,
121  dc1394color_filter_t bayerLayout,
122  core::ImgBase **ppoDst,
123  std::vector<icl8u> &dataBuffer,
124  dc1394bayer_method_t bayerMethod);
125 
127 
128  bool can_extract_image_to(dc1394video_frame_t *f,
129  const utils::Size &desiredSizeHint,
130  core::format desiredFormatHint,
131  core::depth desiredDepthHint);
132 
134 
138  void install_signal_handler();
139 
141  void bayer2gray(icl8u *src, icl8u*dst, int w, int h);
142 
144  dc1394_t *get_static_context();
145 
147 
150  void free_static_context();
151 
153 
154  bool is_dc800_capable(dc1394camera_t *cam);
155 
157 
165  void set_iso_speed(dc1394camera_t *cam, int mbits);
166  }
167  } // namespace io
168 }
169 
dc1394video_frame_t * get_a_frame(dc1394camera_t *c)
gets a new frame from the given camera
dc1394_t * get_static_context()
since rc9 of libdc, a libary context was introduced
undocument this line if you encounter any issues!
Definition: Any.h:37
Ipp8u icl8u
8Bit unsigned integer type for the ICL
Definition: BasicTypes.h:64
void set_streaming(dc1394camera_t *c, bool on)
ensures iso streaming of the given camera to have the given state (on or off)
std::string to_string(dc1394video_mode_t vm)
translate a dc1394video_mode_t into a string representation
void release_dc_cam(dc1394camera_t *c)
stops the capturing and streaming process
format
determines the color-format, that is associated with the images channels
Definition: Types.h:70
void initialize_dc_cam(dc1394camera_t *c, int nDMABuffers, DCDeviceOptions *options)
(TODO) sets up a camera to some useful defaults dependent on its model id
dc1394feature_t feature_from_string(const std::string &s)
translate a dc1394feature_t from a string representation
void extract_image_to_2(dc1394video_frame_t *f, dc1394color_filter_t bayerLayout, core::ImgBase **ppoDst, std::vector< icl8u > &dataBuffer, dc1394bayer_method_t bayerMethod)
extracts the given frame (in most appropiate way)
bool can_extract_image_to(dc1394video_frame_t *f, const utils::Size &desiredSizeHint, core::format desiredFormatHint, core::depth desiredDepthHint)
determins if the desired parameters can be fullfilled by extract_image_to(..)
dc1394framerate_t framerate_from_string(const std::string &s)
translate a dc1394framerate_t from a string representation
dc1394video_frame_t * get_newest_frame(dc1394camera_t *c)
gets the newest frame from a given camera
void bayer2gray(icl8u *src, icl8u *dst, int w, int h)
internally used bayer conversion function
bool is_dc800_capable(dc1394camera_t *cam)
returns whether the given camera supports firewire B
depth
determines the pixel type of an image (8Bit-int or 32Bit-float)
Definition: Types.h:60
void free_static_context()
(since rc 9 of libdc) releases the static dc-context
void extract_image_to(dc1394video_frame_t *f, dc1394color_filter_t bayerLayout, core::ImgBase **ppoDst, const utils::Size &desiredSizeHint, core::format desiredFormatHint, core::depth desiredDepthHint, std::vector< icl8u > &dataBuffer, dc1394bayer_method_t bayerMethod)
converts a grabbed frame
dc1394video_mode_t videomode_from_string(const std::string &s)
translate a dc1394video_mode_t from a string representation
dc1394bayer_method_t bayermethod_from_string(const std::string &s)
translate a dc1394bayer_method_t from a string representation
void install_signal_handler()
creates a signal handler for the SIGINT signal
void set_iso_speed(dc1394camera_t *cam, int mbits)
sets iso transmission speed for the wrapped dc1394 context
const std::vector< std::string > & getListOfAllFeatures()
returns a list of all currently implemented dc1394 features