Converting color RGB/HSV from int to double and double to int
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
Some multiplatform GUI toolkits provides colors based on int RGB or HSV values (Qt for example) http://doc.trolltech.com/3.3/qcolor.html It will be nice to have converter color RGB/HSV from int to double and double to int inside vtkMath. Example:
// Description: // Convert color RGB from int to double and double to int. // The input color is not modified. static void RGBTorgb(int RGB[3], double rgb[3]) { RGBTorgb(RGB[0], RGB[1], RGB[2], rgb, rgb+1, rgb+2); } static void RGBTorgb(int R, int G, int B, double *r, double *g, double *b);
static void rgbToRGB(double rgb[3], int RGB[3]) { rgbToRGB(rgb[0], rgb[1], rgb[2], RGB, RGB+1, RGB+2); } static void rgbToRGB(double r, double g, double b, int *R, int *G, int *B);
// Description: // Convert color HSV from int to double and double to int. // The input color is not modified. static void HSVTohsv(int HSV[3], double hsv[3]) { HSVTohsv(HSV[0], HSV[1], HSV[2], hsv, hsv+1, hsv+2); } static void HSVTohsv(int H, int S, int V, double *h, double *s, double *v);
static void hsvToHSV(double hsv[3], int HSV[3]) { hsvToHSV(hsv[0], hsv[1], hsv[2], HSV, HSV+1, HSV+2); } static void hsvToHSV(double h, double s, double v, int *H, int *S, int *V);