imagick.noise.inc in Imagick 7
File
effects/imagick.noise.inc
View source
<?php
function image_imagick_noise(stdClass $image, $type) {
return $image->resource
->addNoiseImage($type);
}
function imagick_noise($image, $data = array()) {
image_toolkit_invoke('noise', $image, $data);
}
function imagick_noise_form($data) {
$data = array_merge(imagick_noise_defaults(), (array) $data);
$form['type'] = array(
'#type' => 'select',
'#title' => t('Noise type'),
'#options' => array(
imagick::NOISE_UNIFORM => t('Uniform'),
imagick::NOISE_GAUSSIAN => t('Gaussian'),
imagick::NOISE_MULTIPLICATIVEGAUSSIAN => t('Multiplicative gaussian'),
imagick::NOISE_IMPULSE => t('Impulse'),
imagick::NOISE_LAPLACIAN => t('Laplacian'),
imagick::NOISE_POISSON => t('Poisson'),
imagick::NOISE_RANDOM => t('Random'),
),
'#default_value' => $data['type'],
);
return $form;
}
function imagick_noise_defaults() {
return array(
'type' => imagick::NOISE_UNIFORM,
);
}