#include <Histogram.h>
Inherits GuiComponent.
Public Member Functions | |
Histogram () | |
~Histogram () | |
void | update (unsigned short *data, unsigned int &size) |
void | render (int x, int y, int width, int height) |
void | onLeftMouseClick (int x, int y) |
void | onMouseDrag (int x, int y) |
void | getColorByDensity (unsigned short &density, float &red, float &green, float &blue, float &alpha) |
bool | isInitialised () |
bool | removeControlPoint () |
Public Attributes | |
TxPoint * | grabbedPoint |
Definition at line 33 of file Histogram.h.
|
The constructor of the Histogram creates the window wich shows the histogram. Definition at line 18 of file Histogram.cpp. References grabbedPoint. |
|
The destructor deletes the pointes that are initialised by the contructor. Definition at line 71 of file Histogram.h. References grabbedPoint. |
|
This function takes a specific density and computes the resulting color responding to the histogram attached control points.
Definition at line 176 of file Histogram.cpp. References TxFunction::getLinearInterpolatedColor(). |
|
Return the flag wether the histogram is initalised Definition at line 133 of file Histogram.h. |
|
This method is called, when the user hit the histogram at a given position x and y - e.g. when clicked with the mouse. The function determines if: 1. the user clicked on an empty space 2. the user selected an existing controlpoint In the first case, the program will add a new controlpoint at the given position. In the second case the program will ask the user if her wants to delete or change the controlpoint.
Definition at line 62 of file Histogram.cpp. References TxFunction::addControlPoint(), OrthographicCamera::getLocalWorldCoordinates(), grabbedPoint, GuiComponent::hit(), and TxFunction::hitTxPoint(). |
|
This method is called, each time the user drag the mouse over the histogram. This usually happens when a controlpoint is moved.
Definition at line 99 of file Histogram.cpp. References OrthographicCamera::getLocalWorldCoordinates(), grabbedPoint, GuiComponent::hit(), TxFunction::moveControlPoint(), and TxPoint::rgba. |
|
Remove the current grabbed point. If the point is NULL, the method returns false and nothing is removed. Definition at line 202 of file Histogram.cpp. References grabbedPoint, and TxFunction::removeControlPoint(). |
|
This function is responsible for the drawing of the histogram. Therefore it takes 4 parameters wich determine the viewport - e.g. where the histogram is drawn and wich size it has. Internal the histogram is always drawn with an orthographic projection.
Definition at line 114 of file Histogram.cpp. References TxFunction::render(), OrthographicCamera::startCamera(), and OrthographicCamera::stopCamera(). |
|
This method initialise the frequency of occurrence of the density by reading each densiy value from the given array and adding +1 to the entry occurenceArray[density]. This function should be called each time, a new file is opened
Definition at line 26 of file Histogram.cpp. References GuiComponent::enable(), and GuiComponent::hide(). |
|
Pointer to the slected TxPoint. Definition at line 60 of file Histogram.h. Referenced by Histogram(), onLeftMouseClick(), onMouseDrag(), removeControlPoint(), and ~Histogram(). |