当前位置: 首页>>代码示例>>PHP>>正文


PHP WideImage_Image类代码示例

本文整理汇总了PHP中WideImage_Image的典型用法代码示例。如果您正苦于以下问题:PHP WideImage_Image类的具体用法?PHP WideImage_Image怎么用?PHP WideImage_Image使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了WideImage_Image类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 /**
  * Returns rotated image
  *
  * @param WideImage_Image $image
  * @param numeric $angle
  * @param int $bgColor
  * @param bool $ignoreTransparent
  * @return WideImage_Image
  */
 function execute($image, $angle, $bgColor, $ignoreTransparent)
 {
     $angle = -floatval($angle);
     if ($angle < 0) {
         $angle = 360 + $angle;
     }
     $angle = $angle % 360;
     if ($angle == 0) {
         return $image->copy();
     }
     if ($bgColor === null) {
         if ($image->isTransparent()) {
             $bgColor = $image->getTransparentColor();
         } else {
             $tc = array('red' => 255, 'green' => 255, 'blue' => 255, 'alpha' => 127);
             if ($image->isTrueColor()) {
                 $bgColor = $image->getExactColorAlpha($tc);
                 if ($bgColor == -1) {
                     $bgColor = $image->allocateColorAlpha($tc);
                 }
             } else {
                 $bgColor = $image->getExactColor($tc);
                 if ($bgColor == -1) {
                     $bgColor = $image->allocateColor($tc);
                 }
             }
         }
     }
     return new WideImage_TrueColorImage(imagerotate($image->getHandle(), $angle, $bgColor, $ignoreTransparent));
 }
开发者ID:eduardosilvapereira,项目名称:mcja,代码行数:39,代码来源:Rotate.php

示例2:

 /**
  * Apply the manipulation with the setup options to the passed in image.
  * This does not do any memory manipulation
  *
  * @param WideImage_Image $image
  * @return WideImage_Image
  */
 public function &apply(WideImage_Image &$image)
 {
     if (!$this->isSetup()) {
         throw new RokGallery_Manipulation_Exception(rc__('ROKGALLERY_MANIPULATION_WAS_NOT_SETUP_PRIOR_TO_APPLYING'));
     }
     $return_image = $image->resize($this->width, $this->height);
     return $return_image;
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:15,代码来源:Resize.php

示例3: execute

 /**
  * Executes imagegammacorrect()
  *
  * @param WideImage_Image $image
  * @param numeric $input_gamma
  * @param numeric $output_gamma
  * @return WideImage_TrueColorImage
  */
 function execute($image, $input_gamma, $output_gamma)
 {
     $new = $image->copy();
     if (!imagegammacorrect($new->getHandle(), $input_gamma, $output_gamma)) {
         throw new WideImage_GDFunctionResultException("imagegammacorrect() returned false");
     }
     return $new;
 }
开发者ID:yusuffakhruddin,项目名称:Filemanager,代码行数:16,代码来源:CorrectGamma.php

示例4: execute

 /**
  * Executes imageconvolution() filter.
  *
  * @param WideImage_Image $image
  * @param array           $matrix
  * @param numeric         $div
  * @param numeric         $offset
  *
  * @return WideImage_Image
  */
 public function execute($image, $matrix, $div, $offset)
 {
     $new = $image->asTrueColor();
     if (!imageconvolution($new->getHandle(), $matrix, $div, $offset)) {
         throw new WideImage_GDFunctionResultException('imageconvolution() returned false');
     }
     return $new;
 }
开发者ID:dongilbert,项目名称:mautic,代码行数:18,代码来源:ApplyConvolution.php

示例5: execute

 /**
  * Returns a mirrored image
  *
  * @param WideImage_Image $image
  * @return WideImage_Image
  */
 function execute($image)
 {
     $new = $image->copy();
     $width = $image->getWidth();
     $height = $image->getHeight();
     for ($x = 0; $x < $width; $x++) {
         imagecopy($new->getHandle(), $image->getHandle(), $x, 0, $width - $x - 1, 0, 1, $height);
     }
     return $new;
 }
开发者ID:eduardosilvapereira,项目名称:mcja,代码行数:16,代码来源:Mirror.php

示例6: execute

 /**
  * Returns a flipped image
  *
  * @param WideImage_Image $image
  * @return WideImage_Image
  */
 function execute($image)
 {
     $new = $image->copy();
     $width = $image->getWidth();
     $height = $image->getHeight();
     for ($y = 0; $y < $height; $y++) {
         imagecopy($new->getHandle(), $image->getHandle(), 0, $y, 0, $height - $y - 1, $width, 1);
     }
     return $new;
 }
开发者ID:eduardosilvapereira,项目名称:mcja,代码行数:16,代码来源:Flip.php

示例7: execute

 /**
  * Rotates and mirrors and image properly based on current orientation value
  *
  * @param WideImage_Image $img
  * @param int $orientation
  * @return WideImage_Image
  */
 function execute($img, $orientation)
 {
     switch ($orientation) {
         case 2:
             return $img->mirror();
             break;
         case 3:
             return $img->rotate(180);
             break;
         case 4:
             return $img->rotate(180)->mirror();
             break;
         case 5:
             return $img->rotate(90)->mirror();
             break;
         case 6:
             return $img->rotate(90);
             break;
         case 7:
             return $img->rotate(-90)->mirror();
             break;
         case 8:
             return $img->rotate(-90);
             break;
         default:
             return $img->copy();
     }
 }
开发者ID:EZTABLE,项目名称:wideimage,代码行数:35,代码来源:ExifOrient.php

示例8: execute

 /**
  * Returns a greyscale copy of an image
  *
  * @param WideImage_Image $image
  * @return WideImage_Image
  */
 function execute($image)
 {
     $new = $image->asTrueColor();
     if (!imagefilter($new->getHandle(), IMG_FILTER_GRAYSCALE)) {
         throw new WideImage_GDFunctionResultException("imagefilter() returned false");
     }
     if (!$image->isTrueColor()) {
         $new = $new->asPalette();
     }
     return $new;
 }
开发者ID:NaszvadiG,项目名称:DivaSul,代码行数:17,代码来源:AsGrayscale.php

示例9:

 /**
  * Apply the manipulation with the setup options to the passed in image.
  * This does not do any memory manipulation
  *
  * @param WideImage_Image $image
  * @return WideImage_Image
  */
 public function &apply(WideImage_Image &$image)
 {
     if (!$this->isSetup()) {
         throw new RokGallery_Manipulation_Exception(rc__('ROKGALLERY_MANIPULATION_WAS_NOT_SETUP_PRIOR_TO_APPLYING'));
     }
     if ($this->left == 0 && $this->top == 0 && $this->width == 0 && $this->height == 0) {
         $this->width = $image->getWidth();
         $this->height = $image->getHeight();
     }
     $return_image = $image->crop($this->left, $this->top, $this->width, $this->height);
     return $return_image;
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:19,代码来源:Crop.php

示例10: execute

 /**
  * Returns a flipped image
  *
  * @param WideImage_Image $image
  * @return WideImage_Image
  */
 function execute($image)
 {
     $new = $image->copy();
     $width = $image->getWidth();
     $height = $image->getHeight();
     if ($new->isTransparent()) {
         imagefilledrectangle($new->getHandle(), 0, 0, $width, $height, $new->getTransparentColor());
     }
     for ($y = 0; $y < $height; $y++) {
         imagecopy($new->getHandle(), $image->getHandle(), 0, $y, 0, $height - $y - 1, $width, 1);
     }
     return $new;
 }
开发者ID:victorborg3s,项目名称:kimera,代码行数:19,代码来源:Flip.php

示例11: execute

 /**
  * Returns a mirrored image
  *
  * @param WideImage_Image $image
  * @return WideImage_Image
  */
 function execute($image)
 {
     $new = $image->copy();
     $width = $image->getWidth();
     $height = $image->getHeight();
     if ($new->isTransparent()) {
         imagefilledrectangle($new->getHandle(), 0, 0, $width, $height, $new->getTransparentColor());
     }
     for ($x = 0; $x < $width; $x++) {
         imagecopy($new->getHandle(), $image->getHandle(), $x, 0, $width - $x - 1, 0, 1, $height);
     }
     return $new;
 }
开发者ID:victorborg3s,项目名称:kimera,代码行数:19,代码来源:Mirror.php

示例12: execute

 /**
  * Executes imagefilter
  *
  * @param WideImage_Image $image
  * @param int $filter 
  * @param numeric $arg1
  * @param numeric $arg2
  * @param numeric $arg3
  * @return WideImage_TrueColorImage
  */
 function execute($image, $filter, $arg1 = null, $arg2 = null, $arg3 = null, $arg4 = null)
 {
     $new = $image->asTrueColor();
     if (in_array($filter, self::$one_arg_filters)) {
         imagefilter($new->getHandle(), $filter, $arg1);
     } elseif (defined('IMG_FILTER_PIXELATE') && $filter == IMG_FILTER_PIXELATE) {
         imagefilter($new->getHandle(), $filter, $arg1, $arg2);
     } elseif ($filter == IMG_FILTER_COLORIZE) {
         imagefilter($new->getHandle(), $filter, $arg1, $arg2, $arg3, $arg4);
     } else {
         imagefilter($new->getHandle(), $filter);
     }
     return $new;
 }
开发者ID:google-code-backups,项目名称:rsslounge,代码行数:24,代码来源:ApplyFilter.php

示例13: execute

 /**
  * Returns a flipped image.
  *
  * @param WideImage_Image $image
  *
  * @return WideImage_Image
  */
 public function execute($image)
 {
     $new = $image->copy();
     $width = $image->getWidth();
     $height = $image->getHeight();
     if ($new->isTransparent()) {
         imagefilledrectangle($new->getHandle(), 0, 0, $width, $height, $new->getTransparentColor());
     }
     for ($y = 0; $y < $height; ++$y) {
         if (!imagecopy($new->getHandle(), $image->getHandle(), 0, $y, 0, $height - $y - 1, $width, 1)) {
             throw new WideImage_GDFunctionResultException('imagecopy() returned false');
         }
     }
     return $new;
 }
开发者ID:dongilbert,项目名称:mautic,代码行数:22,代码来源:Flip.php

示例14: execute

 /**
  * Returns a mirrored image
  *
  * @param WideImage_Image $image
  * @return WideImage_Image
  */
 function execute($image)
 {
     $new = $image->copy();
     $width = $image->getWidth();
     $height = $image->getHeight();
     if ($new->isTransparent()) {
         imagefilledrectangle($new->getHandle(), 0, 0, $width, $height, $new->getTransparentColor());
     }
     for ($x = 0; $x < $width; $x++) {
         if (!imagecopy($new->getHandle(), $image->getHandle(), $x, 0, $width - $x - 1, 0, 1, $height)) {
             throw new WideImage_GDFunctionResultException("imagecopy() returned false");
         }
     }
     return $new;
 }
开发者ID:ehazell,项目名称:AZDWR,代码行数:21,代码来源:Mirror.php

示例15: execute

 /**
  * Returns a greyscale copy of an image
  *
  * @param WideImage_Image $image
  * @return WideImage_Image
  */
 function execute($image)
 {
     $palette = $image instanceof WideImage_PaletteImage;
     $transparent = $image->isTransparent();
     if ($palette && $transparent) {
         $tci = $image->getTransparentColor();
     }
     $new = $image->asTrueColor();
     imagefilter($new->getHandle(), IMG_FILTER_GRAYSCALE);
     if ($palette) {
         $new = $new->asPalette();
         if ($transparent) {
             $new->setTransparentColor($tci);
         }
     }
     return $new;
 }
开发者ID:victorborg3s,项目名称:kimera,代码行数:23,代码来源:AsGrayscale.php


注:本文中的WideImage_Image类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。