diff options
author | Gunnar Sletta <gunnar.sletta@digia.com> | 2013-04-26 11:15:56 +0200 |
---|---|---|
committer | Gunnar Sletta <gunnar.sletta@digia.com> | 2013-04-26 12:18:28 +0300 |
commit | 87c5ac7bac247624bd4f074558fa3f212ce15f1e (patch) | |
tree | a1e642d971a3af47fb62b33ed012237ddf85407e /basicsuite/Graphical Effects/effect_BrightnessContrast.qml | |
parent | 96c0d5069473e929d597a96ebac994a983acd0d1 (diff) |
New shader demo, more suitable for touch and embedded
Change-Id: I48af8bc9c58930c26e822503c5c94c55690f37db
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'basicsuite/Graphical Effects/effect_BrightnessContrast.qml')
-rw-r--r-- | basicsuite/Graphical Effects/effect_BrightnessContrast.qml | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/basicsuite/Graphical Effects/effect_BrightnessContrast.qml b/basicsuite/Graphical Effects/effect_BrightnessContrast.qml new file mode 100644 index 0000000..97ccb48 --- /dev/null +++ b/basicsuite/Graphical Effects/effect_BrightnessContrast.qml @@ -0,0 +1,35 @@ +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; + } + +} |