![]() |
PVCAM
3.9.x
Programmable Virtual Camera Access Method library
|
This sample demonstrates usage of post-processing features and parameters and shows how to correctly control them programmatically. The code is very similar to the PostProcessingParameters sample, but it is not interactive. The only purpose of this example is to find the post-processing parameter for a given ID and toggle its state.
Every camera may support different set of post-processing 'features'. Features are groups that group one or more 'parameters'. These 'parameters' are similar to regular PVCAM parameters, but they need to be discovered by the application at run-time. The 'parameters' are currently limited to uns32 data type.
The application will usually build a tree similar to the following one:
Because the indexes and their order may be different for every camera, the PVCAM also provides a PARAM_PP_FEAT_ID and PARAM_PP_PARAM_ID parameters. These IDs are uniquely defined in pvcam.h and they are assigned to a particular feature/parameter.
If the application needs to programmatically control a particular PP parameter, then it should use the ID to find to corresponding indexes first, then set the indexes to PVCAM and control the parameter state via PARAM_PP_PARAM parameter.
The code snippet below initializes PVCAM and opens the first available camera. Please refer to the actual code sample in the SDK installation directory for more details about the common helper functions used in this documentation.
Check if the camera supports post-processing parameters:
Detect all available post-processing features using the DiscoverCameraPostProcessing helper function and display them in a tree structure:
In this example we will try to find DENOISING feature and its index together with ENABLED parameter index:
If we found the parameter, toggle its state and exit. Although all post-processing parameters report the value as uns32
type (pl_get_param with ATTR_TYPE returns TYPE_UNS32), the first parameter under each feature usually serves as boolean switch to enable or disable the feature. Value of 0 disables the feature, value of 1 enables it.
Cleanup before exiting the application. For more details, please, refer to the Closing Camera and Uninitializing PVCAM section.