You are here

public static function GdGaussianBlur::applyCoeffs in Image Effects 8

Same name and namespace in other branches
  1. 8.3 src/Component/GdGaussianBlur.php \Drupal\image_effects\Component\GdGaussianBlur::applyCoeffs()
  2. 8.2 src/Component/GdGaussianBlur.php \Drupal\image_effects\Component\GdGaussianBlur::applyCoeffs()

Applies the Gaussian coefficients to the destination image.

Parameters

resource $src: The source image resource.

resource $dst: The destination image resource.

float[] $coeffs: The array of coefficients to use for the blur.

int $radius: The radius of the blur.

string $axis: The direction of the blur.

1 call to GdGaussianBlur::applyCoeffs()
GDOperationTrait::imageCopyGaussianBlurred in src/Plugin/ImageToolkit/Operation/gd/GDOperationTrait.php
Gets a copy of the source with the Gaussian Blur algorithm applied.

File

src/Component/GdGaussianBlur.php, line 68

Class

GdGaussianBlur
Gaussian Blur helper methods for GD.

Namespace

Drupal\image_effects\Component

Code

public static function applyCoeffs($src, $dst, array $coeffs, $radius, $axis) {
  if ($axis === 'HORIZONTAL') {
    $numlines = imagesy($src);
    $linelen = imagesx($src);
  }
  else {
    $numlines = imagesx($src);
    $linelen = imagesy($src);
  }
  for ($line = 0; $line < $numlines; $line++) {
    static::applyCoeffsLine($src, $dst, $line, $linelen, $coeffs, $radius, $axis);
  }
}