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 e13f2d1266a1d8fd179ac4c1b7276dbd831b6436 (commit) via 67b0b61db1e6e49583be60eb07807bacc77273f2 (commit) via 25e233552995b48bf90f7631e075a8e83782b8fa (commit) via 8cd7aa8c4396771f0e28b1677b571cfff171f1f1 (commit) via aa090dff3b0c8343388fca5586e73653e9d66c12 (commit) via 2bdf13f554c7ce4edf977dd73abcf520e145da64 (commit) from df87777210da0ea03b70f5d8cf138050a5399e05 (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/e13f2d1266a1d8fd179ac4c1b7276dbd831b6...
commit e13f2d1266a1d8fd179ac4c1b7276dbd831b6436 Merge: 67b0b61 df87777 Author: Tomas Gavenciak gavento@ucw.cz Date: Fri Dec 28 02:15:23 2012 +0100
Merge branch 'master' of ssh://repo.or.cz/srv/git/gfxprim
http://repo.or.cz/w/gfxprim.git/commit/67b0b61db1e6e49583be60eb07807bacc7727...
commit 67b0b61db1e6e49583be60eb07807bacc77273f2 Author: Tomas Gavenciak gavento@ucw.cz Date: Fri Dec 28 02:14:25 2012 +0100
core: pylib: Fix a bug in Context.Convert
diff --git a/pylib/gfxprim/core/__init__.py b/pylib/gfxprim/core/__init__.py index 366d049..27c32e3 100644 --- a/pylib/gfxprim/core/__init__.py +++ b/pylib/gfxprim/core/__init__.py @@ -79,8 +79,8 @@ def _init(module): @extend(_context) def Convert(self, target_type): """Converts context to a different pixel type, allocates new context. - See GP_ContextConvert() for details.""" - return c_core.GP_ContextConvert(self, pixeltype_no(target_type)) + See GP_ContextConvertAlloc() for details.""" + return c_core.GP_ContextConvertAlloc(self, pixeltype_no(target_type))
# Manipulation extend_direct(_context, "PutPixel", c_core.GP_PutPixel,
http://repo.or.cz/w/gfxprim.git/commit/25e233552995b48bf90f7631e075a8e83782b...
commit 25e233552995b48bf90f7631e075a8e83782b8fa Author: Tomas Gavenciak gavento@ucw.cz Date: Fri Dec 28 02:13:50 2012 +0100
core: pylib: Extend PixelTypeDescription with __str__
diff --git a/pylib/gfxprim/core/__init__.py b/pylib/gfxprim/core/__init__.py index a4301f5..366d049 100644 --- a/pylib/gfxprim/core/__init__.py +++ b/pylib/gfxprim/core/__init__.py @@ -25,6 +25,14 @@ def _init(module): from ..utils import extend, extend_direct, add_swig_getmethod, add_swig_setmethod from ..utils import import_members _context = module['Context'] + _ptdescr = c_core.GP_PixelTypeDescription + + # String representation + + @extend(_ptdescr, name='__str__') + @extend(_ptdescr, name='__repr__') + def ptdescr_str(self): + return "<PixelTypeDescription %s>" % (self.name, )
# String representation
http://repo.or.cz/w/gfxprim.git/commit/8cd7aa8c4396771f0e28b1677b571cfff171f...
commit 8cd7aa8c4396771f0e28b1677b571cfff171f1f1 Author: Tomas Gavenciak gavento@ucw.cz Date: Fri Dec 28 02:12:37 2012 +0100
core: pylib: First Context tests and a runner
diff --git a/tests/pylib/runtests.sh b/tests/pylib/runtests.sh new file mode 100755 index 0000000..a64a8c0 --- /dev/null +++ b/tests/pylib/runtests.sh @@ -0,0 +1,2 @@ +cd ../.. +./gp_run.sh nosetests -w tests/pylib/ "$@" diff --git a/tests/pylib/test_core.py b/tests/pylib/test_core.py new file mode 100644 index 0000000..2752c64 --- /dev/null +++ b/tests/pylib/test_core.py @@ -0,0 +1,68 @@ + +### Helper imports and decorators +# TODO: separate (nose plugin?) + +from unittest import SkipTest + +def alltypes(_filter=None): + def decorate(f): + def gen(): + for t in core.PixelTypes[1:]: + if (_filter is None) or _filter(t): + yield f, t + gen.__name__ = f.__name__ + return gen + return decorate + + +### The actual tests + +from gfxprim import core +from gfxprim.core import Context + +def test_basic_types_exist(): + assert core.C.PIXEL_RGB888 > 0 + assert core.C.PIXEL_RGBA8888 > 0 + assert core.C.PIXEL_G8 > 0 + +def test_create_context(): + c = Context.Create(7, 9, core.C.PIXEL_RGB888) + assert c.w == 7 + assert c.h == 9 + + +@alltypes() +def test_create_context_and_check_sanity(t): + "Allocate Context by pixeltype and check basic invariants" + c = Context.Create(13, 15, t.type) + assert c.w == 13 + assert c.h == 15 + assert c._bit_endian == t.bit_endian + assert c.bpp == t.size + assert c._free_pixels + +@alltypes() +def test_create_by_number(t): + "Allocation by pixeltype number" + c = Context.Create(3, 5, t) + +@alltypes() +def test_context_convert_from_RGB888(t): + "Test conversion from RGB888" + if 'P' in t.name: + raise SkipTest("Palette conversion os TODO") + c = Context.Create(17, 19, core.C.PIXEL_RGB888) + # both by number and the pixeltype + c2 = c.Convert(t) + assert c2.pixel_type == t.type + c3 = c.Convert(t.type) + assert c3.pixel_type == t.type + +@alltypes() +def test_context_convert_to_RGB888(t): + "Test conversion to RGB888" + if 'P' in t.name: + raise SkipTest("Palette conversion os TODO") + c = Context.Create(1, 1, t) + c2 = c.Convert(core.C.PIXEL_RGB888) + assert c2.pixel_type == core.C.PIXEL_RGB888
http://repo.or.cz/w/gfxprim.git/commit/aa090dff3b0c8343388fca5586e73653e9d66...
commit aa090dff3b0c8343388fca5586e73653e9d66c12 Author: Tomas Gavenciak gavento@ucw.cz Date: Fri Dec 28 02:09:11 2012 +0100
Update .gitignore for pylib
diff --git a/.gitignore b/.gitignore index 7007e36..f6c7e20 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,7 @@ config.h config.gen.mk gfxprim-config +pylib/gfxprim/*/*_c.py +pylib/gfxprim/*/*_wrap.c +pylib/gfxprim/*/c_*.py +
http://repo.or.cz/w/gfxprim.git/commit/2bdf13f554c7ce4edf977dd73abcf520e145d...
commit 2bdf13f554c7ce4edf977dd73abcf520e145da64 Author: Tomas Gavenciak gavento@ucw.cz Date: Thu Dec 27 21:24:06 2012 +0100
Make gp_run.sh (slightly) more robust
diff --git a/gp_run.sh b/gp_run.sh index 4c76693..e1d60f3 100755 --- a/gp_run.sh +++ b/gp_run.sh @@ -2,7 +2,7 @@
# Very simple script to run python, ipython and GP executables
-BDIR=. +BDIR=`pwd`
export LD_LIBRARY_PATH=$BDIR/build/ export PYTHONPATH=$BDIR/pylib/
-----------------------------------------------------------------------
Summary of changes: .gitignore | 4 ++ gp_run.sh | 2 +- pylib/gfxprim/core/__init__.py | 12 ++++++- tests/pylib/runtests.sh | 2 + tests/pylib/test_core.py | 68 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 85 insertions(+), 3 deletions(-) create mode 100755 tests/pylib/runtests.sh create mode 100644 tests/pylib/test_core.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.