pyrs_types.cpp
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 #include "python.hpp"
5 #include "../include/librealsense2/hpp/rs_types.hpp"
6 
7 void init_types(py::module &m) {
9  // error+subclasses
10  enum product_line
11  {
13  any_intel = RS2_PRODUCT_LINE_ANY_INTEL,
14  non_intel = RS2_PRODUCT_LINE_NON_INTEL,
15  D400 = RS2_PRODUCT_LINE_D400,
16  SR300 = RS2_PRODUCT_LINE_SR300,
17  L500 = RS2_PRODUCT_LINE_L500,
18  T200 = RS2_PRODUCT_LINE_T200,
20  TRACKING = RS2_PRODUCT_LINE_TRACKING
21  };
22 
23  py::enum_< product_line >( m, "product_line" )
24  .value( "any", product_line::any )
25  .value( "any_intel", product_line::any_intel )
26  .value( "non_intel", product_line::non_intel )
27  .value( "D400", product_line::D400 )
28  .value( "SR300", product_line::SR300 )
29  .value( "L500", product_line::L500 )
30  .value( "T200", product_line::T200 )
31  .value( "DEPTH", product_line::DEPTH )
32  .value( "TRACKING", product_line::TRACKING )
33  .export_values();
34 
35  py::class_<rs2::option_range> option_range(m, "option_range"); // No docstring in C++
36  option_range.def(py::init<>())
37  .def_readwrite("min", &rs2::option_range::min)
38  .def_readwrite("max", &rs2::option_range::max)
39  .def_readwrite("default", &rs2::option_range::def)
40  .def_readwrite("step", &rs2::option_range::step)
41  .def("__repr__", [](const rs2::option_range &self) {
42  std::stringstream ss;
43  ss << "<" SNAME ".option_range: " << self.min << "-" << self.max
44  << "/" << self.step << " [" << self.def << "]>";
45  return ss.str();
46  });
47 
48  py::class_<rs2::region_of_interest> region_of_interest(m, "region_of_interest"); // No docstring in C++
49  region_of_interest.def(py::init<>())
50  .def_readwrite("min_x", &rs2::region_of_interest::min_x)
51  .def_readwrite("min_y", &rs2::region_of_interest::min_y)
52  .def_readwrite("max_x", &rs2::region_of_interest::max_x)
53  .def_readwrite("max_y", &rs2::region_of_interest::max_y);
55 }
constexpr const char * DEPTH
const GLfloat * m
Definition: glext.h:6814
#define RS2_PRODUCT_LINE_TRACKING
Definition: rs_context.h:99
GLfloat value
void init_types(py::module &m)
Definition: pyrs_types.cpp:7
#define RS2_PRODUCT_LINE_NON_INTEL
Definition: rs_context.h:93
#define RS2_PRODUCT_LINE_D400
Definition: rs_context.h:94
#define SNAME
Definition: pybackend.cpp:27
#define RS2_PRODUCT_LINE_L500
Definition: rs_context.h:96
#define RS2_PRODUCT_LINE_T200
Definition: rs_context.h:97
#define RS2_PRODUCT_LINE_ANY_INTEL
Definition: rs_context.h:92
#define RS2_PRODUCT_LINE_DEPTH
Definition: rs_context.h:98
#define RS2_PRODUCT_LINE_ANY
Definition: rs_context.h:91
#define RS2_PRODUCT_LINE_SR300
Definition: rs_context.h:95


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