Commit 0246b4ba authored by Wolthera van Hövell's avatar Wolthera van Hövell 🐛

Enable High range color picking for the visual selector.

It has huge issues when using a color space that isn't the displayrenderer's but I think that can be fixed.

Ref T2337
parent 62a4f7c6
...@@ -323,17 +323,16 @@ KoColor KisVisualColorSelectorShape::convertShapeCoordinateToKoColor(QPointF coo ...@@ -323,17 +323,16 @@ KoColor KisVisualColorSelectorShape::convertShapeCoordinateToKoColor(QPointF coo
KoColor c = m_d->currentColor; KoColor c = m_d->currentColor;
QVector <float> channelValues (c.colorSpace()->channelCount()); QVector <float> channelValues (c.colorSpace()->channelCount());
channelValues.fill(1.0); channelValues.fill(1.0);
c.colorSpace()->normalisedChannelsValue(c.data(), channelValues);
QVector <qreal> maxvalue(c.colorSpace()->channelCount()); QVector <qreal> maxvalue(c.colorSpace()->channelCount());
maxvalue.fill(1.0); maxvalue.fill(1.0);
if (m_d->displayRenderer) { if (m_d->displayRenderer) {
for (int ch = 0; ch<maxvalue.size(); ch++) { for (int ch = 0; ch<maxvalue.size(); ch++) {
//KoChannelInfo *channel = m_d->cs->channels()[ch]; KoChannelInfo *channel = m_d->cs->channels()[ch];
//maxvalue[ch] = m_d->displayRenderer->maxVisibleFloatValue(channel); maxvalue[ch] = m_d->displayRenderer->maxVisibleFloatValue(channel);
channelValues[ch] = channelValues[ch]/(maxvalue[ch]); channelValues[ch] = channelValues[ch]/(maxvalue[ch]);
} }
} }
c.colorSpace()->normalisedChannelsValue(c.data(), channelValues);
qreal huedivider = 1.0; qreal huedivider = 1.0;
qreal huedivider2 = 1.0; qreal huedivider2 = 1.0;
...@@ -411,8 +410,8 @@ QPointF KisVisualColorSelectorShape::convertKoColorToShapeCoordinate(KoColor c) ...@@ -411,8 +410,8 @@ QPointF KisVisualColorSelectorShape::convertKoColorToShapeCoordinate(KoColor c)
maxvalue.fill(1.0); maxvalue.fill(1.0);
if (m_d->displayRenderer) { if (m_d->displayRenderer) {
for (int ch = 0; ch<maxvalue.size(); ch++) { for (int ch = 0; ch<maxvalue.size(); ch++) {
//KoChannelInfo *channel = m_d->cs->channels()[ch]; KoChannelInfo *channel = m_d->cs->channels()[ch];
//maxvalue[ch] = m_d->displayRenderer->maxVisibleFloatValue(channel); maxvalue[ch] = m_d->displayRenderer->maxVisibleFloatValue(channel);
channelValues[ch] = channelValues[ch]/(maxvalue[ch]); channelValues[ch] = channelValues[ch]/(maxvalue[ch]);
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment