note 100081 deleted from function.imageconvolution by danbrown

From: Date: Tue, 28 Sep 2010 15:44:50 +0000
Subject: note 100081 deleted from function.imageconvolution by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-172775@lists.php.net to get a copy of this message
Note Submitter: arthur at kuhrmeier dot name ---- Relating to the two post before, here is the slimmed version of the ConvolutionFilter function: <?php class ConvolutionFilter { public $matrix; public $div; public function computeDiv() { $this->div = array_sum(array_map('array_sum', $matrix)); } function __construct() { $matrix = func_get_args(); $this->matrix = array_chunk($matrix, 3); $this->computeDiv(); } } ?> I replaced "computeDiv" with phunction.sf.net's suggestions and simplified the construct of the 3x3 matrix by using "array_chunk". So fabien dot snauwaert's function looks quite polished ;-)

« previous php.notes (#172775) next »