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 80d98abae1846cff3ffcd16edf2b00c87ad19020 (commit) via 2a96bbcf1e62de2aeff0ac728c71477fccc18e6d (commit) via 7d0e2bb5dcedab5c81890c3dbed2aa2e2856c81a (commit) via d754038d2b333494cfe8c53abf98f9771bfa5289 (commit) from a30c88774de677c922827ac3f8f1032db96ec044 (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/80d98abae1846cff3ffcd16edf2b00c87ad19...
commit 80d98abae1846cff3ffcd16edf2b00c87ad19020 Author: Cyril Hrubis metan@ucw.cz Date: Mon Apr 15 21:18:30 2013 +0200
demos: py_simple: Remove broken plot.py.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/demos/py_simple/plot.py b/demos/py_simple/plot.py deleted file mode 100755 index d58e574..0000000 --- a/demos/py_simple/plot.py +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env python -import gfxprim.core as core -import gfxprim.backends as backends -import gfxprim.gfx as gfx -import sys -from math import * - -W = 640 -H = 480 -EPS = 0.05 - -env = {} -env['sin'] = sin -env['cos'] = cos -env['sqrt'] = sqrt - -def compute(func, x, y_min, y_max): - env['x'] = x - try: - ret = eval(func, env) - except ZeroDivisionError: - return -1 - - return - H * ret / (y_max - y_min) + (H * y_max) / (y_max - y_min) - -def x_to_x(x, x_min, x_max): - return (x_max - x_min) * x / W + x_min - -class plotter(object): - def __init__(self, func, x_min, x_max, y_min, y_max): - self.x = 0.0 - self.y = compute(func, x_to_x(self.x, x_min, x_max), y_min, y_max) - self.y_min = y_min - self.y_max = y_max - self.x_min = x_min - self.x_max = x_max - self.func = func - def next(self): - x = x_to_x(self.x + 1, self.x_min, self.x_max) - new_y = compute(self.func, x, self.y_min, self.y_max) - - inc = 1.0 - - while (abs(new_y - self.y) > 1 and inc > EPS): - x = x_to_x(self.x + inc, self.x_min, self.x_max) - new_y = compute(self.func, x, self.y_min, self.y_max) - inc /= 2 - - self.x += inc - self.y = new_y - - print(self.x, self.y) - - -def main(): - bk = backends.BackendSDLInit(W, H, 0, 0, "Plot AA") - assert bk - print(bk) - print("Modify source for parameters,") - print("Kill to terminate ;-)") - print("Usage: function x_min x_max y_min y_max") - black = bk.context.RGBToPixel(0, 0, 0) - - x_min = float(sys.argv[2]) - x_max = float(sys.argv[3]) - y_min = float(sys.argv[4]) - y_max = float(sys.argv[5]) - p = plotter(sys.argv[1], x_min, x_max, y_min, y_max) - - r = 255 - g = 0 - b = 0 - - while p.x < W: - x = int((p.x + 0.5) * 0x100) - y = int((p.y + 0.5) * 0x100) - gfx.PutPixelAA(bk.context, x, y, bk.context.RGBToPixel(int(r), int(g), int(b))) - bk.Flip() - p.next() - - while True: - pass - -if __name__ == '__main__': - main()
http://repo.or.cz/w/gfxprim.git/commit/2a96bbcf1e62de2aeff0ac728c71477fccc18...
commit 2a96bbcf1e62de2aeff0ac728c71477fccc18e6d Author: Cyril Hrubis metan@ucw.cz Date: Mon Apr 15 21:14:23 2013 +0200
build: pywrap.mk: Two fixes.
* Rebuild the so libs when configure was runned. (path to the python config could changed)
* Remove redundand -I (I'm suprised it compiled fine before)
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/pywrap.mk b/pywrap.mk index 4518b71..3cac52a 100644 --- a/pywrap.mk +++ b/pywrap.mk @@ -18,6 +18,8 @@ ALL+=$(SWIG_LIB) $(SWIG_PY) $(SWIG_PY): $(SWIG_C) @
+$(SWIG_LIB): $(TOPDIR)/config.gen.mk + $(SWIG_C): $(SWIG_SRC) ifdef VERBOSE $(SWIG) $(SWIGOPTS) -python $(INCLUDES) $< @@ -28,10 +30,10 @@ endif # VERBOSE
$(SWIG_LIB): $(SWIG_C) ifdef VERBOSE - $(CC) $< $(CFLAGS) -D_GNU_SOURCE=1 $(LDFLAGS) -I$(PYTHON_INCLUDE) --shared -lGP $(LDLIBS) -L$(TOPDIR)/build/ -o $@ + $(CC) $< $(CFLAGS) -D_GNU_SOURCE=1 $(LDFLAGS) $(PYTHON_INCLUDE) --shared -lGP $(LDLIBS) -L$(TOPDIR)/build/ -o $@ else # VERBOSE @echo "LD $@" - @$(CC) $< $(CFLAGS) -D_GNU_SOURCE=1 $(LDFLAGS) -I$(PYTHON_INCLUDE) --shared -lGP $(LDLIBS) -L$(TOPDIR)/build/ -o $@ + @$(CC) $< $(CFLAGS) -D_GNU_SOURCE=1 $(LDFLAGS) $(PYTHON_INCLUDE) --shared -lGP $(LDLIBS) -L$(TOPDIR)/build/ -o $@ endif # VERBOSE
endif # PYTHON_CONFIG
http://repo.or.cz/w/gfxprim.git/commit/7d0e2bb5dcedab5c81890c3dbed2aa2e2856c...
commit 7d0e2bb5dcedab5c81890c3dbed2aa2e2856c81a Author: Cyril Hrubis metan@ucw.cz Date: Mon Apr 15 21:11:56 2013 +0200
pywrap: core: CallbackProxy: Reword error message.
The error happens in general case, not only on parse error.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/pylib/gfxprim/core/core.i b/pylib/gfxprim/core/core.i index 2657327..afca013 100644 --- a/pylib/gfxprim/core/core.i +++ b/pylib/gfxprim/core/core.i @@ -43,9 +43,9 @@ static int GP_ProgressCallbackProxy(GP_ProgressCallback *self)
res = PyEval_CallObject(obj, args);
- /* Parse Error */ + /* Parse Error, Interruption, etc. */ if (res == NULL) { - GP_WARN("Parse error while calling callback, aborting"); + GP_WARN("Error while calling callback, aborting"); return 1; }
http://repo.or.cz/w/gfxprim.git/commit/d754038d2b333494cfe8c53abf98f9771bfa5...
commit d754038d2b333494cfe8c53abf98f9771bfa5289 Author: Cyril Hrubis metan@ucw.cz Date: Mon Apr 15 21:11:12 2013 +0200
demos: py_simple: Fixes.
* Fix compatibility with python 2.6
* Various small fixes.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/demos/py_simple/backends.py b/demos/py_simple/backends.py index 6c53116..f6d9e40 100755 --- a/demos/py_simple/backends.py +++ b/demos/py_simple/backends.py @@ -28,7 +28,7 @@ def main(): backend_string = sys.argv[1]
if len(sys.argv) > 2: - print("Usage: {} [backend init string]".format(sys.argv[0])) + print("Usage: %s [backend init string]" % sys.argv[0]) sys.exit(1)
# Create backend window diff --git a/demos/py_simple/gfx.py b/demos/py_simple/gfx.py index 2c9aef3..9d82a1b 100755 --- a/demos/py_simple/gfx.py +++ b/demos/py_simple/gfx.py @@ -136,17 +136,16 @@ def next(bk, i): return i
def main(): - print(dir(gfx)) - # Create X11 window bk = backends.BackendX11Init(None, 0, 0, 320, 240, "GFX demo", 0) assert(bk) - print(dir(bk.context.gfx))
bk.Flip()
i = 0
+ print("Press SPACE to draw different shape, ESC to exit") + # Event loop while True: ev = bk.WaitEvent() diff --git a/demos/py_simple/progress_callback.py b/demos/py_simple/progress_callback.py index d743c23..4055f1a 100755 --- a/demos/py_simple/progress_callback.py +++ b/demos/py_simple/progress_callback.py @@ -7,7 +7,8 @@ import gfxprim.loaders as loaders import gfxprim.filters as filters
def progress_callback(callback): - sys.stdout.write("rLoading {:3.2f}%".format(callback)) + sys.stdout.write("rLoading %3.2f%%" % callback) + sys.stdout.flush() return 0
def main(): @@ -19,15 +20,15 @@ def main():
try: img = loaders.Load(sys.argv[1], callback) - print() - except RuntimeError as detail: - print("Failed to load image '{}': {}".format(sys.argv[1], detail)) + print('') + except OSError as detail: + print("Failed to load image '%s': %s" % (sys.argv[1], detail)) exit(1)
try: img = filters.FilterGaussianBlurAlloc(img, 50, 50, callback) - print() - except RuntimeError: + print('') + except OSError: print("Filter Aborted")
if __name__ == '__main__': diff --git a/demos/py_simple/rotate90.py b/demos/py_simple/rotate90.py index 4a77835..099fb51 100755 --- a/demos/py_simple/rotate90.py +++ b/demos/py_simple/rotate90.py @@ -16,7 +16,7 @@ def main(): # Load Image src = loaders.Load(sys.argv[1]) # Rotate by 90 degrees - res = filters.FilterRotate90Alloc(src) + res = filters.FilterRotate90Alloc(src, None) # Save Image res.loaders.Save(sys.argv[2])
diff --git a/demos/py_simple/x11_windows.py b/demos/py_simple/x11_windows.py index bb656d3..1766087 100755 --- a/demos/py_simple/x11_windows.py +++ b/demos/py_simple/x11_windows.py @@ -17,13 +17,13 @@ def redraw(bk, id): c.gfx.Fill(black)
align = text.C.ALIGN_CENTER | text.C.VALIGN_CENTER - c.text.Text(None, c.w//2, c.h//2, align, white, black, "{} - {}x{}".format(id, c.w, c.h)) + c.text.Text(None, c.w//2, c.h//2, align, white, black, "%s - %sx%s" % (id, c.w, c.h))
bk.Flip()
def parse_events(bk, id):
- print("------ Window {} -------".format(id)) + print("------ Window %s -------" % (id))
while True: ev = bk.GetEvent()
-----------------------------------------------------------------------
Summary of changes: demos/py_simple/backends.py | 2 +- demos/py_simple/gfx.py | 5 +- demos/py_simple/plot.py | 85 ---------------------------------- demos/py_simple/progress_callback.py | 13 +++-- demos/py_simple/rotate90.py | 2 +- demos/py_simple/x11_windows.py | 4 +- pylib/gfxprim/core/core.i | 4 +- pywrap.mk | 6 ++- 8 files changed, 19 insertions(+), 102 deletions(-) delete mode 100755 demos/py_simple/plot.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.