| Home > C: Programming > Function descriptions > | History back Previous chapter Next chapter Print |
is_DirectRenderer |
|
uEye Camera Manual Version 4.00
|
|
USB 2.0 USB 3.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.
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 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
pParam |
Pointer to a data object or an array of objects (depending on the mode selected using nMode). The pointer pParam is of the type void. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
nSize |
Size (in bytes) of the data object or array. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Return values
When used with DR_CHECK_COMPATIBILITY |
IS_DR_DEVICE_CAPS_INSUFFICIENT The graphics hardware does not fully support the uEye Direct3D functions. |
IS_DR_CANNOT_CREATE_SURFACE |
The image surface or overlay surface could not be created. |
IS_DR_CANNOT_CREATE_TEXTURE |
The texture could not be created. |
IS_DR_CANNOT_CREATE_VERTEX_BUFFER |
The vertex buffer could not be created. |
IS_DR_CANNOT_GET_OVERLAY_DC |
Could not get the device context handle for the overlay. |
IS_DR_CANNOT_LOCK_OVERLAY_SURFACE |
The overlay surface could not be locked. |
IS_DR_CANNOT_RELEASE_OVERLAY_DC |
Could not release the device context handle for the overlay. |
IS_DR_CANNOT_UNLOCK_OVERLAY_SURFACE |
The overlay surface could not be unlocked. |
IS_DR_DEVICE_CAPS_INSUFFICIENT |
Function is not supported by the graphics hardware. |
IS_DR_DEVICE_OUT_OF_MEMORY |
Not enough graphics memory available. |
IS_DR_NOT_ALLOWED_WHILE_DC_IS_ACTIVE |
A device context handle is still open in the application. |
IS_INVALID_CAMERA_HANDLE |
Invalid camera handle |
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_NOT_SUPPORTED |
The camera model used here does not support this function or setting. |
IS_SUCCESS |
Function executed successfully |
IS_TIMED_OUT |
A timeout occurred. An image capturing process could not be terminated within the allowable period. |
Related functions
UINT nType = IS_SET_DM_DIRECT3D;
if (is_DirectRenderer(m_pMainView->GetCameraHandle(), DR_GET_SUPPORTED,
(void*)&nType, sizeof(nType)) == IS_SUCCESS)
{
// Direct3D is supported
}
nType = IS_SET_DM_OPENGL;
if (is_DirectRenderer(m_pMainView->GetCameraHandle(), DR_GET_SUPPORTED,
(void*)&nType, sizeof(nType)) == IS_SUCCESS)
{
// OpenGL is supported
}
//------------------------------------
// 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);
Example overlay size and position
//------------------------------------
// Size of overlay
//------------------------------------
// Query maximum size of overlay area
UINT OverlaySize[2];
is_DirectRenderer (hCam, DR_GET_MAX_OVERLAY_SIZE,
(void*)OverlaySize, sizeof(OverlaySize));
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,
(void*)Size, sizeof (Size));
// Set position of overlay area
UINT Position[2];
Position[0] = 20;
Position[1] = 0;
is_DirectRenderer (hCam, DR_SET_OVERLAY_POSITION,
void*)Position, sizeof (Position));
//------------------------------------
// Key color
//------------------------------------
// Get current key color
UINT OverlayKeyColor[3];
is_DirectRenderer (hCam, DR_GET_OVERLAY_KEY_COLOR,
(void*)OverlayKeyColor, sizeof(OverlayKeyColor));
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,
(void*)OverlayKeyColor, sizeof(OverlayKeyColor));
//------------------------------------
// 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,
(void*)UserSync, sizeof (UserSync));
INT Min = UserSync[0];
INT Max = UserSync[1];
INT SyncPosition = 400;
is_DirectRenderer (hCam, DR_SET_USER_SYNC,
void*)&SyncPosition, sizeof (SyncPosition));
// 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,
(void*)”c:\test.bmp”, NULL);
//------------------------------------
// 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,
(void*)&nColorMode, sizeof (nColorMode));
nColorMode = IS_CM_MONO8;
is_DirectRenderer (hCam, DR_SET_STEAL_FORMAT,
void*)&nColorMode, sizeof (nColorMode));
// Copy image with function returning immediately
INT nwait = IS_DONT_WAIT;
is_DirectRenderer(hCam, DR_STEAL_NEXT_FRAME,
(void*)&wait, sizeof (wait));
//------------------------------------
// Handle to window
//------------------------------------
// Set new window handle for image display
is_DirectRenderer (hCam, DR_SET_HWND,
(void*)&hWnd, sizeof (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