Transfer Class Reference
Constructor & Destructor Documentation
Transfer::Transfer |
( |
std::vector< int > |
DensityArray, |
|
|
int |
num | |
|
) |
| | |
Transfer constructor. This is the class of the transfer function which handles color interpolation between selected colors at certain densities. DensityArray contains the occurrences of densities. num defines the amount of density values used.
- Parameters:
-
| std::vector<int> | DensityArray |
| int | num |
Member Function Documentation
Add new points to transfer function. This function adds new points to a list of points which is then used to interpolate their corresponding color values.
- Parameters:
-
float * Transfer::clearData |
( |
|
) |
|
Clear data in transfer function. This function is used to clean up before loading new data. The empty color vector colorf is returned.
- Returns:
- float* colorf
float * Transfer::colorInterpolation |
( |
|
) |
|
Color interpolation for the transfer function. The colors for the texture are interpolated from the points in the list. The points are obtained from the transfer function on the user inteface. The program initializes with two points in the list, which are created automatically to ensure a functioning interpolation. These are a white point at density = 1 and a black point at density = 0. This function returns the color vector (containing floats) of length num*4 for a texture.
- Returns:
- float* colorf
float * Transfer::getColorf |
( |
|
) |
|
Get the color vector. This function returns a vector of interpolated colors of size num*4.
- Returns:
- float* colorf
void Transfer::removePoint |
( |
int |
pos |
) |
|
Remove points from transfer function. This function removes the point from the list of points at a given position..
- Parameters:
-
void Transfer::removePoints |
( |
|
) |
|
Remove ALL points from transfer function. This function is mainly used for cleanup.
void Transfer::sortPoints |
( |
|
) |
|
Sort the list of points by density. To ensure that the list can be used for interpolation, the list first has to be sorted. They are sorted in descending order corresponding to their density value.
The documentation for this class was generated from the following files: