Astra SDK  v2.1.3
StreamDescription.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_STREAMDESCRIPTION_HPP
18 #define ASTRA_STREAMDESCRIPTION_HPP
19 
20 #include "capi/astra_core.h"
21 #include <cassert>
22 
23 namespace astra {
24 
32  {
33  public:
34  StreamDescription(::astra_stream_type_t type,
35  ::astra_stream_subtype_t subtype = DEFAULT_SUBTYPE)
36  {
37  ::astra_stream_desc_t::type = type;
38  ::astra_stream_desc_t::subtype = subtype;
39  }
40 
41  StreamDescription(const ::astra_stream_desc_t& desc)
42  {
43  *this = desc;
44  }
45 
46  StreamDescription& operator=(const ::astra_stream_desc_t& desc)
47  {
48  ::astra_stream_desc_t::type = desc.type;
49  ::astra_stream_desc_t::subtype = desc.subtype;
50 
51  return *this;
52  }
53 
54  operator ::astra_stream_desc_t*() { return this; }
55  operator const ::astra_stream_desc_t*() const { return this; }
56 
57  astra_stream_type_t type() const { return ::astra_stream_desc_t::type; }
58 
59  astra_stream_subtype_t subtype() const { return ::astra_stream_desc_t::subtype; }
60  };
61 
62  inline bool operator==(const StreamDescription& lhs, const StreamDescription& rhs)
63  {
64  return lhs.type() == rhs.type() && lhs.subtype() == rhs.subtype();
65  }
66 
67  inline bool operator!=(const StreamDescription& lhs, const StreamDescription& rhs)
68  {
69  return !(lhs == rhs);
70  }
71 }
72 
73 #endif // ASTRA_STREAMDESCRIPTION_HPP
Stream Description class
Definition: StreamDescription.hpp:32
bool operator!=(const ImageStreamMode &lhs, const ImageStreamMode &rhs)
compare is ImageStreamMode not equal
Definition: Image.hpp:247
bool operator==(const ImageStreamMode &lhs, const ImageStreamMode &rhs)
compare is ImageStreamMode equal
Definition: Image.hpp:230
Definition: astra_types.h:42