| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- /****************************************************************************
- **
- ** Copyright (C) 2021 The Qt Company Ltd.
- ** Contact: https://www.qt.io/licensing/
- **
- ** This file is part of the Qt Graphical Effects module.
- **
- ** $QT_BEGIN_LICENSE:COMM$
- **
- ** Commercial License Usage
- ** Licensees holding valid commercial Qt licenses may use this file in
- ** accordance with the commercial license agreement provided with the
- ** Software or, alternatively, in accordance with the terms contained in
- ** a written agreement between you and The Qt Company. For licensing terms
- ** and conditions see https://www.qt.io/terms-conditions. For further
- ** information use the contact form at https://www.qt.io/contact-us.
- **
- ** $QT_END_LICENSE$
- **
- **
- **
- **
- **
- **
- **
- **
- **
- **
- **
- **
- **
- **
- **
- **
- **
- **
- **
- ****************************************************************************/
- import QtQuick 2.12
- import QtGraphicalEffects.private 1.12
- Item {
- id: rootItem
- property variant source
- property real radius: 0.0
- property int maximumRadius: 0
- property real spread: 0.0
- property color color: "white"
- property bool cached: false
- property bool transparentBorder: false
- SourceProxy {
- id: sourceProxy
- input: rootItem.source
- sourceRect: rootItem.transparentBorder ? Qt.rect(-1, -1, parent.width + 2.0, parent.height + 2.0) : Qt.rect(0, 0, 0, 0)
- }
- ShaderEffectSource {
- id: cacheItem
- anchors.fill: shaderItem
- visible: rootItem.cached
- smooth: true
- sourceItem: shaderItem
- live: true
- hideSource: visible
- }
- GaussianDirectionalBlur {
- id: shaderItem
- x: transparentBorder ? -maximumRadius - 1 : 0
- y: transparentBorder ? -maximumRadius - 1 : 0
- width: horizontalBlur.width
- height: horizontalBlur.height
- horizontalStep: 0.0
- verticalStep: 1.0 / parent.height
- source: horizontalBlur
- radius: rootItem.radius
- maximumRadius: rootItem.maximumRadius
- transparentBorder: rootItem.transparentBorder
- enableColor: true
- color: rootItem.color
- spread: rootItem.spread
- }
- GaussianDirectionalBlur {
- id: horizontalBlur
- width: transparentBorder ? parent.width + 2 * maximumRadius + 2 : parent.width
- height: transparentBorder ? parent.height + 2 * maximumRadius + 2 : parent.height
- horizontalStep: 1.0 / parent.width
- verticalStep: 0.0
- source: sourceProxy.output
- radius: rootItem.radius
- maximumRadius: rootItem.maximumRadius
- transparentBorder: rootItem.transparentBorder
- visible: false
- }
- }
|