Polaroid.php in Imagick 8
File
src/Plugin/ImageToolkit/Operation/imagick/Polaroid.php
View source
<?php
namespace Drupal\imagick\Plugin\ImageToolkit\Operation\imagick;
use Imagick;
use ImagickDraw;
class Polaroid extends ImagickOperationBase {
protected function arguments() {
return [
'angle' => [
'description' => 'The angle of the polaroid effect.',
],
];
}
protected function process(Imagick $resource, array $arguments) {
$angle = $arguments['angle'];
if (empty($angle)) {
$angle = mt_rand(-30, 30);
}
return $resource
->polaroidImage(new ImagickDraw(), $angle);
}
}
Classes
Name |
Description |
Polaroid |
Defines imagick oilpaint operation. |