当前位置: 首页>>代码示例>>C++>>正文


C++ WindowPaintData::multiplySaturation方法代码示例

本文整理汇总了C++中WindowPaintData::multiplySaturation方法的典型用法代码示例。如果您正苦于以下问题:C++ WindowPaintData::multiplySaturation方法的具体用法?C++ WindowPaintData::multiplySaturation怎么用?C++ WindowPaintData::multiplySaturation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WindowPaintData的用法示例。


在下文中一共展示了WindowPaintData::multiplySaturation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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);
}
开发者ID:mgottschlag,项目名称:kwin-tiling,代码行数:47,代码来源:logout.cpp

示例2: 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);
}
开发者ID:walac,项目名称:kde-workspace,代码行数:8,代码来源:dimscreen.cpp

示例3: 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);
}
开发者ID:aarontc,项目名称:kde-workspace,代码行数:13,代码来源:diminactive.cpp


注:本文中的WindowPaintData::multiplySaturation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。