Exemplo n.º 1
0
 /**
  * {@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 \GdWrapper\Resource\Resource $merge The image resource that will be merged into another images.
  * @param \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 \GdWrapper\Action\MergeStrategy\Strategy $strategy [OPTIONAL] The merging strategy.
  *
  * @see \GdWrapper\Action\AbstractAction::__construct()
  */
 public function __construct(Resource $merge, Position $position, $opacity = 100, Strategy $strategy = null, $resourceFactoryClass = null)
 {
     $this->setMergeResource($merge);
     $this->setPosition($position);
     $this->setOpacity($opacity);
     if ($strategy === null) {
         $strategy = new DefaultMerge();
     }
     $this->setStrategy($strategy);
     parent::__construct($resourceFactoryClass);
 }
Exemplo n.º 2
0
 /**
  * {@inherit-doc}
  *
  * Creates a Crop action.
  *
  * @param Strategy $strategy The cropping strategy.
  *
  * @see \GdWrapper\Action\AbstractAction::__construct()
  */
 public function __construct(Strategy $strategy, $resourceFactoryClass = null)
 {
     $this->strategy = $strategy;
     parent::__construct($resourceFactoryClass);
 }