PageRenderTime 26ms CodeModel.GetById 23ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/libraries/joomla/image/filter/negate.php

https://bitbucket.org/eternaware/joomus
PHP | 43 lines | 14 code | 3 blank | 26 comment | 1 complexity | 4b2cd0010081ea71b78d882311d2460e MD5 | raw file
Possible License(s): LGPL-2.1
 1<?php
 2/**
 3 * @package     Joomla.Platform
 4 * @subpackage  Image
 5 *
 6 * @copyright   Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 7 * @license     GNU General Public License version 2 or later; see LICENSE
 8 */
 9
10defined('JPATH_PLATFORM') or die;
11
12/**
13 * Image Filter class to negate the colors of an image.
14 *
15 * @package     Joomla.Platform
16 * @subpackage  Image
17 * @since       11.3
18 */
19class JImageFilterNegate extends JImageFilter
20{
21	/**
22	 * Method to apply a filter to an image resource.
23	 *
24	 * @param   array  $options  An array of options for the filter.
25	 *
26	 * @return  void
27	 *
28	 * @since   11.3
29	 * @throws  RuntimeException
30	 */
31	public function execute(array $options = array())
32	{
33		// Verify that image filter support for PHP is available.
34		if (!function_exists('imagefilter'))
35		{
36			JLog::add('The imagefilter function for PHP is not available.', JLog::ERROR);
37			throw new RuntimeException('The imagefilter function for PHP is not available.');
38		}
39
40		// Perform the negative filter.
41		imagefilter($this->handle, IMG_FILTER_NEGATE);
42	}
43}