Вход Регистрация
Файл: concrete5.7.5.6/concrete/vendor/imagine/imagine/lib/Imagine/Filter/Basic/Crop.php
Строк: 42
<?php

/*
 * This file is part of the Imagine package.
 *
 * (c) Bulat Shakirzyanov <mallluhuct@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace ImagineFilterBasic;

use 
ImagineImageImageInterface;
use 
ImagineImageBoxInterface;
use 
ImagineImagePointInterface;
use 
ImagineFilterFilterInterface;

/**
 * A crop filter
 */
class Crop implements FilterInterface
{
    
/**
     * @var PointInterface
     */
    
private $start;

    
/**
     * @var BoxInterface
     */
    
private $size;

    
/**
     * Constructs a Crop filter with given x, y, coordinates and crop width and
     * height values
     *
     * @param PointInterface $start
     * @param BoxInterface   $size
     */
    
public function __construct(PointInterface $startBoxInterface $size)
    {
        
$this->start $start;
        
$this->size  $size;
    }

    
/**
     * {@inheritdoc}
     */
    
public function apply(ImageInterface $image)
    {
        return 
$image->crop($this->start$this->size);
    }
}
Онлайн: 1
Реклама