36 bool IsInitialized ()
const override;
37 bool IsOpened ()
const override;
38 bool IsAcquiring ()
const override;
39 bool AreParametersSet()
const override;
58 *width = (int)_scanWidth;
66 *height = (int)_scanHeight;
90 long long GetImageSize ()
const {
return (
size_t)_scanHeight * (int)_scanWidth; }
114 bool SetNumBuffers (
int value)
override { _numBuffers = value;
return true; }
129 bool AcquireFramesWriteToDisk (
const char* baseFilePath,
int numFrames,
bool keepMemoryAllocated)
override;
132 bool AcquireWriteFramesToMemory (
unsigned short** data,
int numFrames)
override;
135 bool AcquireWriteFramesToMemory (
unsigned short* data,
int numFrames)
override;
149 std::atomic<CurrentStates> _currentState;
152 std::atomic<int> _linesLost;
153 std::atomic<int> _triggersMissed;
154 std::atomic<int> _acquisitionTimeout;
155 std::atomic<bool> _acquiringSeries;
156 std::atomic<bool> _abortAcquisition;
163 vector<unsigned short> _acquisitionData;
165 std::string _cameraFileName;
166 std::string _seriesBaseFileName;
168 virtual bool DeleteResources() {
return true; }
170 void OutputDebugMsg(
const wchar_t* str)
const
174 OutputDebugString( str );
178 void OutputDebugMsg(
const char* str)
const
182 OutputDebugStringA( str );
186 string FormSeriesBaseFileName (
const char* baseFilePath);
187 string FormSeriesFinalFileName (
size_t index,
const char* extension);
190 template <
typename T>
191 static bool SaveMemoryToBinFile(
const char* fname,
long long size,
const T* data)
198 fout.open(fname, ios::out | ios::binary);
201 fout.write((
char*)data, size *
sizeof(T));
217 std::mutex _mutexTimeCheck;
219 static std::atomic<bool> _id0Taken;
220 static std::atomic<double> _timeCheckInterval;
221 static std::atomic<clock_t> _startTime;
std::string GetFilledDigits(int number, size_t totalDigits)
Gets the string prefixed with zeros so the string is a certain length.
Definition: Helper.cpp:61
Interface of the IWPOCTCamera class.
Class that converts a scanned image from one format to another.
Definition: WPCamera.h:25
bool SetScanHeight(int value) override
Set the height of an image.
Definition: WPCamera.h:107
int GetScanWidth() const override
Get the width of an image.
Definition: WPCamera.h:45
int GetAcquisitionTimeout() const override
Get the acquisition timeout in milliseconds.
Definition: WPCamera.h:96
bool SetResourceIndex(int value) override
Set the resource index of the frame grabber.
Definition: WPCamera.h:123
int GetLinesLost() const override
Get the number of lines lost in the last frame.
Definition: WPCamera.h:84
bool GetScanWidthAndHeight(int *width, int *height) const override
Get the width and height of a scan.
Definition: WPCamera.h:51
std::atomic< ErrorCode > _lastError
The most recent error code.
Definition: WPCamera.h:148
long long GetImageSize() const
Get the size of an image.
Definition: WPCamera.h:90
int GetTriggersMissed() const override
Get the number of triggers missed in the last frame.
Definition: WPCamera.h:87
int GetResourceIndex() const override
Get the resource index of the frame grabber.
Definition: WPCamera.h:99
int GetScanHeight() const override
Get the height of an image.
Definition: WPCamera.h:48
bool SetCameraFileName(const char *name) override
Set the name of the camera configuration file.
Definition: WPCamera.h:117
unsigned int _scanWidth
The width of an scan.
Definition: WPCamera.h:142
const char * GetCameraFileName() const override
Get the name of the camera configuration file.
Definition: WPCamera.h:102
int GetNumBuffers() const override
Get the number of image buffers.
Definition: WPCamera.h:81
unsigned int _scanHeight
The height of an scan.
Definition: WPCamera.h:145
bool SetAcquisitionTimeout(int value) override
Set the acquisition timeout in milliseconds.
Definition: WPCamera.h:120
int GetCameraType() const override
Get the camera type.
Definition: WPCamera.h:93
bool SetNumBuffers(int value) override
Set the number of image buffers.
Definition: WPCamera.h:114
std::atomic< long > _dongleVal
Dongle check return value.
Definition: WPCamera.h:159
Definition: IWPOCTCamera.h:79
CameraType
The following are the camera types that are used in GetOCTCamera and GetCameraType.
Definition: IWPOCTCamera.h:115
CurrentStates
Current states of the camera (more than one can be active) The following are status codes that are us...
Definition: IWPOCTCamera.h:129
ErrorCode
The following are error codes that are used within the camera.
Definition: IWPOCTCamera.h:85