Ejemplo n.º 1
0
void Spectrum::acquireColourResponces(HSVColour &leftColour, HSVColour &rightColour)
{
	leftColour = HSVColour();
	rightColour = HSVColour();

	RGBColour leftRGB;
	RGBColour rightRGB;

	acquireColourResponces(leftRGB, rightRGB);

	leftRGB.computeHSV(leftColour.h, leftColour.s, leftColour.v);
	rightRGB.computeHSV(rightColour.h, rightColour.s, rightColour.v);
}
Ejemplo n.º 2
0
void Spectrum::acquireColourPulses(list<HSVColour> &colours, list<PositionAngle> &angles)
{
	list<RGBColour>* rgbColours = new list<RGBColour>();

	acquireColourPulses(*rgbColours, angles);

	list<RGBColour>::iterator colourIter = rgbColours->begin();
	while(colourIter != rgbColours->end())
	{
		colours.push_back(HSVColour((*colourIter).computeHue(), (*colourIter).computeSaturation(), (*colourIter).computeValue()));

		colourIter++;
	}

	delete rgbColours;
}
Ejemplo n.º 3
0
#include "pwm.h"
#include "hardware.h"

#include "colourengine.hpp"
#include "fader.hpp"

///// Static Member Initialization /////

q15                         ColourEngine::mode_param            = Q15(0.0);
power_t                     ColourEngine::current_power         = OFF;
ColourEngine::mode_t        ColourEngine::current_mode          = mManual;
ColourEngine::colourspace_t ColourEngine::current_colourspace   = clSRGBW;

q15                         ColourEngine::current_brightness    = Q15(0.0);
RGBWColour                  ColourEngine::current_rgbw          = RGBWColour(Q15(1.0), Q15(1.0), Q15(1.0), Q15(1.0));
HSVColour                   ColourEngine::current_hsv           = HSVColour(Q15(0.0), Q15(1.0), Q15(1.0));

Fader                       ColourEngine::brightness_fader(&current_brightness, 1, NULL);

///// Public Methods /////

void ColourEngine::Initialize() {
    // Nothing to initialize
}

void ColourEngine::SetBrightness(q15 brightness) {
    if (brightness_fader.is_fading) {
        brightness_fader.set_target(brightness);
    }
    else {
        current_brightness = brightness;