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.pixel_iterator` --- Pixel-Iterator definitions 

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

3 

4.. versionadded:: 0.5.0 

5""" 

6from ctypes import POINTER, c_void_p, c_int, c_size_t 

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 Pixel Iterator 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/pixel-iterator.h" 

25 // Or 

26 #include "MagickWand/pixel-iterator.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.ClonePixelIterator.argtypes = [c_void_p] 

37 lib.ClonePixelIterator.restype = c_void_p 

38 lib.DestroyPixelIterator.argtypes = [c_void_p] 

39 lib.DestroyPixelIterator.restype = c_void_p 

40 lib.IsPixelIterator.argtypes = [c_void_p] 

41 lib.NewPixelIterator.argtypes = [c_void_p] 

42 lib.NewPixelIterator.restype = c_void_p 

43 lib.PixelClearIteratorException.argtypes = [c_void_p] 

44 lib.PixelGetIteratorException.argtypes = [c_void_p, POINTER(c_int)] 

45 lib.PixelGetIteratorException.restype = c_magick_char_p 

46 lib.PixelGetNextIteratorRow.argtypes = [c_void_p, POINTER(c_size_t)] 

47 lib.PixelGetNextIteratorRow.restype = POINTER(c_void_p) 

48 lib.PixelSetFirstIteratorRow.argtypes = [c_void_p] 

49 lib.PixelSetIteratorRow.argtypes = [c_void_p, c_ssize_t]