beautypg.com

Sensoray 711 User Manual

Page 21

background image

22

Sensoray Model 711 Instruction Manual

the most common.

External buffer must be allocated by an application prior to the call to X11_AllocBuffer. In
this case a pointer to this buffer is passed to X11_AllocBuffer, which insures image
capture into this pre-allocated buffer. The size of the buffer should match the image format
settings. This option is useful when interfacing to a different application, or library, e.g. an
image processing package. Creating an image buffer externally, and then "mapping" an
acquisition buffer onto it provides an easy interface to the third party software, eliminating
the need for image copying. See the sample application that illustrates interfacing to Matrox
Imaging Library (MIL) for the details. Note:

Available only in SX11 Enhanced SDK.

Video memory buffer is allocated in the graphics display (video card) memory. Capturing
directly into video memory provides the fastest capture-and-display operation. In this mode
the SX11 SDK makes use of DirectDraw, allowing overlays of text and/or graphics over the
captured image in real time. The application creates an image display window, and passes
its handle to X11_AllocBuffer. All information that has to show on top of the image is output
to the window client area the way it is usually done for Windows applications. A "key color"
has to be defined prior to the call to X11_AllocBuffer, that is the color that will be replaced
by the captured image. The key color is defined by MODE.advanced.keycolor. For
example, if the key color is white (RGB(255,255,255)), the captured image will show through
all white pixels of the window's client area, while all pixels that are not white will show on top
of the captured image. The captured image format in this mode has to be YCrCb
(mode.color=COLOR_YCRCB). The video card should be capable of DirectDraw and YUV
overlay surfaces support. Multiple frame buffers are not supported in this mode. Onle one
overlay window can be created at a time. See the corresponding sample application for the
details. Note:

Available only in SX11 Enhanced SDK.

Example
//mode.advanced.buffertype = BUF_MEM
//dwFrames = number of frames to allocate
ecode = X11_AllocBuffer (&mode, &buffer, dwFrames);

//mode.advanced.buffertype = BUF_EXT
//p_extbuf = pointer to the external buffer
ecode = X11_AllocBuffer (&mode, &buffer, (DWORD) p_extbuf);

//mode.advanced.buffertype = BUF_VIDEO
//mode.advanced.keycolor = RGB (255, 255, 255) (for example)
//hwnd = image display window handle
ecode = X11_AllocBuffer (&mode, &buffer, (DWORD) hwnd);

X11_FreeBuffer

__declspec(dllexport) void __stdcall X11_FreeBuffer (hbuf)

HBUF hbuf;

/* image buffer handle */

The X11_FreeBuffer function releases the resources associated with an image buffer.

Parameter Description
hbuf

Handle of the image buffer to free.

Notes