View source
<?php
function image_imagick_sketch(stdClass $image, $radius, $sigma, $angle) {
return $image->resource
->sketchImage($radius, $sigma, $angle);
}
function imagick_sketch($image, $data = array()) {
image_toolkit_invoke('sketch', $image, $data);
}
function imagick_sketch_form($data) {
$data = array_merge(imagick_sketch_defaults(), (array) $data);
$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,
);
$form['sigma'] = array(
'#type' => 'textfield',
'#title' => t('Sigma'),
'#description' => t('The standard deviation of the Gaussian, in pixels'),
'#default_value' => $data['sigma'],
'#size' => 3,
);
$form['angle'] = array(
'#type' => 'textfield',
'#title' => t('Angle'),
'#description' => t('Apply the effect along this angle.'),
'#default_value' => $data['angle'],
'#size' => 3,
);
return $form;
}
function imagick_sketch_defaults() {
return array(
'radius' => '8',
'sigma' => '8',
'angle' => '0',
);
}