USB 2.0 USB 3.x GigE |
USB 2.0 USB 3.x GigE |
Syntax
INT is_AllocImageMem (HIDS hCam, INT width, INT height, INT bitspixel, char** ppcMem, INT* pnMemId)
Description
is_AllocImageMem() allocates an image memory for an image having its dimensions defined by width and height and its color depth defined by bitspixel. The memory size is:
size = [width * int((bitspixel + 7) / 8)] * height
The line increment is calculated as:
lineinc = width * int[(bitspixel + 7) / 8]
To read out the line increment, you can use the is_GetImgMemPitch() function.
The starting address of the memory area is returned in ppcMem.
pid returns an ID for the allocated memory. A newly allocated memory is not directly active, i.e. digitised images will not be stored immediately in this new memory. It must first be made active using is_SetImageMem().
The returned pointer must be write-protected and may not be altered because it will be used for all further ImageMem functions. To release the memory, you can use is_FreeImageMem().
In the Direct3D or OpenGL modes, image memory allocation is not necessary. |
RGB16 and RGB15 require the same amount of memory, but can be distinguished by the bitspixel parameter. For information on the bit depths of different color formats please refer to the Appendix: Color and memory formats chapter. |
In case the operating system is short of physical memory, today's OS versions swap individual areas of the RAM that have not been used for some time out to the slower hard disk. This can slow down image capture if more image memory has been allocated than can be provided by the RAM at a time. |
Input parameters
hCam |
Camera handle |
width |
Image width |
height |
Image height |
bitspixel |
Image bit depth (bits per pixel). |
ppcMem |
Returns the pointer to the memory starting address |
pnMemId |
Returns the ID of this memory |
Return values
IS_CANT_ADD_TO_SEQUENCE |
The image memory is already included in the sequence and cannot be added again. |
IS_INVALID_CAMERA_HANDLE |
Invalid camera handle |
IS_INVALID_MEMORY_POINTER |
Invalid pointer or invalid memory ID |
IS_INVALID_PARAMETER |
One of the submitted parameters is outside the valid range or is not supported for this sensor or is not available in this mode. |
IS_NO_SUCCESS |
General error message |
IS_OUT_OF_MEMORY |
No memory could be allocated. |
IS_SEQUENCE_BUF_ALREADY_LOCKED |
The memory could not be locked. The pointer to the buffer is invalid. |
IS_SUCCESS |
Function executed successfully |
Related functions
Sample programs
•uEyeRotationDemo (C++)