Home > C: Programming > Function Descriptions > History back  Previous chapter  Next chapter  Print  

is_AllocImageMem

uEye Camera Manual Version 3.80

is_AllocImageMem

Windows_Logo

Linux_Logo

USB 2.0

GigE

USB 2.0

GigE

Syntax

INT is_AllocImageMem (HIDS hCam, 
INT width, INT height, INT bitspixel,
char** ppcImgMem, INT* pid)

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 at least:

size = [width * ((bitspixel + 1) / 8) + adjust] * height (for details on adjust, see below)

 

The line increment is calculated as:

line        = width * [(bitspixel + 1)  / 8]

lineinc        = line + adjust.

adjust        = 0, if line can be divided by 4 without remainder

adjust        = 4 - rest(line / 4), if line cannot be divided by 4 without remainder

 

To read out the line increment, you can use the is_GetImgMemPitch() function.

The starting address of the memory area is returned in ppcImgMem.

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().

 

Hinweis

In the Direct3D modes, image memory allocation is not necessary.

Hinweis

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.

Hinweis

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).

ppcImgMem

Returns the pointer to the memory starting address

pid

Returns the ID of this memory

Return Values

IS_SUCCESS

Function executed successfully

IS_NO_SUCCESS

General error message

Related Functions

is_FreeImageMem()
is_AddToSequence()
is_SetImageMem()
is_SetAllocatedImageMem()
is_GetColorDepth()
is_GetImgMemPitch()

Sample Programs

uEyeRotationDemo (C++)

Suggestion for improvement? Send us your short Feedback on this chapter. Thank you very much!


© 2010 IDS Imaging Development Systems GmbH
http://www.ids-imaging.com