![]() |
![]() |
|---|---|
USB 2.0 USB 3.x GigE |
USB 2.0 USB 3.x GigE |
Syntax
INT is_AutoParameter(HIDS hCam, UINT nCommand, void* pParam, UINT cbSizeOfParam)
Beschreibung
Die Funktion aktiviert/deaktiviert den Auto-Weißabgleich. Mit der Funktion können alle unterstützten Typen für den Weißabgleichs abgefragt werden. Neben dem älteren Weißabgleich über den Grey-World-Algorithmus gibt es auch eine Farbtemperaturregelung (color temperature) nach Kelvin. Daneben können mit der Funktion die unterstützten Farbräume abgefragt und gesetzt werden.
Über den Übergabeparameter nCommand wird dabei der Funktionsmodus gewählt. Der Übergabeparameter pParam ist abhängig vom Funktionsmodus unterschiedlich belegt; bei Funktionen zum Setzen oder Rücklesen eines Wertes enthält pParam einen Zeiger auf eine Variable vom Typ UINT. Die Größe des Speicherbereichs, auf den pParam verweist, wird im Übergabeparameter cbSizeOfParam angegeben.
Übergabeparameter
hCam |
Handle auf Kamera |
pParam |
Zeiger auf Funktionsparameter, der abhängig von nCommand unterschiedlich belegt ist. |
cbSizeOfParam |
Größe des Speicherbereichs in Byte, auf den pParam verweist. |
UINT nSupportedTypes = 0;
INT nRet = is_AutoParameter(m_hCam, IS_AWB_CMD_GET_SUPPORTED_TYPES, (void*)&nSupportedTypes,
sizeof(nSupportedTypes));
if (nRet == IS_SUCCESS)
{
if ((nSupportedTypes & IS_AWB_COLOR_TEMPERATURE) != 0)
{
// AWB type "Color Temperature" is supported
}
if ((nSupportedTypes & IS_AWB_GREYWORLD) != 0)
{
// AWB type "Greyworld" is supported
}
}
UINT nType = 0;
// Read current type
INT nRet = is_AutoParameter(m_hCam, IS_AWB_CMD_GET_TYPE, (void*)&nType, sizeof(nType));
// Write new type
nType = IS_AWB_GREYWORLD;
nRet = is_AutoParameter(m_hCam, IS_AWB_CMD_SET_TYPE, (void*)&nType, sizeof(nType));
// Is AWB enabled?
UINT nEnable;
INT nRet = is_AutoParameter(m_hCam, IS_AWB_CMD_GET_ENABLE, (void*)&nEnable, sizeof(nEnable));
// Enable AWB (once)
nEnable = IS_AUTOPARAMETER_ENABLE_RUNONCE;
nRet = is_AutoParameter(m_hCam, IS_AWB_CMD_SET_ENABLE, (void*)&nEnable, sizeof(nEnable));
// Choose the auto color mode to get the supported color models for this mode
// See ueye.h for auto color mode defines
INT nSupported = IS_AWB_COLOR_TEMPERATURE;
if (IS_SUCCESS == is_AutoParameter(m_hCam, IS_AWB_CMD_GET_SUPPORTED_RGB_COLOR_MODELS,
(void*)&nSupported, sizeof(nSupported)))
{
if ((nSupported & RGB_COLOR_MODEL_SRGB_D50) != 0)
{
// Color model SRGB D50 is supported. See ueye.h for color model defines
}
}
UINT nRGBColorModel = 0;
INT nRet = is_AutoParameter(m_hCam, IS_AWB_CMD_GET_RGB_COLOR_MODEL, (void*)&nRGBColorModel,
sizeof(nRGBColorModel));
nRGBColorModel = RGB_COLOR_MODEL_CIE_RGB_E;
nRet = is_AutoParameter(m_hCam, IS_AWB_CMD_SET_RGB_COLOR_MODEL, (void*)&nRGBColorModel,
sizeof(nRGBColorModel));