Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1""":mod:`wand.cdefs.magick_wand` --- Magick-Wand definitions 

2~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

3 

4.. versionadded:: 0.5.0 

5""" 

6from ctypes import POINTER, c_void_p, c_bool, c_int 

7from wand.cdefs.wandtypes import c_ssize_t, c_magick_char_p 

8 

9__all__ = ('load',) 

10 

11 

12def load(lib, IM_VERSION): 

13 """Define Magick Wand methods. The ImageMagick version is given as 

14 a second argument for comparison. This will quick to determine which 

15 methods are available from the library, and can be implemented as:: 

16 

17 if IM_VERSION < 0x700: 

18 # ... do ImageMagick-6 methods ... 

19 else 

20 # ... do ImageMagick-7 methods ... 

21 

22 .. seealso:: 

23 

24 #include "wand/magick-wand.h" 

25 // Or 

26 #include "MagickWand/magick-wand.h" 

27 

28 :param lib: the loaded ``MagickWand`` library 

29 :type lib: :class:`ctypes.CDLL` 

30 :param IM_VERSION: the ImageMagick version number (i.e. 0x0689) 

31 :type IM_VERSION: :class:`numbers.Integral` 

32 

33 .. versionadded:: 0.5.0 

34 

35 """ 

36 lib.ClearMagickWand.argtypes = [c_void_p] 

37 lib.CloneMagickWand.argtypes = [c_void_p] 

38 lib.CloneMagickWand.restype = c_void_p 

39 lib.DestroyMagickWand.argtypes = [c_void_p] 

40 lib.DestroyMagickWand.restype = c_void_p 

41 lib.IsMagickWand.argtypes = [c_void_p] 

42 try: 

43 lib.IsMagickWandInstantiated.argtypes = [] 

44 lib.IsMagickWandInstantiated.restype = c_bool 

45 except AttributeError: 

46 lib.IsMagickWandInstantiated = None 

47 pass 

48 lib.MagickClearException.argtypes = [c_void_p] 

49 lib.MagickGetException.argtypes = [c_void_p, POINTER(c_int)] 

50 lib.MagickGetException.restype = c_magick_char_p 

51 lib.MagickGetExceptionType.argtypes = [c_void_p] 

52 lib.MagickGetExceptionType.restype = c_int 

53 lib.MagickGetIteratorIndex.argtypes = [c_void_p] 

54 lib.MagickGetIteratorIndex.restype = c_ssize_t 

55 lib.MagickRelinquishMemory.argtypes = [c_void_p] 

56 lib.MagickRelinquishMemory.restype = c_void_p 

57 lib.MagickResetIterator.argtypes = [c_void_p] 

58 lib.MagickSetFirstIterator.argtypes = [c_void_p] 

59 lib.MagickSetIteratorIndex.argtypes = [c_void_p, c_ssize_t] 

60 lib.MagickSetLastIterator.argtypes = [c_void_p] 

61 lib.MagickWandGenesis.argtypes = [] 

62 lib.MagickWandTerminus.argtypes = [] 

63 lib.NewMagickWandFromImage.argtypes = [c_void_p] 

64 lib.NewMagickWandFromImage.restype = c_void_p 

65 lib.NewMagickWand.argtypes = [] 

66 lib.NewMagickWand.restype = c_void_p