(PECL imagick >= 3.3.0)
ImagickKernel::getMatrix — 取得此核心使用的二維值矩陣
此函式沒有參數。
一個表示核心的值的矩陣(二維陣列)。
範例 #1 ImagickKernel::getMatrix()
<?php
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>";
return $output;
}
$output = "使用參數 '2,3.5' 的內建核心名稱 'ring':<br/>";
$kernel = \ImagickKernel::fromBuiltIn(
\Imagick::KERNEL_RING,
"2,3.5"
);
$matrix = $kernel->getMatrix();
$output .= renderKernelTable($matrix);
echo $output;
?>