USB 2.0 USB 3.x GigE |
USB 2.0 USB 3.x GigE |
Syntax
INT is_PixelClock(HIDS hCam, UINT nCommand, void* pParam, UINT cbSizeOfParam)
Description
The function returns the adjustable pixel clock range and sets the pixel clock. Due to an excessive pixel clock for USB cameras, images may get lost during the transfer. If you change the pixel clock on-the-fly, the current image capturing process will be aborted.
The pixel clock limit values can vary, depending on the camera model and operating mode. For detailed information on the pixel clock range of a specific camera model, please refer to the Camera and sensor data chapter.
In general, the pixel clock is set once when opening the camera and will not be changed. Note that, if you change the pixel clock, the setting ranges for frame rate and exposure time also changes. If you change a parameter, the following order is recommended: 1.Change pixel clock. 2.Query frame rate range and, if applicable, set new value. 3.Query exposure time range and, if applicable, set new value. If one parameter is changed, the following parameters have to be adjusted due to the dependencies. |
The nCommand input parameter is used to select the function mode. 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 cbSizeOfParam input parameter.
Input parameter
hCam |
Camera handle |
pParam |
Pointer to a function parameter, whose function depends on nCommand. |
cbSizeOfParam |
Size (in bytes) of the memory area to which pParam refers. |
Return values
IS_INVALID_MODE |
Camera is in standby mode, function not allowed |
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 |
Related functions
UINT nNumberOfSupportedPixelClocks = 0;
INT nRet = is_PixelClock(hCam, IS_PIXELCLOCK_CMD_GET_NUMBER,
(void*)&nNumberOfSupportedPixelClocks,
sizeof(nNumberOfSupportedPixelClocks));
if ((nRet == IS_SUCCESS) && (nNumberOfSupportedPixelClocks > 0))
{
// No camera has more than 150 different pixel clocks.
// Of course, the list can be allocated dynamically
UINT nPixelClockList[150];
ZeroMemory(&nPixelClockList, sizeof(nPixelClockList));
nRet = is_PixelClock(hCam, IS_PIXELCLOCK_CMD_GET_LIST,
(void*)nPixelClockList,
nNumberOfSupportedPixelClocks * sizeof(UINT));
}
UINT nRange[3];
ZeroMemory(nRange, sizeof(nRange));
// Get pixel clock range
INT nRet = is_PixelClock(hCam, IS_PIXELCLOCK_CMD_GET_RANGE, (void*)nRange, sizeof(nRange));
if (nRet == IS_SUCCESS)
{
UINT nMin = nRange[0];
UINT nMax = nRange[1];
UINT nInc = nRange[2];
}
UINT nPixelClock;
// Get current pixel clock
nRet = is_PixelClock(hCam, IS_PIXELCLOCK_CMD_GET, (void*)&nPixelClock, sizeof(nPixelClock));
UINT nPixelClockDefault;
// Get default pixel clock
INT nRet = is_PixelClock(hCam, IS_PIXELCLOCK_CMD_GET_DEFAULT,
(void*)&nPixelClockDefault, sizeof(nPixelClockDefault));
if (nRet == IS_SUCCESS)
{
// Set this pixel clock
nRet = is_PixelClock(hCam, IS_PIXELCLOCK_CMD_SET,
(void*)&nPixelClockDefault, sizeof(nPixelClockDefault));
}