You are here

class Contrast in Image Effects 8

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

Defines ImageMagick Contrast operation.

Plugin annotation


@ImageToolkitOperation(
  id = "image_effects_imagemagick_contrast",
  toolkit = "imagemagick",
  operation = "contrast",
  label = @Translation("Contrast"),
  description = @Translation("Adjust image contrast.")
)

Hierarchy

  • class \Drupal\image_effects\Plugin\ImageToolkit\Operation\imagemagick\Contrast extends \Drupal\imagemagick\Plugin\ImageToolkit\Operation\imagemagick\ImagemagickImageToolkitOperationBase uses ContrastTrait

Expanded class hierarchy of Contrast

1 string reference to 'Contrast'
ContrastImageEffect::buildConfigurationForm in src/Plugin/ImageEffect/ContrastImageEffect.php
Form constructor.

File

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

Namespace

Drupal\image_effects\Plugin\ImageToolkit\Operation\imagemagick
View source
class Contrast extends ImagemagickImageToolkitOperationBase {
  use ContrastTrait;

  /**
   * {@inheritdoc}
   */
  protected function execute(array $arguments) {
    if ($arguments['level']) {
      $this
        ->getToolkit()
        ->addArgument('-brightness-contrast ' . $this
        ->getToolkit()
        ->escapeShellArg('0x' . $arguments['level']));
    }
    return TRUE;
  }

}

Members