BlendNodeData

Synopsis

Inputs two compatible fields (node data only) and blends (interpolates) between the two using a ratio value. A ratio of 0.0 outputs the first field's node data. A value of 1.0, outputs the second field's node_data. Values inbetween will produce an output containing node data linearly interpolated between each corresponding node. For example, a value of 0.3 will use 70% of the first field, and 30% from the second field.


module BlendNodeData <src_file="blend.cxx"> {
  BlendParams_ref ¶ms <NEportLevels={2,0}>;
  Node_Data &in1 <NEportLevels={2,0}>;
  Node_Data &in2 <NEportLevels={2,0}>;
  float ratio => params.ratio;
  Node_Data out <NEportLevels={0,2}>;
  cxxmethod+notify_inst+req update (
    in1+read+notify+req,
    in2+read+notify+req,
    ratio+read+notify+req,
    out+write );
};

Description

The BlendNodeData module may be used to linearly interpolate node data from two compatible input fields. Only node data is required for the inputs, but these must have the same number of components and nodes, and each component must have the same data type and vector length.

The output node data is of equal size and consists of the same components. Only the actual node data values themselves are changed. The linear interpolation is only performed on the values of the input node data, and does not take into account the coordinate position of the nodes. As such it used instead of the existing interpolate macros/modules in AVS/Express which perform interpolation based on coordinate space (by placing a probe mesh into an existing field).

The ratio parameter is used to determine the balance between the first and second inputs, and hence the value placed into the output node data. At 0.0, only the data from the first input is used. As the ratio value increases towards 1.0, the second input has more influence.

One possible use for blend_node_data is to augment the animate_filename IAC project, so that interpolation may be performed between successive input files in a sequence of files.

Inputs

&in1

First input Node_Data which is processed by the module.

&in2

Second input Node_Data which is processed by the module, and must be compatible with the first input field (as detailed above).

¶ms

Reference to the parameter block, which contains real instances of:

ratio

The blending ratio for generating the output node data. The ratio ranges from 0.0 to 1.0, with 0.0 corresponding to 100% of input 1, and 1.0 corresponding to 100% of input 2.

Outputs

out

Output of the blended (linearly interpolated) node_data.

Utility Macros

The BlendNodeData low-level module is used within the Functional Macro Blend and the User Macro blend_node_data.

Example

An example application BlendNodeDataEg is provided, which inputs two sample fields, and bounces (loops) the ratio between 0.0 and 1.0, and outputs the interpolated field to the surf_plot macro. The example shows blending between the figures '1' and '2'.

Files

iac_proj/blend/blndmods.v contains the BlendParams group and the BlendNodeData module V definitions.

Other Notes

The low-level BlendNodeDataMods library containing the module BlendNodeData does not specify a process. By default the express process will be used.

Author

Paul G. Lever
International AVS Centre

Contact

Paul G. Lever
International AVS Centre
Manchester Visualization Centre
Manchester Computing
University of Manchester
Oxford Road
Manchester
United Kingdom
M13 9PL

See Also

BlendParams, BlendUI, blend_node_data.