Issue using PythonMagick Drawable* requiring CoordinateList
Posted: 2014-02-14T09:47:05-07:00
Hi all, I would appreicate some guidance on the use of PythonMagick's Drawables. At the moment I am getting used to the API and have drawn a couple test shapes (eg circle). However, I am getting a C++ signature mismatch error when trying to use a class that requires Coordinates, such as DrawableBezier or DrawablePolygon.
For example, the test code:
Fails with:
Could someone point me in the right direction here? Part of the problem may be my unfamiliarity with Boost/C++ but the docs don't describe the use of Drawables and searches have turned up dry as well. Thanks in advance!
For example, the test code:
Code: Select all
img = PythonMagick.Image("512x512", "white")
img.fillColor(PythonMagick.Color("#FF0000FF"))
coord1 = PythonMagick.Coordinate(50,50)
coord2 = PythonMagick.Coordinate(50,150)
coord3 = PythonMagick.Coordinate(200,250)
coord4 = PythonMagick.Coordinate(50,25)
coordlist = [coord1, coord2, coord3, coord4]
bezier = PythonMagick.DrawableBezier(coordlist)
img.draw(bezier)
img.write("test.png")
I've had a look at the Magick++ documentation, which makes references to CoordinateList types (IIRC). I figured a python list of PythonMagick.Coordinate would be massaged to a std::list of Magick::Coordinates but perhaps this isn't happening? I freely admit to stabbing in the dark here!Code: Select all
Traceback (most recent call last): File "painter.py", line 49, in <module> bezier = PythonMagick.DrawableBezier(coordlist) Boost.Python.ArgumentError: Python argument types in DrawableBezier.__init__(DrawableBezier, list) did not match C++ signature: __init__(_object*, Magick::DrawableBezier) __init__(_object*, std::list<Magick::Coordinate, std::allocator<Magick::Coordinate> >)
Could someone point me in the right direction here? Part of the problem may be my unfamiliarity with Boost/C++ but the docs don't describe the use of Drawables and searches have turned up dry as well. Thanks in advance!
