HI_ScaleBuffer

HI_ScaleBuffer — performs offset and scaling operations.

Syntax

#include <cogent.h>
ST_STATUS HI_ScaleBuffer(int  nvalues,
 HI_stVALUE*  values,
 double  xscale,
 double  xoff,
 double  yscale,
 double  yoff);

Arguments

nvalues

The number of values in the values array.

values

An array of HI_stVALUE structures.

xscale, xoff

The X value of the data pairs is transformed as follows:

x' = x * xscale + xoffset
yscale, yoff

The Y value of the data pairs is transformed as follows:

y' = y * yscale + yoffset

Returns

t (true) if the transformation was performed with no errors, otherwise nil.

Description

This function performs an offset and scaling transformation on a binary buffer of X-Y data pairs. The buffer is modified in place (i.e., a new buffer is not created, and the old values cannot be recovered). This function can be used to adjust data for graphing.

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