ZED Open Capture  v0.6.0
Low level camera driver for the ZED stereo camera family
videocapture_def.hpp
Go to the documentation of this file.
1 //
3 // Copyright (c) 2021, STEREOLABS.
4 //
5 // All rights reserved.
6 //
7 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
9 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
10 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
11 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
12 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
13 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
14 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
15 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
16 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
17 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
18 //
20 
21 #ifndef VIDEOCAPTURE_DEF_HPP
22 #define VIDEOCAPTURE_DEF_HPP
23 
24 #ifndef NSEC_PER_SEC
25 #define NSEC_PER_SEC 1000000000ULL
26 #endif
27 
28 #include "defines.hpp"
29 
30 namespace sl_oc {
31 
32 namespace video {
33 
37 enum class SL_DEVICE {
38  ZED,
39  ZED_M,
40  ZED_CBS,
41  ZED_M_CBS,
42  ZED_2,
43  ZED_2i,
44  NONE
45 };
46 
50 enum class RESOLUTION {
51  HD2K,
52  HD1080,
53  HD720,
54  VGA,
55  LAST
56 };
57 
61 enum class FPS {
62  FPS_15 = 15,
63  FPS_30 = 30,
64  FPS_60 = 60,
65  FPS_100 = 100,
66  LAST = 101
67 };
68 
72 enum class CAM_SENS_POS {
73  LEFT = 0,
74  RIGHT = 1,
75  LAST = 3
76 };
77 
81 typedef struct VideoParams
82 {
88  fps = FPS::FPS_15;
90  }
91 
93  FPS fps;
94  int verbose;
96 
100 struct Resolution {
101  size_t width;
102  size_t height;
103 
109  Resolution(size_t w_ = 0, size_t h_ = 0) {
110  width = w_;
111  height = h_;
112  }
113 };
114 
116 static const std::vector<Resolution> cameraResolution = {
117  Resolution(2208, 1242),
118  Resolution(1920, 1080),
119  Resolution(1280, 720),
120  Resolution(672, 376)
121 };
122 
123 
124 
128 struct UVCBuffer {
129  void *start;
130  size_t length;
131 };
132 
133 
138 const unsigned char PRESET_GAMMA[9][16] = {
139  {7,14,29,54,66,78,89,103,114,123,139,154,183,206,228,254}, // gamma min
140  {9,17,34,58,71,83,89,108,118,127,143,158,186,208,229,254},
141  {10,20,38,63,75,88,99,112,123,132,147,162,189,210,230,254},
142  {12,23,43,67,80,92,103,117,127,136,151,165,192,212,231,254},
143  {13,26,47,71,84,97,108,121,131,140,155,169,195,214,232,255}, // gamma middle/default
144  {18,32,54,80,93,106,117,130,140,149,164,177,202,219,236,255},
145  {24,38,61,88,102,115,127,139,148,157,172,186,209,225,240,255},
146  {29,44,68,97,111,124,136,147,157,166,181,194,215,230,243,255},
147  {34,50,75,105,120,133,145,156,165,174,189,202,222,235,247,255} // gamma strong
148 };
149 
150 
151 }
152 
153 }
154 
155 #endif // VIDEOCAPTURE_DEF_HPP
RESOLUTION
Available resolutions.
struct sl_oc::video::VideoParams VideoParams
The camera configuration parameters.
FPS
Available frames per seconds.
@ FPS_15
15 Frames per second. Available for all the resolutions.
@ FPS_30
30 Frames per second. Not available for RESOLUTION::HD2K.
@ FPS_100
100 Frames per second. Only available for RESOLUTION::VGA.
@ FPS_60
60 Frames per second. Not available for RESOLUTION::HD2K and RESOLUTION::HD1080.
CAM_SENS_POS
Position of the Camera CMOS sensors.
@ RIGHT
The right sensor.
@ LEFT
The left sensor.
const unsigned char PRESET_GAMMA[9][16]
SL_DEVICE
Camera models.
@ ZED_M_CBS
ZED Mini new FW.
@ ZED_M
ZED Mini old FW.
@ ERROR
Definition: defines.hpp:87
Resolution in pixel for each frame.
Resolution(size_t w_=0, size_t h_=0)
Constructor.
size_t height
array height in pixels
size_t width
array width in pixels
The Buffer struct used by UVC to store frame data.
size_t length
Size of the buffer.
void * start
Address of the first byte of the buffer.
The camera configuration parameters.
RESOLUTION res
Camera resolution.
FPS fps
Frames per second.
VideoParams()
Default constructor setting the default parameter values.