-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathColorizeEx.qml
70 lines (67 loc) · 1.51 KB
/
ColorizeEx.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import QtQuick 2.2
import QtGraphicalEffects 1.0
import QtQuick.Controls 1.2
import QtQuick.Dialogs 1.1
Rectangle {
anchors.fill: parent;
Image {
id: opImage;
x: 4;
y: 4;
width: 200;
height: 200;
source: "bug.jpg";
sourceSize: Qt.size(250, 250);
smooth: true;
visible: false;
}
Colorize {
anchors.fill: opImage;
source: opImage;
hue: hslider.value;
lightness: lslider.value;
saturation: sslider.value;
}
Grid {
anchors.left: parent.left;
anchors.top: opImage.bottom;
anchors.margins: 4;
columns: 2;
verticalItemAlignment: Grid.AlignVCenter;
Text {
text: "hue:";
width: 120;
horizontalAlignment: Text.AlignRight;
}
Slider {
id: hslider;
value: 0.5;
width: 160;
height: 30;
}
Text {
text: "lightness:";
width: 120;
horizontalAlignment: Text.AlignRight;
}
Slider {
id: lslider;
minimumValue: -1.0;
maximumValue: 1.0;
value: 0.0;
width: 160;
height: 30;
}
Text {
text: "saturation:";
width: 120;
horizontalAlignment: Text.AlignRight;
}
Slider {
id: sslider;
value: 0.5;
width: 160;
height: 30;
}
}
}