FastBlur QML Type

Applies a fast blur effect to one or more source items. More...

Import Statement: import QtGraphicalEffects 1.0
Since: QtGraphicalEffects 1.0
Inherits:

Item

Properties

Detailed Description

FastBlur offers lower blur quality than GaussianBlur, but it is faster to render. The FastBlur effect softens the source content by blurring it with algorithm which uses the source content downscaling and bilinear filtering. Use this effect in situations where the source content is rapidly changing and the highest possible blur quality is not needed.

SourceEffect applied

Example

The following example shows how to apply the effect.

import QtQuick 2.0
import QtGraphicalEffects 1.0

Item {
    width: 300
    height: 300

    Image {
        id: bug
        source: "images/bug.jpg"
        sourceSize: Qt.size(parent.width, parent.height)
        smooth: true
        visible: false
    }

    FastBlur {
        anchors.fill: bug
        source: bug
        radius: 32
    }
}

Property Documentation

cached : bool

This property allows the effect output pixels to be cached in order to improve the rendering performance.

Every time the source or effect properties are changed, the pixels in the cache must be updated. Memory consumption is increased, because an extra buffer of memory is required for storing the effect output.

It is recommended to disable the cache when the source or the effect properties are animated.

By default, the property is set to false.


radius : real

This property defines the distance of the neighboring pixels which affect the blurring of an individual pixel. A larger radius increases the blur effect. FastBlur algorithm may internally reduce the accuracy of the radius in order to provide good rendering performance.

The value ranges from 0.0 (no blur) to inf. Visual quality of the blur is reduced when radius exceeds value 64. By default, the property is set to 0.0 (no blur).

Output examples with different blur values

radius: 0 radius: 32 radius: 64

source : variant

This property defines the source item that is going to be blurred.

Note: It is not supported to let the effect include itself, for instance by setting source to the effect's parent.


transparentBorder : bool

This property defines the blur behavior near the edges of the item, where the pixel blurring is affected by the pixels outside the source edges.

If the property is set to true, the pixels outside the source are interpreted to be transparent, which is similar to OpenGL clamp-to-border extension. The blur is expanded slightly outside the effect item area.

If the property is set to false, the pixels outside the source are interpreted to contain the same color as the pixels at the edge of the item, which is similar to OpenGL clamp-to-edge behavior. The blur does not expand outside the effect item area.

By default, the property is set to false.

Output examples with different transparentBorder values

transparentBorder: false transparentBorder: true
radius: 64radius: 64

© 2015 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.