IScanner.h
Go to the documentation of this file.
1 /********************************************************************
2 *
3 * Project Artec 3D Scanning SDK
4 *
5 * Purpose: Universal interface for capture from any scanner
6 *
7 * Copyright: Artec Group
8 *
9 ********************************************************************/
10 #ifndef _ISCANNER_H_
11 #define _ISCANNER_H_
12 
13 #include <artec/sdk/base/Errors.h>
14 #include <artec/sdk/base/IRef.h>
15 #include <artec/sdk/base/Matrix.h>
18 
19 namespace artec { namespace sdk { namespace base
20 {
21 
22 class IImage;
23 class IFrameMesh;
24 class IArrayString;
25 
26 } } };
27 
28 namespace artec { namespace sdk { namespace capturing
29 {
30 using namespace artec::sdk::base::errors;
31 
35 
36 struct FrameProcessorDesc;
37 
38 class IScanner;
39 class IScannerObserver;
40 class IFrame;
41 class IFrameProcessor;
42 class IArrayScannerId;
43 class IScannerSynchronization;
44 
45 extern "C"
46 {
48  enumerateCameras(IArrayString **camerasList, int deviceTypeMask = -1);
49 
52 
54  enumerateScanners(IArrayScannerId **scannersList, int deviceTypeMask = -1, const wchar_t* pathToConfig = NULL);
55 
57  createScanner(IScanner **scanner, const ScannerId *id, int scannerIndex = 0);
58 }
59 
60 
61 /// real-time decoding and triangulation settings
63 {
64  /// decoder settings
65  int minimumObjectSize; ///< Parameter for filtering triangles by patch size
66  /// triangulation settings
67  int trianglesStep; ///< Points density of a frame mesh
68  double edgeLengthThreshold; ///< Threshold for filtering triangles by edge length (in mm)
69  bool interpolate; ///< Switch interpolation on/off
70  double maxInterpolatedLength; ///< Maximum size of holes to be interpolated (in mm)
71  double maxAngle; ///< Maximal angle between plane of polygon and camera direction(in degrees)
72 };
73 
75 {
76 public:
77  /// create IFrameProcessor processor
78  /// if desc == NULL, use default settings
79  virtual ErrorCode createFrameProcessor( IFrameProcessor** processor, FrameProcessorDesc* desc = NULL ) = 0;
80 
81  /// fill desc with default processing parameters
82  virtual ErrorCode initFrameProcessorDesc( FrameProcessorDesc* desc ) = 0;
83 
84  /// get current frame number
85  virtual int getFrameNumber() const = 0;
86 
87  /// make capture action
88  /// safe multi-thread function
89  virtual ErrorCode capture( IFrame** frame, bool captureTexture ) = 0;
90 
91  /// capture texture only
92  /// safe multi-thread function
93  virtual ErrorCode captureTexture( IImage** texture, int* frameNumber ) = 0;
94 
95  /// get scanner ID
96  virtual const ScannerId* getId() const = 0;
97 
98  /// get scanner information
99  virtual const ScannerInfo* getInfo() const = 0;
100 
101  /// get scanner event handler
102  virtual IScannerObserver* getObserver() const = 0;
103 
104  /// set scanner event handler
105  virtual ErrorCode setObserver(IScannerObserver* handler) = 0;
106 
107  /// gain settings
108  virtual float getGain() const = 0;
109  virtual float getTextureGain() const = 0;
110  virtual void setTextureGain( float gain ) = 0;
111 
112  /// get texture gain range
113  virtual float getTextureGainMin() const = 0;
114  virtual float getTextureGainMax() const = 0;
115 
116  /// Returns currently requested scanner FPS
117  virtual float getFPS() const = 0;
118  /// Sets required scanner FPS
119  virtual void setFPS(float fps) = 0;
120  /// Returns maximum possible FPS for this scanner type
121  virtual float getMaximumFPS() const = 0;
122 
123  /// get matrix for texture mapping
124  /// pass it in data-processor mapTexture() function
125  virtual const artec::sdk::base::Matrix3x4D& getTextureMappingMatrix() const = 0;
126 
127  /// get parameters that is needed for a texture brightness normalization
128  /// texture flash power coefficient on a 1000mm distance (~ white plain intensity)
129  virtual float getTextureIllumination() const = 0;
130 
131  /// convert RAW buffer to RGB (use standard capturer conversion)
132  /// perform de-mosaicking, correct vignetting and distortion
133  virtual ErrorCode convertTextureFull( IImage** fullTexture, const IImage* rawTexture ) const = 0;
134 
135  /// convert RAW texture buffer from device to half-resolution RGB (fast)
136  /// perform de-mosaicking, correct vignetting and distortion
137  virtual ErrorCode convertTextureHalf( IImage** halfTexture , const IImage* rawTexture ) const = 0;
138 
139  /// enable/disable flash for geometry camera
140  virtual void enableFlash(bool enable) = 0;
141  virtual bool isFlashEnabled() const = 0;
142 
143  /// flash delay in milliseconds
144  virtual void setFlashDelay( float vl ) = 0;
145  virtual float getFlashDelay() const = 0;
146 
147  /// flash duration for geometry camera only
148  virtual float getFlashDuration() const = 0;
149 
150  /// enable/disable flash for texture capturing
151  virtual void enableTextureFlash(bool enable) = 0;
152  virtual bool isTextureFlashEnabled() const = 0;
153 
154  /// set/get external synchronization trigger delay in milliseconds
155  virtual void setTriggerDelay(float delay) = 0;
156  virtual float getTriggerDelay() const = 0;
157 
158  /// enable/disable scanner trigger for external synchronization
159  virtual void setUseHwTrigger( bool vl ) = 0;
160  virtual bool getUseHwTrigger() const = 0;
161 
162  /// enable/disable texture camera trigger to synchronize texture and depth
163  virtual void setTextureUseHwTrigger( bool vl ) = 0;
164  virtual bool getTextureUseHwTrigger() const = 0;
165 
166  /// set/get external synchronization trigger delay for texture camera in milliseconds
167  virtual void setTextureTriggerDelay(float delay) = 0;
168  virtual float getTextureTriggerDelay() const = 0;
169 
170  /// set/get texture camera shutter speed (exposure time) in milliseconds
171  virtual void setTextureShutterSpeed( float vl ) = 0;
172  virtual float getTextureShutterSpeed() const = 0;
173 
174  /// set auto exposure
175  virtual void enableAutoExposure(bool enable) = 0;
176  virtual bool isAutoExposureEnabled() const = 0;
177 
178  /// set auto white balance
179  virtual void enableAutoWhiteBalance(bool enable) = 0;
180  virtual bool isAutoWhiteBalanceEnabled() const = 0;
181 
182  /// synchronization scanners in bundle
183  virtual ErrorCode setScannerSynchronization(IScannerSynchronization* sync) = 0;
184  virtual IScannerSynchronization* getScannerSynchronization() const = 0;
185 
186  /// fire trigger. not a thread-safe function
187  virtual ErrorCode fireTrigger(bool captureTexture) = 0;
188 
189  /// retrieve captured frame. not a thread-safe function
190  virtual ErrorCode retrieveFrame(IFrame** frame, bool captureTexture) = 0;
191 
192  /// get scanner index in bundle. 0 - when no bundle used
193  virtual int getScannerIndex() const = 0;
194  virtual void setScannerIndex(int newIndex) = 0;
195 };
196 
197 } } } // namespace artec::sdk::capturing
198 
199 #endif // _ISCANNER_H_
ErrorCode ACAPTURESDK_LINK_SPEC enumerateScanners(IArrayScannerId **scannersList, int deviceTypeMask=-1, const wchar_t *pathToConfig=NULL)
bool interpolate
Switch interpolation on/off.
Definition: IScanner.h:69
This namespace is auto-generated from internal event code list.
Definition: Errors.h:55
double maxAngle
Maximal angle between plane of polygon and camera direction(in degrees)
Definition: IScanner.h:71
int minimumObjectSize
decoder settings
Definition: IScanner.h:65
ErrorCode ACAPTURESDK_LINK_SPEC forceIpForGigECameras()
int trianglesStep
triangulation settings
Definition: IScanner.h:67
double maxInterpolatedLength
Maximum size of holes to be interpolated (in mm)
Definition: IScanner.h:70
ErrorCode ACAPTURESDK_LINK_SPEC createScanner(IScanner **scanner, const ScannerId *id, int scannerIndex=0)
#define ACAPTURESDK_LINK_SPEC
double edgeLengthThreshold
Threshold for filtering triangles by edge length (in mm)
Definition: IScanner.h:68
ErrorCode ACAPTURESDK_LINK_SPEC enumerateCameras(IArrayString **camerasList, int deviceTypeMask=-1)
real-time decoding and triangulation settings
Definition: IScanner.h:62