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 df87777210da0ea03b70f5d8cf138050a5399e05 (commit)
from 57673b3b830b3d6434956c656d0cec95156314cc (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/df87777210da0ea03b70f5d8cf138050a539…
commit df87777210da0ea03b70f5d8cf138050a5399e05
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Thu Dec 27 01:38:23 2012 +0100
demos: c_simple: Update backend example.
diff --git a/demos/c_simple/backend_example.c b/demos/c_simple/backend_example.c
index 063da75..3d565ef 100644
--- a/demos/c_simple/backend_example.c
+++ b/demos/c_simple/backend_example.c
@@ -71,10 +71,8 @@ int main(int argc, char *argv[])
GP_BackendFlip(backend);
for (;;) {
- if (backend->Poll)
- GP_BackendPoll(backend);
-
- usleep(1000);
+ /* Wait for backend event */
+ GP_BackendWait(backend);
/* Read and parse events */
GP_Event ev;
@@ -85,13 +83,20 @@ int main(int argc, char *argv[])
switch (ev.type) {
case GP_EV_KEY:
- switch (ev.val.key.key) {
+ switch (ev.val.val) {
case GP_KEY_ESC:
case GP_KEY_Q:
GP_BackendExit(backend);
return 0;
break;
}
+ break;
+ case GP_EV_SYS:
+ case GP_EV_SYS_QUIT:
+ GP_BackendExit(backend);
+ return 0;
+ break;
+ break;
}
}
}
-----------------------------------------------------------------------
Summary of changes:
demos/c_simple/backend_example.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
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 65cea9aefed176553293e6d5b18ad5eb24b9b704 (commit)
via 9405c62813a1cc0ce1584a512ca07384899244b2 (commit)
via e9931e042beccee51ddb1855ba2cecc22dc8d0ea (commit)
from 36422459f0fc8293fb52d4818dc94c8342615a1c (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/65cea9aefed176553293e6d5b18ad5eb24b9…
commit 65cea9aefed176553293e6d5b18ad5eb24b9b704
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Wed Dec 26 16:02:33 2012 +0100
build: pywrap: Fix the dependencies.
Make can't create rule that produces two
or more files so we use small trick with
with dummy rule to fix this.
diff --git a/pywrap.mk b/pywrap.mk
index d8b18f6..2b527b8 100644
--- a/pywrap.mk
+++ b/pywrap.mk
@@ -13,7 +13,11 @@ INCLUDES+=$(addprefix -I$(TOPDIR)/include/, $(INCLUDE))
ALL+=$(SWIG_LIB) $(SWIG_PY)
-$(SWIG_C) $(SWIG_PY): $(SWIG_SRC)
+# Empty rule to satisfy SWIG_PY
+$(SWIG_PY): $(SWIG_C)
+ @
+
+$(SWIG_C): $(SWIG_SRC)
ifdef VERBOSE
$(SWIG) $(SWIGOPTS) -python $(INCLUDES) $<
else # VERBOSE
http://repo.or.cz/w/gfxprim.git/commit/9405c62813a1cc0ce1584a512ca073848992…
commit 9405c62813a1cc0ce1584a512ca07384899244b2
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Wed Dec 26 15:55:35 2012 +0100
build: Fix dependencies for library build.
Now the library is rebuild only once after
the sources has been changed.
diff --git a/build/Makefile b/build/Makefile
index 7ac79b2..59afb71 100644
--- a/build/Makefile
+++ b/build/Makefile
@@ -1,7 +1,10 @@
LIB_OBJECTS=$(shell ./get_objs.sh)
all: libGP.a libGP.so libGP.so.0
-.PHONY: libGP.a libGP.so libGP.so.0
+
+libGP.a: $(LIB_OBJECTS)
+libGP.so: $(LIB_OBJECTS)
+libGP.so.0: $(LIB_OBJECTS)
rebuild: all
http://repo.or.cz/w/gfxprim.git/commit/e9931e042beccee51ddb1855ba2cecc22dc8…
commit e9931e042beccee51ddb1855ba2cecc22dc8d0ea
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Wed Dec 26 15:52:20 2012 +0100
Remove long obsolete TODO file.
diff --git a/TODO b/TODO
deleted file mode 100644
index 04e7bdc..0000000
--- a/TODO
+++ /dev/null
@@ -1,15 +0,0 @@
-What's not implemented (and should be)
---------------------------------------
-
-* Meditate about bit endians and why these aren't separate pixel types
- (which would make our lives a bit easier)
-
-Advanced features
------------------
-
-* bitmaps
- - alpha channel
-
-* gfx primitives
- - drawing with alpha channel
- - anti aliasing
-----------------------------------------------------------------------
Summary of changes:
TODO | 15 ---------------
build/Makefile | 5 ++++-
pywrap.mk | 6 +++++-
3 files changed, 9 insertions(+), 17 deletions(-)
delete mode 100644 TODO
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
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 8bfdadb7f739f7eb614d3c4f427a3d075a0669a1 (commit)
via 55afb5fd376150afe14f6388749547e07fc02c42 (commit)
from 08e5a448761d5d3b25abcf1d42967458e8cdfa62 (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/8bfdadb7f739f7eb614d3c4f427a3d075a06…
commit 8bfdadb7f739f7eb614d3c4f427a3d075a0669a1
Merge: 55afb5f 08e5a44
Author: Tomas Gavenciak <gavento(a)ucw.cz>
Date: Tue Dec 25 03:28:02 2012 +0100
Merge branch 'master' of ssh://repo.or.cz/srv/git/gfxprim
http://repo.or.cz/w/gfxprim.git/commit/55afb5fd376150afe14f6388749547e07fc0…
commit 55afb5fd376150afe14f6388749547e07fc02c42
Author: Tomas Gavenciak <gavento(a)ucw.cz>
Date: Tue Dec 25 03:26:45 2012 +0100
loaders: pylib: cleanup and Context submodule
diff --git a/pylib/gfxprim/loaders/__init__.py b/pylib/gfxprim/loaders/__init__.py
index 5dd476e..621099a 100644
--- a/pylib/gfxprim/loaders/__init__.py
+++ b/pylib/gfxprim/loaders/__init__.py
@@ -1,11 +1,31 @@
-from . import loaders_c
+from . import c_loaders
+
+
+def Load(filename, callback=None):
+ "Load image from given file, guessing the type."
+ c = c_loaders.GP_LoadImage(filename, callback)
+ return c
+
def _init(module):
+ "Extend Context with loaders submodule"
+
+ from ..utils import extend, add_swig_getmethod, add_swig_setmethod
+ from ..core import Context as _context
+
+ class LoadersSubmodule(object):
+ def __init__(self, ctx):
+ self.ctx = ctx
+
+ _context._submodules['loaders'] = LoadersSubmodule
+
+ @extend(LoadersSubmodule)
+ def Save(self, filename, callback=None):
+ """Save the image, guessing the type from the extension.
- # Extend Context with convenience methods
- from ._extend_context import extend_context
- from ..core import Context
- extend_context(Context)
+ Generally, not all pixel types work with all formats.
+ """
+ c_loaders.GP_SaveImage(self.ctx, filename, callback)
# Imports from the SWIG module
import re
@@ -14,11 +34,13 @@ def _init(module):
# Import functions from the SWIG module
from ..utils import import_members
- import_members(loaders_c, module, sub=strip_GP,
- exclude=[
- '^w+_swigregister$',
- '^gfxprim$',
- '^_w+$'])
+ import_members(c_loaders, module, sub=strip_GP,
+ include=[
+ '^GP_Load[A-Z]{3}.*',
+ '^GP_Save[A-Z]{3}.*',
+ '^GP_ListLoaders$',
+ '^GP_LoadMetaData$',
+ ])
_init(locals())
del _init
diff --git a/pylib/gfxprim/loaders/loaders.i b/pylib/gfxprim/loaders/loaders.i
index 7c9d903..f72a3e8 100644
--- a/pylib/gfxprim/loaders/loaders.i
+++ b/pylib/gfxprim/loaders/loaders.i
@@ -1,5 +1,5 @@
%include "../common.i"
-%module(package="gfxprim.loaders") loaders_c
+%module(package="gfxprim.loaders") c_loaders
%{
#include "core/GP_Core.h"
@@ -14,7 +14,7 @@ ERROR_ON_NONZERO(GP_SaveImage);
%newobject GP_LoadImage;
-%include "GP_Loaders.h"
+%include "GP_Loader.h"
ERROR_ON_NONZERO(GP_OpenJPG);
ERROR_ON_NULL(GP_ReadJPG);
-----------------------------------------------------------------------
Summary of changes:
pylib/gfxprim/loaders/__init__.py | 42 ++++++++++++++++++++++++++++--------
pylib/gfxprim/loaders/loaders.i | 4 +-
2 files changed, 34 insertions(+), 12 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
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/0d0f7852bb88e81f1e248e9776022232454d…
commit 0d0f7852bb88e81f1e248e9776022232454d218e
Merge: 324bfb6 77ca5e0
Author: Tomas Gavenciak <gavento(a)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/324bfb6f6762369f769774df7765f871330d…
commit 324bfb6f6762369f769774df7765f871330d262e
Author: Tomas Gavenciak <gavento(a)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/9fd530170199db0cf53d4d4b7223f07b44c2…
commit 9fd530170199db0cf53d4d4b7223f07b44c2554d
Author: Tomas Gavenciak <gavento(a)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/fb131160d2f7320ef2998d1165dab70a6ac2…
commit fb131160d2f7320ef2998d1165dab70a6ac2f97e
Author: Tomas Gavenciak <gavento(a)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/f5cecdf0ef17c206a2481873bedcb2b6178c…
commit f5cecdf0ef17c206a2481873bedcb2b6178ccefa
Author: Tomas Gavenciak <gavento(a)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(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")