WPOCT Software Developer's Kit (SDK)
SDK For using Wasatch Photonics OCT Spectrometers
USB3Camera.h
Go to the documentation of this file.
1 #pragma once
2 
8 #include <mutex>
9 #include <vector>
10 #include <atomic>
11 #include <map>
12 
13 #include <CamCmosOctUsb3.h>
14 #include "WPCamera.h"
15 
16 // Forward class declarations.
17 
18 using namespace std;
19 
21 class USB3Camera : public WPCamera
22 {
23 public:
26  {
27  ScanWidth = 0x12004,
28  ScanHeight = 0x4F00000C,
29  LinePeriod = 0x12100,
30  ExposureTime = 0x12108,
31  TriggerMode = 0x1210C,
32  TriggerFrameLineNumber = 0x12128
33  };
34 
36  USB3Camera();
37 
39  virtual ~USB3Camera();
40 
41  // Events
42 
43  // Getters
44 
46  float GetLinePeriod () const override;
47 
49  float GetExposureTime () const override;
50 
52  int GetTriggerMode () const override;
53 
55  int GetTriggerFrameLineNum () const;
56 
58  int GetCameraWidth () const override;
59 
61  int GetNumCameras () const override;
62 
64  const char* GetCameraID (int index = 0) override;
65 
67  int GetNumBitsInPixel () const override;
68 
70  int GetNumBytesInPixel () const override;
71 
72  // Setters
73 
75  bool SetLinePeriod (float value) override;
76 
78  bool SetExposureTime (float value) override;
79 
81  bool SetTriggerMode (int value) override;
82 
85  bool SetTriggerFrameLineNum (int value);
86 
88  bool SetScanHeight (int value) override;
89 
90  // Methods
91  bool InitializeLibrary () override;
92  bool ShutDownLibrary () override;
93 
95  bool Open (const char* id) override;
97  bool Open (int id = 0) override;
98  bool Close () override;
99 
100  bool ReadParameter (unsigned int address, unsigned int* value) const override;
101  bool WriteParameter (unsigned int address, unsigned int value) override;
102 
103  bool SetParameters () override;
104  bool SetParameters (int height, int numBuffers) override;
105 
106  bool StartAcquiring () override;
107  bool StopAcquiring (bool flushBuffers) override;
108 
109  bool GetBuffer (void** buffer) override;
110  bool GetBuffer2 (unsigned short** buffer) override;
111  bool GetBufferCopy (unsigned short* buffer) override;
112  bool GetBufferAndIndex (void** buffer, int** index, unsigned long* frameNumber) override;
113  bool GetBufferAndIndex2 (unsigned short** buffer, int** index, unsigned long* frameNumber) override;
114  bool AbortGetBuffer () override;
115  bool RequeueBuffer () override;
116  bool RequeueBuffer (int* bufferHandle) override;
117  bool FlushBuffers () override;
118 
120  bool ResetDevice () override;
121 
122 private:
123  std::mutex _mutexGetBuffer;
124  std::mutex _mutexCopyBuffer;
125 
126  CAM_HANDLE _hCamera;
127  tImageInfos _imageInfo;
128  tCameraInfo _curCameraInfo;
129  static bool _cameraIDsCollected;
130  static std::vector<string> _cameraIDs;
131 
132  // Initialize the members.
133  void Init ();
134  void CollectCameraIDs ();
135  bool GetCameraInfoFromId (const char* id, tCameraInfo& cameraInfo) const;
136  int GetCameraWidthInternal ();
137 
138 };
Interface and implementation of the WPCamera class.
This class is the implementation of IWPOCTCamera.
Definition: USB3Camera.h:22
RegisterAddress
Camera register.
Definition: USB3Camera.h:26
Class that converts a scanned image from one format to another.
Definition: WPCamera.h:25