how to pass these arguments in PythonMagick

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
mikew

how to pass these arguments in PythonMagick

Post by mikew »

Hi everyone,

I am new to python and PythonMagick, i am not sure if it is ok to post this here but not python or boost's web, but plz have a look, any suggestions will be thankfull

i am writing some image process APIs use PythonMagick, but don't know how to pass this argument in python
see:
from help(PythonMagick)

Code: Select all

     |      C++ signature:
     |          annotate(Magick::Image {lvalue},std::string,MagickLib::GravityType) -> void*


from my code i did sth like
img.annotate("some text here",don't know what's the second argument)

i tried string, int ..., but just got this kind of error

Code: Select all

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
Boost.Python.ArgumentError: Python argument types in
    Image.annotate(Image, str, str)
did not match C++ signature:
    annotate(Magick::Image {lvalue}, std::string, MagickLib::GravityType)
some other things maybe helpfull

in /usr/include/Magick++/Include.h

Code: Select all

namespace MagickLib
{
#include <magick/MagickCore.h>
...}
then in /usr/include/magick/MagickCore.h

Code: Select all

#include "magick/magick-type.h"
finnally in /usr/include/magick/magick-type.h found it

Code: Select all

typedef enum
{
UndefinedGravity,
ForgetGravity = 0,
NorthWestGravity = 1,
NorthGravity = 2,
NorthEastGravity = 3,
WestGravity = 4,
CenterGravity = 5,
EastGravity = 6,
SouthWestGravity = 7,
SouthGravity = 8,
SouthEastGravity = 9,
StaticGravity = 10
} GravityType;
I want to know how can i use these gravities? thx again for any help

Mike
Post Reply