Astra SDK  v2.1.3
DebugHand.hpp
1 // This file is part of the Orbbec Astra SDK [https://orbbec3d.com]
2 // Copyright (c) 2015-2017 Orbbec 3D
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 // Be excellent to each other.
17 #ifndef ASTRA_HAND_DEBUG_HPP
18 #define ASTRA_HAND_DEBUG_HPP
19 
20 #include <astra_core/astra_core.hpp>
21 #include <astra/capi/astra_ctypes.h>
22 #include <astra/capi/streams/hand_capi.h>
23 
24 namespace astra {
25 
26  using DebugHandViewType = astra_debug_hand_view_type_t;
27 
39  class DebugHandStream : public DataStream
40  {
41  public:
48  : DataStream(connection),
49  debugHandStream_(connection)
50  { }
51 
52  static const astra_stream_type_t id = ASTRA_STREAM_DEBUG_HAND;
53 
59  void set_view_type(DebugHandViewType view)
60  {
61  astra_debug_handstream_set_view_type(debugHandStream_, view);
62  }
63 
69  void set_use_mouse_probe(bool useMouseProbe)
70  {
71  astra_debug_handstream_set_use_mouse_probe(debugHandStream_, useMouseProbe);
72  }
73 
80  {
81  astra_debug_handstream_set_mouse_position(debugHandStream_, position);
82  }
83 
89  void set_pause_input(bool pauseInput)
90  {
91  astra_debug_handstream_set_pause_input(debugHandStream_, pauseInput);
92  }
93 
99  void set_lock_spawn_point(bool lockSpawnPoint)
100  {
101  astra_debug_handstream_set_lock_spawn_point(debugHandStream_, lockSpawnPoint);
102  }
103 
109  DebugHandViewType get_view_type() const
110  {
111  DebugHandViewType view;
112  astra_debug_handstream_get_view_type(debugHandStream_, &view);
113  return view;
114  }
115 
116  private:
117  astra_debug_handstream_t debugHandStream_;
118  };
119 
125  class DebugHandFrame : public ImageFrame<RgbPixel, ASTRA_STREAM_DEBUG_HAND>
126  {
127  public:
134  : ImageFrame(frame, ASTRA_PIXEL_FORMAT_RGB888)
135  {}
136  };
138 }
139 
140 #endif /* ASTRA_HAND_DEBUG_HPP */
Data Stream
Definition: DataStream.hpp:33
A Debug Hand Frame
Definition: DebugHand.hpp:126
DebugHandFrame(astra_imageframe_t frame)
default constructs
Definition: DebugHand.hpp:133
A Debug Hand Stream
Definition: DebugHand.hpp:40
void set_view_type(DebugHandViewType view)
set view type
Definition: DebugHand.hpp:59
void set_mouse_position(Vector2f position)
set mouse position
Definition: DebugHand.hpp:79
DebugHandStream(astra_streamconnection_t connection)
default constructs
Definition: DebugHand.hpp:47
DebugHandViewType get_view_type() const
get view type
Definition: DebugHand.hpp:109
void set_lock_spawn_point(bool lockSpawnPoint)
set lock spawn point
Definition: DebugHand.hpp:99
void set_use_mouse_probe(bool useMouseProbe)
set is use mouse probe
Definition: DebugHand.hpp:69
void set_pause_input(bool pauseInput)
set pause input
Definition: DebugHand.hpp:89
Basic Image Frame
Definition: Image.hpp:397
Definition: stream_types.h:37
Definition: astra_plugin.h:24
Represents a float 2d vector
Definition: Vector2f.hpp:30