forked from cgart/photobooth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
capture.kv
152 lines (125 loc) · 4.46 KB
/
capture.kv
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#:kivy 1.0
#:import kivy kivy
#:import win kivy.core.window
#:import ew kivy.uix.effectwidget
#:import app mainapp.effects
FloatLayout:
id: main_layout
size_hint: (1.0, 1.0)
FullScreenEffect:
id: background_effect
effects: [app.ColorGlowEffect()]
# Widget holding all available slots to show previous images
# all slots are children widget on the same level
CapturedSlots:
id: picture_slots
layout: pic_layout
FboFloatLayout:
id: pic_layout
size: root.size
pos: root.pos
alpha: picture_slots.alpha
canvas:
Color:
rgba: 1,1,1,picture_slots.alpha
Mesh:
vertices: self.vertices
indices: range(len(self.vertices) / 4)
texture: self.texture
mode: 'triangle_fan'
Preview:
id: camera_image
WhiteBillboard:
id: white_overlay
#<Widget>:
# canvas.after:
# Line:
# rectangle: self.x+1,self.y+1,self.width-1,self.height-1
# dash_offset: 5
# dash_length: 3
# ----------------------------------------------------------------------
# Big white flash on the screen
# ----------------------------------------------------------------------
<CapturedSlots>
size_hint: 1.0, 1.0
# ----------------------------------------------------------------------
# Big white flash on the screen
# ----------------------------------------------------------------------
<WhiteBillboard>
size_hint: 1.0, 1.0
index: 100
canvas:
Color:
rgba: 1,1,1,self.alpha
Rectangle:
pos: self.pos
size: self.size
# ----------------------------------------------------------------------
# Preview image defintion
# ----------------------------------------------------------------------
<Preview>:
size: image.size
size_hint: None, None
pos_hint: {'center_x':0.5, 'center_y':0.5}
# pass down to python the Image by the label preview_image
preview_image: image
Image:
id: image
texture: root.image.texture
x: self.parent.x
y: self.parent.y
color: 1,1,1,root.alpha
# create initial image to be 400 pixels width
size: 900, 900 / self.image_ratio
# add shadow background
canvas.before:
Color:
rgba: 1,1,1,root.alpha
BorderImage:
source: 'data/shadow32.png'
border: (36,36,36,36)
size:(self.width+72, self.height+72)
pos: (self.x - 36, self.y - 36)
# ----------------------------------------------------------------------
# Any captured image defintion
# ----------------------------------------------------------------------
<Picture>:
size_hint: None, None
canvas:
Color:
rgba: 1,1,1,root.alpha
Mesh:
vertices: root.vertices
indices: range(len(root.vertices) / 4)
texture: root.fbo_texture
mode: 'triangle_fan'
#Image:
# id: image
# texture: root.img_texture
# color: 1,1,1,root.alpha
# # create initial image to be 400 pixels width
# #size: 640, 360
# size: 600, 600 / self.image_ratio
# #pos: 0,0
# add shadow background
#canvas.before:
# Color:
# rgba: 1,1,1,root.alpha
# BorderImage:
# source: 'data/shadow32.png'
# border: (36,36,36,36)
# size:(self.width+72, self.height+72)
# pos: (-36,-36)
# ----------------------------------------------------------------------
# Numbers for the countdown
# ----------------------------------------------------------------------
<CounterNum>:
size_hint: None, None
pos_hint: {'center_x':0.5, 'center_y':0.5}
canvas:
Color:
rgba: 1.0,1,1.0,0.85
Rectangle:
pos: self.pos
size: self.size
texture: root.label_texture