Writing Feature Values by Group
When a series of features are tightly coupled, they are difficult to modify without following a
specific order. For example, a region-of-interest (ROI) has four values (OffsetX, OffsetY, Width and
Height) that are inter-dependent and must be defined as a group. To solve this problem, the
SapAcqDevice class allows you to temporarily set the feature values in an “internal cache” and then
download the values to the camera at the same time. The following code illustrates this process
using an ROI example.
Sample Code for Sapera LT ++
…
// Set manual mode to update features
success = pAcq->SetUpdateFeatureMode(SapAcqDevice::UpdateFeatureManual);
// Set buffer left position (in the internal cache only)
success = pAcq->SetFeatureValue("OffsetX", 50);
// Set buffer top position (in the internal cache only)
success = pAcq->SetFeatureValue("OffsetY", 50);
// Set buffer width (in the internal cache only)
success = pAcq->SetFeatureValue("Width", 300);
// Set buffer height (in the internal cache only)
success = pAcq->SetFeatureValue("Height", 300);
// Write features to device (by reading values from the internal cache)
success = pAcq->UpdateFeaturesToDevice();
// Set back the automatic mode
success = pAcq->SetUpdateFeatureMode(SapAcqDevice::UpdateFeatureAuto);
…
For more details, see the Sapera LT ++ Programmer’s Manual