Products | Support | Send comments on this topic. | Email a link to this topic. | Back to Getting Started | Help Version 18.0.10.24
LEADTOOLS Multimedia API Help

IltmmVideoProcAmp::GetRange Example for C++

Show in webframe

HRESULT GetCaptureVideoFormatCount(IltmmCapture *pCapture)
{
   HRESULT   hr;
   long      lMin, lMax, lSteppingDelta, lDefault, lCapsFlags;
   long      lFlags, lVal;

   IltmmVideoProcAmp* pVidProcAmp = NULL;

   // try to get the capture object's VideoProAmp object
   hr = pCapture->get_VideoProcAmp(&pVidProcAmp);
   if (FAILED(hr))
      return hr;

   // try to get the range info for the proc amp
   hr = pVidProcAmp->GetRange(ltmmVideoProcAmp_Brightness,
                               &lMin, &lMax, &lSteppingDelta,
                               &lDefault, &lCapsFlags);
   if (FAILED(hr))
   {
      // release the video proc amp object
      pVidProcAmp->Release();
      return hr;
   }

   // try to get the brightness value and (auto or manual) settings 
   hr = pVidProcAmp->Get(ltmmVideoProcAmp_Brightness,
                          &lVal, &lFlags);
   if (FAILED(hr))
   {
      // release the video proc amp object
      pVidProcAmp->Release();
      return hr;
   }

   // set the brightness value to a manual setting of current+10 
   lVal = min(lVal + 10, lMax);
   hr = pVidProcAmp->Set(ltmmVideoProcAmp_Brightness,
                          lVal, ltmmVideoProcAmp_Flags_Manual);
   if (FAILED(hr))
   {
      // release the video proc amp object
      pVidProcAmp->Release();
      return hr;
   }

   // release the video proc amp object
   pVidProcAmp->Release();

   return S_OK;
}
Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.