summaryrefslogtreecommitdiffstats
path: root/basicsuite/graphicaleffects
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@digia.com>2014-01-24 13:22:02 +0100
committerTopi Reiniƶ <topi.reinio@digia.com>2014-01-27 11:29:55 +0200
commitca01d5f9f5e960337a044be6e00de58fd4fbdb05 (patch)
tree3f2e25c5f05d5e5ba9bc44f2e5a09b86741c3fb5 /basicsuite/graphicaleffects
parent5a362f80d9da6d2d36efc127588f3c427211f98c (diff)
Make basicsuite demos run stand-alone
This change will make the demos run standalone when built in Qt Creator. - Rename example directories to lowercase/non-whitespace to avoid build & deployment problems - Add title.txt files so titles remain displayed correctly in the launcher - Add a common shared source files used for the standalone apps, and .pro-files for each example - Remove .qmlproject files (not needed) - Adjust documentation to match the new directory structure Change-Id: Ib24e461952da3b2c88aab0363249115ea44ee0f2 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@digia.com>
Diffstat (limited to 'basicsuite/graphicaleffects')
-rw-r--r--basicsuite/graphicaleffects/Checkers.qml68
-rw-r--r--basicsuite/graphicaleffects/description.txt2
-rw-r--r--basicsuite/graphicaleffects/effect_BrightnessContrast.qml75
-rw-r--r--basicsuite/graphicaleffects/effect_Colorize.qml74
-rw-r--r--basicsuite/graphicaleffects/effect_CustomDissolve.qml165
-rw-r--r--basicsuite/graphicaleffects/effect_CustomWave.qml158
-rw-r--r--basicsuite/graphicaleffects/effect_Displacement.qml80
-rw-r--r--basicsuite/graphicaleffects/effect_DropShadow.qml83
-rw-r--r--basicsuite/graphicaleffects/effect_GaussianBlur.qml79
-rw-r--r--basicsuite/graphicaleffects/effect_Glow.qml79
-rw-r--r--basicsuite/graphicaleffects/effect_HueSaturation.qml74
-rw-r--r--basicsuite/graphicaleffects/effect_OpacityMask.qml70
-rw-r--r--basicsuite/graphicaleffects/effect_ThresholdMask.qml83
-rw-r--r--basicsuite/graphicaleffects/graphicaleffects.pro12
-rwxr-xr-xbasicsuite/graphicaleffects/images/bug.jpgbin0 -> 376684 bytes
-rw-r--r--basicsuite/graphicaleffects/images/butterfly.pngbin0 -> 36912 bytes
-rw-r--r--basicsuite/graphicaleffects/images/fog.pngbin0 -> 225653 bytes
-rwxr-xr-xbasicsuite/graphicaleffects/images/glass_normal.pngbin0 -> 13489 bytes
-rw-r--r--basicsuite/graphicaleffects/main.qml231
-rw-r--r--basicsuite/graphicaleffects/preview_l.jpgbin0 -> 33841 bytes
-rw-r--r--basicsuite/graphicaleffects/title.txt1
21 files changed, 1334 insertions, 0 deletions
diff --git a/basicsuite/graphicaleffects/Checkers.qml b/basicsuite/graphicaleffects/Checkers.qml
new file mode 100644
index 0000000..9e42b1c
--- /dev/null
+++ b/basicsuite/graphicaleffects/Checkers.qml
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: For any questions to Digia, please use the contact form at
+** http://qt.digia.com/
+**
+** This file is part of the examples of the Qt Enterprise Embedded.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+
+
+// The checkers background
+ShaderEffect {
+
+ property real tileSize: 16
+ property color color1: Qt.rgba(0.7, 0.7, 0.7, 1);
+ property color color2: Qt.rgba(0.6, 0.6, 0.6, 1);
+
+ property size _pixelSize: Qt.size(Math.PI * width / tileSize, Math.PI * height / tileSize);
+
+ fragmentShader:
+ "
+ uniform lowp vec4 color1;
+ uniform lowp vec4 color2;
+ uniform lowp float qt_Opacity;
+ uniform highp vec2 _pixelSize;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ highp vec2 tc = sign(sin(qt_TexCoord0 * _pixelSize));
+ if (tc.x != tc.y)
+ gl_FragColor = color1 * qt_Opacity;
+ else
+ gl_FragColor = color2 * qt_Opacity;
+ }
+ "
+}
diff --git a/basicsuite/graphicaleffects/description.txt b/basicsuite/graphicaleffects/description.txt
new file mode 100644
index 0000000..e2d3acf
--- /dev/null
+++ b/basicsuite/graphicaleffects/description.txt
@@ -0,0 +1,2 @@
+This example shows the Qt Quick 2.0 ShaderEffect type and the QtGraphicalEffect module. Qt Quick 2.0 provides the ability to use inline GLSL in your Qt Quick applications to create stunning visual effects. However, as UIs typically reuse many of the same effects, the QtGraphicalEffects module provides a set of predefined, commonly used effects. This includes blur, drop-shadows, glow, blending, opacity masks and more.
+
diff --git a/basicsuite/graphicaleffects/effect_BrightnessContrast.qml b/basicsuite/graphicaleffects/effect_BrightnessContrast.qml
new file mode 100644
index 0000000..fb8302d
--- /dev/null
+++ b/basicsuite/graphicaleffects/effect_BrightnessContrast.qml
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: For any questions to Digia, please use the contact form at
+** http://qt.digia.com/
+**
+** This file is part of the examples of the Qt Enterprise Embedded.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import QtGraphicalEffects 1.0
+
+Item {
+
+ id: root
+
+ property real inputX: 0.7;
+ property real feedbackX: effect.brightness
+ property string nameX: "Brightness"
+
+ property real inputY: 0.8;
+ property real feedbackY: effect.contrast
+ property string nameY: "Contrast"
+
+ Image {
+ id: image
+ source: "images/bug.jpg"
+ anchors.centerIn: parent
+ visible: false
+ }
+
+ BrightnessContrast {
+ id: effect;
+
+ source: image
+ anchors.fill: source
+
+ scale: source.height > root.height * 0.8 ? root.height / source.height * 0.8 : 1;
+
+ brightness: inputX * 2 - 1;
+ contrast: inputY * 2 - 1;
+ }
+
+}
diff --git a/basicsuite/graphicaleffects/effect_Colorize.qml b/basicsuite/graphicaleffects/effect_Colorize.qml
new file mode 100644
index 0000000..4244f21
--- /dev/null
+++ b/basicsuite/graphicaleffects/effect_Colorize.qml
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: For any questions to Digia, please use the contact form at
+** http://qt.digia.com/
+**
+** This file is part of the examples of the Qt Enterprise Embedded.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import QtGraphicalEffects 1.0
+
+Item {
+ id: root
+
+ property real inputX: 0.6;
+ property real feedbackX: effect.hue
+ property string nameX: "Hue"
+
+ property real inputY: 0.7
+ property real feedbackY: effect.saturation
+ property string nameY: "Saturation"
+
+ Image {
+ id: image
+ source: "images/bug.jpg"
+ width: Math.min(root.width, root.height) * 0.8;
+ height: width
+ sourceSize: Qt.size(width, height);
+ anchors.centerIn: parent
+ }
+
+ Colorize {
+ id: effect;
+
+ source: image
+ anchors.fill: source
+ scale: source.height > root.height * 0.8 ? root.height / source.height * 0.8 : 1;
+
+ hue: root.inputX * 2 - 1;
+ saturation: root.inputY
+ }
+}
diff --git a/basicsuite/graphicaleffects/effect_CustomDissolve.qml b/basicsuite/graphicaleffects/effect_CustomDissolve.qml
new file mode 100644
index 0000000..43be640
--- /dev/null
+++ b/basicsuite/graphicaleffects/effect_CustomDissolve.qml
@@ -0,0 +1,165 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: For any questions to Digia, please use the contact form at
+** http://qt.digia.com/
+**
+** This file is part of the examples of the Qt Enterprise Embedded.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+
+Item {
+
+
+ width: 700
+ height: 600
+ id: root
+
+ property real inputX: 0.5;
+ property real feedbackX: inputX
+ property string nameX: "Dissolution"
+
+ property real inputY: 0.5;
+ property real feedbackY: effect.amplitude
+ property string nameY: "Amplitude"
+
+ Rectangle {
+ id: sourceItem
+ anchors.centerIn: parent
+ width: text.width + 50
+ height: text.height + 20
+ gradient: Gradient {
+ GradientStop { position: 0; color: "steelblue" }
+ GradientStop { position: 1; color: "black" }
+ }
+ border.color: "lightsteelblue"
+ border.width: 2
+
+//? color: "transparent"
+
+ radius: 10
+
+ layer.enabled: true
+ layer.smooth: true
+ layer.sourceRect: Qt.rect(-1, -1, width + 2, height + 2);
+
+ visible: false
+
+ Text {
+ id: text
+ font.pixelSize: root.height * 0.08
+ anchors.centerIn: parent;
+ text: "Code Less, Create More!"
+ color: "lightsteelblue"
+ style: Text.Raised
+
+ }
+ }
+
+ ShaderEffect {
+
+ id: effect
+
+ anchors.fill: sourceItem;
+
+ property variant source: sourceItem;
+
+ property real t: (1 + tlength) * (1 - root.inputX) - tlength;
+ property real tlength: 1.0
+ property real amplitude: 2.0 * height * root.inputY;
+
+ mesh: "40x4"
+
+ vertexShader:
+ "
+ uniform highp mat4 qt_Matrix;
+ uniform lowp float t;
+ uniform lowp float tlength;
+ uniform highp float amplitude;
+
+ attribute highp vec4 qt_Vertex;
+ attribute highp vec2 qt_MultiTexCoord0;
+
+ varying highp vec2 vTexCoord;
+ varying lowp float vOpacity;
+
+ void main() {
+ vTexCoord = qt_MultiTexCoord0;
+
+ vec4 pos = qt_Vertex;
+
+ lowp float tt = smoothstep(t, t+tlength, qt_MultiTexCoord0.x);
+
+ vOpacity = 1.0 - tt;
+
+ pos.y += (amplitude * (qt_MultiTexCoord0.y * 2.0 - 1.0) * (-2.0 * tt)
+ + 3.0 * amplitude * (qt_MultiTexCoord0.y * 2.0 - 1.0)
+ + amplitude * sin(0.0 + tt * 2.14152 * qt_MultiTexCoord0.x)
+ + amplitude * sin(0.0 + tt * 7.4567)
+ ) * tt;
+
+ pos.x += amplitude * sin(6.0 + tt * 4.4567) * tt;
+
+ gl_Position = qt_Matrix * pos;
+ }
+ "
+ fragmentShader:
+ "
+ uniform sampler2D source;
+
+ uniform lowp float t;
+ uniform lowp float tlength;
+ uniform lowp float qt_Opacity;
+
+ varying highp vec2 vTexCoord;
+ varying lowp float vOpacity;
+
+ // Noise function from: http://stackoverflow.com/questions/4200224/random-noise-functions-for-glsl
+ highp float rand(vec2 n) {
+ return fract(sin(dot(n.xy, vec2(12.9898, 78.233))) * 43758.5453);
+ }
+
+ void main() {
+ lowp vec4 tex = texture2D(source, vTexCoord);
+ lowp float opacity = 1.0 - smoothstep(0.9, 1.0, vOpacity);
+ lowp float particlify = smoothstep(1.0 - vOpacity, 1.0, rand(vTexCoord)) * vOpacity;
+ gl_FragColor = tex * mix(vOpacity, particlify, opacity) * qt_Opacity;
+ }
+
+ "
+
+ }
+
+}
diff --git a/basicsuite/graphicaleffects/effect_CustomWave.qml b/basicsuite/graphicaleffects/effect_CustomWave.qml
new file mode 100644
index 0000000..5bde628
--- /dev/null
+++ b/basicsuite/graphicaleffects/effect_CustomWave.qml
@@ -0,0 +1,158 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: For any questions to Digia, please use the contact form at
+** http://qt.digia.com/
+**
+** This file is part of the examples of the Qt Enterprise Embedded.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+
+Item {
+ id: root
+
+ property real inputX: 0.9;
+ property real feedbackX: shader.zrot
+ property string nameX: "Rotation"
+
+ property real inputY: 0.7
+ property real feedbackY: shader.amp
+ property string nameY: "Amplitude"
+
+
+ ShaderEffect {
+ id: shader
+ width: height
+ height: parent.height
+ anchors.centerIn: parent;
+ scale: height > root.height * 0.8 ? root.height * 0.8 / height : 1;
+
+ blending: true
+
+ mesh: "50x50"
+
+ property variant size: Qt.size(width, height);
+
+ property variant source: Image { source: "images/bug.jpg" }
+
+ property real amp: root.inputY * 0.1;
+
+ property real xrot: 2 / 8 * Math.PI;
+
+ property real zrot: -root.inputX * Math.PI * 2
+
+ property real time: 0
+ NumberAnimation on time {
+ id: timeAnimation
+ from: 0;
+ to: Math.PI * 2;
+ duration: 3457;
+ loops: Animation.Infinite
+ running: true;
+ }
+
+ vertexShader: "
+ attribute highp vec4 qt_Vertex;
+ attribute highp vec2 qt_MultiTexCoord0;
+ uniform highp mat4 qt_Matrix;
+ uniform highp float xrot;
+ uniform highp float zrot;
+ uniform highp vec2 size;
+ uniform highp float time;
+ uniform highp float amp;
+ varying lowp vec2 v_TexCoord;
+ varying lowp float v_light;
+ void main() {
+ highp float xcosa = cos(xrot);
+ highp float xsina = sin(xrot);
+
+ highp mat4 xrot = mat4(1, 0, 0, 0,
+ 0, xcosa, xsina, 0,
+ 0, -xsina, xcosa, 0,
+ 0, 0, 0, 1);
+
+ highp float zcosa = cos(zrot);
+ highp float zsina = sin(zrot);
+
+ highp mat4 zrot = mat4(zcosa, zsina, 0, 0,
+ -zsina, zcosa, 0, 0,
+ 0, 0, 1, 0,
+ 0, 0, 0, 1);
+
+ highp float near = 2.;
+ highp float far = 6.;
+ highp float fmn = far - near;
+
+ highp mat4 proj = mat4(near, 0, 0, 0,
+ 0, near, 0, 0,
+ 0, 0, -(far + near) / fmn, -1.,
+ 0, 0, -2. * far * near / fmn, 1);
+
+ highp mat4 model = mat4(2, 0, 0, 0,
+ 0, 2, 0, 0,
+ 0, 0, 2, 0,
+ 0, -.5, -4, 1);
+
+ vec4 nLocPos = vec4(qt_Vertex.xy * 2.0 / size - 1.0, 0, 1);
+ nLocPos.z = cos(nLocPos.x * 5. + time) * amp;
+
+ vec4 pos = proj * model * xrot * zrot * nLocPos;
+ pos = vec4(pos.xyx/pos.w, 1);
+
+ gl_Position = qt_Matrix * vec4((pos.xy + 1.0) / 2.0 * size , 0, 1);
+
+ v_TexCoord = qt_MultiTexCoord0;
+
+
+ v_light = dot(normalize(vec3(-sin(nLocPos.x * 5.0 + time) * 5.0 * amp, 0, -1)), vec3(0, 0, -1));
+ }
+ "
+
+ fragmentShader: "
+ uniform lowp sampler2D source;
+ uniform lowp float qt_Opacity;
+ varying highp vec2 v_TexCoord;
+ varying lowp float v_light;
+ void main() {
+ highp vec4 c = texture2D(source, v_TexCoord);
+ gl_FragColor = (vec4(pow(v_light, 16.0)) * 0.3 + c) * qt_Opacity;
+ }
+ "
+
+ }
+
+}
+
+
diff --git a/basicsuite/graphicaleffects/effect_Displacement.qml b/basicsuite/graphicaleffects/effect_Displacement.qml
new file mode 100644
index 0000000..3c7b6d0
--- /dev/null
+++ b/basicsuite/graphicaleffects/effect_Displacement.qml
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: For any questions to Digia, please use the contact form at
+** http://qt.digia.com/
+**
+** This file is part of the examples of the Qt Enterprise Embedded.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import QtGraphicalEffects 1.0
+
+Item {
+
+ id: root
+
+ property real inputX: 0.1;
+
+ property real feedbackX: effect.displacement
+
+ property string nameX: "Displacement"
+
+ Image {
+ id: image
+ source: "images/bug.jpg"
+ anchors.centerIn: parent
+ visible: false
+ }
+
+ Image {
+ id: displacementMap
+ source: "images/glass_normal.png"
+ smooth: true
+ visible: false
+ }
+
+ Displace {
+ id: effect;
+
+ source: image
+ displacementSource: displacementMap
+ anchors.fill: source
+
+ scale: source.height > root.height * 0.8 ? root.height / source.height * 0.8 : 1;
+
+ displacement: inputX
+ }
+
+}
diff --git a/basicsuite/graphicaleffects/effect_DropShadow.qml b/basicsuite/graphicaleffects/effect_DropShadow.qml
new file mode 100644
index 0000000..0dd3c48
--- /dev/null
+++ b/basicsuite/graphicaleffects/effect_DropShadow.qml
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: For any questions to Digia, please use the contact form at
+** http://qt.digia.com/
+**
+** This file is part of the examples of the Qt Enterprise Embedded.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import QtGraphicalEffects 1.0
+
+Item {
+
+ id: root
+
+ property real inputX: 0.5;
+ property real inputY: 0.2;
+
+ property real feedbackX: effect.radius
+ property real feedbackY: effect.spread
+
+ property string nameX: "Radius"
+ property string nameY: "Spread"
+
+ Image {
+ id: image
+ source: "images/butterfly.png"
+ anchors.centerIn: parent
+ visible: false
+ }
+
+ DropShadow {
+ id: effect;
+
+ source: image
+ anchors.fill: source
+
+ scale: source.height > root.height * 0.8 ? root.height / source.height * 0.8 : 1;
+
+ samples: 4
+
+ radius: root.inputX * 7
+ spread: root.inputY;
+
+ color: Qt.rgba(0, 0, 0, 0.4);
+
+ verticalOffset: 30.5
+ horizontalOffset: 30.5
+ }
+
+}
diff --git a/basicsuite/graphicaleffects/effect_GaussianBlur.qml b/basicsuite/graphicaleffects/effect_GaussianBlur.qml
new file mode 100644
index 0000000..7acfa3b
--- /dev/null
+++ b/basicsuite/graphicaleffects/effect_GaussianBlur.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: For any questions to Digia, please use the contact form at
+** http://qt.digia.com/
+**
+** This file is part of the examples of the Qt Enterprise Embedded.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import QtGraphicalEffects 1.0
+
+Item {
+
+ id: root
+
+ property real inputX: 0.5;
+ property real inputY: 1
+
+ property real feedbackX: effect.radius
+ property real feedbackY: effect.deviation
+
+ property string nameX: "Radius"
+ property string nameY: "Deviation"
+
+ Image {
+ id: image
+ source: "images/bug.jpg"
+ width: Math.min(root.width, root.height) * 0.8;
+ height: width
+ sourceSize: Qt.size(width, height);
+ anchors.centerIn: parent
+ }
+
+ GaussianBlur {
+ id: effect;
+
+ source: image
+ anchors.fill: source
+
+ scale: source.height > root.height * 0.8 ? root.height / source.height * 0.8 : 1;
+ samples: 4
+
+ deviation: root.inputY * 20;
+ radius: root.inputX * 7
+ }
+
+}
diff --git a/basicsuite/graphicaleffects/effect_Glow.qml b/basicsuite/graphicaleffects/effect_Glow.qml
new file mode 100644
index 0000000..728f8cc
--- /dev/null
+++ b/basicsuite/graphicaleffects/effect_Glow.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: For any questions to Digia, please use the contact form at
+** http://qt.digia.com/
+**
+** This file is part of the examples of the Qt Enterprise Embedded.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import QtGraphicalEffects 1.0
+
+Item {
+
+ id: root
+
+ property real inputX: 0.5;
+ property real inputY: 0.2;
+
+ property real feedbackX: effect.radius
+ property real feedbackY: effect.spread
+
+ property string nameX: "Radius"
+ property string nameY: "Spread"
+
+ Image {
+ id: image
+ source: "images/butterfly.png"
+ anchors.centerIn: parent
+ visible: false
+ }
+
+ Glow {
+ id: effect;
+
+ source: image
+ anchors.fill: source
+
+ scale: source.height > root.height * 0.8 ? root.height / source.height * 0.8 : 1;
+
+ samples: 4
+
+ radius: root.inputX * 7
+ spread: root.inputY;
+
+ color: Qt.rgba(1, 0, 1, 1);
+ }
+}
diff --git a/basicsuite/graphicaleffects/effect_HueSaturation.qml b/basicsuite/graphicaleffects/effect_HueSaturation.qml
new file mode 100644
index 0000000..e6ba039
--- /dev/null
+++ b/basicsuite/graphicaleffects/effect_HueSaturation.qml
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: For any questions to Digia, please use the contact form at
+** http://qt.digia.com/
+**
+** This file is part of the examples of the Qt Enterprise Embedded.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import QtGraphicalEffects 1.0
+
+Item {
+ id: root
+
+ property real inputX: 0.6;
+ property real feedbackX: effect.hue
+ property string nameX: "Hue"
+
+ property real inputY: 0.2
+ property real feedbackY: effect.saturation
+ property string nameY: "Saturation"
+
+ Image {
+ id: image
+ source: "images/bug.jpg"
+ width: Math.min(root.width, root.height) * 0.8;
+ height: width
+ sourceSize: Qt.size(width, height);
+ anchors.centerIn: parent
+ }
+
+ HueSaturation {
+ id: effect;
+
+ source: image
+ anchors.fill: source
+ scale: source.height > root.height * 0.8 ? root.height / source.height * 0.8 : 1;
+
+ hue: root.inputX * 2 - 1;
+ saturation: root.inputY * 2 - 1
+ }
+}
diff --git a/basicsuite/graphicaleffects/effect_OpacityMask.qml b/basicsuite/graphicaleffects/effect_OpacityMask.qml
new file mode 100644
index 0000000..47df139
--- /dev/null
+++ b/basicsuite/graphicaleffects/effect_OpacityMask.qml
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: For any questions to Digia, please use the contact form at
+** http://qt.digia.com/
+**
+** This file is part of the examples of the Qt Enterprise Embedded.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import QtGraphicalEffects 1.0
+
+Item {
+
+ id: root
+
+ Image {
+ id: image
+ source: "images/bug.jpg"
+ anchors.centerIn: parent
+ visible: false
+ }
+
+ Image {
+ id: mask
+ source: "images/butterfly.png"
+ visible: false
+ }
+
+ OpacityMask {
+ id: effect;
+
+ source: image
+ maskSource: mask
+ anchors.fill: source
+
+ scale: source.height > root.height * 0.8 ? root.height / source.height * 0.8 : 1;
+ }
+}
diff --git a/basicsuite/graphicaleffects/effect_ThresholdMask.qml b/basicsuite/graphicaleffects/effect_ThresholdMask.qml
new file mode 100644
index 0000000..18cb07b
--- /dev/null
+++ b/basicsuite/graphicaleffects/effect_ThresholdMask.qml
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: For any questions to Digia, please use the contact form at
+** http://qt.digia.com/
+**
+** This file is part of the examples of the Qt Enterprise Embedded.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import QtGraphicalEffects 1.0
+
+Item {
+
+ id: root
+
+ property real inputX: 0.5;
+ property real inputY: 0.2;
+
+ property real feedbackX: effect.threshold
+ property real feedbackY: effect.spread
+
+ property string nameX: "Threshold"
+ property string nameY: "Spread"
+
+ Image {
+ id: image
+ source: "images/bug.jpg"
+ anchors.centerIn: parent
+ visible: false
+ }
+
+ Image {
+ id: mask
+ source: "images/fog.png"
+ visible: false
+ }
+
+ ThresholdMask {
+ id: effect;
+
+ source: image
+ maskSource: mask;
+ anchors.fill: source
+
+ scale: source.height > root.height * 0.8 ? root.height / source.height * 0.8 : 1;
+
+ threshold: root.inputX
+ spread: root.inputY
+ }
+
+}
diff --git a/basicsuite/graphicaleffects/graphicaleffects.pro b/basicsuite/graphicaleffects/graphicaleffects.pro
new file mode 100644
index 0000000..8f9c8cf
--- /dev/null
+++ b/basicsuite/graphicaleffects/graphicaleffects.pro
@@ -0,0 +1,12 @@
+TARGET = graphicaleffects
+
+include(../shared/shared.pri)
+
+content.files = \
+ *.qml \
+ images
+content.path = $$DESTPATH
+
+OTHER_FILES += $${content.files}
+
+INSTALLS += target content \ No newline at end of file
diff --git a/basicsuite/graphicaleffects/images/bug.jpg b/basicsuite/graphicaleffects/images/bug.jpg
new file mode 100755
index 0000000..43e3676
--- /dev/null
+++ b/basicsuite/graphicaleffects/images/bug.jpg
Binary files differ
diff --git a/basicsuite/graphicaleffects/images/butterfly.png b/basicsuite/graphicaleffects/images/butterfly.png
new file mode 100644
index 0000000..ce544f2
--- /dev/null
+++ b/basicsuite/graphicaleffects/images/butterfly.png
Binary files differ
diff --git a/basicsuite/graphicaleffects/images/fog.png b/basicsuite/graphicaleffects/images/fog.png
new file mode 100644
index 0000000..f462222
--- /dev/null
+++ b/basicsuite/graphicaleffects/images/fog.png
Binary files differ
diff --git a/basicsuite/graphicaleffects/images/glass_normal.png b/basicsuite/graphicaleffects/images/glass_normal.png
new file mode 100755
index 0000000..ba360ef
--- /dev/null
+++ b/basicsuite/graphicaleffects/images/glass_normal.png
Binary files differ
diff --git a/basicsuite/graphicaleffects/main.qml b/basicsuite/graphicaleffects/main.qml
new file mode 100644
index 0000000..66c97ff
--- /dev/null
+++ b/basicsuite/graphicaleffects/main.qml
@@ -0,0 +1,231 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: For any questions to Digia, please use the contact form at
+** http://qt.digia.com/
+**
+** This file is part of the examples of the Qt Enterprise Embedded.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+
+Item {
+ id: root
+
+ width: 1280
+ height: 720
+
+ Checkers {
+ id: checkers;
+ anchors.fill: parent
+ anchors.leftMargin: list.width
+ tileSize: 32
+ }
+
+ Loader {
+ id: loader
+ anchors.fill: checkers;
+ }
+
+ Rectangle {
+ id: listBackground
+ anchors.left: parent.left
+ anchors.right: checkers.left
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ color: "black"
+ }
+
+ ListModel {
+ id: listModel
+ ListElement { name: "Brignthness / Contrast"; file: "effect_BrightnessContrast.qml" }
+ ListElement { name: "Colorize"; file: "effect_Colorize.qml" }
+ ListElement { name: "Displacement"; file: "effect_Displacement.qml" }
+ ListElement { name: "Drop Shadow"; file: "effect_DropShadow.qml" }
+ ListElement { name: "Gaussian Blur"; file: "effect_GaussianBlur.qml" }
+ ListElement { name: "Glow"; file: "effect_Glow.qml" }
+ ListElement { name: "Hue / Saturation"; file: "effect_HueSaturation.qml" }
+ ListElement { name: "Opacity Mask"; file: "effect_OpacityMask.qml" }
+ ListElement { name: "Threshold Mask"; file: "effect_ThresholdMask.qml" }
+ ListElement { name: "Wave (custom)"; file: "effect_CustomWave.qml" }
+ ListElement { name: "Dissolve (custom)"; file: "effect_CustomDissolve.qml" }
+ }
+
+ ListView
+ {
+ id: list
+ anchors.top: parent.top
+ anchors.left: parent.left
+ width: parent.width / 4
+ height: parent.height - width
+
+ clip: true
+ focus: true
+
+ highlightMoveDuration: 0
+
+ onCurrentItemChanged: {
+ var entry = listModel.get(currentIndex);
+ loader.source = entry.file;
+ }
+
+ model: listModel
+
+ highlight: Rectangle {
+ color: "steelblue"
+ }
+
+ delegate: Item {
+ id: delegateRoot
+
+ width: list.width
+ height: root.height * 0.05
+
+ Rectangle {
+ width: parent.width
+ height: 3
+ anchors.bottom: parent.bottom
+ gradient: Gradient {
+ GradientStop { position: 0; color: "transparent" }
+ GradientStop { position: 0.5; color: "lightgray" }
+ GradientStop { position: 1; color: "transparent" }
+ }
+ }
+
+ Text {
+ color: "white"
+ font.pixelSize: parent.height * 0.5
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.verticalCenterOffset: -2
+ x: parent.width * 0.1
+ text: name
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: list.currentIndex = index;
+ }
+ }
+ }
+
+ Canvas {
+ id: canvas
+ anchors.fill: controller
+ anchors.margins: 10
+
+ property real padding: 20
+
+ onPaint: {
+ var ctx = canvas.getContext("2d");
+
+ var w = canvas.width
+ var h = canvas.height;
+
+
+ ctx.fillStyle = "rgb(50, 50, 50)"
+ ctx.beginPath();
+ ctx.roundedRect(0, 0, w, h, w * 0.1, w * 0.1);
+ ctx.fill();
+
+ var margin = canvas.padding;
+ var segmentSize = 4
+ ctx.strokeStyle = "gray"
+ ctx.beginPath();
+ ctx.moveTo(margin, margin);
+ ctx.lineTo(margin, h-margin);
+ ctx.moveTo(margin, h - margin);
+ ctx.lineTo(w-margin, h - margin);
+
+ var segmentCount = 11
+ for (var i = 0; i<segmentCount; ++i) {
+ var offset = margin + i * (w - margin * 2) / (segmentCount - 1);
+ ctx.moveTo(margin - segmentSize, offset);
+ ctx.lineTo(margin + segmentSize, offset);
+ ctx.moveTo(offset, h - margin - segmentSize);
+ ctx.lineTo(offset, h - margin + segmentSize);
+ }
+
+ ctx.stroke();
+ }
+ }
+
+ Text {
+ id: labelX
+ anchors.bottom: canvas.bottom
+ x: canvas.width * 0.4
+ anchors.bottomMargin: 2
+ text: (loader.item != undefined && typeof loader.item.nameX != 'undefined' ? loader.item.nameX : "")
+ + (loader.item != undefined && typeof loader.item.feedbackX != 'undefined' ? ": " + loader.item.feedbackX.toFixed(2) : "");
+
+ color: "white"
+ font.pixelSize: canvas.padding * 0.5
+ }
+
+ Text {
+ id: labelY
+
+ anchors.verticalCenter: canvas.verticalCenter
+ anchors.verticalCenterOffset: canvas.height * 0.15
+ anchors.left: canvas.left
+ transformOrigin: Item.TopLeft
+ rotation: -90
+ text: (loader.item != undefined && typeof loader.item.nameY != 'undefined' ? loader.item.nameY : "")
+ + (loader.item != undefined && typeof loader.item.feedbackY != 'undefined' ? ": " + loader.item.feedbackY.toFixed(2) : "");
+ color: "white"
+ font.pixelSize: canvas.padding * 0.5
+ }
+
+ MouseArea {
+ id: controller
+
+ anchors.top: list.bottom;
+ anchors.left: parent.left
+ anchors.right: checkers.left
+ anchors.bottom: parent.bottom;
+
+ onPositionChanged: {
+ var effect = loader.item;
+ function bound(val) { return Math.max(0, Math.min(1, val)); }
+ if (effect != undefined) {
+ if (typeof effect.inputX != 'undefined')
+ effect.inputX = bound(mouseX / controller.width);
+ if (typeof effect.inputY != 'undefined')
+ effect.inputY = bound(1 - mouseY / controller.height);
+ }
+ }
+
+ }
+
+
+}
diff --git a/basicsuite/graphicaleffects/preview_l.jpg b/basicsuite/graphicaleffects/preview_l.jpg
new file mode 100644
index 0000000..80fbbd5
--- /dev/null
+++ b/basicsuite/graphicaleffects/preview_l.jpg
Binary files differ
diff --git a/basicsuite/graphicaleffects/title.txt b/basicsuite/graphicaleffects/title.txt
new file mode 100644
index 0000000..e048172
--- /dev/null
+++ b/basicsuite/graphicaleffects/title.txt
@@ -0,0 +1 @@
+Graphical Effects