Merge remote-tracking branch 'refs/remotes/tvdzwan/master'

Former-commit-id: 0087b8cee957f0b87f722d02ef7fccbc1a34b118
This commit is contained in:
tociek 2015-11-28 22:55:46 +01:00
commit e44db34969

View File

@ -21,27 +21,33 @@ bool operator !=(CiColor p1, CiColor p2) {
} }
PhilipsHueLight::PhilipsHueLight(unsigned int id, QString originalState, QString modelId) : PhilipsHueLight::PhilipsHueLight(unsigned int id, QString originalState, QString modelId) :
id(id), originalState(originalState) { id(id), originalState(originalState) {
// Hue system model ids (http://www.developers.meethue.com/documentation/supported-lights). // Hue system model ids (http://www.developers.meethue.com/documentation/supported-lights).
// Light strips, color iris, ... // Light strips, color iris, ...
const std::set<QString> GAMUT_A_MODEL_IDS = { "LLC001", "LLC005", "LLC006", "LLC007", "LLC010", "LLC011", "LLC012", const std::set<QString> GAMUT_A_MODEL_IDS = { "LLC001", "LLC005", "LLC006", "LLC007", "LLC010", "LLC011", "LLC012",
"LLC013", "LST001" }; "LLC013", "LLC014", "LST001" };
// Hue bulbs, spots, ... // Hue bulbs, spots, ...
const std::set<QString> GAMUT_B_MODEL_IDS = { "LCT001", "LCT002", "LCT003", "LLM001" }; const std::set<QString> GAMUT_B_MODEL_IDS = { "LCT001", "LCT002", "LCT003", "LCT007", "LLM001" };
// Find id in the sets and set the appropiate color space. // Hue Lightstrip plus, go ...
if (GAMUT_A_MODEL_IDS.find(modelId) != GAMUT_A_MODEL_IDS.end()) { const std::set<QString> GAMUT_C_MODEL_IDS = { "LLC020", "LST002" };
colorSpace.red = {0.703f, 0.296f}; // Find id in the sets and set the appropiate color space.
colorSpace.green = {0.2151f, 0.7106f}; if (GAMUT_A_MODEL_IDS.find(modelId) != GAMUT_A_MODEL_IDS.end()) {
colorSpace.blue = {0.138f, 0.08f}; colorSpace.red = {0.703f, 0.296f};
} else if (GAMUT_B_MODEL_IDS.find(modelId) != GAMUT_B_MODEL_IDS.end()) { colorSpace.green = {0.2151f, 0.7106f};
colorSpace.red = {0.675f, 0.322f}; colorSpace.blue = {0.138f, 0.08f};
colorSpace.green = {0.4091f, 0.518f}; } else if (GAMUT_B_MODEL_IDS.find(modelId) != GAMUT_B_MODEL_IDS.end()) {
colorSpace.blue = {0.167f, 0.04f}; colorSpace.red = {0.675f, 0.322f};
} else { colorSpace.green = {0.4091f, 0.518f};
colorSpace.red = {1.0f, 0.0f}; colorSpace.blue = {0.167f, 0.04f};
colorSpace.green = {0.0f, 1.0f}; } else if (GAMUT_C_MODEL_IDS.find(modelId) != GAMUT_B_MODEL_IDS.end()) {
colorSpace.blue = {0.0f, 0.0f}; colorSpace.red = {0.675f, 0.322f};
} colorSpace.green = {0.2151f, 0.7106f};
colorSpace.blue = {0.167f, 0.04f};
} else {
colorSpace.red = {1.0f, 0.0f};
colorSpace.green = {0.0f, 1.0f};
colorSpace.blue = {0.0f, 0.0f};
}
// Initialize black color. // Initialize black color.
black = rgbToCiColor(0.0f, 0.0f, 0.0f); black = rgbToCiColor(0.0f, 0.0f, 0.0f);
// Initialize color with black // Initialize color with black