silverstripe-framework/model/Image_Backend.php

132 lines
2.2 KiB
PHP
Raw Normal View History

<?php
/**
* Image_Backend
2014-08-15 08:53:05 +02:00
*
* A backend for manipulation of images via the Image class
*
* @package framework
* @subpackage filesystem
*/
interface Image_Backend {
/**
* __construct
*
* @param string $filename = null
* @param array $args = array()
* @return void
*/
public function __construct($filename = null, $args = array());
/**
* writeTo
*
* @param string $path
* @return void
*/
public function writeTo($path);
2014-08-15 08:53:05 +02:00
/**
* setQuality
*
* @param int $quality
* @return void
*/
public function setQuality($quality);
2014-08-15 08:53:05 +02:00
/**
* setImageResource
2014-08-15 08:53:05 +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
/**
* getImageResource
2014-08-15 08:53:05 +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
/**
* 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
/**
* 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
/**
* resizeByWidth
*
* @param int $width
* @return Image_Backend
*/
public function resizeByWidth($width);
2014-08-15 08:53:05 +02:00
/**
* resizeByHeight
*
* @param int $height
* @return Image_Backend
*/
public function resizeByHeight($height);
2014-08-15 08:53:05 +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
/**
* croppedResize
*
* @param int $width
* @param int $height
* @return Image_Backend
*/
public function croppedResize($width, $height);
/**
* imageAvailable
2014-08-15 08:53:05 +02:00
*
* @param string $filename
* @return boolean
*/
public function imageAvailable($filename, $manipulation);
/**
* onBeforeDelete
2014-08-15 08:53:05 +02:00
*
* @param Image $frontend
* @return void
*/
public function onBeforeDelete($frontend);
}