#include <displaycolor.h>
This can be used as a color selector in a transfer function editor.
To draw the colors, this model is used:
* ---------------------- white (1,1,1) * | | * | | * R G B R * |------|------|------| * (100) (010) (001) (100) * | | * | | * ---------------------- black (0,0,0) *
Internally, a 128x128 texture is created.
Public Member Functions | |
DisplayColor () | |
~DisplayColor () | |
void | display () const |
void | getRGB (float x, float y, float &r, float &g, float &b) const |
void | mark (float r, float g, float b) |
Tools::TransferFunction::DisplayColor::DisplayColor | ( | ) |
Tools::TransferFunction::DisplayColor::~DisplayColor | ( | ) |
void Tools::TransferFunction::DisplayColor::display | ( | ) | const |
display the colors in a centered 1x1 square
void Tools::TransferFunction::DisplayColor::getRGB | ( | float | x, | |
float | y, | |||
float & | r, | |||
float & | g, | |||
float & | b | |||
) | const |
get rgb for a normalized position (0..1)
x,y | (in) mouse position normalized with the box size (0..1) | |
r,g,b | (out) color selected at position x,y |
void Tools::TransferFunction::DisplayColor::mark | ( | float | r, | |
float | g, | |||
float | b | |||
) |
place a cursor at color rgb