Instruction manual
the supplied memory buffers.
FrameCount specifies the number of buffers in a sequence. If FrameCount is 0/1 only a single buffer is
used for image acquisition.
Pitch specifies the offset in pixel between the start locations of two following lines of an image. Pitch must
supply the value (horizontal X dimension) used to allocate the image memory buffer. With user defined
image buffers the Pitch is fixed to the specified value, e.g. a call to el_SetAcqWindow will not change the
Pitch.
The image buffer pointers supplied with MemStart are returned by el_InitHW() for compatibility reasons.
Identification of Image Memory Buffers:
If more than one sequence is defined the returned value in *BuffNo can be used by el_NewMemBuffer to
switch between sequences already allocated. If only one sequence is used, BuffNo can be set to NULL
(WARNING NULL can not be used with current software release). In this case no identifier is assigned for
the buffer.
CAVEATS: When the function is called, all frame buffers created before are invalid, and a new buffer or
sequence is created depending on the parameters of the function. Single buffers and sequences can be
freed by the function el_FreeMemBuffer .
User defined image memory:
To use user defined image memory together with el_InitHW some conditions have to mentioned:
If image memory is allocated with malloc() or with user specific allocation routines the start address of
each image buffer passed to el_InitHW must be page (on HiPerCam1 0x20000) aligned otherwise
el_InitHW will return with error.
To request page aligned memory, please use one of the following methods:
The function VirtualAlloc() reserves or commits a region of memory in the virtual address space of your
application. Memory allocated with VirtualAlloc() can not be exported to other applications.
To use memory mapped files as shared memory for multiple applications use the functions
CreateFileMapping() and MapViewOfFiles(). For detailed information, please refer to the function
description within the Windows SDK.Allocating Image Memory
SEE ALSO: el_NewMemBuffer , el_FreeMemBuffer
EXAMPLE:
// Initialize buffers with default sizes.
if((vidbufpoi = el_InitHW (BoardId, NULL, 0, 0, 0, 0, 0))
== NULL){
sprintf( str, "Initializing video hardware. (err-no: %d)",
el_GetErrorCode() );
MessageBox( NULL, str, "Error", MB_OK ); /* Windows only */
bErrorOnHardwareInit = TRUE;
}
5.2.23. el_NewMemBuffer
void**
el_NewMemBuffer ( long BoardId, void** MemStart, long SizeX, long SizeY, long
FrameCount, long Pitch, long *BuffNo );
PARAMETERS:
Chapter 5. Programmers
Reference
68