<?php

/**
 * Takes a source filename, and allow for editing 
 * 
 * Provides abstraction for common image manipulation functions
 * 
 * @since 3.5
 */
interface WP_Image_Editor {	
	/**
	 * Initialize Image for editing
	 * 
	 * @param string $file_path Filename to prepare for edit
	 * @param bool $stream Output as stream, rather than to a file 
	 */
	function __construct( $file_path, $stream = false );

	/**
	 * Resizes Image.
	 * 
	 * Saves to self by default; otherwise saves to $output_file
	 *
	 * @since 3.5
	 * 
	 * @param int $width Width of Image Output
	 * @param int $height Height of Image Output
	 * @param string $output_file Path to file location to save
	 * @return bool true or stream if succeeded, false otherwise.
	 */
	public function resize( $width, $height, $output_file = null, $output_quality = 90 );

	/**
	 * Rotates Image.
	 * 
	 * Saves to self by default; otherwise saves to $output_file
	 * 
	 * @since 3.5
	 * 
	 * @param int $angle Positive or negative angle of rotation
	 * @param string $output_file Path to file location to save
	 * @return bool true or stream if succeeded, false otherwise.
	 */
	public function rotate( $angle, $output_file = null );

	/**
	 * Crops Image.
	 * 
	 * Saves to self by default; otherwise saves to $output_file
	 *
	 * @since 3.5
	 * @param int dst_x x-coordinate of destination point.
	 * @param int $dst_y y-coordinate of destination point.
	 * @param int $src_x y-coordinate of destination point.
	 * @param int $src_y y-coordinate of source point.
	 * @param int $dst_w Destination width.
	 * @param int $dst_h Destination height.
	 * @param int $src_w Source width.
	 * @param int $src_h Source height.
	 * @param string $output_file Path to file location to save
	 * @return bool true or stream if succeeded, false otherwise.
	 */
	public function crop( $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h, $output_file = null, $output_quality = 90 );

	/**
	 * Checks to see if $mime_type is supported by image editor class
	 *
	 * @since 3.5
	 *
	 * @param string mime-type of image to check
	 * @return true if type is supported by class, and false otherwise
	 */
	public function is_supported( $mime_type );
}

?>
