Testing for Properties

While some properties apply to all acquisition FIFOs, some apply only to specific kinds of FIFOs. If you are not sure that an acquisition FIFO supports a particular property, you can use the propertyQuery() function to test for it. For example, this is how to test to see if a FIFO supports the contrast and brightness property:

ccContrastBrightnessProp* cbProp = fifo->propertyQuery();
if (cbProp)
cbProp->contrastBrightness(0.4, 0.6);

Or, using reference semantics, write:

try
{
ccContrastBrightnessProp& cbProp = fifo->propertyQuery();
cbProp.contrastBrightness(0.4, 0.6);
}
catch (cmStd bad_cast&)
{
// The brightness/contrast property is not supported.
}