.\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford .\" Junior University. All rights reserved. .\" .\" Permission to use, copy, modify and distribute this software and its .\" documentation for any purpose is hereby granted without fee, provided .\" that the above copyright notice and this permission notice appear in .\" all copies of this software and that you do not sell the software. .\" Commercial licensing is available by contacting the author. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, .\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY .\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. .\" .\" Author: .\" Phil Lacroute .\" Computer Systems Laboratory .\" Electrical Engineering Dept. .\" Stanford University .\" .\" $Date: 1994/12/31 19:49:53 $ .\" $Revision: 1.1 $ .\" .\" Macros .\" .FS -- function start .\" is return type of function .\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. .\" .FA -- function arguments .\" one argument declaration follows on next line .de FA .IP " " 4 .. .\" .FE -- function end .\" end of function declaration .de FE .PD .. .\" .DS -- display start .de DS .IP " " 4 .. .\" .DE -- display done .de DE .LP .. .TH vpRamp 3 "" VolPack .SH NAME vpRamp \- initialize an array with a piecewise-linear ramp .SH SYNOPSIS #include .sp .FS vpResult \fBvpRamp(\fIarray, stride, num_points, ramp_x, ramp_y\fB)\fR .FA float *\fIarray;\fR .FA int \fIstride;\fR .FA int \fInum_points;\fR .FA int *\fIramp_x;\fR .FA float *\fIramp_y;\fR .FE .SH ARGUMENTS .IP \fIarray\fR Output array. .IP \fIstride\fR Stride from one array element to the next, in bytes. .IP \fInum_points\fR Number of entries in the input arrays (\fIramp_x\fR and \fIramp_y\fR). .IP \fIramp_x\fR Input array containing indices into \fIarray\fR. .IP \fIramp_y\fR Input array containing values to store into \fIarray\fR. .SH DESCRIPTION \fBvpRamp\fR is 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 the \fIarray\fR argument, 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. .PP The values in \fIramp_x\fR most be strictly increasing. The \fIstride\fR argument 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). .PP This function is useful for creating lookup tables used for opacity transfer functions (see vpSetClassifierTable(3)) and shading functions (see vpSetLookupShader(3)). .SH ERRORS The normal return value is VP_OK. The following error return value is possible: .IP VPERROR_BAD_VALUE The number of points is less than one or the X values are not strictly increasing. .SH SEE ALSO VolPack(3)