本文整理汇总了C++中WindowPaintData::multiplyBrightness方法的典型用法代码示例。如果您正苦于以下问题:C++ WindowPaintData::multiplyBrightness方法的具体用法?C++ WindowPaintData::multiplyBrightness怎么用?C++ WindowPaintData::multiplyBrightness使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WindowPaintData
的用法示例。
在下文中一共展示了WindowPaintData::multiplyBrightness方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: paintWindow
void DimScreenEffect::paintWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data)
{
if (mActivated && (w != window) && w->isManaged()) {
data.multiplyBrightness((1.0 - 0.33 * timeline.currentValue()));
data.multiplySaturation((1.0 - 0.33 * timeline.currentValue()));
}
effects->paintWindow(w, mask, region, data);
}
示例2: paintWindow
void DimInactiveEffect::paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data)
{
if (dimWindow(w) || w == previousActive) {
double previous = 1.0;
if (w == previousActive)
previous = previousActiveTimeline.currentValue();
if (previousActiveTimeline.currentValue() == 1.0)
previousActive = NULL;
data.multiplyBrightness((1.0 - (dim_strength / 100.0) * timeline.currentValue() * previous));
data.multiplySaturation((1.0 - (dim_strength / 100.0) * timeline.currentValue() * previous));
}
effects->paintWindow(w, mask, region, data);
}
示例3: paintWindow
void LogoutEffect::paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data)
{
if (progress > 0.0) {
if (effects->compositingType() == KWin::OpenGLCompositing) {
// In OpenGL mode we add vignetting and, if supported, a slight blur
if (blurSupported) {
// When using blur we render everything to an FBO and as such don't do the vignetting
// until after we render the FBO to the screen.
if (w == logoutWindow) {
// Window is rendered after the FBO
windowOpacity = data.opacity();
data.setOpacity(0.0); // Cheat, we need the opacity for later but don't want to blur it
} else {
if (logoutWindowPassed || ignoredWindows.contains(w)) {
// Window is rendered after the FBO
windows.append(w);
windowsOpacities[ w ] = data.opacity();
data.setOpacity(0.0);
} else // Window is added to the FBO
data.multiplySaturation((1.0 - progress * 0.2));
}
} else {
// If we are not blurring then we are not rendering to an FBO
if (w == logoutWindow)
// This is the logout window don't alter it but render our vignetting now
renderVignetting();
else if (!logoutWindowPassed && !ignoredWindows.contains(w))
// Window is in the background, desaturate
data.multiplySaturation((1.0 - progress * 0.2));
// All other windows are unaltered
}
}
if (effects->compositingType() == KWin::XRenderCompositing) {
// Since we can't do vignetting in XRender just do a stronger desaturation and darken
if (w != logoutWindow && !logoutWindowPassed && !ignoredWindows.contains(w)) {
data.multiplySaturation((1.0 - progress * 0.8));
data.multiplyBrightness((1.0 - progress * 0.3));
}
}
if (w == logoutWindow ||
ignoredWindows.contains(w)) // HACK: All windows past the first ignored one should not be
// blurred as it affects the stacking order.
// All following windows are on top of the logout window and should not be altered either
logoutWindowPassed = true;
}
effects->paintWindow(w, mask, region, data);
}