KdenliveSettings::setBezier_showpixmap(show);
if (show && (int)m_mode < 6)
m_edit.setPixmap(QPixmap::fromImage(ColorTools::rgbCurvePlane(m_edit.size(), (ColorTools::ColorsRGB)((int)m_mode), 1, palette().background().color().rgb())));
-// else if (show && m_mode == ModeHue)
-// m_edit.setPixmap(QPixmap::fromImage(ColorTools::hsvHueShiftPlane(m_edit.size(), 200, 200, 0, 360)));
+ else if (show && m_mode == ModeHue)
+ m_edit.setPixmap(QPixmap::fromImage(ColorTools::hsvCurvePlane(m_edit.size(), QColor::fromHsv(200, 200, 200), ColorTools::COM_H, ColorTools::COM_H)));
else
m_edit.setPixmap(QPixmap());
}
}
-QImage ColorTools::hsvCurvePlane(const QSize &size, const QColor &baseColor, const ComponentsHSV &xVariant, const ComponentsHSV &yVariant)
+QImage ColorTools::hsvCurvePlane(const QSize &size, const QColor &baseColor,
+ const ComponentsHSV &xVariant, const ComponentsHSV &yVariant, const bool &shear, const float offsetY)
{
Q_ASSERT(size.width() > 0);
Q_ASSERT(size.height() > 0);
col.setHsvF(hue, sat, val);
- plane.setPixel(x, y, col.rgba());
+ if (!shear) {
+ plane.setPixel(x, y, col.rgba());
+ } else {
+ plane.setPixel(x, int(2*size.height() + y - x*size.width()/size.height() - offsetY * size.height()) % size.height(), col.rgba());
+ }
}
}
Basic HSV plane with two components varying on the x and y axis.
If both components are the same, then the y axis will be considered.
MIN/MAX give the minimum/maximum saturation, usually 0..255.
+ Missing colour components will be taken from baseColor.
+ For shear == true, the image will be sheared such that the x axis goes through (0,0) and (1,1). offsetY can additionally
+ shift the whole x axis vertically.
*/
- static QImage hsvCurvePlane(const QSize &size, const QColor &baseColor, const ComponentsHSV &xVariant, const ComponentsHSV &yVariant);
+ static QImage hsvCurvePlane(const QSize &size, const QColor &baseColor,
+ const ComponentsHSV &xVariant, const ComponentsHSV &yVariant, const bool &shear = false, const float offsetY = 0);
signals:
void signalYuvWheelCalculationFinished();