![]() |
![]() |
![]() |
![]() |
DVclamp
Synopsis
clamp Node_Data to min/max values
module DVclamp { /* clamps data to min/max values */
Node_Data+Iparam &in { /* input field */
nnodes+req;
};
int+Iparam component; /* which vector component
to clamp */
int+Iparam below; /* toggle to turn on lower clamping */
int+Iparam above; /* toggle to turn on upper clamping */
int+Iparam reset_minmax;
float+Iparam min_value; /* lower clamping value */
float+Iparam max_value; /* upper clamping value */
/* Output always has a single node data component */
Node_Data+Oparam out; /* output field */
method+notify_val+notify_inst upd_clamp
= "DVclamp_update";
};Description
DVclamp transforms the values in one component of a Node_Data object as follows: If above is set, then any value above max_value is set to max_value. If below is set, then any value below min_value is set to min_value. Otherwise, the values are not changed.If both above and below are on, then the output field's selected component values are all in this range:min_value <= value <= max_valueNull data values are not affected.
Input
A reference to an input field that contains a Node_Data object. The field's data components can be scalar or vector.
An integer. If the value is not 0, the field's minimum and maximum data values are reset to post-clamping values.
Output
A new Node_Data that contains the clamped output component. It has the same data type as the input Node_Data.
Example
File
modules/clamp.cUtility DVM macrosDVMclamp_param, Clamp
See also
![]() |
![]() |
![]() |
![]() |