magickMorphologyImage method

Future<bool> magickMorphologyImage({
  1. required MorphologyMethod method,
  2. required int iterations,
  3. required KernelInfo kernel,
})

MagickMorphologyImage() applies a user supplied kernel to the image according to the given morphology method.

This method runs inside an isolate different from the main isolate.

Sending invalid parameters will cause an invalid state and may crash the app, so you should make sure to validate the input to this method.

  • method: the morphology method to be applied.
  • iterations: apply the operation this many times (or no change). A value of -1 means loop until no change found. How this is applied may depend on the morphology method. Typically this is a value of 1.
  • kernel: An array of doubles representing the morphology kernel.

Implementation

Future<bool> magickMorphologyImage({
  required MorphologyMethod method,
  required int iterations,
  required KernelInfo kernel,
}) async =>
    await _magickCompute(
      _magickMorphologyImage,
      _MagickMorphologyImageParams(
        _wandPtr.address,
        method,
        iterations,
        kernel,
      ),
    );