Provided by: libvolpack1-dev_1.0b3-3_amd64

**NAME**

vpRamp - initialize an array with a piecewise-linear ramp

**SYNOPSIS**

#include <volpack.h> vpResultvpRamp(array,stride,num_points,ramp_x,ramp_y)float *array;intstride;intnum_points;int *ramp_x;float *ramp_y;

**ARGUMENTS**

arrayOutput array.strideStride from one array element to the next, in bytes.num_pointsNumber of entries in the input arrays (ramp_xandramp_y).ramp_xInput array containing indices intoarray.ramp_yInput array containing values to store intoarray.

**DESCRIPTION**

vpRampis a utility routine for initializing linear arrays of floating-point numbers with piecewise-linear ramps. A ramp is defined by a set of (x, y) pairs. The X coordinates are integers that index entries in thearrayargument, and the Y coordinates are floating- point values to store into the array. Linearly-interpolated Y values are stored in array elements with indexes in between two of the X values. The values inramp_xmost be strictly increasing. Thestrideargument may be used to skip array elements or to initialize arrays with a non-standard stride. If the output array is a simple linear array of type float then the stride should be sizeof(float). This function is useful for creating lookup tables used for opacity transfer functions (see vpSetClassifierTable(3)) and shading functions (see vpSetLookupShader(3)).

**ERRORS**

The normal return value is VP_OK. The following error return value is possible: VPERROR_BAD_VALUE The number of points is less than one or the X values are not strictly increasing.

**SEE** **ALSO**

VolPack(3)