|
WPOCT Software Developer's Kit (SDK)
SDK For using Wasatch Photonics OCT Spectrometers
|
This class is the implementation of IWPOCTCamera. More...
#include <CameraLinkCamera.h>


Public Types | |
| enum | RegisterAddress { LinePeriod = 0x12100 , ExposureTime = 0x12108 , TriggerMode = 0x1210C } |
| Camera register. | |
| enum | ServerCategory { ServerAll , ServerAcq , ServerAcqDevice } |
| enum | ResourceType { ResourceAcq = 0 , ResourceDisplay , ResourceCab , ResourcePixPro , ResourceRtPro = ResourcePixPro , ResourceObsolete1 , ResourceGraphic , ResourceGio , ResourceCounter , ResourceAcqDevice , ResourceLast = ResourceAcqDevice } |
Public Types inherited from IWPOCTCamera | |
| enum | ErrorCode { NoError = 0 , InitializeLibraryError = 1 , ShutdownLibraryError = 2 , UpdateCameraListError = 3 , GetCameraInfoError = 4 , OpenCameraError = 5 , CloseCameraError = 6 , MemoryAllocationError = 7 , ProcessingError = 8 , ReadParameterError = 9 , SetParameterError = 10 , StartAcquiringError = 11 , StopAcquiringError = 12 , GetBufferError = 13 , BufferCompletedWithZeros = 14 , AbortGetBufferError = 15 , RequeueBufferError = 16 , FlushBufferError = 17 , TimeoutError = 18 , CameraFileError = 19 , DongleNotFound = 20 , NumErrors = 21 , DLLExpired = 22 , NoError = 0 , InitializeLibraryError = 1 , ShutdownLibraryError = 2 , UpdateCameraListError = 3 , GetCameraInfoError = 4 , OpenCameraError = 5 , CloseCameraError = 6 , MemoryAllocationError = 7 , ProcessingError = 8 , ReadParameterError = 9 , SetParameterError = 10 , StartAcquiringError = 11 , StopAcquiringError = 12 , GetBufferError = 13 , BufferCompletedWithZeros = 14 , AbortGetBufferError = 15 , RequeueBufferError = 16 , FlushBufferError = 17 , TimeoutError = 18 , CameraFileError = 19 , DongleNotFound = 20 , NumErrors = 21 , DLLExpired = 22 } |
| The following are error codes that are used within the camera. More... | |
| enum | CameraType { NoCamera = 0 , USB3 = 1 , CameraLink = 2 , NI1433 = 3 , NumCameras = 4 , NoCamera = 0 , USB3 = 1 , CameraLink = 2 , NI1433 = 3 , NumCameras = 4 } |
| The following are the camera types that are used in GetOCTCamera and GetCameraType. More... | |
| enum | CurrentStates { Idle = 0 , LibraryInitialized = 1 , CameraOpened = 2 , ParametersSet = 4 , CameraAcquiring = 8 , Idle = 0 , LibraryInitialized = 1 , CameraOpened = 2 , ParametersSet = 4 , CameraAcquiring = 8 } |
| Current states of the camera (more than one can be active) The following are status codes that are used within the camera. More... | |
| enum class | ErrorCode { NoError = 0 , InitializeLibraryError = 1 , ShutdownLibraryError = 2 , UpdateCameraListError = 3 , GetCameraInfoError = 4 , OpenCameraError = 5 , CloseCameraError = 6 , MemoryAllocationError = 7 , ProcessingError = 8 , ReadParameterError = 9 , SetParameterError = 10 , StartAcquiringError = 11 , StopAcquiringError = 12 , GetBufferError = 13 , BufferCompletedWithZeros = 14 , AbortGetBufferError = 15 , RequeueBufferError = 16 , FlushBufferError = 17 , TimeoutError = 18 , CameraFileError = 19 , DongleNotFound = 20 , NumErrors = 21 , DLLExpired = 22 , NoError = 0 , InitializeLibraryError = 1 , ShutdownLibraryError = 2 , UpdateCameraListError = 3 , GetCameraInfoError = 4 , OpenCameraError = 5 , CloseCameraError = 6 , MemoryAllocationError = 7 , ProcessingError = 8 , ReadParameterError = 9 , SetParameterError = 10 , StartAcquiringError = 11 , StopAcquiringError = 12 , GetBufferError = 13 , BufferCompletedWithZeros = 14 , AbortGetBufferError = 15 , RequeueBufferError = 16 , FlushBufferError = 17 , TimeoutError = 18 , CameraFileError = 19 , DongleNotFound = 20 , NumErrors = 21 , DLLExpired = 22 } |
| enum class | CameraType { NoCamera = 0 , USB3 = 1 , CameraLink = 2 , NI1433 = 3 , NumCameras = 4 , NoCamera = 0 , USB3 = 1 , CameraLink = 2 , NI1433 = 3 , NumCameras = 4 } |
| enum class | CurrentStates { Idle = 0 , LibraryInitialized = 1 , CameraOpened = 2 , ParametersSet = 4 , CameraAcquiring = 8 , Idle = 0 , LibraryInitialized = 1 , CameraOpened = 2 , ParametersSet = 4 , CameraAcquiring = 8 } |
Public Member Functions | |
| CameraLinkCamera () | |
| Constructor. | |
| virtual | ~CameraLinkCamera () |
| Destructor. | |
| float | GetLinePeriod () const override |
| Get the period between lines. | |
| float | GetExposureTime () const override |
| Get the exposure time. | |
| int | GetTriggerMode () const override |
| Get the trigger mode. | |
| int | GetCameraWidth () const override |
| Get the width of the camera in pixels. | |
| int | GetNumCameras () const override |
| Get the number of cameras in system. | |
| const char * | GetCameraID (int index=0) override |
| Get the camera ID string (260 chars max). | |
| int | GetNumBitsInPixel () const override |
| Get the size of a pixel in bits. | |
| int | GetNumBytesInPixel () const override |
| Get the size of a padded pixel in bytes. | |
| bool | SetLinePeriod (float value) override |
| Set the period between lines. | |
| bool | SetExposureTime (float value) override |
| Set the exposure time. | |
| bool | SetTriggerMode (int value) override |
| Set the trigger mode. | |
| bool | SetCameraFileName (const char *name) override |
| Set the name of the camera configuration file. | |
| bool | InitializeLibrary () override |
| Initializes the library. | |
| bool | ShutDownLibrary () override |
| Shuts down the camera library. More... | |
| bool | Open (const char *id) override |
| This uses the CameraLink card's server name. | |
| bool | Open (int id=0) override |
| This uses a 0 or 1 and only works for USB cameras. | |
| bool | Close () override |
| Closes the camera opened with the Open command. More... | |
| bool | ReadParameter (unsigned int address, unsigned int *value) const override |
| Reads a parameter or register from the camera and returns the value in the value argument. More... | |
| bool | WriteParameter (unsigned int address, unsigned int value) override |
| Writes a parameter or register to the camera with the value supplied. More... | |
| bool | SetParameters () override |
| Sets the height of the camera buffers and the number of buffers based on values entered with SetScanHeight and SetNumBuffers. More... | |
| bool | SetParameters (int height, int numBuffers) override |
| Sets the height of the camera buffers and the number of buffers that the camera can use. More... | |
| bool | StartAcquiring () override |
| Starts the camera acquiring frames of data. More... | |
| bool | StopAcquiring (bool flushBuffers) override |
| Stops the camera data acquisition. More... | |
| bool | GetBuffer (void **buffer) override |
| Gets a buffer from the camera. More... | |
| bool | GetBuffer2 (unsigned short **buffer) override |
| Gets a camera buffer and returns the pointer to the buffer. More... | |
| bool | GetBufferCopy (unsigned short *buffer) override |
| Gets a camera buffer and copies it into the buffer supplied. More... | |
| bool | GetBufferAndIndex (void **buffer, int **index, unsigned long *frameNumber) override |
| Gets a buffer from the camera. More... | |
| bool | GetBufferAndIndex2 (unsigned short **buffer, int **index, unsigned long *frameNumber) override |
| Gets a camera buffer and returns a void pointer to the buffer. More... | |
| bool | AbortGetBuffer () override |
| Cancel the GetBuffer call. More... | |
| bool | RequeueBuffer () override |
| Requeues the most recent camera buffer obtained so it can be used again. More... | |
| bool | RequeueBuffer (int *bufferHandle) override |
| Requeues the camera buffer pointed to by the bufferHandle so it can be used again. More... | |
| bool | FlushBuffers () override |
| Flushes all camera buffers so they can be used by the camera for acquisition. More... | |
| bool | ResetDevice () override |
| Reset camera or card. | |
Public Member Functions inherited from WPCamera | |
| WPCamera () | |
| Constructor. | |
| virtual | ~WPCamera () |
| Destructor. | |
| bool | IsInitialized () const override |
| Is the camera library initialized? | |
| bool | IsOpened () const override |
| Is the camera opened? | |
| bool | IsAcquiring () const override |
| Is the camera currently acquiring? | |
| bool | AreParametersSet () const override |
| Are camera parameters set? | |
| IWPOCTCamera::ErrorCode | GetLastError () const override |
| Gets the result of the most current operation. | |
| IWPOCTCamera::CurrentStates | GetCurrentState () const override |
| Gets the current status of the camera. More... | |
| int | GetScanWidth () const override |
| Get the width of an image. | |
| int | GetScanHeight () const override |
| Get the height of an image. | |
| bool | GetScanWidthAndHeight (int *width, int *height) const override |
| Get the width and height of a scan. | |
| int | GetNumBuffers () const override |
| Get the number of image buffers. | |
| int | GetLinesLost () const override |
| Get the number of lines lost in the last frame. | |
| int | GetTriggersMissed () const override |
| Get the number of triggers missed in the last frame. | |
| long long | GetImageSize () const |
| Get the size of an image. | |
| int | GetCameraType () const override |
| Get the camera type. | |
| int | GetAcquisitionTimeout () const override |
| Get the acquisition timeout in milliseconds. | |
| int | GetResourceIndex () const override |
| Get the resource index of the frame grabber. | |
| const char * | GetCameraFileName () const override |
| Get the name of the camera configuration file. | |
| bool | SetScanHeight (int value) override |
| Set the height of an image. | |
| bool | SetNumBuffers (int value) override |
| Set the number of image buffers. | |
| bool | SetCameraFileName (const char *name) override |
| Set the name of the camera configuration file. | |
| bool | SetAcquisitionTimeout (int value) override |
| Set the acquisition timeout in milliseconds. | |
| bool | SetResourceIndex (int value) override |
| Set the resource index of the frame grabber. | |
| bool | AcquireFramesWriteToDisk (const char *baseFilePath, int numFrames, bool keepMemoryAllocated) override |
| Write consecutive image acquisitions to memory. When finished write all to disk. More... | |
| bool | AcquireWriteFramesToMemory (unsigned short **data, int numFrames) override |
| Write consecutive image acquisitions to memory pointed to by data supplied by this dll. | |
| bool | AcquireWriteFramesToMemory (unsigned short *data, int numFrames) override |
| Write consecutive image acquisitions to memory pointed to by data supplied by the application. | |
Public Member Functions inherited from IWPOCTCamera | |
| virtual void | Dispose () |
| virtual bool | IsInitialized () |
| virtual bool | IsOpened () |
| virtual bool | AreParametersSet () |
| virtual bool | IsAcquiring () |
| virtual int | GetScanWidth () |
| virtual int | GetScanHeight () |
| virtual bool | GetScanWidthAndHeight (ref int width, ref int height) |
| virtual int | GetCameraWidth () |
| virtual int | GetNumCameras () |
| virtual int | GetNumBuffers () |
| virtual int | GetLinesLost () |
| virtual int | GetTriggersMissed () |
| virtual float | GetLinePeriod () |
| virtual float | GetExposureTime () |
| virtual int | GetTriggerMode () |
| virtual int | GetCameraType () |
| virtual int | GetNumBitsInPixel () |
| virtual int | GetNumBytesInPixel () |
| virtual int | GetAcquisitionTimeout () |
| virtual int | GetResourceIndex () |
| virtual string | GetCameraFileName () |
| virtual bool | SetCameraFileName (string name) |
| virtual bool | Open (string id) |
| virtual bool | ReadParameter (uint address, ref uint value) |
| virtual bool | WriteParameter (uint address, uint value) |
| virtual bool | GetBuffer (ref global::System.IntPtr buffer) |
| virtual bool | GetBuffer2 (ref global::System.IntPtr buffer) |
| unsafe bool | GetBufferCopy (ushort[] buffer) |
| virtual bool | GetBufferAndIndex (ref global::System.IntPtr buffer, ref global::System.IntPtr index, ref ulong frameNumber) |
| virtual bool | GetBufferAndIndex2 (ref global::System.IntPtr buffer, ref global::System.IntPtr index, ref ulong frameNumber) |
| virtual bool | RequeueBuffer (ref int bufferHandle) |
| virtual bool | AcquireFramesWriteToDisk (string baseFilePath, int numFrames, bool keepMemoryAllocated) |
| unsafe bool | AcquireWriteFramesToMemory (ref global::System.IntPtr data, int numFrames) |
| unsafe bool | AcquireWriteFramesToMemory (ushort[] data, int numFrames) |
| virtual IWPOCTCamera.ErrorCode | GetLastError () |
| virtual IWPOCTCamera.CurrentStates | GetCurrentState () |
Protected Member Functions | |
| bool | DeleteResources () override |
Protected Member Functions inherited from WPCamera | |
| void | OutputDebugMsg (const wchar_t *str) const |
| void | OutputDebugMsg (const char *str) const |
| string | FormSeriesBaseFileName (const char *baseFilePath) |
| string | FormSeriesFinalFileName (size_t index, const char *extension) |
| string | GetFilledDigits (int number, int totalDigits) |
| Gets the string prefixed with zeros so the string is a certain length. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from IWPOCTCamera | |
| static IWPOCTCamera | GetOCTCamera (IWPOCTCamera.CameraType cameraType) |
| static IWPOCTCamera.ErrorCode | GetLastAttemptError () |
| static bool | DestroyOCTCamera (IWPOCTCamera camera) |
| static bool | DestroyOCTCamera () |
Static Protected Member Functions inherited from WPCamera | |
| template<typename T > | |
| static bool | SaveMemoryToBinFile (const char *fname, long long size, const T *data) |
Protected Attributes inherited from WPCamera | |
| int | _id |
| unsigned int | _scanWidth |
| The width of an scan. | |
| unsigned int | _scanHeight |
| The height of an scan. | |
| std::atomic< ErrorCode > | _lastError |
| The most recent error code. | |
| std::atomic< CurrentStates > | _currentState |
| int | _numBuffers |
| std::atomic< int > | _linesLost |
| std::atomic< int > | _triggersMissed |
| std::atomic< int > | _acquisitionTimeout |
| std::atomic< bool > | _acquiringSeries |
| std::atomic< bool > | _abortAcquisition |
| std::atomic< long > | _dongleVal |
| Dongle check return value. | |
| int | _resourceIndex |
| CameraType | _cameraType |
| vector< unsigned short > | _acquisitionData |
| std::string | _cameraFileName |
| std::string | _seriesBaseFileName |
Protected Attributes inherited from IWPOCTCamera | |
| bool | swigCMemOwn |
This class is the implementation of IWPOCTCamera.
|
overridevirtual |
|
overridevirtual |
Closes the camera opened with the Open command.
This call should be made after the StopAcquiring API is called.
Implements IWPOCTCamera.
|
overridevirtual |
Flushes all camera buffers so they can be used by the camera for acquisition.
This call is only needed by USB cameras when acquiring is stopped. Alternatively, the flushBuffer flag can be set to true in StopAcquiring to get the same effect.
Often called after StopAcquiring is called.
Implements IWPOCTCamera.
|
overridevirtual |
Gets a buffer from the camera.
| buffer | The pointer to the data. |
Implements IWPOCTCamera.
|
overridevirtual |
Gets a camera buffer and returns the pointer to the buffer.
This call will wait until a buffer is filled before returning. If the timeout period is reached before the buffer is filled, the call returns with a false return value.
| buffer[out] | pointer to an unsigned short pointer that holds the location of the start of the camera buffer. |
Implements IWPOCTCamera.
|
overridevirtual |
Gets a buffer from the camera.
Also returns the index of the buffer.
| buffer | The pointer to the data. |
| index | The buffer index. |
| frameNumber | The frame number captured since the camera started acquiring. |
Implements IWPOCTCamera.
|
overridevirtual |
Gets a camera buffer and returns a void pointer to the buffer.
The index associated with the buffer is also returned. This index is used with USB cameras to requeue the buffer specified. The frameNumber is a number that counts up as successive frames are returned. It can be used to assure the frames are put in the correct order. GetBufferAndIndex will wait until a buffer is filled before returning. If the timeout period is reached before the buffer is filled, the call returns with a false return value.
| buffer[out] | pointer to an unsigned short pointer that holds the location of the start of the camera buffer. |
| index[out] | pointer to an int pointer that holds the index of the camera buffer. |
| frameNumber[out] | pointer to the frame number returned. This value counts up from zero when acquisition is started. |
Implements IWPOCTCamera.
|
overridevirtual |
Gets a camera buffer and copies it into the buffer supplied.
This call will wait until a buffer is filled before returning. If the timeout period is reached before the buffer is filled, the call returns with a false return value. Note that the RequeueBuffer API does not need to be called after calling this API.
| buffer[out] | void pointer to a buffer that will have the camera buffer data copied to it. |
Implements IWPOCTCamera.
|
overridevirtual |
Reads a parameter or register from the camera and returns the value in the value argument.
| address[in] | the location where the parameter is stored. |
| value[out] | pointer to int that contains the value of the register once the call returns. |
Implements IWPOCTCamera.
|
overridevirtual |
Requeues the most recent camera buffer obtained so it can be used again.
This call is used for USB cameras where only a single thread is used to acquire camera data. CameraLink frame grabbers do not need to call this API. Used with GetBuffer().
Implements IWPOCTCamera.
|
overridevirtual |
Requeues the camera buffer pointed to by the bufferHandle so it can be used again.
This call is used for USB cameras where multi-threading is used to acquire camera data. CameraLink frame grabbers do not need to call this API. Used with GetBufferAndIndex().
| bufferHandle[in] | the buffer handle obtained in the GetBufferAndIndex call. |
Implements IWPOCTCamera.
|
overridevirtual |
Sets the height of the camera buffers and the number of buffers based on values entered with SetScanHeight and SetNumBuffers.
Implements IWPOCTCamera.
|
overridevirtual |
Sets the height of the camera buffers and the number of buffers that the camera can use.
| height[in] | the height (number of line scans) of a camera buffer. |
| numBuffers[in] | the number of buffers available to the camera. Minimum value could be 2 but in reality should be between 10 and
|
Implements IWPOCTCamera.
|
overridevirtual |
Shuts down the camera library.
This should be the last step before deleting the camera object.
Implements IWPOCTCamera.
|
overridevirtual |
|
overridevirtual |
Stops the camera data acquisition.
| flushBuffers[in] | flag on whether to flush buffers after acquiring has stopped. This flag is only used by OctoPlus USB3 cameras. |
Implements IWPOCTCamera.
|
overridevirtual |
Writes a parameter or register to the camera with the value supplied.
| address[in] | the location where the parameter is stored. |
| value[in] | int that contains the value of the register to be written. |
Implements IWPOCTCamera.