本文整理汇总了PHP中Matrix::apply方法的典型用法代码示例。如果您正苦于以下问题:PHP Matrix::apply方法的具体用法?PHP Matrix::apply怎么用?PHP Matrix::apply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix
的用法示例。
在下文中一共展示了Matrix::apply方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: apply
public function apply($resource)
{
@(list(, $method) = func_get_args());
switch ($method) {
case self::FILTER:
if (!function_exists('imagefilter')) {
throw new Exception("It seems your PHP version is not compiled with the bundled version of the GD library");
}
if (!imagefilter($resource, IMG_FILTER_EMBOSS)) {
throw new Exception("EMBOSS filter failed");
}
return $resource;
case self::MATRIX:
default:
return parent::apply($resource, array(-2, -1, 0, -1, 1, 1, 0, 1, 2));
}
}
示例2: apply
public function apply($resource)
{
@(list(, $method) = func_get_args());
switch ($method) {
case self::FILTER:
if (!function_exists('imagefilter')) {
throw new Exception("It seems your PHP version is not compiled with the bundled version of the GD library, therefore you cannot use this graphic effect");
}
if (!imagefilter($resource, IMG_FILTER_MEAN_REMOVAL)) {
throw new Exception("MEAN_REMOVAL filter failed");
}
return $resource;
case self::MATRIX:
default:
return parent::apply(func_get_arg(0), array(0, -1, 0, -1, 5, -1, 0, -1, 0));
}
}
示例3: apply
public function apply($resource)
{
return parent::apply($resource, array(0, -2, 0, -2, 20, -2, 0, -2, 0));
}