You are here

function imagick_blur_form in Imagick 7

Settings form for the imagick blur effect.

Parameters

$action: The saved action form parameters.

1 string reference to 'imagick_blur_form'
imagick_image_effect_info in ./imagick.module
Implements hook_image_effect_info()

File

effects/imagick.blur.inc, line 64

Code

function imagick_blur_form($data) {
  $data = array_merge(imagick_blur_defaults(), (array) $data);
  $form['type'] = array(
    '#type' => 'select',
    '#title' => t('Blur type'),
    '#options' => array(
      NORMAL_BLUR => t('Normal'),
      ADAPTIVE_BLUR => t('Adaptive'),
      GAUSSIAN_BLUR => t('Gaussian'),
      MOTION_BLUR => t('Motion'),
      RADIAL_BLUR => t('Radial'),
    ),
    '#default_value' => $data['type'],
  );
  $form['radius'] = array(
    '#type' => 'textfield',
    '#title' => t('Radius'),
    '#description' => t('The radius of the Gaussian, in pixels, not counting the center pixel.'),
    '#default_value' => $data['radius'],
    '#size' => 3,
    '#states' => array(
      'invisible' => array(
        ':input[name="data[type]"]' => array(
          'value' => RADIAL_BLUR,
        ),
      ),
    ),
  );
  $form['sigma'] = array(
    '#type' => 'textfield',
    '#title' => t('Sigma'),
    '#description' => t('The standard deviation of the Gaussian, in pixels'),
    '#default_value' => $data['sigma'],
    '#size' => 3,
    '#states' => array(
      'invisible' => array(
        ':input[name="data[type]"]' => array(
          'value' => RADIAL_BLUR,
        ),
      ),
    ),
  );
  $form['angle'] = array(
    '#type' => 'textfield',
    '#title' => t('Angle'),
    '#description' => t('The angle of the blur'),
    '#default_value' => $data['angle'],
    '#size' => 3,
    '#states' => array(
      'visible' => array(
        ':input[name="data[type]"]' => array(
          array(
            'value' => MOTION_BLUR,
          ),
          array(
            'value' => RADIAL_BLUR,
          ),
        ),
      ),
    ),
  );
  return $form;
}