centralize and fixup example sources install targets

This follows suit with aeb036e in qtbase.

Change-Id: Ie8580d0a1f38ab9858b0e44c9f99bdc552a1752a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
Joerg Bornemann
2012-12-05 13:03:09 +01:00
committed by The Qt Project
parent 90c8ba233b
commit 6b4994c265
407 changed files with 216 additions and 271 deletions

View File

@@ -0,0 +1,80 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Rectangle {
id: root
color: textColor
radius: 0.25 * height
property string text
property color bgColor: "white"
property color bgColorSelected: "red"
property color textColor: "black"
property alias enabled: mouseArea.enabled
signal clicked
Rectangle {
anchors { fill: parent; margins: 1 }
color: mouseArea.pressed ? bgColorSelected : bgColor
radius: 0.25 * height
Text {
id: text
anchors.centerIn: parent
text: root.text
font.pixelSize: 0.5 * parent.height
color: mouseArea.pressed ? bgColor : textColor
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
MouseArea {
id: mouseArea
anchors.fill: parent
onClicked: {
root.clicked()
}
}
}
}

View File

@@ -0,0 +1,163 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Rectangle {
id: root
color: "black"
property alias effect: effectLoader.item
property alias gripSize: divider.gripSize
property string effectSource
property real volume: 0.5
signal videoFramePainted
Divider {
id: divider
visible: false
z: 1.0
onValueChanged: updateDivider()
}
ShaderEffectSource {
id: theSource
smooth: true
hideSource: true
}
Loader {
id: contentLoader
}
Loader {
id: effectLoader
source: effectSource
}
Connections {
id: videoFramePaintedConnection
onFramePainted: {
if (performanceLoader.item)
root.videoFramePainted()
}
ignoreUnknownSignals: true
}
onWidthChanged: {
if (effectLoader.item)
effectLoader.item.targetWidth = root.width
}
onHeightChanged: {
if (effectLoader.item)
effectLoader.item.targetHeight = root.height
}
onEffectSourceChanged: {
console.log("[qmlvideofx] Content.onEffectSourceChanged " + effectSource)
effectLoader.source = effectSource
effectLoader.item.parent = root
effectLoader.item.targetWidth = root.width
effectLoader.item.targetHeight = root.height
updateSource()
effectLoader.item.source = theSource
divider.visible = effectLoader.item.divider
updateDivider()
}
function init() {
console.log("[qmlvideofx] Content.init")
openImage("qrc:/images/qt-logo.png")
root.effectSource = "EffectPassThrough.qml"
}
function updateDivider() {
if (effectLoader.item && effectLoader.item.divider)
effectLoader.item.dividerValue = divider.value
}
function updateSource() {
console.log("[qmlvideofx] Content.updateSource")
if (contentLoader.item) {
contentLoader.item.parent = root
contentLoader.item.anchors.fill = root
theSource.sourceItem = contentLoader.item
if (effectLoader.item)
effectLoader.item.anchors.fill = contentLoader.item
}
}
function openImage(path) {
console.log("[qmlvideofx] Content.openImage \"" + path + "\"")
stop()
contentLoader.source = "ContentImage.qml"
videoFramePaintedConnection.target = null
contentLoader.item.source = path
updateSource()
}
function openVideo(path) {
console.log("[qmlvideofx] Content.openVideo \"" + path + "\"")
stop()
contentLoader.source = "ContentVideo.qml"
videoFramePaintedConnection.target = contentLoader.item
contentLoader.item.mediaSource = path
contentLoader.item.volume = volume
contentLoader.item.play()
updateSource()
}
function openCamera() {
console.log("[qmlvideofx] Content.openCamera")
stop()
contentLoader.source = "ContentCamera.qml"
videoFramePaintedConnection.target = contentLoader.item
updateSource()
}
function stop() {
console.log("[qmlvideofx] Content.stop")
if (contentLoader.source == "ContentVideo.qml")
contentLoader.item.stop()
theSource.sourceItem = null
}
}

View File

@@ -0,0 +1,51 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
import QtMultimedia 5.0
VideoOutput {
source: camera
Camera {
id: camera
}
}

View File

@@ -0,0 +1,47 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Image {
fillMode: Image.PreserveAspectFit
smooth: true
}

View File

@@ -0,0 +1,58 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
import QtMultimedia 5.0
VideoOutput {
source: mediaPlayer
property alias mediaSource: mediaPlayer.source
property alias volume: mediaPlayer.volume
MediaPlayer {
id: mediaPlayer
autoPlay: true
volume: 0.5
}
function play() { mediaPlayer.play() }
function stop() { mediaPlayer.stop() }
}

View File

@@ -0,0 +1,50 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
import QtMobility.systeminfo 1.1
Item {
ScreenSaver {
screenSaverInhibited: true
}
}

View File

@@ -0,0 +1,73 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Rectangle {
id: root
anchors.fill: parent
color: "transparent"
property alias value: slider.value
property alias lineWidth: line.width
property alias gripSize: slider.gripSize
Rectangle {
id: line
anchors { top: parent.top; bottom: parent.bottom }
x: parent.value * parent.width - (width / 2)
width: 2
color: "red"
}
Slider {
id: slider
increment: 0.0
lineColor: "transparent"
fillColor: "transparent"
gripColor: "red"
anchors {
top: parent.top
topMargin: gripSize / 2
left: parent.left
right: parent.right
}
}
}

View File

@@ -0,0 +1,75 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
ShaderEffect {
property variant source
property ListModel parameters: ListModel { }
property bool divider: true
property real dividerValue: 0.5
property real targetWidth: 0
property real targetHeight: 0
property string fragmentShaderFilename
property string vertexShaderFilename
QtObject {
id: d
property string fragmentShaderCommon: "
#ifdef GL_ES
precision mediump float;
#else
# define lowp
# define mediump
# define highp
#endif // GL_ES
"
}
// The following is a workaround for the fact that ShaderEffect
// doesn't provide a way for shader programs to be read from a file,
// rather than being inline in the QML file
onFragmentShaderFilenameChanged:
fragmentShader = d.fragmentShaderCommon + fileReader.readFile(fragmentShaderFilename)
onVertexShaderFilenameChanged:
vertexShader = fileReader.readFile(vertexShaderFilename)
}

View File

@@ -0,0 +1,59 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Effect {
parameters: ListModel {
ListElement {
name: "grid spacing"
value: 0.5
}
}
// Transform slider values, and bind result to shader uniforms
property real grid: parameters.get(0).value * 10
property real step_x: 0.0015625
property real step_y: targetHeight ? (step_x * targetWidth / targetHeight) : 0.0
fragmentShaderFilename: "shaders/billboard.fsh"
}

View File

@@ -0,0 +1,56 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Effect {
parameters: ListModel {
ListElement {
name: "threshold"
value: 0.5
}
}
// Transform slider values, and bind result to shader uniforms
property real threshold: parameters.get(0).value
fragmentShaderFilename: "shaders/blackandwhite.fsh"
}

View File

@@ -0,0 +1,46 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Effect {
fragmentShaderFilename: "shaders/emboss.fsh"
}

View File

@@ -0,0 +1,85 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
// Based on http://www.geeks3d.com/20100909/shader-library-gaussian-blur-post-processing-filter-in-glsl/
import QtQuick 2.0
Item {
id: root
property bool divider: true
property real dividerValue: 0.5
property ListModel parameters: ListModel {
ListElement {
name: "radius"
value: 0.5
}
}
property alias targetWidth: verticalShader.targetWidth
property alias targetHeight: verticalShader.targetHeight
property alias source: verticalShader.source
Effect {
id: verticalShader
anchors.fill: parent
dividerValue: parent.dividerValue
property real blurSize: 4.0 * parent.parameters.get(0).value / targetHeight
fragmentShaderFilename: "shaders/gaussianblur_v.fsh"
}
Effect {
id: horizontalShader
anchors.fill: parent
dividerValue: parent.dividerValue
property real blurSize: 4.0 * parent.parameters.get(0).value / parent.targetWidth
fragmentShaderFilename: "shaders/gaussianblur_h.fsh"
source: horizontalShaderSource
ShaderEffectSource {
id: horizontalShaderSource
sourceItem: verticalShader
smooth: true
hideSource: true
}
}
}

View File

@@ -0,0 +1,46 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Effect {
fragmentShaderFilename: "shaders/glow.fsh"
}

View File

@@ -0,0 +1,61 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Effect {
parameters: ListModel {
ListElement {
name: "hue"
value: 0.5
}
ListElement {
name: "width"
value: 0.5
}
}
// Transform slider values, and bind result to shader uniforms
property real targetHue: parameters.get(0).value * 360
property real windowWidth: parameters.get(1).value * 60
fragmentShaderFilename: "shaders/isolate.fsh"
}

View File

@@ -0,0 +1,93 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Effect {
id: root
divider: false
parameters: ListModel {
ListElement {
name: "radius"
value: 0.5
}
ListElement {
name: "diffraction"
value: 0.5
}
}
property real posX: -1
property real posY: -1
QtObject {
id: d
property real oldTargetWidth: root.targetWidth
property real oldTargetHeight: root.targetHeight
}
// Transform slider values, and bind result to shader uniforms
property real radius: parameters.get(0).value * 100
property real diffractionIndex: parameters.get(1).value
onTargetWidthChanged: {
if (posX == -1)
posX = targetWidth / 2
else if (d.oldTargetWidth != 0)
posX *= (targetWidth / d.oldTargetWidth)
d.oldTargetWidth = targetWidth
}
onTargetHeightChanged: {
if (posY == -1)
posY = targetHeight / 2
else if (d.oldTargetHeight != 0)
posY *= (targetHeight / d.oldTargetHeight)
d.oldTargetHeight = targetHeight
}
fragmentShaderFilename: "shaders/magnify.fsh"
MouseArea {
anchors.fill: parent
onPositionChanged: { root.posX = mouse.x; root.posY = root.targetHeight - mouse.y }
}
}

View File

@@ -0,0 +1,57 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Effect {
divider: false
parameters: ListModel {
ListElement {
name: "extent"
value: 0.5
}
}
// Transform slider values, and bind result to shader uniforms
property real curlExtent: 1.0 - parameters.get(0).value
fragmentShaderFilename: "shaders/pagecurl.fsh"
}

View File

@@ -0,0 +1,46 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Effect {
divider: false
}

View File

@@ -0,0 +1,56 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Effect {
parameters: ListModel {
ListElement {
name: "granularity"
value: 0.5
}
}
// Transform slider values, and bind result to shader uniforms
property real granularity: parameters.get(0).value * 20
fragmentShaderFilename: "shaders/pixelate.fsh"
}

View File

@@ -0,0 +1,58 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Effect {
parameters: ListModel {
ListElement {
name: "gamma"
value: 0.5
}
}
// Transform slider values, and bind result to shader uniforms
property real gamma: parameters.get(0).value
property real numColors: 8.0
fragmentShaderFilename: "shaders/posterize.fsh"
}

View File

@@ -0,0 +1,64 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Effect {
parameters: ListModel {
ListElement {
name: "amplitude"
value: 0.5
}
ListElement {
name: "frequency"
value: 0.5
}
}
// Transform slider values, and bind result to shader uniforms
property real amplitude: parameters.get(0).value * 0.03
property real n: parameters.get(1).value * 7
property real time: 0
NumberAnimation on time { loops: Animation.Infinite; from: 0; to: Math.PI * 2; duration: 600 }
fragmentShaderFilename: "shaders/ripple.fsh"
}

View File

@@ -0,0 +1,154 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Rectangle {
id: root
property int itemHeight: 25
property string effectSource: ""
signal clicked
QtObject {
id: d
property Item selectedItem
}
ListModel {
id: sources
ListElement { name: "No effect"; source: "EffectPassThrough.qml" }
ListElement { name: "Billboard"; source: "EffectBillboard.qml" }
ListElement { name: "Black & white"; source: "EffectBlackAndWhite.qml" }
ListElement { name: "Blur"; source: "EffectGaussianBlur.qml" }
ListElement { name: "Edge detection"; source: "EffectSobelEdgeDetection1.qml" }
//ListElement { name: "Edge detection (Sobel, #2)"; source: "EffectSobelEdgeDetection2.qml" }
ListElement { name: "Emboss"; source: "EffectEmboss.qml" }
ListElement { name: "Glow"; source: "EffectGlow.qml" }
ListElement { name: "Isolate"; source: "EffectIsolate.qml" }
ListElement { name: "Magnify"; source: "EffectMagnify.qml" }
ListElement { name: "Page curl"; source: "EffectPageCurl.qml" }
ListElement { name: "Pixelate"; source: "EffectPixelate.qml" }
ListElement { name: "Posterize"; source: "EffectPosterize.qml" }
ListElement { name: "Ripple"; source: "EffectRipple.qml" }
ListElement { name: "Sepia"; source: "EffectSepia.qml" }
ListElement { name: "Sharpen"; source: "EffectSharpen.qml" }
ListElement { name: "Shockwave"; source: "EffectShockwave.qml" }
ListElement { name: "Tilt shift"; source: "EffectTiltShift.qml" }
ListElement { name: "Toon"; source: "EffectToon.qml" }
ListElement { name: "Warhol"; source: "EffectWarhol.qml" }
ListElement { name: "Wobble"; source: "EffectWobble.qml" }
ListElement { name: "Vignette"; source: "EffectVignette.qml" }
}
Component {
id: sourceDelegate
Item {
id: sourceDelegateItem
width: root.width
height: itemHeight
Button {
id: sourceSelectorItem
anchors.centerIn: parent
width: 0.9 * parent.width
height: 0.8 * itemHeight
text: name
onClicked: {
if (d.selectedItem)
d.selectedItem.state = "baseState"
d.selectedItem = sourceDelegateItem
d.selectedItem.state = "selected"
effectSource = source
root.clicked()
}
}
states: [
State {
name: "selected"
PropertyChanges {
target: sourceSelectorItem
bgColor: "#ff8888"
}
}
]
Component.onCompleted: {
if (name == "No effect") {
state = "selected"
d.selectedItem = sourceDelegateItem
}
}
transitions: [
Transition {
from: "*"
to: "*"
ColorAnimation {
properties: "color"
easing.type: Easing.OutQuart
duration: 500
}
}
]
}
}
Flickable {
anchors.fill: parent
contentHeight: (itemHeight * sources.count) + layout.anchors.topMargin + layout.spacing
clip: true
Column {
id: layout
anchors {
fill: parent
topMargin: 10
}
Repeater {
model: sources
delegate: sourceDelegate
}
}
}
}

View File

@@ -0,0 +1,46 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Effect {
fragmentShaderFilename: "shaders/sepia.fsh"
}

View File

@@ -0,0 +1,56 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Effect {
parameters: ListModel {
ListElement {
name: "sharpness"
value: 0.5
}
}
// Transform slider values, and bind result to shader uniforms
property real amount: parameters.get(0).value * 18
fragmentShaderFilename: "shaders/sharpen.fsh"
}

View File

@@ -0,0 +1,80 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Effect {
id: root
parameters: ListModel {
ListElement {
name: "amplitude"
value: 0.5
}
}
// Transform slider values, and bind result to shader uniforms
property real granularity: parameters.get(0).value * 20
property real weight: parameters.get(0).value
property real centerX
property real centerY
property real time
SequentialAnimation {
running: true
loops: Animation.Infinite
ScriptAction {
script: {
centerX = Math.random()
centerY = Math.random()
}
}
NumberAnimation {
target: root
property: "time"
from: 0
to: 1
duration: 1000
}
}
fragmentShaderFilename: "shaders/shockwave.fsh"
}

View File

@@ -0,0 +1,59 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Effect {
parameters: ListModel {
ListElement {
name: "threshold"
value: 0.5
}
}
// Transform slider values, and bind result to shader uniforms
property real mixLevel: parameters.get(0).value
property real targetSize: 250 - (200 * mixLevel) // TODO: fix ...
property real resS: targetSize
property real resT: targetSize
fragmentShaderFilename: "shaders/sobeledgedetection1.fsh"
}

View File

@@ -0,0 +1,56 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Effect {
parameters: ListModel {
ListElement {
name: "threshold"
value: 0.5
}
}
// Transform slider values, and bind result to shader uniforms
property real weight: parameters.get(0).value
fragmentShaderFilename: "shaders/sobeledgedetection2.fsh"
}

View File

@@ -0,0 +1,46 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Effect {
fragmentShaderFilename: "shaders/tiltshift.fsh"
}

View File

@@ -0,0 +1,63 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Effect {
parameters: ListModel {
ListElement {
name: "threshold"
value: 0.5
}
}
// Transform slider values, and bind result to shader uniforms
property real threshold: parameters.get(0).value
property real targetSize: 250 - (200 * threshold) // TODO: fix ...
property real resS: targetSize
property real resT: targetSize
// TODO
property real magTol: 0.3
property real quantize: 8.0
fragmentShaderFilename: "shaders/toon.fsh"
}

View File

@@ -0,0 +1,46 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Effect {
fragmentShaderFilename: "shaders/vignette.fsh"
}

View File

@@ -0,0 +1,46 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Effect {
fragmentShaderFilename: "shaders/warhol.fsh"
}

View File

@@ -0,0 +1,61 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Effect {
parameters: ListModel {
ListElement {
name: "amplitude"
value: 0.5
}
}
// Transform slider values, and bind result to shader uniforms
property real amplitude: parameters.get(0).value * 0.05
property real frequency: 20
property real time: 0
NumberAnimation on time { loops: Animation.Infinite; from: 0; to: Math.PI * 2; duration: 600 }
fragmentShaderFilename: "shaders/wobble.fsh"
}

View File

@@ -0,0 +1,384 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
import Qt.labs.folderlistmodel 2.0
Rectangle {
id: fileBrowser
color: "transparent"
property string folder
property bool shown: loader.sourceComponent
signal fileSelected(string file)
function selectFile(file) {
if (file != "")
folder = loader.item.folders.folder
loader.sourceComponent = undefined
fileBrowser.fileSelected(file)
}
Loader {
id: loader
}
function show() {
loader.sourceComponent = fileBrowserComponent
loader.item.parent = fileBrowser
loader.item.anchors.fill = fileBrowser
loader.item.folder = fileBrowser.folder
}
Component {
id: fileBrowserComponent
Rectangle {
id: root
color: "white"
property bool showFocusHighlight: false
property variant folders: folders1
property variant view: view1
property alias folder: folders1.folder
property color textColor: "black"
FolderListModel {
id: folders1
folder: folder
}
FolderListModel {
id: folders2
folder: folder
}
SystemPalette {
id: palette
}
Component {
id: folderDelegate
Rectangle {
id: wrapper
function launch() {
if (folders.isFolder(index))
down(filePath);
else
fileBrowser.selectFile(filePath)
}
width: root.width
height: 52
color: "transparent"
Rectangle {
id: highlight; visible: false
anchors.fill: parent
color: palette.highlight
gradient: Gradient {
GradientStop { id: t1; position: 0.0; color: palette.highlight }
GradientStop { id: t2; position: 1.0; color: Qt.lighter(palette.highlight) }
}
}
Item {
width: 48; height: 48
Image {
source: "qrc:/images/folder.png"
anchors.centerIn: parent
visible: folders.isFolder(index)
}
}
Text {
id: nameText
anchors.fill: parent; verticalAlignment: Text.AlignVCenter
text: fileName
anchors.leftMargin: 54
font.pixelSize: 32
color: (wrapper.ListView.isCurrentItem && root.showFocusHighlight) ? palette.highlightedText : textColor
elide: Text.ElideRight
}
MouseArea {
id: mouseRegion
anchors.fill: parent
onPressed: {
root.showFocusHighlight = false;
wrapper.ListView.view.currentIndex = index;
}
onClicked: { if (folders == wrapper.ListView.view.model) launch() }
}
states: [
State {
name: "pressed"
when: mouseRegion.pressed
PropertyChanges { target: highlight; visible: true }
PropertyChanges { target: nameText; color: palette.highlightedText }
}
]
}
}
Rectangle {
id: cancelButton
width: 100
height: titleBar.height - 7
color: "black"
anchors { bottom: parent.bottom; horizontalCenter: parent.horizontalCenter }
Text {
anchors { fill: parent; margins: 4 }
text: "Cancel"
color: "white"
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.pixelSize: 20
}
MouseArea {
anchors.fill: parent
onClicked: fileBrowser.selectFile("")
}
}
ListView {
id: view1
anchors.top: titleBar.bottom
anchors.bottom: cancelButton.top
x: 0
width: parent.width
model: folders1
delegate: folderDelegate
highlight: Rectangle {
color: palette.highlight
visible: root.showFocusHighlight && view1.count != 0
gradient: Gradient {
GradientStop { id: t1; position: 0.0; color: palette.highlight }
GradientStop { id: t2; position: 1.0; color: Qt.lighter(palette.highlight) }
}
width: view1.currentItem == null ? 0 : view1.currentItem.width
}
highlightMoveVelocity: 1000
pressDelay: 100
focus: true
state: "current"
states: [
State {
name: "current"
PropertyChanges { target: view1; x: 0 }
},
State {
name: "exitLeft"
PropertyChanges { target: view1; x: -root.width }
},
State {
name: "exitRight"
PropertyChanges { target: view1; x: root.width }
}
]
transitions: [
Transition {
to: "current"
SequentialAnimation {
NumberAnimation { properties: "x"; duration: 250 }
}
},
Transition {
NumberAnimation { properties: "x"; duration: 250 }
NumberAnimation { properties: "x"; duration: 250 }
}
]
Keys.onPressed: root.keyPressed(event.key)
}
ListView {
id: view2
anchors.top: titleBar.bottom
anchors.bottom: parent.bottom
x: parent.width
width: parent.width
model: folders2
delegate: folderDelegate
highlight: Rectangle {
color: palette.highlight
visible: root.showFocusHighlight && view2.count != 0
gradient: Gradient {
GradientStop { id: t1; position: 0.0; color: palette.highlight }
GradientStop { id: t2; position: 1.0; color: Qt.lighter(palette.highlight) }
}
width: view1.currentItem == null ? 0 : view1.currentItem.width
}
highlightMoveVelocity: 1000
pressDelay: 100
states: [
State {
name: "current"
PropertyChanges { target: view2; x: 0 }
},
State {
name: "exitLeft"
PropertyChanges { target: view2; x: -root.width }
},
State {
name: "exitRight"
PropertyChanges { target: view2; x: root.width }
}
]
transitions: [
Transition {
to: "current"
SequentialAnimation {
NumberAnimation { properties: "x"; duration: 250 }
}
},
Transition {
NumberAnimation { properties: "x"; duration: 250 }
}
]
Keys.onPressed: root.keyPressed(event.key)
}
Keys.onPressed: {
root.keyPressed(event.key);
if (event.key == Qt.Key_Return || event.key == Qt.Key_Select || event.key == Qt.Key_Right) {
view.currentItem.launch();
event.accepted = true;
} else if (event.key == Qt.Key_Left) {
up();
}
}
BorderImage {
source: "qrc:/images/titlebar.sci";
width: parent.width;
height: 52
y: -7
id: titleBar
Rectangle {
id: upButton
width: 48
height: titleBar.height - 7
color: "transparent"
Image { anchors.centerIn: parent; source: "qrc:/images/up.png" }
MouseArea { id: upRegion; anchors.centerIn: parent
width: 56
height: 56
onClicked: if (folders.parentFolder != "") up()
}
states: [
State {
name: "pressed"
when: upRegion.pressed
PropertyChanges { target: upButton; color: palette.highlight }
}
]
}
Rectangle {
color: "gray"
x: 48
width: 1
height: 44
}
Text {
anchors.left: upButton.right; anchors.right: parent.right; height: parent.height
anchors.leftMargin: 4; anchors.rightMargin: 4
text: folders.folder
color: "white"
elide: Text.ElideLeft; horizontalAlignment: Text.AlignRight; verticalAlignment: Text.AlignVCenter
font.pixelSize: 32
}
}
function down(path) {
if (folders == folders1) {
view = view2
folders = folders2;
view1.state = "exitLeft";
} else {
view = view1
folders = folders1;
view2.state = "exitLeft";
}
view.x = root.width;
view.state = "current";
view.focus = true;
folders.folder = path;
}
function up() {
var path = folders.parentFolder;
if (folders == folders1) {
view = view2
folders = folders2;
view1.state = "exitRight";
} else {
view = view1
folders = folders1;
view2.state = "exitRight";
}
view.x = -root.width;
view.state = "current";
view.focus = true;
folders.folder = path;
}
function keyPressed(key) {
switch (key) {
case Qt.Key_Up:
case Qt.Key_Down:
case Qt.Key_Left:
case Qt.Key_Right:
root.showFocusHighlight = true;
break;
default:
// do nothing
break;
}
}
}
}
}

View File

@@ -0,0 +1,94 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Rectangle {
id: root
color: "white"
property int buttonHeight: 35
property int topMargin: 0
signal openImage
signal openVideo
signal openCamera
signal close
Rectangle {
anchors {
top: parent.top;
topMargin: root.topMargin
bottom: parent.bottom;
horizontalCenter: parent.horizontalCenter
}
width: 0.9 * parent.width
color: "transparent"
Column {
anchors.fill: parent
spacing: 5
Button {
text: "Open image"
height: buttonHeight
width: parent.width
onClicked: root.openImage()
}
Button {
text: "Open video"
height: buttonHeight
width: parent.width
onClicked: root.openVideo()
}
Button {
text: "Start camera"
height: buttonHeight
width: parent.width
onClicked: root.openCamera()
}
Button {
text: "Reset"
height: buttonHeight
width: parent.width
onClicked: root.close()
}
}
}
}

View File

@@ -0,0 +1,113 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
// Mouse area which flashes to indicate its location on the screen
import QtQuick 2.0
MouseArea {
property alias hintColor: hintRect.color
property bool hintEnabled: true
Rectangle {
id: hintRect
anchors.fill: parent
color: "yellow"
opacity: 0
states: [
State {
name: "high"
PropertyChanges {
target: hintRect
opacity: 0.8
}
},
State {
name: "low"
PropertyChanges {
target: hintRect
opacity: 0.4
}
}
]
transitions: [
Transition {
from: "low"
to: "high"
SequentialAnimation {
NumberAnimation {
properties: "opacity"
easing.type: Easing.InOutSine
duration: 500
}
ScriptAction { script: hintRect.state = "low" }
}
},
Transition {
from: "*"
to: "low"
SequentialAnimation {
NumberAnimation {
properties: "opacity"
easing.type: Easing.InOutSine
duration: 500
}
ScriptAction { script: hintRect.state = "high" }
}
},
Transition {
from: "*"
to: "baseState"
NumberAnimation {
properties: "opacity"
easing.type: Easing.InOutSine
duration: 500
}
}
]
}
onHintEnabledChanged: hintRect.state = hintEnabled ? "low" : "baseState"
Component.onCompleted: hintRect.state = "low"
}

View File

@@ -0,0 +1,109 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Rectangle {
id: root
color: "transparent"
height: view.model.count * sliderHeight
property color lineColor: "black"
property real gripSize: 25
property real spacing: 10
property real sliderHeight: 40
property ListModel model: ListModel { }
Rectangle {
anchors.fill: parent
color: "black"
opacity: 0.5
radius: 10
}
Component {
id: editDelegate
Rectangle {
id: delegate
width: parent.width
height: root.sliderHeight
color: "transparent"
Text {
id: text
text: name
color: "white"
anchors {
top: parent.top
bottom: parent.bottom
left: parent.left
}
font.pixelSize: 0.5 * parent.height
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
width: 150
}
Slider {
anchors {
top: parent.top
bottom: parent.bottom
left: text.right
leftMargin: 20
right: parent.right
rightMargin: 20
}
gripSize: root.gripSize
value: model.value
onValueChanged: view.model.setProperty(index, "value", value)
}
}
}
ListView {
id: view
anchors.fill: parent
model: root.model
delegate: editDelegate
interactive: false
}
}

View File

@@ -0,0 +1,129 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Rectangle {
id: root
color: "transparent"
radius: 5
property alias value: grip.value
property color fillColor: "white"
property color lineColor: "black"
property color gripColor: "white"
property real gripSize: 20
property real gripTolerance: 3.0
property real increment: 0.1
property bool enabled: true
Rectangle {
anchors { left: parent.left; right: parent.right; verticalCenter: parent.verticalCenter }
height: 3
color: displayedColor(root.lineColor)
Rectangle {
anchors { fill: parent; margins: 1 }
color: root.fillColor
}
}
MouseArea {
anchors.fill: parent
enabled: root.enabled
onClicked: {
if (parent.width) {
var newValue = mouse.x / parent.width
if (Math.abs(newValue - parent.value) > parent.increment) {
if (newValue > parent.value)
parent.value = Math.min(1.0, parent.value + parent.increment)
else
parent.value = Math.max(0.0, parent.value - parent.increment)
}
}
}
}
Rectangle {
id: grip
property real value: 0.5
x: (value * parent.width) - width/2
anchors.verticalCenter: parent.verticalCenter
width: root.gripTolerance * root.gripSize
height: width
radius: width/2
color: "transparent"
MouseArea {
id: mouseArea
enabled: root.enabled
anchors.fill: parent
drag {
target: grip
axis: Drag.XAxis
minimumX: -parent.width/2
maximumX: root.width - parent.width/2
}
onPositionChanged: {
if (drag.active)
updatePosition()
}
onReleased: {
updatePosition()
}
function updatePosition() {
value = (grip.x + grip.width/2) / grip.parent.width
}
}
Rectangle {
anchors.centerIn: parent
width: root.gripSize
height: width
radius: width/2
color: root.gripColor
}
}
function displayedColor(c) {
var tint = Qt.rgba(c.r, c.g, c.b, 0.25)
return enabled ? c : Qt.tint(c, tint)
}
}

View File

@@ -0,0 +1,186 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Rectangle {
id: root
width: 900
height: 600
color: "grey"
property string fileName
property alias volume: content.volume
property bool perfMonitorsLogging: false
property bool perfMonitorsVisible: false
QtObject {
id: d
property real gripSize: 20
}
Rectangle {
id: inner
anchors.fill: parent
color: "grey"
Content {
id: content
anchors {
top: parent.top
bottom: parent.bottom
left: parent.left
right: effectSelectionPanel.left
margins: 5
}
gripSize: d.gripSize
width: 600
height: 600
}
Loader {
id: performanceLoader
function init() {
console.log("[qmlvideofx] performanceLoader.init logging " + root.perfMonitorsLogging + " visible " + root.perfMonitorsVisible)
var enabled = root.perfMonitorsLogging || root.perfMonitorsVisible
source = enabled ? "../performancemonitor/PerformanceItem.qml" : ""
}
onLoaded: {
item.parent = content
item.anchors.top = content.top
item.anchors.left = content.left
item.anchors.right = content.right
item.logging = root.perfMonitorsLogging
item.displayed = root.perfMonitorsVisible
item.init()
}
}
ParameterPanel {
id: parameterPanel
anchors {
left: parent.left
bottom: parent.bottom
right: effectSelectionPanel.left
margins: 20
}
gripSize: d.gripSize
}
EffectSelectionPanel {
id: effectSelectionPanel
anchors {
top: parent.top
bottom: fileOpen.top
right: parent.right
margins: 5
}
width: 300
itemHeight: 40
onEffectSourceChanged: {
content.effectSource = effectSource
parameterPanel.model = content.effect.parameters
}
}
FileOpen {
id: fileOpen
anchors {
right: parent.right
bottom: parent.bottom
margins: 5
}
width: effectSelectionPanel.width
height: 165
buttonHeight: 32
topMargin: 10
}
}
FileBrowser {
id: imageFileBrowser
anchors.fill: root
Component.onCompleted: fileSelected.connect(content.openImage)
}
FileBrowser {
id: videoFileBrowser
anchors.fill: root
Component.onCompleted: fileSelected.connect(content.openVideo)
}
Component.onCompleted: {
fileOpen.openImage.connect(openImage)
fileOpen.openVideo.connect(openVideo)
fileOpen.openCamera.connect(openCamera)
fileOpen.close.connect(close)
}
function init() {
console.log("[qmlvideofx] main.init")
imageFileBrowser.folder = imagePath
videoFileBrowser.folder = videoPath
content.init()
performanceLoader.init()
if (fileName != "")
content.openVideo(fileName)
}
function qmlFramePainted() {
if (performanceLoader.item)
performanceLoader.item.qmlFramePainted()
}
function openImage() {
imageFileBrowser.show()
}
function openVideo() {
videoFileBrowser.show()
}
function openCamera() {
content.openCamera()
}
function close() {
content.openImage("qrc:/images/qt-logo.png")
}
}

View File

@@ -0,0 +1,408 @@
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Rectangle {
id: root
width: 640
height: 360
color: "grey"
property string fileName
property alias volume: content.volume
property bool perfMonitorsLogging: false
property bool perfMonitorsVisible: false
QtObject {
id: d
property bool dialogShown: (fileOpenContainer.state == "shown" ||
effectSelectionPanel.state == "shown" ||
videoFileBrowser.shown ||
imageFileBrowser.shown)
property real gripSize: 40
}
// Create ScreenSaver element via Loader, so this app will still run if the
// SystemInfo module is not available
Loader {
source: "DisableScreenSaver.qml"
}
Loader {
id: performanceLoader
Connections {
target: d
onDialogShownChanged:
if (performanceLoader.item)
performanceLoader.item.enabled = !d.dialogShown
ignoreUnknownSignals: true
}
function init() {
console.log("[qmlvideofx] performanceLoader.init logging " + root.perfMonitorsLogging + " visible " + root.perfMonitorsVisible)
var enabled = root.perfMonitorsLogging || root.perfMonitorsVisible
source = enabled ? "../performancemonitor/PerformanceItem.qml" : ""
}
onLoaded: {
item.parent = root
item.anchors.top = root.top
item.anchors.left = root.left
item.logging = root.perfMonitorsLogging
item.displayed = root.perfMonitorsVisible
item.init()
}
}
Rectangle {
id: inner
anchors.fill: parent
color: "grey"
Content {
id: content
anchors.fill: parent
gripSize: d.gripSize
onVideoFramePainted: performanceLoader.item.videoFramePainted()
}
ParameterPanel {
id: parameterPanel
anchors {
left: parent.left;
right: parent.right;
margins: 10
}
y: parent.height
gripSize: d.gripSize
states: [
State {
name: "shown"
PropertyChanges {
target: parameterPanel
y: parent.height - (parameterPanel.height + 10)
}
}
]
transitions: [
Transition {
from: "*"
to: "*"
NumberAnimation {
properties: "y"
easing.type: Easing.OutQuart
duration: 500
}
}
]
state: (enabled && !d.dialogShown) ? "shown" : "baseState"
}
EffectSelectionPanel {
id: effectSelectionPanel
anchors {
top: parent.top;
bottom: parameterPanel.top;
margins: 10
}
x: parent.width
width: parent.width - 40
opacity: 0.75
radius: 20
itemHeight: 50
states: [
State {
name: "shown"
PropertyChanges {
target: effectSelectionPanel
x: 20
}
}
]
transitions: [
Transition {
from: "*"
to: "*"
NumberAnimation {
properties: "x"
easing.type: Easing.OutQuart
duration: 500
}
}
]
onEffectSourceChanged: {
content.effectSource = effectSource
if (content.effect.parameters.count) {
parameterPanel.model = content.effect.parameters
parameterPanel.enabled = true
} else {
parameterPanel.enabled = false
}
}
onClicked: state = "baseState"
}
Rectangle {
id: fileOpenContainer
anchors {
top: parent.top
bottom: parameterPanel.top
margins: 10
}
x: -width
width: parent.width - 40
color: "transparent"
Column {
anchors.fill: parent
FileOpen {
id: fileOpen
color: "transparent"
width: parent.width
height: 200
opacity: 0.75
radius: 20
buttonHeight: 40
}
MouseArea {
width: parent.width
height: 250
onClicked: fileOpenContainer.state = "baseState"
}
}
states: [
State {
name: "shown"
PropertyChanges {
target: fileOpenContainer
x: 20
}
}
]
transitions: [
Transition {
from: "*"
to: "*"
NumberAnimation {
properties: "x"
easing.type: Easing.OutQuart
duration: 500
}
}
]
}
Rectangle {
id: splashScreen
anchors {
horizontalCenter: parent.horizontalCenter
verticalCenter: parent.verticalCenter
}
width: 300
height: 200
radius: 0.1 * height
color: "white"
opacity: 0.9
border { color: "black"; width: 2 }
Text {
anchors {
fill: parent
margins: 5
}
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.pixelSize: 24
text: "Tap on left side to switch between sources.\n\nTap on right side to switch between effects."
wrapMode: Text.WordWrap
}
MouseArea {
anchors.fill: parent
onClicked: parent.state = "hidden"
}
states: [
State {
name: "hidden"
PropertyChanges {
target: splashScreen
opacity: 0.0
}
}
]
transitions: [
Transition {
from: "*"
to: "*"
NumberAnimation {
properties: "opacity"
easing.type: Easing.OutQuart
duration: 500
}
}
]
}
HintedMouseArea {
id: fileOpenMouseArea
anchors {
left: parent.left;
top: parent.top;
bottom: parameterPanel.top;
topMargin: 75
}
width: 100
onClicked: {
fileOpenMouseArea.hintEnabled = false
effectSelectionPanelMouseArea.hintEnabled = false
splashScreen.state = "hidden"
fileOpenContainer.state = "shown"
}
enabled: !d.dialogShown
}
HintedMouseArea {
id: effectSelectionPanelMouseArea
anchors {
right: parent.right;
top: parent.top;
bottom: parameterPanel.top;
topMargin: 75
}
width: 100
onClicked: {
fileOpenMouseArea.hintEnabled = false
effectSelectionPanelMouseArea.hintEnabled = false
splashScreen.state = "hidden"
effectSelectionPanel.state = "shown"
}
enabled: !d.dialogShown
}
Image {
source: "qrc:/images/close.png"
anchors {
top: parent.top
right: parent.right
margins: 5
}
MouseArea {
anchors.fill: parent
onClicked: Qt.quit()
}
}
}
Component.onCompleted: {
fileOpen.openImage.connect(openImage)
fileOpen.openVideo.connect(openVideo)
fileOpen.openCamera.connect(openCamera)
fileOpen.close.connect(close)
}
FileBrowser {
id: imageFileBrowser
anchors.fill: root
Component.onCompleted: fileSelected.connect(content.openImage)
}
FileBrowser {
id: videoFileBrowser
anchors.fill: root
Component.onCompleted: fileSelected.connect(content.openVideo)
}
// Called from main() once root properties have been set
function init() {
console.log("[qmlvideofx] main.init")
imageFileBrowser.folder = imagePath
videoFileBrowser.folder = videoPath
content.init()
performanceLoader.init()
if (fileName != "") {
fileOpenMouseArea.hintEnabled = false
effectSelectionPanelMouseArea.hintEnabled = false
splashScreen.state = "hidden"
content.openVideo(fileName)
}
}
function qmlFramePainted() {
if (performanceLoader.item)
performanceLoader.item.qmlFramePainted()
}
function openImage() {
fileOpenContainer.state = "baseState"
imageFileBrowser.show()
}
function openVideo() {
fileOpenContainer.state = "baseState"
videoFileBrowser.show()
}
function openCamera() {
fileOpenContainer.state = "baseState"
content.openCamera()
}
function close() {
fileOpenContainer.state = "baseState"
content.openImage("qrc:/images/qt-logo.png")
}
}