#include <TxFunction.h>
Public Member Functions | |
TxFunction (float x1, float y1, float x2, float y2) | |
void | addControlPoint (GLfloat x, GLfloat y, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) |
void | removeControlPoint (TxPoint *p) |
void | moveControlPoint (TxPoint *point, GLfloat x, GLfloat y) |
TxPoint * | hitTxPoint (GLfloat x, GLfloat y) |
TxPoint * | getLastTxPoint () |
TxPoint * | getFirstTxPoint () |
void | render () |
TxPoint * | getNearestNeighbour (unsigned short density) |
void | getLinearInterpolatedColor (unsigned short density, float &red, float &green, float &blue, float &alpha) |
Definition at line 17 of file TxFunction.h.
|
The contructor the tranferfunction creates a function with 2 controlpoints - at the beginning and at the end. The controlpoints are usually given by the histogram dimensions.
|
|
Add a controlPoint to the vector wich holds the TxPoints. The function should only be called after the check.
Referenced by Histogram::onLeftMouseClick(). |
|
Retrieve the first point Definition at line 37 of file TxFunction.cpp. |
|
Retrieve the last point Definition at line 32 of file TxFunction.cpp. |
|
Find the linear interpolated color of a given density. The method searches for the controlpoint that is next to the given density using the
Definition at line 103 of file TxFunction.cpp. References getNearestNeighbour(), TxPoint::position, and TxPoint::rgba. Referenced by Histogram::getColorByDensity(). |
|
Find the next greater neighbour for a given density. This will also determine the Definition at line 90 of file TxFunction.cpp. Referenced by getLinearInterpolatedColor(). |
|
Check if the point is already in the function. This function is called each time before the user adds a point
Referenced by Histogram::onLeftMouseClick(). |
|
Update the coordinates of a given controlpoint.
Definition at line 42 of file TxFunction.cpp. References TxPoint::moveTo(). Referenced by Histogram::onMouseDrag(). |
|
Remove the given controlPoint from the list, if it is not the end or starting point of the transfer function.
Definition at line 62 of file TxFunction.cpp. Referenced by Histogram::removeControlPoint(). |
|
This function draws the shape of the transfer function. Definition at line 73 of file TxFunction.cpp. References TxPoint::render(). Referenced by Histogram::render(). |