You are here

function image_imagick_convolve in Imagick 7

Image effect form callback for the convolve image format effect.

Parameters

array $data: The current configuration for this image effect.

Return value

array The form definition for this effect.

File

effects/imagick.convolve.inc, line 12

Code

function image_imagick_convolve(stdClass $image, $kernel, $label) {
  $matrix = [];
  foreach (new RecursiveIteratorIterator(new RecursiveArrayIterator($kernel)) as $value) {
    $matrix[] = $value;
  }
  return $image->resource
    ->convolveImage($matrix);
}