ImagickKernel::getMatrix

(PECL imagick >= 3.3.0)

ImagickKernel::getMatrix — Renvoie la matrice 2D des valeurs utilisĂ©es dans ce noyau

Description

public function ImagickKernel::getMatrix(): array

Renvoie la matrice 2D des valeurs utilisĂ©es dans ce noyau. Les Ă©lĂ©ments sont soit des flottants pour les Ă©lĂ©ments qui sont utilisĂ©s, soit 'false' si l'Ă©lĂ©ment doit ĂȘtre ignorĂ©.

Liste de paramĂštres

Cette fonction ne contient aucun paramĂštre.

Valeurs de retour

Une matrice (tableau 2D) des valeurs qui représentent le noyau.

Exemples

Exemple #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 = "The built-in kernel name 'ring' with parameters of '2,3.5':<br/>";
    $kernel = \ImagickKernel::fromBuiltIn(
        \Imagick::KERNEL_RING,
        "2,3.5"
    );
    $matrix = $kernel->getMatrix();
    $output .= renderKernelTable($matrix);

    echo $output;

?>
add a note

User Contributed Notes

There are no user contributed notes for this page.