17 #ifndef COLOURWHEEL_H_ 18 #define COLOURWHEEL_H_ 22 #include "../3daudio/SDevices.H" 25 #define MAXANGLE (5.0/8.0)*2.0*M_PI 29 #define DIFFUSIVITY 1.0 35 spk.add(1.0, 0.0, 0.0);
36 spk.add(0.0, 1.0, 0.0);
37 spk.add(-1.0,-1.0,0.0);
40 src.add(1.0, 0.0, 0.0);
49 loc testLoc(-1.0, 0.0, 0.0), tempLoc;
50 tempLoc=testLoc.findVectorFromAngle(i);
51 *
src.current()=source(tempLoc.x, tempLoc.y, tempLoc.z);
59 colour.red =(gushort)
rint(
spk.activations.current()[0]*65535.0);
60 colour.green=(gushort)
rint(
spk.activations.current()[1]*65535.0);
61 colour.blue =(gushort)
rint(
spk.activations.current()[2]*65535.0);
62 int res=gdk_colormap_alloc_color(
rainbow, &
colour, TRUE, FALSE);
64 std::cerr<<
"ColourWheel:: Colour map colour alloc Failed"<<std::endl;
80 rainbow=gdk_colormap_new(gdk_visual_get_best_with_type(GDK_VISUAL_TRUE_COLOR), TRUE);
85 colour.red =(gushort)
rint(0.0);
86 colour.green=(gushort)
rint(0.0);
87 colour.blue =(gushort)
rint(0.0);
88 int res=gdk_colormap_alloc_color(rainbow, &colour, TRUE, FALSE);
90 std::cerr<<
"ColourWheel:: Colour map black colour alloc Failed"<<std::endl;
96 spk.remSources(srcId);
97 gdk_colormap_unref(rainbow);
101 double angle=-
MAXANGLE*height/maxHeight;
103 loc testLoc(-1.0, -1.0, 0.0), tempLoc;
104 tempLoc=testLoc.findVectorFromAngle(angle);
106 *src.current()=source(tempLoc.x, tempLoc.y, tempLoc.z);
114 colour.red =(gushort)
rint(0.0);
115 colour.green=(gushort)
rint(0.0);
116 colour.blue =(gushort)
rint(0.0);
117 int res=gdk_colormap_alloc_color(rainbow, &colour, TRUE, FALSE);
119 std::cerr<<
"ColourWheel:: Colour map black colour alloc Failed"<<std::endl;
127 colour.red =(gushort)
rint(65535.0);
128 colour.green=(gushort)
rint(65535.0);
129 colour.blue =(gushort)
rint(65535.0);
130 int res=gdk_colormap_alloc_color(rainbow, &colour, TRUE, FALSE);
132 std::cerr<<
"ColourWheel:: Colour map white colour alloc Failed"<<std::endl;
139 #endif //COLOURWHEEL_H_
GdkColor * colourFromHeight(double height, double maxHeight)