Imbo\Image\Transformation\Blur::transform PHP Method

transform() public method

Transform the image
public transform ( Imbo\EventManager\EventInterface $event )
$event Imbo\EventManager\EventInterface The event instance
    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);
        }
    }