2012-10-25 00:28:39 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Image_Backend
|
2014-08-15 08:53:05 +02:00
|
|
|
*
|
2012-10-25 00:28:39 +02:00
|
|
|
* A backend for manipulation of images via the Image class
|
|
|
|
*
|
|
|
|
* @package framework
|
|
|
|
* @subpackage filesystem
|
|
|
|
*/
|
|
|
|
interface Image_Backend {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* __construct
|
|
|
|
*
|
|
|
|
* @param string $filename = null
|
2015-02-11 16:58:47 +01:00
|
|
|
* @param array $args = array()
|
2012-10-25 00:28:39 +02:00
|
|
|
* @return void
|
|
|
|
*/
|
2015-02-11 16:58:47 +01:00
|
|
|
public function __construct($filename = null, $args = array());
|
2012-10-25 00:28:39 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* writeTo
|
|
|
|
*
|
|
|
|
* @param string $path
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function writeTo($path);
|
2014-08-15 08:53:05 +02:00
|
|
|
|
2012-10-25 00:28:39 +02:00
|
|
|
/**
|
|
|
|
* setQuality
|
|
|
|
*
|
|
|
|
* @param int $quality
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function setQuality($quality);
|
2014-08-15 08:53:05 +02:00
|
|
|
|
2012-10-25 00:28:39 +02:00
|
|
|
/**
|
|
|
|
* setImageResource
|
2014-08-15 08:53:05 +02:00
|
|
|
*
|
2012-10-25 00:28:39 +02:00
|
|
|
* Set the backend-specific resource handling the manipulations. Replaces Image::setGD()
|
|
|
|
*
|
|
|
|
* @param mixed $resource
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function setImageResource($resource);
|
2014-08-15 08:53:05 +02:00
|
|
|
|
2012-10-25 00:28:39 +02:00
|
|
|
/**
|
|
|
|
* getImageResource
|
2014-08-15 08:53:05 +02:00
|
|
|
*
|
2012-10-25 00:28:39 +02:00
|
|
|
* Get the backend-specific resource handling the manipulations. Replaces Image::getGD()
|
|
|
|
*
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function getImageResource();
|
2014-08-15 08:53:05 +02:00
|
|
|
|
2012-10-25 00:28:39 +02:00
|
|
|
/**
|
|
|
|
* hasImageResource
|
|
|
|
*
|
|
|
|
* @return boolean
|
|
|
|
*/
|
|
|
|
public function hasImageResource();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* resize
|
|
|
|
*
|
|
|
|
* @param int $width
|
|
|
|
* @param int $height
|
|
|
|
* @return Image_Backend
|
|
|
|
*/
|
|
|
|
public function resize($width, $height);
|
2014-08-15 08:53:05 +02:00
|
|
|
|
2012-10-25 00:28:39 +02:00
|
|
|
/**
|
|
|
|
* resizeRatio
|
|
|
|
*
|
|
|
|
* @param int $width
|
|
|
|
* @param int $height
|
|
|
|
* @return Image_Backend
|
|
|
|
*/
|
|
|
|
public function resizeRatio($maxWidth, $maxHeight, $useAsMinimum = false);
|
2014-08-15 08:53:05 +02:00
|
|
|
|
2012-10-25 00:28:39 +02:00
|
|
|
/**
|
|
|
|
* resizeByWidth
|
|
|
|
*
|
|
|
|
* @param int $width
|
|
|
|
* @return Image_Backend
|
|
|
|
*/
|
|
|
|
public function resizeByWidth($width);
|
2014-08-15 08:53:05 +02:00
|
|
|
|
2012-10-25 00:28:39 +02:00
|
|
|
/**
|
|
|
|
* resizeByHeight
|
|
|
|
*
|
|
|
|
* @param int $height
|
|
|
|
* @return Image_Backend
|
|
|
|
*/
|
|
|
|
public function resizeByHeight($height);
|
2014-08-15 08:53:05 +02:00
|
|
|
|
2012-10-25 00:28:39 +02:00
|
|
|
/**
|
|
|
|
* paddedResize
|
|
|
|
*
|
|
|
|
* @param int $width
|
|
|
|
* @param int $height
|
|
|
|
* @return Image_Backend
|
|
|
|
*/
|
|
|
|
public function paddedResize($width, $height, $backgroundColor = "FFFFFF");
|
2014-08-15 08:53:05 +02:00
|
|
|
|
2012-10-25 00:28:39 +02:00
|
|
|
/**
|
|
|
|
* croppedResize
|
|
|
|
*
|
|
|
|
* @param int $width
|
|
|
|
* @param int $height
|
|
|
|
* @return Image_Backend
|
|
|
|
*/
|
|
|
|
public function croppedResize($width, $height);
|
2014-01-02 16:59:34 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* imageAvailable
|
2014-08-15 08:53:05 +02:00
|
|
|
*
|
2014-01-02 16:59:34 +01:00
|
|
|
* @param string $filename
|
|
|
|
* @return boolean
|
|
|
|
*/
|
|
|
|
public function imageAvailable($filename, $manipulation);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* onBeforeDelete
|
2014-08-15 08:53:05 +02:00
|
|
|
*
|
2014-01-02 16:59:34 +01:00
|
|
|
* @param Image $frontend
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function onBeforeDelete($frontend);
|
|
|
|
|
2012-10-25 00:28:39 +02:00
|
|
|
}
|