コード例 #1
0
ファイル: Merge.php プロジェクト: hbarcelos/gd-wrapper
 /**
  * {@inherit-doc}
  *
  * Creates a new Merge action.
  *
  * The parameter `$opacity` must be an integer from `0` to `100`, where `0` means completely
  * transparent merging (that is, no visible modifications) and `100` means opaque merging,
  * with all the pixels of the merge resource overlaping the original one in the merge area.
  *
  * @param Hbarcelos\GdWrapper\Resource\Resource $merge The image resource that will be merged into another images.
  * @param Hbarcelos\GdWrapper\Geometry\Position\Position $position The position where the merge resource will be placed.
  * @param int $opacity [OPTIONAL] The opacity of the merged image.
  * @param Hbarcelos\GdWrapper\Action\MergeMode\Mode $mode [OPTIONAL] The merging mode.
  *
  * @see Hbarcelos\GdWrapper\Action\AbstractAction::__construct()
  */
 public function __construct(Resource $merge, Position $position, $opacity = 100, Mode $mode = null, $resourceFactoryClass = null)
 {
     $this->setMergeResource($merge);
     $this->setPosition($position);
     $this->setOpacity($opacity);
     if ($mode === null) {
         $mode = new DefaultMerge();
     }
     $this->setMode($mode);
     parent::__construct($resourceFactoryClass);
 }
コード例 #2
0
ファイル: Crop.php プロジェクト: hbarcelos/gd-wrapper
 /**
  * {@inherit-doc}
  *
  * Creates a Crop action.
  *
  * @param Mode $mode The cropping mode.
  *
  * @see Hbarcelos\GdWrapper\Action\AbstractAction::__construct()
  */
 public function __construct(Mode $mode, $resourceFactoryClass = null)
 {
     $this->mode = $mode;
     parent::__construct($resourceFactoryClass);
 }