WPOCT Software Developer's Kit (SDK)
SDK For using Wasatch Photonics OCT Spectrometers
IWPOCTCamera.h
Go to the documentation of this file.
1 
10 #pragma once
11 
79 {
80 public:
84  enum ErrorCode
85  {
86  NoError = 0,
87  InitializeLibraryError = 1,
88  ShutdownLibraryError = 2,
89  UpdateCameraListError = 3,
90  GetCameraInfoError = 4,
91  OpenCameraError = 5,
92  CloseCameraError = 6,
93  MemoryAllocationError = 7,
94  ProcessingError = 8,
95  ReadParameterError = 9,
96  SetParameterError = 10,
97  StartAcquiringError = 11,
98  StopAcquiringError = 12,
99  GetBufferError = 13,
100  BufferCompletedWithZeros = 14,
101  AbortGetBufferError = 15,
102  RequeueBufferError = 16,
103  FlushBufferError = 17,
104  TimeoutError = 18,
105  CameraFileError = 19,
106  DongleNotFound = 20,
107  NumErrors = 21,
108  DLLExpired = 22
109  };
110 
115  {
116  NoCamera = 0,
117  USB3 = 1,
118  CameraLink = 2,
119  NI1433 = 3,
120  NumCameras = 4
121  };
122 
129  {
130  Idle = 0,
131  LibraryInitialized = 1,
132  CameraOpened = 2,
133  ParametersSet = 4,
134  CameraAcquiring = 8
135  };
136 
137  virtual ~IWPOCTCamera() { }
138 
140  // Getters
142 
144  virtual bool IsInitialized () const = 0;
145 
147  virtual bool IsOpened () const = 0;
148 
150  virtual bool AreParametersSet () const = 0;
151 
153  virtual bool IsAcquiring () const = 0;
154 
156  virtual int GetScanWidth () const = 0;
157 
159  virtual int GetScanHeight () const = 0;
160 
165  virtual bool GetScanWidthAndHeight(int* width, int* height) const = 0;
166 
169  virtual int GetCameraWidth () const = 0;
170 
172  virtual int GetNumCameras () const = 0;
173 
179  virtual const char* GetCameraID (int index) = 0;
180 
182  virtual int GetNumBuffers () const = 0;
183 
186  virtual int GetLinesLost () const = 0;
187 
191  virtual int GetTriggersMissed () const = 0;
192 
196  virtual float GetLinePeriod () const = 0;
197 
200  virtual float GetExposureTime () const = 0;
201 
205  virtual int GetTriggerMode () const = 0;
206 
209  virtual int GetCameraType () const = 0;
210 
214  virtual int GetNumBitsInPixel () const = 0;
215 
217  virtual int GetNumBytesInPixel () const = 0;
218 
221  virtual int GetAcquisitionTimeout () const = 0;
222 
226  virtual int GetResourceIndex () const = 0;
227 
230  virtual const char* GetCameraFileName () const = 0;
231 
233  // Setters
235 
241  virtual bool SetScanHeight (int value) = 0;
242 
250  virtual bool SetNumBuffers (int value) = 0;
251 
258  virtual bool SetLinePeriod (float value) = 0;
259 
264  virtual bool SetExposureTime (float value) = 0;
265 
271  virtual bool SetTriggerMode (int value) = 0;
272 
278  virtual bool SetCameraFileName (const char* name) = 0;
279 
284  virtual bool SetAcquisitionTimeout (int value) = 0;
285 
290  virtual bool SetResourceIndex (int value) = 0;
291 
293  // Methods
295 
299  virtual bool InitializeLibrary () = 0;
300 
304  virtual bool ShutDownLibrary () = 0;
305 
306  // -------------------------------------------------------------------------
307  // Open the camera
308  // -------------------------------------------------------------------------
309 
315  virtual bool Open (const char* id) = 0;
316 
323  virtual bool Open (int id) = 0;
324 
328  virtual bool Close () = 0;
329 
330  // -------------------------------------------------------------------------
331  // Parameters
332  // -------------------------------------------------------------------------
333 
343  virtual bool ReadParameter (unsigned int address, unsigned int* value) const = 0;
344 
352  virtual bool WriteParameter (unsigned int address, unsigned int value) = 0;
353 
357  virtual bool SetParameters () = 0;
358 
369  virtual bool SetParameters (int height, int numBuffers) = 0;
370 
373  virtual bool StartAcquiring () = 0;
374 
379  virtual bool StopAcquiring (bool flushBuffers) = 0;
380 
383  virtual bool ResetDevice () = 0;
384 
385  // -------------------------------------------------------------------------
386  // Buffer and queue commands
387  // -------------------------------------------------------------------------
388 
397  virtual bool GetBuffer (void** buffer) = 0;
398 
408  virtual bool GetBuffer2 (unsigned short** buffer) = 0;
409 
419  virtual bool GetBufferCopy (unsigned short* buffer) = 0;
420 
440  virtual bool GetBufferAndIndex (void** buffer, int** index, unsigned long* frameNumber) = 0;
441 
458  virtual bool GetBufferAndIndex2 (unsigned short** buffer, int** index, unsigned long* frameNumber) = 0;
459 
462  virtual bool AbortGetBuffer () = 0;
463 
469  virtual bool RequeueBuffer () = 0;
470 
479  virtual bool RequeueBuffer (int* bufferHandle) = 0;
480 
488  virtual bool FlushBuffers () = 0;
489 
490  // -------------------------------------------------------------------------
491  // Series Capture
492  // -------------------------------------------------------------------------
493 
505  virtual bool AcquireFramesWriteToDisk (const char* baseFilePath, int numFrames,
506  bool keepMemoryAllocated) = 0;
507 
518  virtual bool AcquireWriteFramesToMemory (unsigned short** data, int numFrames) = 0;
519 
526  virtual bool AcquireWriteFramesToMemory (unsigned short* data, int numFrames) = 0;
527 
528  // -------------------------------------------------------------------------
529  // Status
530  // -------------------------------------------------------------------------
531 
533  virtual IWPOCTCamera::ErrorCode GetLastError () const = 0;
534 
538 
539 // Include the section below when compiling with Swig.
540 #ifdef _RUNSWIG
547  static IWPOCTCamera* GetOCTCamera(IWPOCTCamera::CameraType cameraType);
548 
552  static bool DestroyOCTCamera(IWPOCTCamera* camera = NULL);
553 
554  static IWPOCTCamera::ErrorCode GetLastAttemptError();
555 };
556 
557 // Include the section below when compiling in Visual Studio.
558 #else
559 };
560 #ifdef __cplusplus
561 extern "C" {
562 #endif
563 
565 __declspec(dllexport) IWPOCTCamera* GetOCTCamera (IWPOCTCamera::CameraType cameraType);
566 
567 __declspec(dllexport) IWPOCTCamera::ErrorCode GetLastAttemptError();
568 
570 __declspec(dllexport) bool DestroyOCTCamera (IWPOCTCamera* camera = NULL);
571 
572 #ifdef __cplusplus
573 }
574 #endif
575 #endif
__declspec(dllexport) IWPOCTCamera *GetOCTCamera(IWPOCTCamera __declspec(dllexport) IWPOCTCamera __declspec(dllexport) bool DestroyOCTCamera(IWPOCTCamera *camera
Gets the instance of the camera object.
Definition: IWPOCTController.cpp:29
Definition: IWPOCTCamera.h:79
virtual int GetNumBitsInPixel() const =0
Gets the number of bits used in a pixel (typically 10, 12, or 16).
CameraType
The following are the camera types that are used in GetOCTCamera and GetCameraType.
Definition: IWPOCTCamera.h:115
virtual int GetAcquisitionTimeout() const =0
Gets the acquisition timeout in milliseconds.
virtual float GetLinePeriod() const =0
Gets the time between the start of line scans in microseconds.
virtual bool IsInitialized() const =0
Is the camera library initialized?
virtual bool SetCameraFileName(const char *name)=0
Sets the name of the camera configuration (CCF) file.
virtual bool SetParameters(int height, int numBuffers)=0
Sets the height of the camera buffers and the number of buffers that the camera can use.
virtual bool IsAcquiring() const =0
Is the camera currently acquiring?
virtual bool StopAcquiring(bool flushBuffers)=0
Stops the camera data acquisition.
virtual int GetNumBuffers() const =0
Get the number of image buffers.
virtual bool IsOpened() const =0
Is the camera opened?
virtual bool SetAcquisitionTimeout(int value)=0
Sets the acquisition timeout in milliseconds.
virtual IWPOCTCamera::ErrorCode GetLastError() const =0
Gets the result of the most current operation.
virtual bool AreParametersSet() const =0
Are camera parameters set?
virtual bool FlushBuffers()=0
Flushes all camera buffers so they can be used by the camera for acquisition.
virtual int GetResourceIndex() const =0
Gets the current resource index of the frame grabber (0 or 1).
virtual bool AcquireFramesWriteToDisk(const char *baseFilePath, int numFrames, bool keepMemoryAllocated)=0
Acquire consecutive image acquisitions to memory.
virtual int GetNumCameras() const =0
Get the number of cameras in system.
virtual bool SetExposureTime(float value)=0
Sets the exposure time in microseconds.
virtual int GetNumBytesInPixel() const =0
Get the size of a padded pixel in bytes (typically 2).
CurrentStates
Current states of the camera (more than one can be active) The following are status codes that are us...
Definition: IWPOCTCamera.h:129
@ Idle
Idle means the library is not initialized.
Definition: IWPOCTCamera.h:130
virtual bool Open(int id)=0
Opens the camera specified by the id.
virtual bool SetTriggerMode(int value)=0
Sets the trigger mode of the camera.
virtual bool GetBuffer2(unsigned short **buffer)=0
Gets a camera buffer and returns the pointer to the buffer.
virtual bool RequeueBuffer(int *bufferHandle)=0
Requeues the camera buffer pointed to by the bufferHandle so it can be used again.
virtual bool SetParameters()=0
Sets the height of the camera buffers and the number of buffers based on values entered with SetScanH...
virtual bool GetBufferCopy(unsigned short *buffer)=0
Gets a camera buffer and copies it into the buffer supplied.
virtual bool ResetDevice()=0
Resets the camera or frame grabber.
virtual bool GetBufferAndIndex(void **buffer, int **index, unsigned long *frameNumber)=0
Gets a camera buffer and returns a void pointer to the buffer.
virtual bool SetNumBuffers(int value)=0
Sets the number of buffers available to the camera for acquisition, but the camera is not changed unt...
virtual bool WriteParameter(unsigned int address, unsigned int value)=0
Writes a parameter or register to the camera with the value supplied.
virtual bool AcquireWriteFramesToMemory(unsigned short *data, int numFrames)=0
Write consecutive image acquisitions to memory supplied by this DLL.
virtual int GetTriggersMissed() const =0
Gets the triggers missed because it occurred before scanning for the current trigger finished.
virtual bool StartAcquiring()=0
Starts the camera acquiring frames of data.
virtual bool SetResourceIndex(int value)=0
Sets the active resource index if the frame grabber supports it.
virtual const char * GetCameraFileName() const =0
Gets the name of the camera configuration file (CCF) file being used.
virtual bool AcquireWriteFramesToMemory(unsigned short **data, int numFrames)=0
Write consecutive image acquisitions to memory supplied by the application.
virtual bool SetLinePeriod(float value)=0
Sets the period between lines in microseconds.
virtual int GetScanHeight() const =0
Get the height of a scan.
virtual float GetExposureTime() const =0
Gets the time of the camera in microseconds.
virtual bool GetBuffer(void **buffer)=0
Gets a camera buffer and returns a void pointer to the buffer.
virtual bool ReadParameter(unsigned int address, unsigned int *value) const =0
Reads a parameter or register from the camera and returns the value in the value argument.
virtual const char * GetCameraID(int index)=0
Get the camera ID string.
virtual bool AbortGetBuffer()=0
Cancel the GetBuffer call.
virtual int GetCameraType() const =0
Gets the camera type of the camera object, either CameraLink or e2v OctoPlus USB3 (National Instrumen...
virtual bool Close()=0
Closes the camera opened with the Open command.
virtual bool GetBufferAndIndex2(unsigned short **buffer, int **index, unsigned long *frameNumber)=0
Gets a camera buffer and returns a void pointer to the buffer.
virtual bool Open(const char *id)=0
Opens the camera specified by the id.
virtual bool GetScanWidthAndHeight(int *width, int *height) const =0
Get the width and height of a scan.
virtual bool ShutDownLibrary()=0
Shuts down the camera library.
virtual int GetLinesLost() const =0
Get the number of lines lost in the last frame.
virtual bool RequeueBuffer()=0
Requeues the most recent camera buffer obtained so it can be used again.
virtual int GetCameraWidth() const =0
Get the width of the camera in pixels.
virtual bool InitializeLibrary()=0
Opens the camera library.
virtual int GetTriggerMode() const =0
Get the trigger mode (internal, external with auto exposure, or external with specified exposure).
ErrorCode
The following are error codes that are used within the camera.
Definition: IWPOCTCamera.h:85
virtual IWPOCTCamera::CurrentStates GetCurrentState() const =0
Gets the current status of the camera.
virtual bool SetScanHeight(int value)=0
Sets the scan height size but the camera is not changed until SetParameters is called.
virtual int GetScanWidth() const =0
Get the width of a scan (e.g. 2048)