<?php

/**
 * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 *
 * @package fusionLib
 * @copyright Copyright (c) 2013 fusionLib. All rights reserved.
 * @link http://fusionlib.com
 */

/**
 * flImageFilterSepia Class
 *
 * Image filter to give an image a sepia look.
 *
 * @package fusionLib
 */
class flImageFilterSepia {

	/**
	 * Apply the filter to the image.
	 *
	 * @param flImage $image The image object.
	 */
	function apply($image) {
		//http://hanswestman.se/2011/07/some-image-filters-for-php-gd/
		imagefilter($img = $image->getImageResource(), IMG_FILTER_CONTRAST, -10);
		imagefilter($img, IMG_FILTER_GRAYSCALE);
		imagefilter($img, IMG_FILTER_COLORIZE, 45, 25, 0);
		imagefilter($img, IMG_FILTER_BRIGHTNESS, -30);
	}
}
