Convolve.php in Imagick 8
File
src/Plugin/ImageToolkit/Operation/imagick/Convolve.php
View source
<?php
namespace Drupal\imagick\Plugin\ImageToolkit\Operation\imagick;
use Imagick;
use ImagickKernel;
class Convolve extends ImagickOperationBase {
protected function arguments() {
return [
'matrix' => [
'description' => 'The convolution matrix.',
],
];
}
protected function process(Imagick $resource, array $arguments) {
$matrix = $arguments['matrix']['entries'];
array_walk_recursive($matrix, function (&$value) {
$value = (int) $value;
});
return $resource
->convolveImage(ImagickKernel::fromMatrix($matrix));
}
}
Classes
Name |
Description |
Convolve |
Defines imagick sharpen operation. |