Safe Haskell | None |
---|---|
Language | Haskell98 |
- magickWandGenesis :: IO ()
- magickWandTerminus :: IO ()
- newMagickWand :: IO (Ptr MagickWand)
- newMagickWandFromImage :: Ptr Image -> IO (Ptr MagickWand)
- cloneMagickWand :: Ptr MagickWand -> IO (Ptr MagickWand)
- clearMagickWand :: Ptr MagickWand -> IO ()
- destroyMagickWand :: Ptr MagickWand -> IO (Ptr MagickWand)
- pDestroyMagickWand :: FunPtr (Ptr MagickWand -> IO ())
- isMagicWand :: Ptr MagickWand -> IO MagickBooleanType
- magickClearException :: Ptr MagickWand -> IO MagickBooleanType
- magickGetException :: Ptr MagickWand -> Ptr ExceptionType -> IO CString
- magickGetExceptionType :: Ptr MagickWand -> IO ExceptionType
- magickGetIteratorIndex :: Ptr MagickWand -> IO CSize
- magickNextImage :: Ptr MagickWand -> IO MagickBooleanType
- magickPreviousImage :: Ptr MagickWand -> IO MagickBooleanType
- magickResizeImage :: Ptr MagickWand -> CSize -> CSize -> FilterTypes -> CDouble -> IO MagickBooleanType
- magickWriteImages :: Ptr MagickWand -> CString -> MagickBooleanType -> IO MagickBooleanType
- magickSetSize :: Ptr MagickWand -> CSize -> CSize -> IO MagickBooleanType
- magickGetSize :: Ptr MagickWand -> Ptr CSize -> Ptr CSize -> IO MagickBooleanType
- magickGaussianBlurImage :: Ptr MagickWand -> CDouble -> CDouble -> IO MagickBooleanType
- magickGaussianBlurImageChannel :: Ptr MagickWand -> ChannelType -> CDouble -> CDouble -> IO MagickBooleanType
- magickSetImageArtifact :: Ptr MagickWand -> CString -> CString -> IO MagickBooleanType
- magickDeleteImageArtifact :: Ptr MagickWand -> CString -> IO MagickBooleanType
- magickSetIteratorIndex :: Ptr MagickWand -> CSize -> IO MagickBooleanType
- magickResetIterator :: Ptr MagickWand -> IO ()
- magickSetFirstIterator :: Ptr MagickWand -> IO ()
- magickSetLastIterator :: Ptr MagickWand -> IO ()
- magickRelinquishMemory :: Ptr () -> IO ()
- magickGetColorspace :: Ptr MagickWand -> IO ColorspaceType
- magickSetColorspace :: Ptr MagickWand -> ColorspaceType -> IO MagickBooleanType
- magickGetCompressionQuality :: Ptr MagickWand -> IO CSize
- magickSetCompressionQuality :: Ptr MagickWand -> CSize -> IO MagickBooleanType
- magickGetCompression :: Ptr MagickWand -> IO CompressionType
- magickSetCompression :: Ptr MagickWand -> CompressionType -> IO MagickBooleanType
Documentation
magickWandGenesis :: IO ()
MagickWandGenesis() initializes the MagickWand environment.
magickWandTerminus :: IO ()
MagickWandTerminus() terminates the MagickWand environment.
Constructing magic wand
newMagickWand :: IO (Ptr MagickWand)
NewMagickWand() returns a wand required for all other methods in the API. A fatal exception is thrown if there is not enough memory to allocate the wand. Use DestroyMagickWand() to dispose of the wand when it is no longer needed.
:: Ptr Image | Image |
-> IO (Ptr MagickWand) |
NewMagickWandFromImage() returns a wand with an image.
cloneMagickWand :: Ptr MagickWand -> IO (Ptr MagickWand)
CloneMagickWand() makes an exact copy of the specified wand.
Clearing and destroying
clearMagickWand :: Ptr MagickWand -> IO ()
ClearMagickWand() clears resources associated with the wand, leaving the wand blank, and ready to be used for a new set of images.
destroyMagickWand :: Ptr MagickWand -> IO (Ptr MagickWand)
DestroyMagickWand() deallocates memory associated with an MagickWand.
pDestroyMagickWand :: FunPtr (Ptr MagickWand -> IO ())
Utilities
isMagicWand :: Ptr MagickWand -> IO MagickBooleanType
IsMagickWand() returns MagickTrue if the wand is verified as a magick wand.
Exceptions
magickClearException :: Ptr MagickWand -> IO MagickBooleanType
MagickClearException() clears any exceptions associated with the wand.
magickGetException :: Ptr MagickWand -> Ptr ExceptionType -> IO CString
MagickGetException() returns the severity, reason, and description of any error that occurs when using other methods in this API.
magickGetExceptionType :: Ptr MagickWand -> IO ExceptionType
MagickGetExceptionType() returns the exception type associated with the wand. If no exception has occurred, UndefinedExceptionType is returned.
magickGetIteratorIndex :: Ptr MagickWand -> IO CSize
MagickGetIteratorIndex() returns the position of the iterator in the image list.
Image functions
magickNextImage :: Ptr MagickWand -> IO MagickBooleanType
MagickNextImage() sets the next image in the wand as the current image. It is typically used after MagickResetIterator(), after which its first use will set the first image as the current image (unless the wand is empty).
It will return MagickFalse when no more images are left to be returned which happens when the wand is empty, or the current image is the last image.
When the above condition (end of image list) is reached, the iterator is automatically set so that you can start using MagickPreviousImage() to again iterate over the images in the reverse direction, starting with the last image (again). You can jump to this condition immeditally using MagickSetLastIterator().
magickPreviousImage :: Ptr MagickWand -> IO MagickBooleanType
MagickPreviousImage() sets the previous image in the wand as the current image.
It is typically used after MagickSetLastIterator(), after which its first use will set the last image as the current image (unless the wand is empty).
It will return MagickFalse when no more images are left to be returned which happens when the wand is empty, or the current image is the first image. At that point the iterator is than reset to again process images in the forward direction, again starting with the first image in list. Images added at this point are prepended.
Also at that point any images added to the wand using MagickAddImages() or MagickReadImages() will be prepended before the first image. In this sense the condition is not quite exactly the same as MagickResetIterator().
:: Ptr MagickWand | |
-> CSize | the number of columns in the scaled image |
-> CSize | the number of rows in the scaled image |
-> FilterTypes | filter |
-> CDouble | blur factor where 1 > blurry, < 1 sharp |
-> IO MagickBooleanType |
MagickResizeImage() scales an image to the desired dimensions with one of these filters:
Most of the filters are FIR (finite impulse response), however, Bessel, Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc are windowed (brought down to zero) with the Blackman filter.
:: Ptr MagickWand | |
-> CString | filename |
-> MagickBooleanType | join images into a single multi-image file. |
-> IO MagickBooleanType |
MagickWriteImages() writes an image or image sequence.
:: Ptr MagickWand | |
-> CSize | columns |
-> CSize | rows |
-> IO MagickBooleanType |
MagickSetSize() sets the size of the magick wand. Set it before you read a raw image format such as RGB, GRAY, or CMYK.
:: Ptr MagickWand | |
-> Ptr CSize | the width in pixels |
-> Ptr CSize | the height in pixels |
-> IO MagickBooleanType |
MagickGetSize() returns the size associated with the magick wand.
:: Ptr MagickWand | |
-> CDouble | radius |
-> CDouble | sigma |
-> IO MagickBooleanType |
MagickGaussianBlurImage() blurs an image. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, the radius should be larger than sigma. Use a radius of 0 and MagickGaussianBlurImage() selects a suitable radius for you.
magickGaussianBlurImageChannel
:: Ptr MagickWand | |
-> ChannelType | |
-> CDouble | radius |
-> CDouble | sigma |
-> IO MagickBooleanType |
magickSetImageArtifact :: Ptr MagickWand -> CString -> CString -> IO MagickBooleanType
MagickSetImageArtifact() associates a artifact with an image. The format of the MagickSetImageArtifact method is:
magickDeleteImageArtifact :: Ptr MagickWand -> CString -> IO MagickBooleanType
MagickDeleteImageArtifact() deletes a wand artifact.
:: Ptr MagickWand | |
-> CSize | the scene number |
-> IO MagickBooleanType |
MagickSetIteratorIndex() set the iterator to the given position in the image list specified with the index parameter. A zero index will set the first image as current, and so on. Negative indexes can be used to specify an image relative to the end of the images in the wand, with -1 being the last image in the wand.
If the index is invalid (range too large for number of images in
wand) the function will return MagickFalse, but no exception
will
be raised, as it is not actually an error. In that case the current
image will not change.
After using any images added to the wand using magickAddImage
or
magickReadImage
will be added after the image indexed, regardless
of if a zero (first image in list) or negative index (from end)
is used.
Jumping to index 0 is similar to magickResetIterator
but differs
in how magickNextImage
behaves afterward.
magickResetIterator :: Ptr MagickWand -> IO ()
MagickResetIterator() resets the wand iterator.
It is typically used either before iterating though images, or
before calling specific functions such as magickAppendImages
to append all images together.
Afterward you can use magickNextImage
to iterate over all the
images in a wand container, starting with the first image.
Using this before magickAddImages
or magickReadImages
will
cause new images to be inserted between the first and second image.
magickSetFirstIterator :: Ptr MagickWand -> IO ()
MagickSetLastIterator() sets the wand iterator to the last image. The last image is actually the current image, and the next use of MagickPreviousImage() will not change this allowing this function to be used to iterate over the images in the reverse direction. In this sense it is more like MagickResetIterator() than MagickSetFirstIterator(). Typically this function is used before MagickAddImage(), MagickReadImage() functions to ensure new images are appended to the very end of wand's image list.
magickSetLastIterator :: Ptr MagickWand -> IO ()
MagickSetFirstIterator() sets the wand iterator to the first image. After using any images added to the wand using MagickAddImage() or MagickReadImage() will be prepended before any image in the wand. Also the current image has been set to the first image (if any) in the Magick Wand. Using MagickNextImage() will then set teh current image to the second image in the list (if present). This operation is similar to MagickResetIterator() but differs in how MagickAddImage(), MagickReadImage(), and MagickNextImage() behaves afterward.
magickRelinquishMemory :: Ptr () -> IO ()
MagickRelinquishMemory() relinquishes memory resources returned by such methods as MagickIdentifyImage(), MagickGetException(), etc.