Syntax


  

PXL_RETURN_CODE PxLSetFeature (

HANDLE  hCamera,

U32     featureId,

U32     flags,

U32     numParams,

float const * pParams );

 

 

Description


This function sets the value and flags of the selected camera feature.  


  • hCamera is the camera handle.  This value is returned by PxLInitialize.


  • featureId is the feature ID.  For a list of the possible values, see PixeLINKTypes.h or feature types.


  • flags are the properties to be set for the feature.  Feature flags are defined in the file PixeLINKTypes.h.  


Note: Exactly one of the following flags must be set when the function is called


  • FEATURE_FLAG_MANUAL—The application is controlling the feature by sending parameters to the camera.

 

  • FEATURE_FLAG_AUTO—Ask the camera to automatically control the feature continuously.  No intervention by the user is possible.

 

  • FEATURE_FLAG_OFF—The feature is disabled.  The exact effect of turning a feature OFF depends on the camera and the specific feature.

 

  • FEATURE_FLAG_ONEPUSH—The camera sets the feature only once and then returns to manual operation. This flag will be cleared by the camera when the operation is finished.


  • numParams is the number of parameters in the pParams array


  • pParams is the pointer to the array of values for the feature.


Usage 


 

/* Make the request */

PXL_RETURN_CODE rc = PxLSetCameraName(hCamera, “Bottom-left camera”);

if (!API_SUCCESS(rc))

{

/* Error handling here */

}

 

dotNET Usage


float[] newExposure = new float[1];
newExposure[0] = 0.0034;

ReturnCode rc = Api.SetFeature(hCamera, Feature.Shutter, FeatureFlags.Manual, 1, newExposure);

if(!Api.IsSuccess(rc)) {

   //Error handling here

}




Comments, Restrictions and Limitations


Features


Features are camera dependent.  The PxLGetCameraFeatures function should be used to identify the presence and range of all features present in the camera.


When using this function, remember to review the error return codes.  Setting a value out of range, setting an unsupported flag or accessing an unsupported feature will cause an error.  See PxLGetErrorReport.


The following features can only be set if the stream state is turned off (STOP_STREAM) or paused (PAUSED_STREAM).  See PxLSetStreamState.


  • FEATURE_LOOKUP_TABLE
  • FEATURE_FRAME_RATE
  • FEATURE_PIXEL_FORMAT
  • FEATURE_PIXEL_ADDRESSING
  • FEATURE_TRIGGER
  • FEATURE_ROI
  • FEATURE_IMAGER_CLK_DIVISOR 



Using PxLSetFeature with descriptors

PxLSetFeature can change the settings of any custom descriptors that are in use.  Custom descriptors are managed using the advanced functions.


Note that if all descriptors are in focus at once (rather than just a single descriptor), calling PxLSetFeature will set the properties in all descriptors simultaneously.