Memory management of the library.
More...
|
size_t | SK_QUEUEBUFFERSIZE (int CamID) |
| Returns the size of the queue buffer. More...
|
|
PUCHAR | SK_GETQUEUEBUFFER (int CamID) |
| Returns the pointer to the queue buffer. More...
|
|
PVOID | SK_GETBUFFER (int CamID, int BufferID, unsigned char *pData) |
| Returns pointer to queue buffer. More...
|
|
void * | SK_GETSCANADDR (int CamID, int BufferID, int lineNumber) |
| Returns the address of the specified line scan number in buffer of specified buffer object. More...
|
|
PVOID | SK_ALLOC_BUFFER (int CamID, size_t Size, int BufferID) |
| Allocates memory buffer for line scan data with number of bytes. More...
|
|
PVOID | SK_ALLOC_LINES (int CamID, size_t lines, int BufferID) |
| Allocates memory buffer for line scan data with number of lines. More...
|
|
void | 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...
|
|
Memory management of the library.
◆ SK_ALLOC_BUFFER()
PVOID SK_ALLOC_BUFFER |
( |
int |
CamID, |
|
|
size_t |
Size, |
|
|
int |
BufferID |
|
) |
| |
Allocates memory buffer for line scan data with number of bytes.
Example:
- 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 NULL
◆ SK_ALLOC_LINES()
PVOID SK_ALLOC_LINES |
( |
int |
CamID, |
|
|
size_t |
lines, |
|
|
int |
BufferID |
|
) |
| |
Allocates memory buffer for line scan data with number of lines.
Example:
- 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 NULL
◆ SK_FREE_BUFFER()
void 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
◆ SK_GET_BUFFER_LINES()
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
◆ SK_GET_BUFFER_SIZE()
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
◆ SK_GETBUFFER()
PVOID 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 NULL, 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 NULL, then it will get the same value as returned pointer) |
- Returns
- pointer to buffer, else NULL
◆ SK_GETQUEUEBUFFER()
PUCHAR 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 NULL
◆ SK_GETSCANADDR()
void* SK_GETSCANADDR |
( |
int |
CamID, |
|
|
int |
BufferID, |
|
|
int |
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 NULL
◆ SK_QUEUEBUFFERSIZE()
size_t 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
◆ SK_SETUSERBUFFERQUEUE()
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