571d133ab87a696b7764d27b4bfc6b6784fe5479
[yaffs-website] / web / modules / contrib / imagemagick / src / Plugin / ImageToolkit / Operation / imagemagick / Desaturate.php
1 <?php
2
3 namespace Drupal\imagemagick\Plugin\ImageToolkit\Operation\imagemagick;
4
5 /**
6  * Defines imagemagick Desaturate operation.
7  *
8  * @ImageToolkitOperation(
9  *   id = "imagemagick_desaturate",
10  *   toolkit = "imagemagick",
11  *   operation = "desaturate",
12  *   label = @Translation("Desaturate"),
13  *   description = @Translation("Converts an image to grayscale.")
14  * )
15  */
16 class Desaturate extends ImagemagickImageToolkitOperationBase {
17
18   /**
19    * {@inheritdoc}
20    */
21   protected function arguments() {
22     // This operation does not use any parameters.
23     return [];
24   }
25
26   /**
27    * {@inheritdoc}
28    */
29   protected function execute(array $arguments) {
30     $this->getToolkit()->addArgument('-colorspace GRAY');
31     return TRUE;
32   }
33
34 }