You are here

class DrawEllipse in Image Effects 8.3

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

Defines ImageMagick draw ellipse operation.

Plugin annotation


@ImageToolkitOperation(
  id = "image_effects_imagemagick_draw_ellipse",
  toolkit = "imagemagick",
  operation = "draw_ellipse",
  label = @Translation("Draw ellipse"),
  description = @Translation("Draws on the image an ellipse of the specified color.")
)

Hierarchy

  • class \Drupal\image_effects\Plugin\ImageToolkit\Operation\imagemagick\DrawEllipse extends \Drupal\imagemagick\Plugin\ImageToolkit\Operation\imagemagick\ImagemagickImageToolkitOperationBase uses DrawEllipseTrait

Expanded class hierarchy of DrawEllipse

File

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

Namespace

Drupal\image_effects\Plugin\ImageToolkit\Operation\imagemagick
View source
class DrawEllipse extends ImagemagickImageToolkitOperationBase {
  use DrawEllipseTrait;

  /**
   * {@inheritdoc}
   */
  protected function execute(array $arguments) {
    $arg = '';
    $arg .= '-fill ' . $this
      ->escapeArgument($arguments['color']);
    $this
      ->addArgument($arg . ' -draw ' . $this
      ->escapeArgument("ellipse {$arguments['cx']},{$arguments['cy']} {$arguments['width']},{$arguments['height']} 0,360"));
    return TRUE;
  }

}

Members