TOC PREV NEXT INDEX

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

&in

A reference to an input field that contains a Node_Data object. The field's data components can be scalar or vector.

component

An integer. Selects which of the input field's components to clamp.

above

An integer. If value is not 0, clamps data above the max_value.

below

An integer. If value is not 0, clamps data below the min_value.

reset_minmax

An integer. If the value is not 0, the field's minimum and maximum data values are reset to post-clamping values.

min_valuemax_value

Floats. Establish the min and max values above and below which data is clamped to.

Output

out

A new Node_Data that contains the clamped output component. It has the same data type as the input Node_Data.

Example

Libraries.Main.Filters.clamp

File

v/dv.v

modules/clamp.cUtility DVM macrosDVMclamp_param, Clamp

See also

DVthreshold

TOC PREV NEXT INDEX