Astra SDK  v2.1.3
Color.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_COLOR_HPP
18 #define ASTRA_COLOR_HPP
19 
20 #include <astra_core/astra_core.hpp>
21 #include <astra/capi/astra_ctypes.h>
22 #include <astra/capi/streams/color_capi.h>
23 #include <astra/streams/Image.hpp>
24 
25 namespace astra {
26 
38  class ColorStream : public ImageStream
39  {
40  public:
41  explicit ColorStream(astra_streamconnection_t connection)
42  : ImageStream(connection)
43  {
44  colorStream_ = reinterpret_cast<astra_colorstream_t>(connection);
45  }
46 
47  static const astra_stream_type_t id = ASTRA_STREAM_COLOR;
48 
49 
50  private:
51  astra_colorstream_t colorStream_;
52  };
53 
59  class ColorFrame : public ImageFrame<RgbPixel, ASTRA_STREAM_COLOR>
60  {
61  public:
63  : ImageFrame(frame, ASTRA_PIXEL_FORMAT_RGB888)
64  {}
65  };
66 
72  class RawColorFrame : public ImageFrame<uint8_t, ASTRA_STREAM_COLOR>
73  {
74  public:
76  : ImageFrame(frame, ASTRA_PIXEL_FORMAT_RGB888)
77  {}
78  };
79 
80 #ifdef __ANDROID__
81  class NV21ColorFrame : public ImageFrame<uint8_t, ASTRA_STREAM_COLOR>
82  {
83  public:
84  NV21ColorFrame(astra_imageframe_t frame)
85  : ImageFrame(frame, ASTRA_PIXEL_FORMAT_NV21)
86  {}
87  };
88 #endif
90 }
91 
92 #endif // ASTRA_COLOR_HPP
color frame of rgb format
Definition: Color.hpp:60
A color stream
Definition: Color.hpp:39
Basic Image Frame
Definition: Image.hpp:397
ImageFrame(astra_imageframe_t frame, astra_pixel_format_t expected_format)
Default constructs
Definition: Image.hpp:405
basic Image Stream
Definition: Image.hpp:271
color frame of raw format
Definition: Color.hpp:73
Definition: stream_types.h:37
Definition: astra_plugin.h:24