You are here

class Mirror in Image Effects 8.3

Same name in this branch
  1. 8.3 src/Plugin/ImageToolkit/Operation/gd/Mirror.php \Drupal\image_effects\Plugin\ImageToolkit\Operation\gd\Mirror
  2. 8.3 src/Plugin/ImageToolkit/Operation/imagemagick/Mirror.php \Drupal\image_effects\Plugin\ImageToolkit\Operation\imagemagick\Mirror
Same name and namespace in other branches
  1. 8 src/Plugin/ImageToolkit/Operation/imagemagick/Mirror.php \Drupal\image_effects\Plugin\ImageToolkit\Operation\imagemagick\Mirror
  2. 8.2 src/Plugin/ImageToolkit/Operation/imagemagick/Mirror.php \Drupal\image_effects\Plugin\ImageToolkit\Operation\imagemagick\Mirror

Defines ImageMagick Mirror operation.

Plugin annotation


@ImageToolkitOperation(
  id = "image_effects_imagemagick_mirror",
  toolkit = "imagemagick",
  operation = "mirror",
  label = @Translation("Mirror"),
  description = @Translation("Mirror the image horizontally and/or vertically.")
)

Hierarchy

  • class \Drupal\image_effects\Plugin\ImageToolkit\Operation\imagemagick\Mirror extends \Drupal\imagemagick\Plugin\ImageToolkit\Operation\imagemagick\ImagemagickImageToolkitOperationBase uses MirrorTrait

Expanded class hierarchy of Mirror

File

src/Plugin/ImageToolkit/Operation/imagemagick/Mirror.php, line 19

Namespace

Drupal\image_effects\Plugin\ImageToolkit\Operation\imagemagick
View source
class Mirror extends ImagemagickImageToolkitOperationBase {
  use MirrorTrait;

  /**
   * {@inheritdoc}
   */
  protected function execute(array $arguments) {
    if ($arguments['x_axis'] === TRUE) {
      $this
        ->addArgument("-flop");
    }
    if ($arguments['y_axis'] === TRUE) {
      $this
        ->addArgument("-flip");
    }
    return TRUE;
  }

}

Members