DAVID4 SDK  1.8.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
StructuredLightScannerJsonRpc.h
1 //=============================================================================
2 // See License in Related Pages
3 //=============================================================================
4 
5 #pragma once
6 
7 #ifndef DAVID_SDK_STRUCTURED_LIGHT_SCANNER_JSON_RPC_H
8 #define DAVID_SDK_STRUCTURED_LIGHT_SCANNER_JSON_RPC_H
9 
10 #include "davidSDK/ClientJsonRpc.h"
11 
12 namespace david {
13 
14 
15 //=============================================================================
16 // StructuredLightScannerJsonRpc
17 //=============================================================================
18 
19 /// Implements interface functions of IStructuredLightScanner.
20 /// All calls are delegated to a JSON-RPC 2.0 client.
21 /// Example:
22 /// @include SimpleStructuredLightScanner.cpp
24 {
25 public:
26  /// Constructor.
27  /// @param[in,out] client Valid pointer to client implementation.
29 
30  // See IStructuredLightScanner
32 
33  // See IStructuredLightScanner
34  virtual void SetScreenID(int screenID);
35 
36  // See IStructuredLightScanner
37  virtual std::vector<std::string> GetAvailableCameraNames();
38 
39  // See IStructuredLightScanner
40  virtual void SelectCamera(const std::string& cameraName, const ImageFormat& imageFormat = ImageFormat());
41 
42  // See IStructuredLightScanner
43  virtual bool CheckCamera();
44 
45  // See IStructuredLightScanner
46  virtual void SetCameraProperty(const std::string& propertyName, double value, enum CamPropsUsage camPropsUsage = CamPropsForAll);
47 
48  // See IStructuredLightScanner
49  virtual double GetCameraProperty(const std::string& propertyName, enum CamPropsUsage camPropsUsage = CamPropsForScanning);
50 
51  // See IStructuredLightScanner
52  virtual std::vector<std::string> GetCameraPropertyNames(bool onlyAvailable);
53 
54  // See IStructuredLightScanner
55  virtual void SelectImageSequence(const std::string& directory);
56 
57  // See IStructuredLightScanner
58  virtual void GetLiveImage(std::vector<uint8_t>& pixelValues, int& width, int& height);
59 
60  // See IStructuredLightScanner
61  virtual void SetCodedLightPhaseShiftMode(const CodedLightPhaseShiftParams& params);
62 
63  // See IStructuredLightScanner
65 
66  // See IStructuredLightScanner
67  virtual void SetResultFiltering(const ResultFilteringParams& params);
68 
69  // See IStructuredLightScanner
71 
72  // See IStructuredLightScanner
73  virtual void ImportCalibration(const std::string& camCalibFilename, const std::string& projectorCalibFilename);
74 
75  // See IStructuredLightScanner
76  virtual void ExportCalibration(const std::string& camCalibFilename, const std::string& projectorCalibFilename);
77 
78  // See IStructuredLightScanner
79  virtual void ChangeCameraCalibrationResolution(int newWidth, int newHeight);
80 
81  // See IStructuredLightScanner
82  virtual std::vector<CalibPoint> Calibrate(double scale);
83 
84  // See IStructuredLightScanner
85  virtual int Scan(bool grabTexture=false, bool setAsBackground=false);
86 
87  // See IStructuredLightScanner
88  virtual void GrabTexture();
89 
90  // See IStructuredLightScanner
91  virtual void AutoWhiteBalance();
92 
93  // See IStructuredLightScanner
94  virtual int AddScanToShapeFusion();
95 
96  // See IStructuredLightScanner
97  virtual void ExportMesh(const std::string& filename);
98 
99  // See IStructuredLightScanner
100  virtual void ExportBackgroundDepthmap(const std::string& filename);
101 
102  // See IStructuredLightScanner
103  virtual void ImportBackgroundDepthmap(const std::string& filename);
104 
105  //-------------------------------------------------------------------------
106  /// @name Not implemented
107  /// @warning The following functions are not implemented!
108  /// @{
109  //-------------------------------------------------------------------------
110 
111  // See IStructuredLightScanner
112  virtual void GetBackgroundDepthmap(std::vector<float>& depthValues, int &width, int &height);
113 
114  // See IStructuredLightScanner
115  virtual void SetBackgroundDepthmap(const std::vector<float>& depthValues, int width, int height);
116 
117  // See IStructuredLightScanner
118  virtual void SetBackgroundPlanes(const std::vector<Plane>& planes);
119 
120  // See IStructuredLightScanner
121  virtual int GetPatternCount();
122 
123  // See IStructuredLightScanner
124  virtual void GetPatternImage(uint8_t* data, int width, int height, PatternPixelFormat pixelFormat, int patternIndex);
125 
126  // See IStructuredLightScanner
127  virtual void SetCapturedImage(const uint8_t* data, int width, int height, CapturedPixelFormat pixelFormat, int patternIndex);
128 
129  // See IStructuredLightScanner
130  virtual void SetTextureImage(const uint8_t* data, int width, int height, PixelFormat pixelFormat);
131 
132  /// @}
133 
134 private:
135  //-------------------------------------------------------------------------
136  // Private member variables
137  //-------------------------------------------------------------------------
138 
139  ClientJsonRpc* m_client; ///< Client implementation
140 };
141 
142 
143 } // namespace
144 
145 #endif // DAVID_SDK_STRUCTURED_LIGHT_SCANNER_JSON_RPC_H