This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via cc28051e9be2f576b732fc9a59b6174c96edcfab (commit) from 9bb885ab0d280b9cb36180fe21147f24ace5b672 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/cc28051e9be2f576b732fc9a59b6174c96edc...
commit cc28051e9be2f576b732fc9a59b6174c96edcfab Author: Cyril Hrubis metan@ucw.cz Date: Mon Apr 1 17:50:07 2013 +0200
demos: py_simple: Add grabbers example.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/demos/py_simple/cam_view.py b/demos/py_simple/cam_view.py new file mode 100755 index 0000000..4159609 --- /dev/null +++ b/demos/py_simple/cam_view.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python + +from sys import exit +from time import sleep + +import gfxprim.core as core +import gfxprim.backends as backends +import gfxprim.input as input +import gfxprim.grabbers as grabbers + +def main(): + # Open grabber (i.e. web camera) + grabber = grabbers.GrabberV4L2Init("/dev/video0", 320, 240); + assert(grabber) + + # Create X11 window + bk = backends.BackendX11Init(None, 0, 0, grabber.frame.w, grabber.frame.h, "Grabbers test", 0) + assert(bk) + + # Start grabber capture + grabber.Start(); + + # Event loop + while True: + sleep(0.01) + + if (grabber.Poll()): + grabber.frame.Blit(0, 0, bk.context, 0, 0, grabber.frame.w, grabber.frame.h) + bk.Flip() + + ev = bk.PollEvent() + + if (ev is None): + continue + + input.EventDump(ev) + + if (ev.type == input.EV_KEY): + exit(0) + elif (ev.type == input.EV_SYS): + if (ev.code == input.EV_SYS_QUIT): + exit(0) + +if __name__ == '__main__': + main()
-----------------------------------------------------------------------
Summary of changes: demos/py_simple/cam_view.py | 45 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 45 insertions(+), 0 deletions(-) create mode 100755 demos/py_simple/cam_view.py
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.