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, pywrap has been updated via 5827000a1971b8ffd2a91f01bbd65da6e4779e9e (commit) via ab8476d63945f607819a2e3b2fdd998f90fb8fb7 (commit) via 0c4bfea569c5fc142b2b2dfe88eae6fb1af1bb4c (commit) via 79c70696f823e96d2c85d07035fefc109f62db7d (commit) via cc5f16de4ff693a60f55a5b335367b3a8ffd3a40 (commit) via 4a0d49ee3217ef629843a671587ae0e4c1659564 (commit) via 268e020540d7c79ee472d75c1f959228f419b82b (commit) via cac343079cd56a28eac9e54ca3ab4aeee3fba683 (commit) via 5e645909989e30e94ffe9eacf2177f441d44c2d6 (commit) via 9655adbc1de7cf63dd3510bb57f6fec95248c010 (commit) via 761929b143cb585ace1dd3c97cbe2f6be2952b80 (commit) via a21a7b420ab39c6c833aa878898295f61978c909 (commit) from d028c5b88bfbe818f650dac41671b7dc74fab584 (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/5827000a1971b8ffd2a91f01bbd65da6e4779...
commit 5827000a1971b8ffd2a91f01bbd65da6e4779e9e Author: Tomas Gavenciak gavento@ucw.cz Date: Sat Nov 26 23:27:00 2011 +0100
Add convert and copy methods to Context (python)
diff --git a/pylib/context.py b/pylib/context.py index 03187a7..e7c8c41 100644 --- a/pylib/context.py +++ b/pylib/context.py @@ -60,6 +60,23 @@ def extend_context_class(_context_class = core.Context): return c
@extend(_context_class) + def copy(self, withdata): + "Copy the context to a new context. Pixel data are copie optionally." + flags = core.GP_COPY_WITH_PIXELS if withdata else 0 + return core.GP_ContextCopy(self, flags) + + @extend(_context_class) + def convert(self, target_type): + """Converts context to a different pixel type, allocates new context. + See GP_ContextConvert() for details.""" + pixeltype_no = target_type ## TODO also accept PixelType + print "A1" + c = core.GP_ContextConvert(self, pixeltype_no) + print "A2" + return c + + + @extend(_context_class) def save(self, filename, format=None): """Save the image in given format (or guess it from the extension)
http://repo.or.cz/w/gfxprim.git/commit/ab8476d63945f607819a2e3b2fdd998f90fb8...
commit ab8476d63945f607819a2e3b2fdd998f90fb8fb7 Author: Tomas Gavenciak gavento@ucw.cz Date: Sat Nov 26 23:25:46 2011 +0100
Move setting new GP_Context ownership to SWIG
For several context-allocating functions in GP_Context.c
diff --git a/include/core/gfxprim_core.swig b/include/core/gfxprim_core.swig index 4cdb160..d497c8f 100644 --- a/include/core/gfxprim_core.swig +++ b/include/core/gfxprim_core.swig @@ -80,8 +80,6 @@ GP_Context memory allocation is handled by gfxprim, deallocation by GP_ContextFr The wrapper can be used without owning the GP_Context struct by setting self.this and self.thisown.") GP_Context;
-%include "GP_Context.h" - %extend GP_Context { ~GP_Context() { GP_DEBUG(2, "[wrapper] GP_ContextFree (%dx%d raw, %dbpp, free_pixels:%d)", @@ -90,6 +88,14 @@ and self.thisown.") GP_Context; } };
+/* Indicate new wrapper-owned GP_Context */ +%newobject GP_ContextAlloc; +%newobject GP_ContextCopy; +%newobject GP_ContextSubContext; +%newobject GP_ContextConvert; + +%include "GP_Context.h" +
/* * Context manipulation diff --git a/pylib/context.py b/pylib/context.py index 1837b23..03187a7 100644 --- a/pylib/context.py +++ b/pylib/context.py @@ -56,7 +56,6 @@ def extend_context_class(_context_class = core.Context): def subcontext(self, x, y, w, h): "Create a subcontext (rectangular view)." c = core.GP_ContextSubContext(self, None, x, y, w, h) - c.thisown = True # GP_Context IS owned (but not the pixel data) c.parent = self return c
@@ -93,7 +92,6 @@ def extend_context_class(_context_class = core.Context): pixeltype_no = pixeltype if isinstance(pixeltype, int) else 0 # !!! # TODO: actually accept a PixelType c = core.GP_ContextAlloc(w, h, pixeltype_no) - c.thisown = True return c
@extend(_context_class, name='load') @@ -101,7 +99,6 @@ def extend_context_class(_context_class = core.Context): def load(filename): "Load image from given file, guess type." c = loaders.GP_LoadImage_SWIG(filename) - c.thisown = True return c
http://repo.or.cz/w/gfxprim.git/commit/0c4bfea569c5fc142b2b2dfe88eae6fb1af1b...
commit 0c4bfea569c5fc142b2b2dfe88eae6fb1af1bb4c Author: Tomas Gavenciak gavento@ucw.cz Date: Sat Nov 26 23:24:11 2011 +0100
Fix GP_ContextConvert
... a little, still not ideal, but IMO not worth it
diff --git a/libs/core/GP_Context.c b/libs/core/GP_Context.c index 7079901..73e926e 100644 --- a/libs/core/GP_Context.c +++ b/libs/core/GP_Context.c @@ -110,11 +110,13 @@ GP_Context *GP_ContextAlloc(GP_Size w, GP_Size h, GP_PixelType type) GP_Context *GP_ContextConvert(const GP_Context *src, GP_PixelType dst_pixel_type) { - GP_Context *ret = GP_ContextAlloc(src->w, src->h, dst_pixel_type); + int w = GP_ContextW(src); + int h = GP_ContextH(src); + GP_Context *ret = GP_ContextAlloc(w, h, dst_pixel_type); if (ret == NULL) return NULL;
- GP_Blit_Naive(src, 0, 0, src->w, src->h, ret, 0, 0); + GP_Blit(src, 0, 0, w, h, ret, 0, 0); return ret; }
http://repo.or.cz/w/gfxprim.git/commit/79c70696f823e96d2c85d07035fefc109f62d...
commit 79c70696f823e96d2c85d07035fefc109f62db7d Merge: d028c5b cc5f16d Author: Tomas Gavenciak gavento@ucw.cz Date: Sat Nov 26 21:48:44 2011 +0100
Merge branch 'master' of git://repo.or.cz/gfxprim into pywrap
-----------------------------------------------------------------------
Summary of changes: demos/fbshow/fbshow.c | 158 ++++++++++++++++++++++------ demos/grinder/grinder.c | 4 +- doc/context.txt | 4 +- include/core/GP_Context.h | 7 +- include/core/gfxprim_core.swig | 10 ++- include/filters/GP_FilterParam.h | 25 +++++ include/filters/GP_Resize.h | 5 +- include/text/GP_Font.h | 8 +- include/text/GP_Text.h | 56 +++++++--- include/text/GP_TextMetric.h | 29 +++--- include/text/GP_TextStyle.h | 6 +- libs/core/GP_Context.c | 23 ++--- libs/filters/GP_FilterParam.c | 32 ++++++ libs/filters/GP_Resize.c | 174 ++++++++++++++++++++++++++++--- libs/text/GP_Text.c | 215 ++++++++++++++++++-------------------- pylib/context.py | 20 +++- pylib/templates/filter.point.c.t | 2 +- tests/SDL/blittest.c | 5 +- tests/SDL/fileview.c | 3 +- tests/SDL/fonttest.c | 13 ++- tests/SDL/input.c | 20 +++- tests/SDL/shapetest.c | 2 +- tests/SDL/showimage.c | 7 +- tests/SDL/subcontext.c | 2 +- tests/SDL/textaligntest.c | 12 +- tests/drivers/framebuffer_test.c | 4 +- 26 files changed, 595 insertions(+), 251 deletions(-)
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.