CascadiaPHP 2024


(PECL imagick >= 3.3.0)

ImagickKernel::getMatrixGet the 2d matrix of values used in this kernel


public ImagickKernel::getMatrix(): array

Get the 2d matrix of values used in this kernel. The elements are either float for elements that are used or 'false' if the element should be skipped.

Bağımsız Değişkenler

Bu işlevin bağımsız değişkeni yoktur.

Dönen Değerler

A matrix (2d array) of the values that represent the kernel.


Örnek 1 ImagickKernel::getMatrix()


function renderKernelTable($matrix) {
$output = "<table class='infoTable'>";

foreach (
$matrix as $row) {
$output .= "<tr>";
foreach (
$row as $cell) {
$output .= "<td style='text-align:left'>";
if (
$cell === false) {
$output .= "false";
else {
$output .= round($cell, 3);
$output .= "</td>";
$output .= "</tr>";

$output .= "</table>";


$output = "The built-in kernel name 'ring' with parameters of '2,3.5':<br/>";
$kernel = \ImagickKernel::fromBuiltIn(
$matrix = $kernel->getMatrix();
$output .= renderKernelTable($matrix);



add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top