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 0d0f7852bb88e81f1e248e9776022232454d218e (commit) via 324bfb6f6762369f769774df7765f871330d262e (commit) via 9fd530170199db0cf53d4d4b7223f07b44c2554d (commit) via fb131160d2f7320ef2998d1165dab70a6ac2f97e (commit) via f5cecdf0ef17c206a2481873bedcb2b6178ccefa (commit) from 77ca5e065797236b928b1ee5a3e869c564620191 (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/0d0f7852bb88e81f1e248e9776022232454d2...
commit 0d0f7852bb88e81f1e248e9776022232454d218e Merge: 324bfb6 77ca5e0 Author: Tomas Gavenciak gavento@ucw.cz Date: Tue Dec 25 02:18:26 2012 +0100
Merge branch 'master' of ssh://repo.or.cz/srv/git/gfxprim
http://repo.or.cz/w/gfxprim.git/commit/324bfb6f6762369f769774df7765f871330d2...
commit 324bfb6f6762369f769774df7765f871330d262e Author: Tomas Gavenciak gavento@ucw.cz Date: Tue Dec 25 02:15:22 2012 +0100
core: pylib: Cleanup of gfxprim.core and imports
diff --git a/pylib/gfxprim/core/__init__.py b/pylib/gfxprim/core/__init__.py index 4e90c66..a4301f5 100644 --- a/pylib/gfxprim/core/__init__.py +++ b/pylib/gfxprim/core/__init__.py @@ -55,7 +55,6 @@ def _init(module): c.parent = None return c
- extend_direct @extend(_context) def SubContext(self, x, y, w, h): "Create a subcontext (a rectangular view)." @@ -162,112 +161,15 @@ def _init(module):
# Bulk import of functions import_members(c_core, module, sub=strip_GP, - exclude=const_regexes + [ - '^GP_Blitw+$', - '^GP_Contextw+$', - '^GP_PixelSNPrintw+$', - '^GP_WritePixelsw+$', - '.*_Raw.*', - '^w+_swigregister$', - '^cvar$', - '^_w+$']) + include=[ + '^GP_Color.*$', # Might use trimming + '^GP_[GS]etDebugLevel$', + '^GP_PixelRGB.*$', # ...Lookup and ...Match + '^GP_PixelToRGB.*$', # Needs love + '^GP_RGB.*$', # Needs filtering + #'^GP_ProgressCallback.*$', # Needs work + ])
_init(locals()) del _init
-""" -TODO: on entering any func from Python, set up error reporting on GP_ABORT -(raise an exception, restore stack and return, possibly longjmp? -(or just force python trace?) - -!! LIST of symbols to implement - -! Pixeltype table and objects - -GP_PixelTypes - FIX - -! IN Context class - -GP_ContextAlloc C -GP_ContextResize C -GP_ContextConvertAlloc C -GP_ContextPrintInfo N -GP_ContextRotateCCW C -GP_SubContextAlloc C -GP_ContextConvert N -GP_ContextRotateCW C -GP_ContextFree Ci -GP_ContextInit N -GP_SubContext N -GP_ContextCopy C -GP_PixelAddrOffset N - -! ? - -# GP_GammaRelease -# GP_GammaCopy -# GP_GammaAcquire - -! ? - -# GP_DebugPrint -# GP_SetDebugLevel -# GP_GetDebugLevel - -! Color conversion - -GP_RGBA8888ToPixel N -GP_RGB888ToPixel N -GP_PixelToRGB888 -GP_PixelToRGBA8888 -GP_ColorNameToPixel -GP_ColorToPixel - -GP_PixelTypeByName - reimplement - -# GP_PixelRGBMatch -# GP_ColorLoadPixels -# GP_PixelRGBLookup -# GP_ColorNameToColor -# GP_ColorToColorName - -! IN Context class - -Blit - reimplement with keyword args, no raw - -# GP_BlitXYXY -# GP_BlitXYXY_Fast -# GP_BlitXYWH -# GP_BlitXYWH_Clipped -# GP_BlitXYXY_Clipped -# GP_BlitXYXY_Raw_Fast -# GP_BlitXYWH_Raw -# GP_BlitXYXY_Raw - -! Do not want - -# GP_WritePixels_1BPP_LE -# GP_WritePixels_2BPP_LE -# GP_WritePixels_4BPP_LE -# GP_WritePixels1bpp -# GP_WritePixels2bpp -# GP_WritePixels4bpp -# GP_WritePixels8bpp -# GP_WritePixels16bpp -# GP_WritePixels18bpp -# GP_WritePixels32bpp -# GP_WritePixels24bpp - -! IN Context - basic drawing - -GP_PutPixel C -GP_GetPixel C - -! ? - -# GP_NrThreads -# GP_NrThreadsSet -# GP_ProgressCallbackMP -# SWIG_exception -""" -
http://repo.or.cz/w/gfxprim.git/commit/9fd530170199db0cf53d4d4b7223f07b44c25...
commit 9fd530170199db0cf53d4d4b7223f07b44c2554d Author: Tomas Gavenciak gavento@ucw.cz Date: Tue Dec 25 02:14:38 2012 +0100
core: pylib: GP_PixelTypes related access
diff --git a/pylib/gfxprim/core/__init__.py b/pylib/gfxprim/core/__init__.py index cc4577d..4e90c66 100644 --- a/pylib/gfxprim/core/__init__.py +++ b/pylib/gfxprim/core/__init__.py @@ -149,7 +149,18 @@ def _init(module): # every Context also points to C for convenience extend(_context, name='C')(C)
- # Bulk import of functions - TODO: only import specified + # Arrays with pixel type info + module['PixelTypes'] = [c_core.GP_PixelTypes_access(i) + for i in range(C.PIXEL_MAX)] + + module['PixelTypesDict'] = dict(((t.name, t) for t in module['PixelTypes'])) + + def PixelTypeByName(name): + "Return a PixelType descriptor by name, raise KeyError if no such type exists." + return module['PixelTypesDict'][name] + module['PixelTypeByName'] = PixelTypeByName + + # Bulk import of functions import_members(c_core, module, sub=strip_GP, exclude=const_regexes + [ '^GP_Blitw+$', diff --git a/pylib/gfxprim/core/core.i b/pylib/gfxprim/core/core.i index 6e1d017..c59ae6c 100644 --- a/pylib/gfxprim/core/core.i +++ b/pylib/gfxprim/core/core.i @@ -35,6 +35,14 @@ ERROR_ON_NULL(GP_ColorToColorName); %import "GP_FnPerBpp.h" %import "GP_FnPerBpp.gen.h"
+%inline %{ +const GP_PixelTypeDescription *GP_PixelTypes_access(GP_PixelType no) +{ + if (no < 0 || no >= GP_PIXEL_MAX) no = GP_PIXEL_UNKNOWN; + return &GP_PixelTypes[no]; +} +%} + /* * GP_Context wrapping */
http://repo.or.cz/w/gfxprim.git/commit/fb131160d2f7320ef2998d1165dab70a6ac2f...
commit fb131160d2f7320ef2998d1165dab70a6ac2f97e Author: Tomas Gavenciak gavento@ucw.cz Date: Tue Dec 25 01:40:24 2012 +0100
core: Explicit size of GP_PixelTypes
diff --git a/include/core/GP_Pixel.h b/include/core/GP_Pixel.h index f40c8a6..d058ab3 100644 --- a/include/core/GP_Pixel.h +++ b/include/core/GP_Pixel.h @@ -114,7 +114,7 @@ typedef struct { /* * Array of size GP_PIXEL_MAX describing known pixel types */ -extern const GP_PixelTypeDescription const GP_PixelTypes[]; +extern const GP_PixelTypeDescription const GP_PixelTypes[GP_PIXEL_MAX];
#define GP_CHECK_VALID_PIXELTYPE(type) GP_CHECK(((type) > 0) && ((type) < GP_PIXEL_MAX), "Invalid PixelType %d", (type)) diff --git a/libs/core/GP_Pixel.gen.c.t b/libs/core/GP_Pixel.gen.c.t index f41625b..8374856 100644 --- a/libs/core/GP_Pixel.gen.c.t +++ b/libs/core/GP_Pixel.gen.c.t @@ -2,7 +2,6 @@
%% block descr Pixel type definitions and functions -Do not include directly, use GP_Pixel.h %% endblock
%% block body @@ -13,7 +12,7 @@ Do not include directly, use GP_Pixel.h /* * Description of all known pixel types */ -const GP_PixelTypeDescription const GP_PixelTypes [] = { +const GP_PixelTypeDescription const GP_PixelTypes [GP_PIXEL_MAX] = { %% for pt in pixeltypes /* GP_PIXEL_{{ pt.name }} */ { .type = GP_PIXEL_{{ pt.name }},
http://repo.or.cz/w/gfxprim.git/commit/f5cecdf0ef17c206a2481873bedcb2b6178cc...
commit f5cecdf0ef17c206a2481873bedcb2b6178ccefa Author: Tomas Gavenciak gavento@ucw.cz Date: Tue Dec 25 01:39:30 2012 +0100
core: pylib: Pythonic Context.Blit
diff --git a/pylib/gfxprim/core/__init__.py b/pylib/gfxprim/core/__init__.py index 3bf8d08..cc4577d 100644 --- a/pylib/gfxprim/core/__init__.py +++ b/pylib/gfxprim/core/__init__.py @@ -91,6 +91,26 @@ def _init(module): extend_direct(_context, "Resize", c_core.GP_ContextResize, "Resize the context bitmap (reallocate). Fails on subcontexts.")
+ # Blit + + @extend(_context) + def Blit(self, sx, sy, target, tx, ty, w=None, h=None, sx2=None, sy2=None, + tx2=None, ty2=None): + """Copy a rectangle from self to target. (sx,sy) and (tx,ty) define + upper-left corners, rectangle size is given by (width, height), lower-right + corner in source or lower-right corner in the target. Clipped.""" + assert sum([w is not None, sx2 is not None, tx2 is not None]) == 1 + assert sum([h is not None, sy2 is not None, ty2 is not None]) == 1 + if sx2 is not None: + w = max(0, sx2 - sx) + if tx2 is not None: + w = max(0, tx2 - tx) + if sy2 is not None: + h = max(0, sy2 - sy) + if ty2 is not None: + h = max(0, ty2 - ty) + return c_core.GP_BlitXYWH_Clipped(self, sx, sy, target, tx, ty, w, h) + # Color conversions
@extend(_context) @@ -163,7 +183,7 @@ GP_ContextConvertAlloc C GP_ContextPrintInfo N GP_ContextRotateCCW C GP_SubContextAlloc C -GP_ContextConvert C +GP_ContextConvert N GP_ContextRotateCW C GP_ContextFree Ci GP_ContextInit N @@ -190,10 +210,10 @@ GP_RGB888ToPixel N GP_PixelToRGB888 GP_PixelToRGBA8888 GP_ColorNameToPixel +GP_ColorToPixel
GP_PixelTypeByName - reimplement
-# GP_ColorToPixel # GP_PixelRGBMatch # GP_ColorLoadPixels # GP_PixelRGBLookup
-----------------------------------------------------------------------
Summary of changes: include/core/GP_Pixel.h | 2 +- libs/core/GP_Pixel.gen.c.t | 3 +- pylib/gfxprim/core/__init__.py | 147 +++++++++++----------------------------- pylib/gfxprim/core/core.i | 8 ++ 4 files changed, 50 insertions(+), 110 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.