Home > C: Programming > Function Descriptions > | History back Previous chapter Next chapter Print |
is_DirectRenderer |
uEye Camera Manual Version 3.80
is_DirectRenderer
USB 2.0 GigE |
- |
Syntax
INT is_DirectRenderer (HIDS hCam,
UINT nMode,
void* pParam,
UINT nSize)
Description
is_DirectRenderer() provides a set of advanced rendering functions and allows inserting overlay data into the camera's live image without flicker. The graphics card functions of the Direct3D library are supported under Windows.
Notes on using the function:
The second input parameter nMode specifies the effect of the is_DirectRenderer() call.
The value of the third parameter pParam depends on the mode selected with nMode: For example, when setting the overlay size (nMode = DR_SET_OVERLAY_SIZE), a pointer to an array of two values (x and y) is passed (see code samples). When you load a bitmap image (nMode = DR_LOAD_OVERLAY_FROM_FILE), pParam passes the path to the file (see code samples). The required parameters are illustrated in the sample codes at the end of this section.
|
|
Input Parameters
hCam |
Camera handle |
|||||
nMode |
||||||
DR_GET_OVERLAY_DC |
Returns the device context (DC) handle to the overlay area of the graphics card.
|
|||||
DR_RELEASE_OVERLAY_DC |
Releases the device context (DC) handle.
|
|||||
DR_GET_MAX_OVERLAY_SIZE |
Returns the width x and height y of the maximum overlay area supported by the graphics card. Code sample |
|||||
DR_SET_OVERLAY_SIZE |
Defines the size of the overlay area (default: current camera image size). Code sample |
|||||
DR_GET_OVERLAY_SIZE |
Returns the size of the overlay area. (Sample: see DR_SET_OVERLAY_SIZE) |
|||||
DR_SET_OVERLAY_POSITION |
Defines the position of the overlay area. Code sample |
|||||
DR_GET_OVERLAY_KEY_COLOR |
Returns the RGB values of the current key color (default: black). Code sample |
|||||
DR_SET_OVERLAY_KEY_COLOR |
Defines the RGB values of the key color. More details
|
|||||
DR_SHOW_OVERLAY |
Enables overlay display on top of the current camera image. Code sample |
|||||
DR_HIDE_OVERLAY |
Disables overlay display. Code sample |
|||||
DR_ENABLE_SCALING |
Enables real-time scaling of the image to the size of the display window. The overlay is scaled together with the camera image. Code sample |
|||||
DR_ENABLE_IMAGE_SCALING |
Enables real-time scaling of the image to the size of the display window. The overlay is not scaled. (Sample: see DR_ENABLE_SCALING) |
|||||
DR_DISABLE_SCALING |
Disables real-time scaling. Code sample |
|||||
DR_ENABLE |
Enables a semi-transparent display of the overlay area. More details
|
|||||
DR_DISABLE |
Disables the semi-transparent display of the overlay area. Code sample |
|||||
DR_SET_VSYNC_AUTO |
Enables synchronization of the image display with the monitor's image rendering. The image is displayed upon the monitor's next VSYNC signal. Code sample |
|||||
DR_SET_VSYNC_OFF |
Disables image display synchronization. The image is displayed immediately. Code sample |
|||||
DR_SET_USER_SYNC |
Enables synchronization of the image display with a monitor pixel row specified by the user. More details
|
|||||
DR_GET_USER |
Returns the minimum and maximum row position for DR_SET_USER_SYNC. Code sample |
|||||
DR_LOAD_OVERLAY_FROM_FILE |
Loads a bitmap image (*.BMP file) into the overlay area. If the bitmap image is larger than the overlay area, the bitmap image is clipped. Code sample |
|||||
DR_CLEAR_OVERLAY |
Deletes the data of the overlay area by filling it with black color. Code sample |
|||||
DR_STEAL_NEXT_FRAME |
Copies the next image to the active user memory (Steal function). More details - Code sample
|
|||||
DR_SET_STEAL_FORMAT |
Defines the color format for the Steal function. More details - Code sample
|
|||||
DR_GET_STEAL_FORMAT |
Returns the color format setting for the Steal function. Code sample |
|||||
DR_SET_HWND |
Sets a new window handle for image output in Direct3D. Code sample |
|||||
DR_CHECK_COMPATIBILITY |
Returns whether the graphics card supports the uEye Direct3D functions. Code sample |
|||||
pParam |
void-type pointer to a data object or an array of objects (depending on the mode selected using nMode). |
|||||
nSize |
Size (in bytes) of the data object or array. |
Return Values
IS_SUCCESS |
Function executed successfully |
IS_NO_SUCCESS |
General error message |
When used with DR_CHECK_COMPATIBILITY |
IS_DR_DEVICE_CAPS_INSUFFICIENT The graphics hardware does not fully support the uEye Direct3D functions |
Related Functions
Code Samples
//------------------------------------ // DC-Handle //------------------------------------
// Get DC handle for Overlay HDC hDC; is_DirectRenderer (hCam, DR_GET_OVERLAY_DC, (void*)&hDC, sizeof (hDC));
// Release DC handle is_DirectRenderer (hCam, DR_RELEASE_OVERLAY_DC, NULL, NULL); |
//------------------------------------ // Size of overlay //------------------------------------
// Query maximum size of overlay area UINT OverlaySize[2]; is_DirectRenderer (hCam, DR_GET_MAX_OVERLAY_SIZE, INT nWidth = OverlaySize[0]; INT nHeight = OverlaySize[1];
// Set size of overlay area UINT Size[2]; Size[0] = 100; Size[1] = 120; is_DirectRenderer (hCam, DR_SET_OVERLAY_SIZE,
// Set position of overlay area UINT Position[2]; Position[0] = 20; Position[1] = 0; is_DirectRenderer (hCam, DR_SET_OVERLAY_POSITION, |
//------------------------------------ // Key color //------------------------------------
// Get current key color UINT OverlayKeyColor[3]; is_DirectRenderer (hCam, DR_GET_OVERLAY_KEY_COLOR,
INT nRed = OverlayKeyColor[0]; INT nGreen = OverlayKeyColor[1]; INT nBlue = OverlayKeyColor[2];
// Set new key color OverlayKeyColor[0] = GetRValue(m_rgbKeyColor); OverlayKeyColor[1] = GetGValue(m_rgbKeyColor); OverlayKeyColor[2] = GetBValue(m_rgbKeyColor); is_DirectRenderer (hCam, DR_SET_OVERLAY_KEY_COLOR, |
//------------------------------------ // Display //------------------------------------
// Show overlay is_DirectRenderer (hCam, DR_SHOW_OVERLAY, NULL, NULL);
// Hide overlay is_DirectRenderer (hCam, DR_HIDE_OVERLAY, NULL, NULL); |
//------------------------------------ // Scaling //------------------------------------
// Enable scaling is_DirectRenderer (hCam, DR_ENABLE_SCALING, NULL, NULL);
// Disable scaling is_DirectRenderer (hCam, DR_DISABLE_SCALING, NULL, NULL); |
//------------------------------------ // Transparency //------------------------------------
// Enable semi-transparent overlay is_DirectRenderer (hCam, DR_ENABLE_SEMI_TRANSPARENT_OVERLAY, NULL, NULL);
// Disable semi-transparent overlay is_DirectRenderer (hCam, DR_DISABLE_SEMI_TRANSPARENT_OVERLAY, NULL, NULL); |
//------------------------------------ // Synchronization //------------------------------------
// Enable auto-synchronization is_DirectRenderer (hCam, DR_SET_VSYNC_AUTO, NULL, NULL);
// User defined synchronization: Query range and set position UINT UserSync[2]; is_DirectRenderer (hCam, DR_GET_USER_SYNC_POSITION_RANGE, INT Min = UserSync[0]; INT Max = UserSync[1]; INT SyncPosition = 400; is_DirectRenderer (hCam, DR_SET_USER_SYNC,
// Disable synchronization is_DirectRenderer (hCam, DR_SET_VSYNC_OFF, NULL, NULL); |
//------------------------------------ // BMP file //------------------------------------
// Load overlay from BMP file is_DirectRenderer (hCam, DR_LOAD_OVERLAY_FROM_FILE,
//------------------------------------ // Delete overlay //------------------------------------
// Delete overlay area is_DirectRenderer (hCam, DR_CLEAR_OVERLAY, NULL, NULL); |
//------------------------------------ // Steal mode //------------------------------------
// Get and set color mode for image to be copied INT nColorMode; is_DirectRenderer (hCam, DR_GET_STEAL_FORMAT,
nColorMode = IS_CM_MONO8; is_DirectRenderer (hCam, DR_SET_STEAL_FORMAT,
// Copy image with function returning immediately INT nwait = IS_DONT_WAIT; is_DirectRenderer(hCam, DR_STEAL_NEXT_FRAME, |
//------------------------------------ // Handle to window //------------------------------------
// Set new window handle for image display is_DirectRenderer (hCam, DR_SET_HWND,
|
//------------------------------------ // Compatibility //------------------------------------
// Check graphics card compatibility INT nRet = is_DirectRenderer (hCam, DR_CHECK_COMPATIBILITY, NULL, NULL);
if (nRet == IS_DR_DEVICE_CAPS_INSUFFICIENT ) // Graphics card does not support Direct3D |
Sample Programs
• | uEyeDirectRenderer |
• | uEyeSteal |