Home > C: Programming > Function Descriptions > | History back Previous chapter Next chapter Print |
is_Focus |
uEye Camera Manual Version 3.80
is_Focus
USB uEye XS |
USB uEye XS |
Syntax
INT is_Focus (HIDS hCam,
UINT nCommand,
void *pParam,
UINT nSizeOfParam)
Description
Using is_Focus(), you can control the focus of the objective lens if supported by your uEye model.
The nCommand input parameter is used to select the function mode (e.g. enable/disable auto focus, return focal distance). The pParam input parameter depends on the selected function mode. If you select functions for setting or returning a value, pParam contains a pointer to a variable of the UINT type. The size of the memory area to which pParam refers is specified in the nSizeOfParam input parameter.
With USB uEye XS cameras, you can use the face detection function to control the auto focus.
|
|
Input Parameters
hCam |
Camera handle |
||||||||||||||||||||||||||||||
nCommand |
|
||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||
pParam |
Pointer to a function parameter; which function parameter is referred to here depends on nCommand. |
||||||||||||||||||||||||||||||
nSizeOfParam |
Size (in bytes) of the memory area to which pParam refers. |
Status flags from FOCUS_CAPABILITY_FLAGS
FOC_CAP_INVALID |
The camera does not support focus settings |
FOC_CAP_AUTOFOCUS_SUPPORTED |
The camera supports auto focus |
FOC_CAP_MANUAL_SUPPORTED |
The camera supports manual focus |
FOC_CAP_GET_DISTANCE |
The camera supports querying the focal distance |
FOC_CAP_SET_AUTOFOCUS_RANGE |
The camera supports the selection of the auto focus range |
Return Values
IS_SUCCESS |
Function executed successfully |
IS_NO_SUCCESS |
General error message |
IS_NOT_SUPPORTED |
This function is not supported by the current camera |
IS_INVALID_CAPTURE_MODE |
This function is not supported in the current operating mode |
IS_INVALID_PARAMETER |
One of the parameters passed is invalid |
Code Sample
UINT uiCaps = 0;
// Query if the camera supports auto focus INT nRet = is_Focus (m_hCam, FDT_CMD_GET_CAPABILITIES, &uiCaps, sizeof (uiCaps) );
if (nRet == IS_SUCCESS && (uiCaps & FOC_CAP_AUTOFOCUS_SUPPORTED)) { //If supported, enable auto focus nRet = is_Focus (m_hCam, FOC_CMD_SET_ENABLE_AUTOFOCUS, NULL, 0); } |