HI_ScaleBuffer

HI_ScaleBuffer -- performs offset and scaling operations.

Syntax

#include <cogent/cogent.h>

ST_STATUS HI_ScaleBuffer(int nvalues, HI_stVALUE* values, double xscale, double xoff, double yscale, double yoff);

Parameters

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.

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.