![]() |
SK91USB3-WIN
5.5.0
|
Explanations and examples for grabbing of lines or images. More...
Functions | |
| int | SK_GRAB (int CamID, unsigned char *pData, size_t lines, size_t iTimeOutMs, BOOL NoWait, int FrameSync, int LineSyncMode) |
| Grabbing a desired number of lines. More... | |
| int | SK_GRAB_BUFFER (int CamID, int bufferID, size_t iTimeOutMs, BOOL NoWait, int FrameSync, int LineSyncMode) |
| Grabs into given internal buffer. More... | |
| int | SK_WAITFORSCAN (int CamID, unsigned int iTimeOutMs) |
| Waits until grab is finished. More... | |
| int | SK_GRABCONTINUOUS (int CamID, int lines, size_t timeoutMS, bool grabInUserBufferQueue, int NumberOfBuffers, bool FrameSync, int LineSyncMode) |
| Grabs continuously images into a ring buffer. More... | |
| int | SK_GETIMAGE (int CamID, unsigned char **pImage, size_t timeoutMS) |
| Returns the pointer to currently filled buffer. More... | |
| int | SK_STOPGRABBING (int CamID) |
| Stops image grabbing. More... | |
| int | SK_GETIMAGEID (int CamID) |
| Returns an consecutively image ID number. More... | |
| int | SK_GETRESULT (int CamID) |
| Returns the current result status. More... | |
| int | SK_SETBITDEPTH (int CamID, int bitDepth) |
| Setting the output data format. More... | |
| int | SK_GETBITDEPTH (int CamID) |
| Returns the bit depth of output data format. More... | |
| size_t | SK_GETLINES (int CamID) |
| Returns the current number of lines for grabbing. More... | |
| int | SK_DATATRANSFERDIAGNOSIS (int CamID, int enable, LPCTSTR logFilename) |
| The enabled diagnosis allows the checking of data streaming for lost lines or lost frames. More... | |
| size_t | SK_GETLOSTFRAMES (int CamID) |
| Returns the number of lost frames, if SK_DATATRANSFERDIAGNOSIS is enabled. More... | |
Explanations and examples for grabbing of lines or images.
| int SK_DATATRANSFERDIAGNOSIS | ( | int | CamID, |
| int | enable, | ||
| LPCTSTR | logFilename | ||
| ) |
The enabled diagnosis allows the checking of data streaming for lost lines or lost frames.
| CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
| enable | 1 = enable, 0 = disable |
| logFilename | file name for saving diagnosis report, NULL= no saving |
| int SK_GETBITDEPTH | ( | int | CamID | ) |
Returns the bit depth of output data format.
Valid values are:
| bit depth | output format |
|---|---|
| 1 | thresholding mode, 2 byte per transition |
| 2 | thresholding mode with subpixel, 2 byte per transition, sensor > 8k: 4 byte per pixel |
| 8 | 8 bit resolution, 1 byte per pixel |
| 12 | 12 bit resolution, 2 bytes per pixel |
| CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
| int SK_GETIMAGE | ( | int | CamID, |
| unsigned char ** | pImage, | ||
| size_t | timeoutMS | ||
| ) |
Returns the pointer to currently filled buffer.
This function gives access to actual frame from continuous image acquisition.
pImage.| CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
| pImage | pointer to pointer of the buffer with last grabbed image |
| timeoutMS | timeout in milliseconds |
| int SK_GETIMAGEID | ( | int | CamID | ) |
Returns an consecutively image ID number.
| CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
| size_t SK_GETLINES | ( | int | CamID | ) |
Returns the current number of lines for grabbing.
| CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
| size_t SK_GETLOSTFRAMES | ( | int | CamID | ) |
Returns the number of lost frames, if SK_DATATRANSFERDIAGNOSIS is enabled.
| CamID | id of camera |
| int SK_GETRESULT | ( | int | CamID | ) |
Returns the current result status.
| CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
| int SK_GRAB | ( | int | CamID, |
| unsigned char * | pData, | ||
| size_t | lines, | ||
| size_t | iTimeOutMs, | ||
| BOOL | NoWait, | ||
| int | FrameSync, | ||
| int | LineSyncMode | ||
| ) |
Grabbing a desired number of lines.
This function starts grabbing images with the defined number of lines lines.
If the parameter noWait is TRUE, the function will be come back immediately. Use the function SK_WAITFORSCAN to check the completed image acquisition.
For an example how to grab images, see Grab an image into user managed buffer .
| CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
| pData | Destination buffer to write grabbed image into |
| lines | number of lines to grab, minimum = 1, maximum = 65500 |
| iTimeOutMs | time in milliseconds (ms) to wait before timeout error occurs |
| NoWait | true = function returns immediately, useful for image acquistion false = function blocks until image is ready |
| FrameSync | -1 = no change, 1 = wait for FrameSync trigger, 0 = FrameSync trigger off |
| LineSyncMode | -1 = no change, 0 = Free Run, 1 = Line Start, 4 = Exporsure Start, 5 = Exposure Control |
| int SK_GRAB_BUFFER | ( | int | CamID, |
| int | bufferID, | ||
| size_t | iTimeOutMs, | ||
| BOOL | NoWait, | ||
| int | FrameSync, | ||
| int | LineSyncMode | ||
| ) |
Grabs into given internal buffer.
This function starts grabbing into the internal buffer with the ID bufferID. The size and number of lines is defined by the internal buffer.
If the parameter noWait is activated, the function SK_WAITFORSCAN must be called to get the lines / image or rather to wait for image completion.
For an example how to grab images with internal buffer, see Grab an image using internal buffer .
| CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
| bufferID | destination buffer ID |
| iTimeOutMs | time in milliseconds (ms) to wait before timeout error occurs |
| NoWait | true = function returns immediately, useful for image acquistion false = function blocks until image is ready |
| FrameSync | -1 = no change, 1 = wait for FrameSync trigger, 0 = FrameSync trigger off |
| LineSyncMode | -1 = no change, 0 = Free Run, 1 = Line Start, 4 = Exporsure Start, 5 = Exposure Control |
| int SK_GRABCONTINUOUS | ( | int | CamID, |
| int | lines, | ||
| size_t | timeoutMS, | ||
| bool | grabInUserBufferQueue, | ||
| int | NumberOfBuffers, | ||
| bool | FrameSync, | ||
| int | LineSyncMode | ||
| ) |
Grabs continuously images into a ring buffer.
This function starts continuous image grabbing of images with height of lines. A ring buffer with a size of numberOfBuffers will be written cyclical. The ring buffer can be managed internal or by the user. Acquired images can be accessed by SK_GETIMAGE.
For an example how to grab images with user ring buffer, see Continuous grabbing of frames in a user managed buffer queue .
For an example how to grab images with internal ring buffer, see Continuous grabbing of images with internal buffers .
grabInUserBufferQueue is true, the ring buffer must be previously generated by SK_SETUSERBUFFERQUEUE.| CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
| lines | number of scan lines |
| timeoutMS | timeout in milliseconds before timeout error occurs, e.g. 24 h = 86400000 |
| grabInUserBufferQueue | true = user controlled buffer, false = internal memory management |
| NumberOfBuffers | 0 = grabInUserBufferQueue == true, otherwise number of buffers to create |
| FrameSync | -1 = no change, 1 = wait for FrameSync trigger, 0 = FrameSync trigger off |
| LineSyncMode | -1 = no change, 0 = Free Run, 1 = Line Start, 4 = Exporsure Start, 5 = Exposure Control |
| int SK_SETBITDEPTH | ( | int | CamID, |
| int | bitDepth | ||
| ) |
Setting the output data format.
This function sets the resolution of Analog Digital Converter and determines the output data format.
Valid values for bitDepth are:
| bit depth | output format |
|---|---|
| 1 | thresholding mode, 2 byte per transition |
| 2 | thresholding mode with subpixel, 2 byte per transition, sensor > 8k: 4 byte per pixel |
| 8 | 8 bit resolution, 1 byte per pixel |
| 12 | 12 bit resolution, 2 bytes per pixel |
| CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
| bitDepth | bit depth |
| int SK_STOPGRABBING | ( | int | CamID | ) |
Stops image grabbing.
| CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
| int SK_WAITFORSCAN | ( | int | CamID, |
| unsigned int | iTimeOutMs | ||
| ) |
Waits until grab is finished.
If the parameter noWait of the function SK_GRAB is true, this function waits until a grab is finished or timeout error occurs. This is suitable for asynchronous grabbing, e.g. after starting a grab with immediately return from SK_GRAB, a scanner translation unit should be started. This function waits until the grab is ready.
| CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
| iTimeOutMs | timeout in milliseconds |
1.8.13