-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
92 lines (73 loc) · 2.1 KB
/
main.py
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
from kivy.app import App
from kivy.lang import Builder
from realtimeblur import RealtimeBlurWidget
kv = '''
<DragLabel@DragBehavior+Label>:
canvas.before:
Color:
rgb: 1, 0, 0, 1
Rectangle:
pos: self.pos
size: self.size
drag_rectangle: self.x, self.y, self.width, self.height
drag_timeout: 10000000
drag_distance: 0
color: 0, 0, 0, 1
pos: 0, 100
<DragImage@DragBehavior+AsyncImage>:
canvas.before:
Color:
rgb: 1, 1, 1, 1
Rectangle:
pos: self.pos
size: self.size
drag_rectangle: self.x, self.y, self.width, self.height
drag_timeout: 10000000
drag_distance: 0
pos: 400, 400
FloatLayout:
blur_widget: effect_widget
canvas.before:
Color:
rgb: 1, 1, 1, 1
Rectangle:
pos: self.pos
size: self.size
BoxLayout:
size_hint: 1, 0.1
Slider:
min: 0
max: 5
value: root.blur_widget.saturation
on_value:
root.blur_widget.saturation = self.value
Slider:
min: 0
max: 25
value: root.blur_widget.blur_radius
on_value:
root.blur_widget.blur_radius = self.value
Slider:
size_hint_y: 1
min: 0
max: 1
value: root.blur_widget.range_reduction
on_value:
root.blur_widget.range_reduction = self.value
RealtimeBlurWidget:
id: effect_widget
effect_region: self.x, self.height-500, self.width, 500
tint_color: 1, 1, 1, .0
DragLabel:
size_hint: 0.25, 0.2
text: 'Drag me'
DragImage:
size_hint: 0.4, 0.5
keep_ratio: False
allow_stretch: True
source: "https://archive.org/download/PublicDomainImages/Bubbles.jpg"
'''
class TestApp(App):
def build(self):
return Builder.load_string(kv)
TestApp().run()