예제 #1
0
파일: Emboss.php 프로젝트: pyrsmk/imagix
 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
0
파일: Sharpen.php 프로젝트: pyrsmk/imagix
 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
0
파일: Enhance.php 프로젝트: pyrsmk/imagix
 public function apply($resource)
 {
     return parent::apply($resource, array(0, -2, 0, -2, 20, -2, 0, -2, 0));
 }