Commit 926dcb69 authored by Roland Levillain's avatar Roland Levillain
Browse files

python/image2d-misc.py: Have this test pass with SWIG < 1.3.39.

git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4016 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent fa497199
2009-06-08 Roland Levillain <roland@lrde.epita.fr>
* python/image2d-misc.py: Have this test pass with SWIG < 1.3.39.
2009-06-08 Roland Levillain <roland@lrde.epita.fr>
New Swilena module: config.
......
......@@ -22,13 +22,24 @@ from swilena import *
ima = image2d_int.image2d_int(3, 3)
image2d_int.fill(ima, 42)
# FIXME: Help version of SWIG older than 1.3.39. For instance, SWIG
# 1.3.36 does not generate code smart enough to detect that the output
# of `ima.domain()' should be a wrapped `box2d'. Help it.
#
# We should get rid of this when SWIG 1.3.39 (or greater) is
# widespread.
if config.have_swig(0x010339):
domain = ima.domain()
else:
domain = box2d(3, 3)
# FIXME: Eventually we'd like to be able to write this:
#
# for p in ima.domain():
# print "ima(" + str(p) + ") = " + ima(p)
#
# as it is generic and way closer to what we do in C++.
for p in ima.domain():
for p in domain:
# FIXME: Handling POD types (like int) as value types is not
# transparent: ima(p) returns a pointer to int wrapped in a SWIG
# object, and cannot be easily converted to a Python integer
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment