m_edit.setGridLines(KdenliveSettings::bezier_gridlines());
m_ui.buttonShowPixmap->setChecked(KdenliveSettings::bezier_showpixmap());
+ slotShowPixmap(m_ui.buttonShowPixmap->isChecked());
m_ui.buttonShowAllHandles->setChecked(KdenliveSettings::bezier_showallhandles());
}
{
m_showPixmap = show;
KdenliveSettings::setBezier_showpixmap(show);
- if (show && (m_mode == ModeRed || m_mode == ModeGreen || m_mode == ModeBlue || m_mode == ModeLuma ))
- m_edit.setPixmap(QPixmap::fromImage(ColorTools::rgbCurvePlane(m_edit.size(), (ColorTools::ColorsRGB)((int)(m_mode == ModeLuma ? int(m_mode) - 1 : m_mode)))));
+ 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
m_edit.setPixmap(QPixmap());
}
}
-QImage ColorTools::rgbCurvePlane(const QSize &size, const ColorTools::ColorsRGB &color, float scaling)
+QImage ColorTools::rgbCurvePlane(const QSize &size, const ColorTools::ColorsRGB &color, float scaling, const QRgb &background)
{
Q_ASSERT(scaling > 0 && scaling <= 1);
plane.setPixel(x, (h-y-1), qRgb(dval, dcol, dval));
} else if (color == ColorTools::COL_B){
plane.setPixel(x, (h-y-1), qRgb(dval, dval, dcol));
+ } else if (color == ColorTools::COL_A) {
+ plane.setPixel(x, (h-y-1), qRgb(dcol / 255. * qRed(background), dcol / 255. * qGreen(background), dcol / 255. * qBlue(background)));
} else {
plane.setPixel(x, (h-y-1), qRgb(dcol, dcol, dcol));
}
public:
ColorTools();
- enum ColorsRGB { COL_R, COL_G, COL_B, COL_Luma };
+ enum ColorsRGB { COL_R, COL_G, COL_B, COL_A, COL_Luma, COL_RGB };
/**
@brief Draws a UV plane with given Y value.
simulates the case that the curves can adjust only +- scaling*255. This mainly delivers a more constant look
when also using the Luma component for the curves display but might not represent the actual color change!
*/
- static QImage rgbCurvePlane(const QSize &size, const ColorTools::ColorsRGB &color, float scaling = 1);
+ static QImage rgbCurvePlane(const QSize &size, const ColorTools::ColorsRGB &color, float scaling = 1, const QRgb &background = QRgb());
/**
@brief Draws a YPbPr plane with Pb on the x axis and Pr on the y axis.
Y is the Y value to use.
KisCurveWidget *curve = (KisCurveWidget*)m_valueItems[name];
if (curve) {
int color = value.toInt();
- curve->setPixmap(QPixmap::fromImage(ColorTools::rgbCurvePlane(curve->size(), (ColorTools::ColorsRGB)color, 0.8)));
+ curve->setPixmap(QPixmap::fromImage(ColorTools::rgbCurvePlane(curve->size(), (ColorTools::ColorsRGB)(color == 3 ? 4 : color), 0.8)));
}
} else if (type == "bezier_spline") {
BezierSplineWidget *widget = (BezierSplineWidget*)m_valueItems[name];