projekty
/
imago.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d16f56d
)
capture -- live preview
author
Tomas Musil
<tomik.musil@gmail.com>
Fri, 7 Sep 2012 21:39:27 +0000
(23:39 +0200)
committer
Tomas Musil
<tomik.musil@gmail.com>
Fri, 7 Sep 2012 21:39:27 +0000
(23:39 +0200)
capture.py
patch
|
blob
|
history
diff --git
a/capture.py
b/capture.py
index
9b93ba6
..
dbaef64
100755
(executable)
--- a/
capture.py
+++ b/
capture.py
@@
-43,11
+43,27
@@
def main():
im_number = 0
im_number = 0
- saving_dir = "./captured/" + time.strftime("%Y-%m-%d %H:%M")
+ saving_dir = "./captured/" + time.strftime("%Y-%m-%d %H:%M
/
")
if not os.path.isdir(saving_dir):
os.makedirs(saving_dir)
if not os.path.isdir(saving_dir):
os.makedirs(saving_dir)
-
+
+ done = False
+ clock = pygame.time.Clock()
+ while not done: #live preview
+ for event in pygame.event.get():
+ if event.type == pygame.QUIT:
+ done = True
+ del cam
+ sys.exit()
+ if event.type == pygame.KEYDOWN:
+ done = True
+
+ im = cam.get_image()
+ screen.display_picture(im)
+ clock.tick(5)
+
+
if args.a > 0:
last = 0
clock = pygame.time.Clock()
if args.a > 0:
last = 0
clock = pygame.time.Clock()