HI_ClipBuffer

HI_ClipBuffer — clips Y values to fit within a range.

Syntax

#include <cogent.h>
ST_STATUS HI_ClipBuffer(int  nvalues,
 HI_stVALUE*  values,
 double  min,
 double  max);

Arguments

nvalues

The number of values in the values array.

values

An array of HI_stVALUE structures.

min

The minimum of the clipping range (Y values less than this value will be set to this value).

max

The maximum of the clipping range (Y values greater than this value will be set to this value)

Returns

t (true) if the function completed successfully, otherwise nil.

Description

This function clips the Y-value data in a buffer to lie within the range specified. The X-value data is ignored. The buffer is modified in place (i.e., a new buffer is not created, and the old values cannot be recovered). This function is useful during graphing to ensure the data trace does not go outside the desired graph boundaries.

This function corresponds to the Cascade Historian hist_clip_buffer dynamic library function.

Example

HI_ClipBuffer (20, test, target + range, target - range);