Options.java
Go to the documentation of this file.
1 package com.intel.realsense.librealsense;
2 
3 import java.util.HashMap;
4 import java.util.Map;
5 
6 public abstract class Options extends LrsClass implements OptionsInterface {
7  private Map<Option,OptionRange> mOptionRange = new HashMap<>();
8 
9  private class OptionRange {
10  public float min;
11  public float max;
12  public float step;
13  public float def;
14  }
15 
16  private synchronized OptionRange getRange(Option option){
17  if(!mOptionRange.containsKey(option)) {
18  OptionRange optionRange = new OptionRange();
19  nGetRange(mHandle, option.value(), optionRange);
20  mOptionRange.put(option, optionRange);
21  }
22  return mOptionRange.get(option);
23  }
24 
25  @Override
26  public boolean supports(Option option) {
27  return nSupports(mHandle, option.value());
28  }
29 
30  @Override
31  public float getValue(Option option) {
32  return nGetValue(mHandle, option.value());
33  }
34 
35  @Override
36  public void setValue(Option option, float value) {
37  nSetValue(mHandle, option.value(), value);
38  }
39 
40  @Override
41  public float getMinRange(Option option) {
42  return getRange(option).min;
43  }
44 
45  @Override
46  public float getMaxRange(Option option) {
47  return getRange(option).max;
48  }
49 
50  @Override
51  public float getStep(Option option) {
52  return getRange(option).step;
53  }
54 
55  @Override
56  public float getDefault(Option option) {
57  return getRange(option).def;
58  }
59 
60  @Override
61  public boolean isReadOnly(Option option) {
62  return nIsReadOnly(mHandle, option.value());
63  }
64 
65  @Override
67  return nGetDescription(mHandle, option.value());
68  }
69 
70  @Override
72  return nGetValueDescription(mHandle, option.value(), value);
73  }
74 
75  private static native boolean nSupports(long handle, int option);
76  private static native float nGetValue(long handle, int option);
77  private static native void nSetValue(long handle, int option, float value);
78  private static native void nGetRange(long handle, int option, OptionRange outParams);
79  private static native boolean nIsReadOnly(long handle, int option);
80  private static native String nGetDescription(long handle, int option);
81  private static native String nGetValueDescription(long handle, int option, float value);
82 
83 }
static native boolean nSupports(long handle, int option)
String getDescription(Option option)
Definition: Options.java:66
GLuint64 GLenum void * handle
Definition: glext.h:7785
void setValue(Option option, float value)
Definition: Options.java:36
GLfloat value
::std_msgs::String_< std::allocator< void > > String
Definition: String.h:47
Definition: getopt.h:41
static native String nGetDescription(long handle, int option)
Map< Option, OptionRange > mOptionRange
Definition: Options.java:7
synchronized OptionRange getRange(Option option)
Definition: Options.java:16
static native void nSetValue(long handle, int option, float value)
boolean supports(Option option)
Definition: Options.java:26
static native String nGetValueDescription(long handle, int option, float value)
boolean isReadOnly(Option option)
Definition: Options.java:61
static native float nGetValue(long handle, int option)
static native void nGetRange(long handle, int option, OptionRange outParams)
static native boolean nIsReadOnly(long handle, int option)
String valueDescription(Option option, float value)
Definition: Options.java:71


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