當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ImageInterface::effects方法代碼示例

本文整理匯總了PHP中Imagine\Image\ImageInterface::effects方法的典型用法代碼示例。如果您正苦於以下問題:PHP ImageInterface::effects方法的具體用法?PHP ImageInterface::effects怎麽用?PHP ImageInterface::effects使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Imagine\Image\ImageInterface的用法示例。


在下文中一共展示了ImageInterface::effects方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: imageBlur

 /**
  * Command image blur
  * 
  * @param float $sigma
  * 
  * @return void
  */
 protected function imageBlur($sigma = 1)
 {
     $sigma = (double) $sigma;
     $this->image->effects()->blur($sigma);
 }
開發者ID:dgram,項目名稱:zf2-imageresizer,代碼行數:12,代碼來源:ImageProcessing.php

示例2: load

 public function load(ImageInterface $image, array $options = array())
 {
     $image->effects()->grayscale();
     return $image;
 }
開發者ID:CG77,項目名稱:ezpublish-kernel,代碼行數:5,代碼來源:GrayscaleFilterLoader.php

示例3: applyEffect

 /**
  * Применяет эффект к изображению.
  * @param ImageInterface $Image
  * @param string $effect
  * @param string $additional
  * @return bool
  */
 private function applyEffect(ImageInterface $Image, $effect, $additional = null)
 {
     switch ($effect) {
         case 'resize':
             if (!isset($additional['width']) || !isset($additional['height'])) {
                 return false;
             }
             $Image->resize(new Box($additional['width'], $additional['height']));
             break;
         case 'origin':
             break;
         case 'negative':
             $Image->effects()->negative();
             break;
         case 'grayscale':
             $Image->effects()->grayscale();
             break;
         case 'sharpen':
             $Image->effects()->sharpen();
             break;
         case 'colorize':
             $Image->effects()->colorize($Image->palette()->color($additional));
             break;
         case 'gamma':
             $Image->effects()->gamma($additional);
             break;
         case 'blur':
             $Image->effects()->blur($additional);
             break;
         default:
             return false;
     }
     return true;
 }
開發者ID:andrei2nikitin,項目名稱:quiz,代碼行數:41,代碼來源:MainPage.php

示例4: filterColorize

 /**
  * Apply colorize filter
  *
  * @param  ImageInterface	$image An image instance
  * @param  string			$color The hex value of the color
  * @return void
  */
 protected function filterColorize(ImageInterface $image, $color)
 {
     $color = $image->palette()->color($color);
     $image->effects()->colorize($color);
     return $image;
 }
開發者ID:sonjoysam,項目名稱:laravel-image,代碼行數:13,代碼來源:ImageManager.php

示例5: applyColorizeFilter

 /**
  * @param \Imagine\Image\ImageInterface $image
  * @param array $options
  * @return \Imagine\Image\ImageInterface
  */
 protected function applyColorizeFilter(ImageInterface $image, $options)
 {
     if (isset($options['color'])) {
         $color = $image->palette()->color($options['color']);
         $image->effects()->colorize($color);
     }
     return $image;
 }
開發者ID:getherbie,項目名稱:plugin-imagine,代碼行數:13,代碼來源:ImagineExtension.php

示例6: applyEffect

 /**
  * Применяет эффект к изображению.
  * @param ImageInterface $Image
  * @param string $effect
  * @param string $additional
  * @return bool
  */
 private function applyEffect(ImageInterface $Image, $effect, $additional = null)
 {
     switch ($effect) {
         case 'origin':
             break;
         case 'negative':
             $Image->effects()->negative();
             break;
         case 'grayscale':
             $Image->effects()->grayscale();
             break;
         case 'sharpen':
             $Image->effects()->sharpen();
             break;
         case 'colorize':
             $Image->effects()->colorize($Image->palette()->color($additional));
             break;
         case 'gamma':
             $Image->effects()->gamma($additional);
             break;
         case 'blur':
             $Image->effects()->blur($additional);
             break;
         default:
             return false;
     }
     return true;
 }
開發者ID:andrey-mostovoy,項目名稱:photoems,代碼行數:35,代碼來源:MainLandingPage.php


注:本文中的Imagine\Image\ImageInterface::effects方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。