librelist archives

« back to archive

Adding new methods to Image

Adding new methods to Image

From:
Jesse Pavel
Date:
2013-10-24 @ 21:31
Hello,

I'd like to add some missing methods to the Image class. For instance, for
the MagickWand function


MagickBooleanType MagickBrightnessContrastImage(MagickWand *wand,
    const double brightness,const double contrast)

is it as simple as

1. adding to the appropriate section of api.py

    library.MagickBrightnessContrast Image.argtypes = [ctypes.c_void_p,
                                                       ctypes.c_double,
                                                       ctypes.c_double]

2. adding a more pleasant method to image.py that calls the api, performs
argument and error checking, etc, using modulate() as a template.

Thanks,
Jesse

Re: [wand] Adding new methods to Image

From:
Hong Minhee
Date:
2013-10-25 @ 02:44
Feel free to send patches!

Thanks,
Minhee

On Oct 25, 2013, at 6:31 AM, Jesse Pavel <jpavel@alum.mit.edu> wrote:

> Hello,
> 
> I'd like to add some missing methods to the Image class. For instance, 
for the MagickWand function
> 
> MagickBooleanType MagickBrightnessContrastImage(MagickWand *wand,
>     const double brightness,const double contrast)
> 
> is it as simple as
> 
> 1. adding to the appropriate section of api.py
> 
>     library.MagickBrightnessContrast Image.argtypes = [ctypes.c_void_p,
>                                                        ctypes.c_double,
>                                                        ctypes.c_double]
> 
> 2. adding a more pleasant method to image.py that calls the api, 
performs argument and error checking, etc, using modulate() as a template.
> 
> Thanks,
> Jesse
>