You are here

protected function Blur::process in Imagick 8

File

src/Plugin/ImageToolkit/Operation/imagick/Blur.php, line 44

Class

Blur
Defines imagick blur operation.

Namespace

Drupal\imagick\Plugin\ImageToolkit\Operation\imagick

Code

protected function process(Imagick $resource, array $arguments) {
  switch ($arguments['type']) {
    case ImagickConst::NORMAL_BLUR:
      return $resource
        ->blurImage($arguments['radius'], $arguments['sigma']);
      break;
    case ImagickConst::ADAPTIVE_BLUR:
      return $resource
        ->adaptiveBlurImage($arguments['radius'], $arguments['sigma']);
      break;
    case ImagickConst::GAUSSIAN_BLUR:
      return $resource
        ->gaussianBlurImage($arguments['radius'], $arguments['sigma']);
      break;
    case ImagickConst::MOTION_BLUR:
      return $resource
        ->motionBlurImage($arguments['radius'], $arguments['sigma'], $arguments['angle']);
      break;
    case ImagickConst::RADIAL_BLUR:
      return $resource
        ->radialBlurImage($arguments['angle']);
      break;
  }
}