Add a new filter.

@param FilterInterface $filter
@param int             $priority range 0-99.

@return TranscodeInterface
@throws \InvalidArgumentException
@throws \RangeException
@throws InvalidFilterException
510667
public function addFilter(FilterInterface $filter, $priority = 0)
	{
		if ( ! $filter instanceof FrameFilterInterface && ! $filter instanceof AudioFilterInterface)
		{
			throw new InvalidFilterException('Filter type is not supported.');
		}
		
		if ($priority > 99)
		{
			throw new \RangeException('Priority should be in the range from 0 to 99.');
		}
		
		$this->filters->insert($filter, $priority);
		
		return $this;
	}
560216
public function applyFilter(ImageInterface $image, FilterInterface $filter)
    {
        if ($filter instanceof ImagineAware) {
            if ($this->imagine === null) {
                throw new InvalidArgumentException(sprintf('In order to use %s pass an Imagine\Image\ImagineInterface instance to Transformation constructor', get_class($filter)));
            }
            $filter->setImagine($this->imagine);
        }

        return $filter->apply($image);
    }
849223
public function addFilter( $filter, $callback, $priority = 10 )
    {
        if ( !isset( $this->filters[ $filter ] ) )
        {
            $this->filters[ $filter ] = array();
        }

        $this->filters[ $filter ][] = array(
            'priority' => $priority,
            'callback' => $callback,
        );

        if ( 1 < count( $this->filters[ $filter ] ) )
        {
            usort( $this->filters[ $filter ], array( $this, '_sortByPriority' ) );
        }

        if ( $this->debug )
        {
            echo PHP_EOL . '+FILTER: ' . $filter . ' -> '
                    . $this->_serializeCallback( $callback )
                    . ' + Priority: ' . $priority . PHP_EOL;
        }
    }
403310
protected function add_filter( $hook, $method, $priority = 10, $arg_count = 1 ) {
		return add_filter(
			$hook,
			$this->map_filter( $this->get_wp_filter_id( $hook, $method, $priority ), $method, $arg_count ),
			$priority,
			$arg_count
		);
	}
618412
public function addProvider(PathProviderInterface $provider, $priority = 0)
    {
        $this->providers[$priority][] = $provider;
        $this->sorted                 = null;
    }
998889
public function addFactory(FactoryInterface $factory, $priority = 10)
    {
        $this->factoryList->insert($factory, $priority);
        return $this;
    }
700489
public function addVisitor(VisitorInterface $visitor, $priority = 0)
    {
        $this->sortedVisitors = null;

        $this->visitors[spl_object_hash($visitor)] = array(
            'priority' => $priority,
            'visitor' => $visitor
        );

        return $this;
    }
1345549
public function filter($filter)
    {
        if (is_array($filter)) {
            $filter = new GridFilter($filter);
        }

        if ($filter instanceof FilterSpecification) {
            $filter = new GridFilter($filter->asFilter());
        }

        $this->filter = $filter;

        return $this;
    }
412883
public function add_filter_by_key( FilterInterface $filter, $key ) {

		if ( ! is_scalar( $key ) ) {
			throw new Exception\InvalidArgumentException( 'key should be a scalar value.' );
		}

		$key = (string) $key;

		if ( ! isset ( $this->filters_by_key[ $key ] ) ) {
			$this->filters_by_key[ $key ] = [ ];
		}

		$this->filters_by_key[ $key ][] = $filter;

		return $this;
	}
1135812
public function removeFilterHandler($filterName, $filterHandlerName, $priority = 50)
    {
        $this->removeHandler(self::FILTER, $filterName, $filterHandlerName, $priority);
    }
316465
private function addFilterReq($f, $p = FilterChain::DEFAULT_PRIORITY) {
		$this->_filtersReq->attach($f, $p);
	}
529420
public function addFilter($key, $filter)
    {
        if (false === isset($this->filters[$key])) {
            $this->filters[$key] = [];
        }

        $this->filters[$key][] = $filter;

        return $this;
    }
808297
public function setFilter($filter = null)
    {
        $this->filter = is_callable($filter) ? $filter : null;

        return $this;
    }
76892
public function setPropertyFilter(PropertyFilterInterface $filter)
    {
        $this->propertyFilter = $filter;

        $this->getReader()->setPropertyFilter($filter);
        $this->getWriter()->setPropertyFilter($filter);

        $dataVersionHash = $this->getDataVersionHash();
        $this->getReader()->setDataVersionHash($dataVersionHash);
        $this->getWriter()->setDataVersionHash($dataVersionHash);
    }
62560
public static function create($filter)
    {
        if (array_key_exists($filter, static::$filters)) {
            $class = static::$filters[$filter];
        } else if (
        is_subclass_of($filter, 'Slick\Filter\FilterInterface')
        ) {
            $class = $filter;
        } else {
            throw new Exception\UnknownFilterClassException(
                "The filter '{$filter}' is not defined or does not " .
                "implements the Slick\\Filter\\FilterInterface interface"
            );
        }

        return new $class();
    }
867356
protected function _setCallbackFilter($filter)
    {
        if (!is_callable($filter, true) && !is_null($filter)) {
            throw new InvalidArgumentException('Filter must be a callable');
        }

        $this->callbackFilter = $filter;

        return $this;
    }
344277
public function addFactory(FilterBagFactoryInterface $factory, $priority = 0)
    {
        $this->factories[$priority][] = $factory;

        unset($this->sorted);
    }