IFrameFilter::getParameter Method |
|||||||||||||||||||||||
Reads a frame filter parameter. | |||||||||||||||||||||||
Syntax: | tFilterError getParameter( const std::string& name, std::string& value ); tFilterError getParameter( const std::string& name, bool& value ); tFilterError getParameter( const std::string& name, long& value ); tFilterError getParameter( const std::string& name, int& value ); tFilterError getParameter( const std::string& name, float& value ); tFilterError getParameter( const std::wstring& name, std::wstring& value ); tFilterError getParameter( const std::wstring& name, bool& value ); tFilterError getParameter( const std::wstring& name, long& value ); tFilterError getParameter( const std::wstring& name, int& value ); tFilterError getParameter( const std::wstring& name, float& value ); |
||||||||||||||||||||||
|
|||||||||||||||||||||||
Return Value: | A member of the tFilterError enumeration.
|
||||||||||||||||||||||
Remarks: | All calls to getParameter have to be inside a beginParamTransfer /endParamTransfer block. Especially when reading multiple parameters, such as X/Y-coordinates, this is important to ensure parameter consistency. To save all parameters of a frame filter, use IFrameFilter::getSettings. |
||||||||||||||||||||||
Example: | The following example shows how to get the parameters of a frame filter. Assume a frame filter was loaded and set with the following code: smart_com<IFrameFilter> pRotFlipFilter = FilterLoader::createFilter( "Rotate Flip" ); grabber.setDeviceFrameFilters( pRotFlipFilter.get() ); The parameters are read using beginParamTransfer, getParameter and endParamTransfer: pRotFlipFilter->beginParamTransfer(); long rot = 0; if( eNO_ERROR != pRotFlipFilter->getParameter( "Rotation Angle", rot ) ) { std::cerr << "Error getting parameter 'rotation'" << std::endl; } else { std::cout << "Rotation Angle = " << rot << std::endl; } bool flipH = false; if( eNO_ERROR != pRotFlipFilter->setParameter( "Flip H", flipH ) ) { std::cerr << "Error getting parameter 'fliph'" << std::endl; } else { std::cout << "Flip H = " << flipH << std::endl; } bool flipV = false; if( eNO_ERROR != pRotFlipFilter->setParameter( "Flip V", flipV ) ) { std::cerr << "Error getting parameter 'flipv'" << std::endl; } else { std::cout << "Flip V = " << flipV << std::endl; } pRotFlipFilter->endParamTransfer(); |
||||||||||||||||||||||
See also: | IFrameFilter, IFrameFilter::setParameter, IFrameFilter::getAvailableParameters, IFrameFilter::beginParamTransfer, IFrameFilter::endParamTransfer |