processing-blocks-factory.h
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2017 Intel Corporation. All Rights Reserved.
3 
4 #pragma once
5 
6 #include <vector>
7 
8 #include "align.h"
9 #include "types.h"
10 
12 
13 namespace librealsense
14 {
15  std::shared_ptr<librealsense::align> create_align(rs2_stream align_to);
16 
18  {
19  public:
21 
22  processing_block_factory(const std::vector<stream_profile>& from,
23  const std::vector<stream_profile>& to,
24  std::function<std::shared_ptr<processing_block>(void)> generate_func);
25 
26  bool operator==(const processing_block_factory& rhs) const;
27 
28  std::vector<stream_profile> get_source_info() const { return _source_info; }
29  std::vector<stream_profile> get_target_info() const { return _target_info; }
30  std::shared_ptr<processing_block> generate();
31 
33  template<typename T, typename Fn>
34  static std::vector<processing_block_factory> create_pbf_vector( rs2_format src, const std::vector<rs2_format>& dst, rs2_stream stream, Fn creator )
35  {
36  std::vector<processing_block_factory> rgb_factories;
37  for( auto d : dst )
38  {
39  // register identity processing block if requested
40  if( src == d )
41  {
42  rgb_factories.push_back( { { {src} }, { {src, stream} }, [=]() { return creator( std::make_shared<identity_processing_block>() ); } } );
43  continue;
44  }
45 
46  rgb_factories.push_back( { { {src} }, { {d, stream} }, [=]() { return creator( std::make_shared<T>( d )); } } );
47  }
48 
49  return rgb_factories;
50  }
51  template<typename T>
52  static std::vector<processing_block_factory> create_pbf_vector( rs2_format src, const std::vector<rs2_format>& dst, rs2_stream stream )
53  {
54  return create_pbf_vector< T >( src, dst, stream,
55  []( std::shared_ptr< generic_processing_block > pb )
56  {
57  return pb;
58  } );
59  }
60 
61  stream_profiles find_satisfied_requests(const stream_profiles& sp, const stream_profiles& supported_profiles) const;
62  bool has_source(const std::shared_ptr<stream_profile_interface>& source) const;
63 
64  protected:
65  std::vector<stream_profile> _source_info;
66  std::vector<stream_profile> _target_info;
67  std::function<std::shared_ptr<processing_block>(void)> generate_processing_block;
68  };
69 }
typedef void(APIENTRY *GLDEBUGPROC)(GLenum source
static std::vector< processing_block_factory > create_pbf_vector(rs2_format src, const std::vector< rs2_format > &dst, rs2_stream stream, Fn creator)
GLenum GLenum dst
Definition: glext.h:1751
d
Definition: rmse.py:171
bool has_source(const std::shared_ptr< stream_profile_interface > &source) const
GLuint GLuint stream
Definition: glext.h:1790
GLenum src
Definition: glext.h:1751
bool operator==(const processing_block_factory &rhs) const
std::function< std::shared_ptr< processing_block >void)> generate_processing_block
GLint GLint GLsizei GLint GLenum format
static processing_block_factory create_id_pbf(rs2_format format, rs2_stream stream, int idx=0)
rs2_format
A stream&#39;s format identifies how binary data is encoded within a frame.
Definition: rs_sensor.h:59
std::vector< stream_profile > get_target_info() const
std::vector< std::shared_ptr< stream_profile_interface >> stream_profiles
Definition: streaming.h:165
rs2_stream
Streams are different types of data provided by RealSense devices.
Definition: rs_sensor.h:42
std::shared_ptr< librealsense::align > create_align(rs2_stream align_to)
std::vector< stream_profile > get_source_info() const
static std::vector< processing_block_factory > create_pbf_vector(rs2_format src, const std::vector< rs2_format > &dst, rs2_stream stream)
GLsizei GLsizei GLchar * source
std::shared_ptr< processing_block > generate()
stream_profiles find_satisfied_requests(const stream_profiles &sp, const stream_profiles &supported_profiles) const


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:39