Describes the memory management of the library.
More...
|
int | SK_QUEUEBUFFERSIZE (int CamID) |
| Returns the size of the queue buffer. More...
|
|
unsigned char * | SK_GETQUEUEBUFFER (int CamID) |
| Returns the pointer to the queue buffer. More...
|
|
unsigned char * | SK_GETBUFFER (int CamID, int BufferID, unsigned char *pData) |
| Returns pointer to queue buffer. More...
|
|
unsigned char * | SK_GETSCANADDR (int CamID, int BufferID, size_t lineNumber) |
| Returns the address of the specified line scan number in buffer of specified buffer object. More...
|
|
void * | SK_ALLOC_BUFFER (int CamID, size_t size, int BufferID) |
| Allocates memory buffer for line scan data with number of bytes. More...
|
|
void * | SK_ALLOC_LINES (int CamID, size_t lines, int BufferID) |
| Allocates memory buffer for line scan data with number of lines. More...
|
|
int | SK_FREE_BUFFER (int CamID, int BufferID) |
| Frees memory buffer, which were allocated by SK_ALLOC_BUFFER or SK_ALLOC_LINES. More...
|
|
size_t | SK_GET_BUFFER_LINES (int CamID, int BufferID) |
| Returns the number of lines which the memory can store. More...
|
|
size_t | SK_GET_BUFFER_SIZE (int CamID, int BufferID) |
| Returns the number of bytes which the memory can store. More...
|
|
int | SK_SETUSERBUFFERQUEUE (int CamID, void *pBufferList, int buffersize, int numberOfBuffers) |
| Installs a user managed buffer queue. More...
|
|
Describes the memory management of the library.
void* SK_ALLOC_BUFFER |
( |
int |
CamID, |
|
|
size_t |
size, |
|
|
int |
BufferID |
|
) |
| |
Allocates memory buffer for line scan data with number of bytes.
Example:
SK_GRAB(m_CamID, 0, 2000,
false, 0, SK_FREERUN);
- Parameters
-
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
size | size of memory buffer in bytes (size results from SK_GETBYTESPERLINE * lines per image to acquire) |
BufferID | number of memory object, default = 0 (range 0 ... 3) |
- Returns
- pointer to buffer as (void *) pointer, else nullptr
void* SK_ALLOC_LINES |
( |
int |
CamID, |
|
|
size_t |
lines, |
|
|
int |
BufferID |
|
) |
| |
Allocates memory buffer for line scan data with number of lines.
Example:
SK_GRAB(m_CamID, 0, 2000,
false, 0, SK_FREERUN);
- Parameters
-
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
lines | number of lines to scan |
BufferID | number of memory object, default = 0 (range 0 ... 3) |
- Returns
- pointer to buffer as (void *) pointer, else nullptr
int SK_FREE_BUFFER |
( |
int |
CamID, |
|
|
int |
BufferID |
|
) |
| |
Frees memory buffer, which were allocated by SK_ALLOC_BUFFER or SK_ALLOC_LINES.
- Parameters
-
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
BufferID | id of memory object, default = 0 (range -1, 0 ... 3)
-1 = free all memory objects |
- Returns
- SK_RESULT_OK on success, else see Error Code Table
size_t SK_GET_BUFFER_LINES |
( |
int |
CamID, |
|
|
int |
BufferID |
|
) |
| |
Returns the number of lines which the memory can store.
- Parameters
-
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
BufferID | id of memory object, default = 0 (range 0 ... 3) |
- Returns
- number of lines, else 0
size_t SK_GET_BUFFER_SIZE |
( |
int |
CamID, |
|
|
int |
BufferID |
|
) |
| |
Returns the number of bytes which the memory can store.
- Parameters
-
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
BufferID | id of memory object, default = 0 (range 0 ... 3) |
- Returns
- number of bytes, else 0
unsigned char* SK_GETBUFFER |
( |
int |
CamID, |
|
|
int |
BufferID, |
|
|
unsigned char * |
pData |
|
) |
| |
Returns pointer to queue buffer.
This function returns the pointer to queue buffer and if pData
is not nullptr, pData
get the pointer to the buffer too,
- Parameters
-
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
BufferID | number of memory object, default = 0 |
pData | pointer to user managed memory (if not nullptr, then it will get the same value as returned pointer) |
- Returns
- pointer to buffer, else nullptr
unsigned char* SK_GETQUEUEBUFFER |
( |
int |
CamID | ) |
|
Returns the pointer to the queue buffer.
- Parameters
-
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
- Returns
- pointer to queue buffer, else nullptr
unsigned char* SK_GETSCANADDR |
( |
int |
CamID, |
|
|
int |
BufferID, |
|
|
size_t |
lineNumber |
|
) |
| |
Returns the address of the specified line scan number in buffer of specified buffer object.
- Parameters
-
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
BufferID | number of memory object, default = 0 |
lineNumber | line scan number |
- Returns
- pointer to specified line scan number in buffer, else nullptr
int SK_QUEUEBUFFERSIZE |
( |
int |
CamID | ) |
|
Returns the size of the queue buffer.
- Parameters
-
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
- Returns
- size of the queue buffer in bytes, else see Error Code Table
int SK_SETUSERBUFFERQUEUE |
( |
int |
CamID, |
|
|
void * |
pBufferList, |
|
|
int |
buffersize, |
|
|
int |
numberOfBuffers |
|
) |
| |
Installs a user managed buffer queue.
This function allows the user to manage the buffer queue by himself. If it is not required, the function SK_GRABCONTINUOUS with grabInUserBufferQueue
= false is recommended.
Example to create the buffer queue and call the function:
if (m_pData) delete m_pData;
m_pData = new unsigned char[m_nrOfBuffer * m_imagesize];
memset(m_pData, 0, m_nrOfBuffer * m_imagesize);
std::vector<unsigned char *> m_bufferList;
for(int i = 0; i < m_nrOfBuffer; i++)
m_bufferList.push_back(static_cast<unsigned char *>(m_pData + i * m_imageSize));
- Note
- All frames must have the same size.
- Parameters
-
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
pBufferList | pointer to the buffer list |
buffersize | size of each frame in bytes (max 65500 lines * SK_GETBYTESPERLINE ) |
numberOfBuffers | number of frames |
- Returns
- SK_RESULT_OK on success, else see Error Code Table