hdr-config.h
Go to the documentation of this file.
1 /* License: Apache 2.0. See LICENSE file in root directory.
2 Copyright(c) 2020 Intel Corporation. All Rights Reserved. */
3 
4 
5 #pragma once
6 
7 #include <vector>
8 #include "hw-monitor.h"
9 
10 namespace librealsense
11 {
12  struct hdr_params {
14  float _exposure;
15  float _gain;
16 
17  hdr_params();
18  hdr_params(int sequence_id, float exposure, float gain);
19 
20  hdr_params& operator=(const hdr_params& other);
21  };
22 
23  inline bool operator==(const hdr_params& first, const hdr_params& second)
24  {
25  return (first._sequence_id == second._sequence_id) &&
26  (first._exposure == second._exposure) &&
27  (first._gain == second._gain);
28  }
29 
30  class hdr_config
31  {
32  public:
33  hdr_config(hw_monitor& hwm, std::shared_ptr<sensor_base> depth_ep,
34  const option_range& exposure_range, const option_range& gain_range);
35 
36 
37  float get(rs2_option option) const;
38  void set(rs2_option option, float value, option_range range);
39  bool is_config_in_process() const;
40 
41  bool is_enabled() const;
42 
43  private:
44  bool is_hdr_id(int id) const;
45  bool is_hdr_enabled_in_device(std::vector<byte>& result) const;
46  bool is_current_subpreset_hdr(const std::vector<byte>& current_subpreset) const;
47  bool configure_hdr_as_in_fw(const std::vector<byte>& current_subpreset);
48  command prepare_hdr_sub_preset_command() const;
49  std::vector<uint8_t> prepare_sub_preset_header() const;
50  std::vector<uint8_t> prepare_sub_preset_frames_config() const;
51 
52  const int DEFAULT_HDR_ID = 0;
53  const int DEFAULT_CURRENT_HDR_SEQUENCE_INDEX = -1;
54  const int DEFAULT_HDR_SEQUENCE_SIZE = 2;
55 
56  // exposure value has been set to fit the 30 fps (default fps)
57  const float PRE_ENABLE_HDR_EXPOSURE = 30000.f;
58 
59  const uint8_t CONTROL_ID_LASER = 0;
60  const uint8_t CONTROL_ID_EXPOSURE = 1;
61  const uint8_t CONTROL_ID_GAIN = 2;
62 
63  void set_options_to_be_restored_after_disable();
64  void restore_options_after_disable();
65 
66  bool validate_config() const;
67  bool send_sub_preset_to_fw();
68  void disable();
69  void set_id(float value);
70  void set_sequence_size(float value);
71  void set_sequence_index(float value);
72  void set_enable_status(float value);
73  void set_exposure(float value);
74  void set_gain(float value);
75 
76  int _id;
78  std::vector<hdr_params> _hdr_sequence_params;
80  mutable bool _is_enabled;
86  std::weak_ptr<sensor_base> _sensor;
91  };
92 
93 }
rs2_option
Defines general configuration controls. These can generally be mapped to camera UVC controls...
Definition: rs_option.h:22
GLfloat value
unsigned char uint8_t
Definition: stdint.h:78
GLuint GLenum option
Definition: glext.h:5923
std::vector< hdr_params > _hdr_sequence_params
Definition: hdr-config.h:78
option_range _gain_range
Definition: hdr-config.h:88
hdr_params & operator=(const hdr_params &other)
Definition: hdr-config.cpp:520
GLint first
std::weak_ptr< sensor_base > _sensor
Definition: hdr-config.h:86
bool operator==(const hdr_params &first, const hdr_params &second)
Definition: hdr-config.h:23
GLsizei range
option_range _exposure_range
Definition: hdr-config.h:87
GLuint64EXT * result
Definition: glext.h:10921


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