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 3447cc05da97de60400ac7cfbf0325e4ac84e1ad (commit) via fb285f7f619180016cbb1bfe514dea535bef474c (commit) from b122be1293116b690cd8414d8e158aeb99910b4a (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/3447cc05da97de60400ac7cfbf0325e4ac84e...
commit 3447cc05da97de60400ac7cfbf0325e4ac84e1ad Author: Cyril Hrubis metan@ucw.cz Date: Sat Apr 21 12:38:49 2012 +0200
pywrap: Add simple pygtk + gfxprim example.
diff --git a/demos/py_simple/pygtk_example.py b/demos/py_simple/pygtk_example.py new file mode 100755 index 0000000..e2ef4a0 --- /dev/null +++ b/demos/py_simple/pygtk_example.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python + +import sys + +import pygtk +pygtk.require('2.0') +import gtk + +import gfxprim.core as core +import gfxprim.loaders as loaders +import gfxprim.filters as filters + +class HelloWorld: + def delete_event(self, widget, event, data=None): + return False + + def destroy(self, widget, data=None): + gtk.main_quit() + + def __init__(self): + self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) + self.window.set_title("PyGTK Example") + self.window.connect("delete_event", self.delete_event) + self.window.connect("destroy", self.destroy) + self.window.set_border_width(1) + + self.image = gtk.Image(); + self.window.add(self.image) + + self.window.show() + self.image.show() + + img = loaders.LoadImage(sys.argv[2], None) + self.pixmap = gtk.gdk.Pixmap(None, img.w, img.h, 24) + self.gc = gtk.gdk.Drawable.new_gc(self.pixmap) + + img2 = img.Convert(core.core_c.GP_PIXEL_BGR888); + + self.pixmap.draw_rgb_image(self.gc, 0, 0, img2.w, img2.h, + gtk.gdk.RGB_DITHER_NONE, + img2._hacky_hacky_pixels_buffer()) + + self.image.set_from_pixmap(self.pixmap, None) + + + def main(self): + gtk.main() + +if __name__ == "__main__": + hello = HelloWorld() + hello.main()
http://repo.or.cz/w/gfxprim.git/commit/fb285f7f619180016cbb1bfe514dea535bef4...
commit fb285f7f619180016cbb1bfe514dea535bef474c Author: Cyril Hrubis metan@ucw.cz Date: Sat Apr 21 12:15:47 2012 +0200
config: Add BGR888 pixel type, that's needed for interfacing other libraries.
diff --git a/gfxprim_config.py b/gfxprim_config.py index 2876af0..b3eed3b 100644 --- a/gfxprim_config.py +++ b/gfxprim_config.py @@ -61,6 +61,11 @@ config = GfxPrimConfig( ('R', 16, 8), ('G', 8, 8), ('B', 0, 8)]), + + PixelType(name='BGR888', pixelsize=PS_24BPP, chanslist=[ + ('B', 16, 8), + ('G', 8, 8), + ('R', 0, 8)]),
PixelType(name='RGB565', pixelsize=PS_16BPP, chanslist=[ ('R', 11, 5),
-----------------------------------------------------------------------
Summary of changes: demos/py_simple/pygtk_example.py | 51 ++++++++++++++++++++++++++++++++++++++ gfxprim_config.py | 5 +++ 2 files changed, 56 insertions(+), 0 deletions(-) create mode 100755 demos/py_simple/pygtk_example.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.