vpRamp(3)
π vpRamp π
okay bestie, this is a page from the Library Functions Manual, and today's main character is vpRamp β she initializes an array with a piecewise-linear ramp. slay. let's get into it π
β¨ NAME β¨
vpRamp β initialize an array with a piecewise-linear ramp
πΈ SYNOPSIS πΈ
#include <volpack.h>
vpResult
vpRamp(array, stride, num_points, ramp_x, ramp_y)
float *array;
int stride;
int num_points;
int *ramp_x;
float *ramp_y;
π«Ά ARGUMENTS π«Ά
arrayβ the output array, bestie. this is where the good stuff gets written πstrideβ how many bytes you hop to get from one array element to the next.num_pointsβ how many entries live in the input arrays (ramp_xandramp_y).ramp_xβ input array full of indices intoarray.ramp_yβ input array full of the values you're storing intoarray.
π¦ DESCRIPTION π¦
vpRamp is a utility routine for initializing linear arrays of floating-point numbers with piecewise-linear ramps. it's giving β¨utilityβ¨ and honestly? we're obsessed.
so a ramp is defined by a set of (x, y) pairs. the X coordinates are integers that index entries in the array argument, and the Y coordinates are floating-point values you store into the array. and the elements of array whose indexes land in between two of those X values? they get linearly-interpolated Y values. no cap, that's the whole vibe. π
heads up bestie: the values in ramp_x must be strictly increasing. like, non-negotiable. fr fr.
the stride argument may be used to skip array elements or to initialize arrays with a non-standard stride. and if your output array is just a simple linear array of type float, then stride should be sizeof(float). easy math, iykyk.
this function is useful for creating lookup tables used for opacity transfer functions (see vpSetClassifierTable(3)) and shading functions (see vpSetLookupShader(3)). lookup table queen π
π ERRORS π
the normal return value is VP_OK. she ate. but 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 π
and that's the whole page, bestie π this was vpRamp(3) from the VolPack library β thanks for reading, mwah πβ¨
π¦ where this page comes from
- debian bookworm: libvolpack1-dev 1.0b3-9 Β· BSD-3-Clause
- debian trixie: libvolpack1-dev 1.0b3-10 Β· BSD-3-Clause
- ubuntu jammy: libvolpack1-dev 1.0b3-9 Β· BSD-3-Clause
- ubuntu noble: libvolpack1-dev 1.0b3-9.1 Β· BSD-3-Clause
- ubuntu questing: libvolpack1-dev 1.0b3-11
- ubuntu resolute: libvolpack1-dev 1.0b3-11build1 Β· BSD-3-Clause
- ubuntu stonking: libvolpack1-dev 1.0b3-11build1 Β· BSD-3-Clause
- Copyright (c) 1994 The Board of Trustees of The Leland Stanford
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms