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 425038462f7fe79ed853487a0ce66ecd927d1c8f (commit) via 7b84c8bb9d3d8ac020b3460a3cec4d19450d130b (commit) via 8c85a6820eef1c67fef1d2ca545eaaa478844c85 (commit) via 9c8989f7e34a92c66193f44fe17952c68516d565 (commit) from a19009feb951a42521104ff1d2657ce9fc77df99 (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/425038462f7fe79ed853487a0ce66ecd927d1...
commit 425038462f7fe79ed853487a0ce66ecd927d1c8f Author: Cyril Hrubis metan@ucw.cz Date: Tue May 27 22:34:00 2014 +0200
doc: Add two more python examples.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/doc/example_py_cam_view.txt b/doc/example_py_cam_view.txt new file mode 100644 index 00000000..209a7343 --- /dev/null +++ b/doc/example_py_cam_view.txt @@ -0,0 +1,8 @@ +Camera Viewer +------------- +A simple program that shows video from camera (V4L2 device) + +[source,python] +------------------------------------------------------------------ +include::../demos/py_simple/cam_view.py[] +------------------------------------------------------------------ diff --git a/doc/example_py_font_style.txt b/doc/example_py_font_style.txt new file mode 100644 index 00000000..49d3b760 --- /dev/null +++ b/doc/example_py_font_style.txt @@ -0,0 +1,8 @@ +Font Style +---------- +A simple example that shows drawing with compiled in bitmap fonts. + +[source,python] +------------------------------------------------------------------ +include::../demos/py_simple/font_style.py[] +------------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/7b84c8bb9d3d8ac020b3460a3cec4d19450d1...
commit 7b84c8bb9d3d8ac020b3460a3cec4d19450d130b Author: Cyril Hrubis metan@ucw.cz Date: Tue May 27 22:25:53 2014 +0200
pywrap: Unbreak Fill after it was moved to core
After GP_Fill() was moved to core from gfx the python bindings were not fixed correctly.
Now Fill() is available both in core and in gfx.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/pylib/gfxprim/core/__init__.py b/pylib/gfxprim/core/__init__.py index 96bf9be4..82b27f9e 100644 --- a/pylib/gfxprim/core/__init__.py +++ b/pylib/gfxprim/core/__init__.py @@ -156,6 +156,11 @@ def _init(module): "Convert RGBA8888 (values 0-255) to context pixel type." return c_core.GP_RGBAToPixel(int(r), int(g), int(b), int(a), self.pixel_type)
+ @extend(_context) + def Fill(self, pixel): + "Fills context with given pixel value." + return c_core.GP_Fill(self, pixel) + # Handle submodule methods such as context.gfx.Line(...) _available_submodules = frozenset(['gfx', 'loaders', 'text', 'filters'])
@@ -201,7 +206,8 @@ def _init(module): '^GP_PixelRGB.*$', # ...Lookup and ...Match '^GP_PixelToRGB.*$', # Needs love '^GP_RGB.*$', # Needs filtering - ]) + '^GP_Fill', + ])
module['Convert'] = c_core.GP_ContextConvertAlloc
diff --git a/pylib/gfxprim/gfx/__init__.py b/pylib/gfxprim/gfx/__init__.py index dc2e9a94..daf99e11 100644 --- a/pylib/gfxprim/gfx/__init__.py +++ b/pylib/gfxprim/gfx/__init__.py @@ -36,13 +36,17 @@ def _init(module): import_members(c_gfx, C, include=const_regexes, sub=strip_GP)
for name in [ - 'ArcSegment', 'Circle', 'Ellipse', 'Fill', 'FillCircle', 'FillEllipse', + 'ArcSegment', 'Circle', 'Ellipse', 'FillCircle', 'FillEllipse', 'FillRect', 'FillRect_AA', 'FillRing', 'FillTetragon', 'FillTriangle', 'HLine', 'HLineAA', 'Line', 'LineAA', 'PutPixelAA', 'Rect', 'Ring', 'Tetragon', 'Triangle', 'VLine', 'VLineAA']: extend_submodule(GfxSubmodule, name, c_gfx.__getattribute__('GP_' + name))
+ @extend(GfxSubmodule) + def Fill(self, color): + self.ctx.Fill(color) + def flatten_coords(points): "Helper for Polygon and FillPolygon coordinates" l = []
http://repo.or.cz/w/gfxprim.git/commit/8c85a6820eef1c67fef1d2ca545eaaa478844...
commit 8c85a6820eef1c67fef1d2ca545eaaa478844c85 Author: Cyril Hrubis metan@ucw.cz Date: Tue May 27 21:59:35 2014 +0200
demos/py_simple: New python gfxprim + Qt example
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/demos/py_simple/gfxprim_qt.py b/demos/py_simple/gfxprim_qt.py new file mode 100755 index 00000000..61eabb2d --- /dev/null +++ b/demos/py_simple/gfxprim_qt.py @@ -0,0 +1,35 @@ +#!/usr/bin/python + +import sys +from PySide import QtGui +import gfxprim.core as core +import gfxprim.loaders as loaders + +def getpixmap(path): + img = loaders.Load(path) + if img.pixel_type != core.C.PIXEL_BGR888: + img = img.Convert(core.C.PIXEL_BGR888) + qt_img = QtGui.QImage(img.ToByteArray(), img.w, img.h, + img.bytes_per_row, QtGui.QImage.Format_RGB888) + pix = QtGui.QPixmap.fromImage(qt_img) + return pix + +class ImageLabel(QtGui.QLabel): + def __init__(self, path, parent=None): + QtGui.QLabel.__init__(self, parent) + + self.setWindowTitle(path) + + self.pix = getpixmap(path) + self.setPixmap(self.pix) + size = self.pix.size() + self.setGeometry(100, 100, size.width(), size.height()) + +def main(): + app = QtGui.QApplication(sys.argv) + w = ImageLabel(sys.argv[1]) + w.show() + sys.exit(app.exec_()) + +if __name__ == '__main__': + main() diff --git a/doc/example_py_qt.txt b/doc/example_py_qt.txt new file mode 100644 index 00000000..354ab553 --- /dev/null +++ b/doc/example_py_qt.txt @@ -0,0 +1,9 @@ +Qt (PySide) +----------- +A simple program that shows how to combine Qt (link:http://pyside.org%5BPySide]) +with GFXprim in python. + +[source,python] +------------------------------------------------------------------ +include::../demos/py_simple/gfxprim_qt.py[] +------------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/9c8989f7e34a92c66193f44fe17952c68516d...
commit 9c8989f7e34a92c66193f44fe17952c68516d565 Author: Cyril Hrubis metan@ucw.cz Date: Tue May 27 21:55:40 2014 +0200
doc: Add C64 font example image
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/doc/images/fonts/font_c64.png b/doc/images/fonts/font_c64.png new file mode 100644 index 00000000..e868101f Binary files /dev/null and b/doc/images/fonts/font_c64.png differ diff --git a/doc/text.txt b/doc/text.txt index 8a4a4cb4..e0264ff6 100644 --- a/doc/text.txt +++ b/doc/text.txt @@ -202,6 +202,9 @@ image::images/fonts/font_tiny_mono.png["Font Tiny Mono"] .Font Tiny (GP_FontTiny) image::images/fonts/font_tiny.png["Font Tiny"]
+.Font C64 (GP_FontC64) +image::images/fonts/font_c64.png["Font C64"] + TrueType Fonts ~~~~~~~~~~~~~~
-----------------------------------------------------------------------
Summary of changes: demos/py_simple/gfxprim_qt.py | 35 ++++++++++++++++++++ ...ample_py_resize.txt => example_py_cam_view.txt} | 8 ++-- ..._py_showimage.txt => example_py_font_style.txt} | 8 ++-- doc/example_py_qt.txt | 9 +++++ doc/images/fonts/font_c64.png | Bin 0 -> 2373 bytes doc/text.txt | 3 ++ pylib/gfxprim/core/__init__.py | 8 ++++- pylib/gfxprim/gfx/__init__.py | 6 +++- 8 files changed, 67 insertions(+), 10 deletions(-) create mode 100755 demos/py_simple/gfxprim_qt.py copy doc/{example_py_resize.txt => example_py_cam_view.txt} (53%) copy doc/{example_py_showimage.txt => example_py_font_style.txt} (53%) create mode 100644 doc/example_py_qt.txt create mode 100644 doc/images/fonts/font_c64.png
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.