PDA

View Full Version : how to accessWhiteBalanceGreen



UweAndersen
November 16, 2016, 16:09:59
Hello !

The following

long min = m_VCDProp->getRangeMin(VCDElement_WhiteBalanceRed);
long max = m_VCDProp->getRangeMax(VCDElement_WhiteBalanceRed);
long val = m_VCDProp->getValue(VCDElement_WhiteBalanceRed);
printf("RED min:%X max:%X val:%X\n", min, max, val);

min = m_VCDProp->getRangeMin(VCDElement_WhiteBalanceBlue);
max = m_VCDProp->getRangeMax(VCDElement_WhiteBalanceBlue);
val = m_VCDProp->getValue(VCDElement_WhiteBalanceBlue);
printf("BLUE min:%X max:%X val:%X\n", min, max, val);

min = m_VCDProp->getRangeMin(VCDElement_WhiteBalanceGreen);
max = m_VCDProp->getRangeMax(VCDElement_WhiteBalanceGreen);
val = m_VCDProp->getValue(VCDElement_WhiteBalanceGreen);
printf("GREEN min:%X max:%X val:%X\n", min, max, val);

works for WhiteBalanceRed & WhiteBalanceBlue but nor for WhiteBalanceGreen("min", "max" and "val" are all zero).
Can you tell me why?

Regards,
Uwe

Stefan Geissler
November 16, 2016, 16:31:29
Please use following code:


bool Is_WhiteBalance_White_Balance_Green_Available(Grab ber* pGrabber)
{
bool bResult = false;
if( pGrabber->isDevValid() )
{
tIVCDRangePropertyPtr pRangeItf;
tIVCDPropertyItemsPtr pItems = pGrabber->getAvailableVCDProperties();
pItems->findInterfacePtr(VCDID_WhiteBalance, VCDElement_WhiteBalanceGreen ,pRangeItf);

if( pRangeItf != NULL )
{
bResult = true;
}
}

return bResult;
}


long Get_WhiteBalance_White_Balance_Green_Value(Grabber * pGrabber)
{
if( pGrabber->isDevValid() )
{
tIVCDRangePropertyPtr pRangeItf;
tIVCDPropertyItemsPtr pItems = pGrabber->getAvailableVCDProperties();
pItems->findInterfacePtr(VCDID_WhiteBalance, VCDElement_WhiteBalanceGreen ,pRangeItf);

if( pRangeItf != NULL )
{
return pRangeItf->getValue();
}
}

return 0;
}

void Set_WhiteBalance_White_Balance_Green_Value(Grabber * pGrabber, long Value)
{
if( pGrabber->isDevValid() )
{
tIVCDRangePropertyPtr pRangeItf;
tIVCDPropertyItemsPtr pItems = pGrabber->getAvailableVCDProperties();
pItems->findInterfacePtr(VCDID_WhiteBalance, VCDElement_WhiteBalanceGreen ,pRangeItf);

if( pRangeItf != NULL )
{
pRangeItf->setValue(Value);
}
}
}

long Get_WhiteBalance_White_Balance_Green_Min(Grabber* pGrabber)
{
if( pGrabber->isDevValid() )
{
tIVCDRangePropertyPtr pRangeItf;
tIVCDPropertyItemsPtr pItems = pGrabber->getAvailableVCDProperties();
pItems->findInterfacePtr(VCDID_WhiteBalance, VCDElement_WhiteBalanceGreen ,pRangeItf);

if( pRangeItf != NULL )
{
return pRangeItf->getRangeMin();
}
}

return 0;
}

long Get_WhiteBalance_White_Balance_Green_Max(Grabber* pGrabber)
{
if( pGrabber->isDevValid() )
{
tIVCDRangePropertyPtr pRangeItf;
tIVCDPropertyItemsPtr pItems = pGrabber->getAvailableVCDProperties();
pItems->findInterfacePtr(VCDID_WhiteBalance, VCDElement_WhiteBalanceGreen ,pRangeItf);

if( pRangeItf != NULL )
{
return pRangeItf->getRangeMax();
}
}

return 0;
}



Can you tell me why?
Maybe it is not supported by your camera mode? I can not say, I do not know this. However, the above function "Is_WhiteBalance_White_Balance_Green_Available" will give you that answer.

UweAndersen
November 17, 2016, 08:51:41
Thank you!
Everything is working now.