public function transform(EventInterface $event)
{
$params = $event->getArgument('params');
$type = isset($params['type']) ? $params['type'] : 'gaussian';
$blurTypes = ['gaussian', 'adaptive', 'motion', 'radial'];
if (!in_array($type, $blurTypes)) {
throw new TransformationException('Unknown blur type: ' . $type, 400);
}
switch ($type) {
case 'motion':
return $this->motionBlur($event);
case 'radial':
return $this->radialBlur($event);
case 'adaptive':
return $this->blur($event, true);
default:
return $this->blur($event);
}
}