clamp Node_Data to min/max values
group DVclamp {
Node_Data+Iparam &in { /* input field */
nnodes+req;
};
int+Iparam component; /* which 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 */
Node_Data+Oparam out; /* output field */
method+notify_val+notify_inst upd_clamp = "clamp" ;
} ;
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_value
Null data values are not affected.
A reference to an input field that contains a Node_Data object. The field's data components can be scalar or vector.
An integer. Selects which of the input field's components to clamp.
An integer. If value is not 0, clamps data above the max_value.
An integer. If value is not 0, clamps data below the min_value.
An integer. If the value is not 0, the field's minimum and maximum data values are reset to post-clamping values.
Floats. Establish the min and max values above and below which data is clamped to.
A new Node_Data that contains the clamped output component. It has the same data type as the input Node_Data.