Abstract Class Phalcon\Image\Adapter\AbstractAdapter
Código fuente en GitHub
Namespace |
Phalcon\Image\Adapter |
|
Uses |
Phalcon\Image\Enum, Phalcon\Image\Exception |
|
Implements |
AdapterInterface |
Phalcon\Image\Adapter
Todos los adaptadores de imagen deben usar esta clase
Propiedades
//
protected static checked = false;
//
protected file;
/**
* Image height
*
* @var int
*/
protected height;
//
protected image;
/**
* Image mime type
*
* @var string
*/
protected mime;
//
protected realpath;
/**
* Image type
*
* Driver dependent
*
* @var int
*/
protected type;
/**
* Image width
*
* @var int
*/
protected width;
Métodos
public function background( string $color, int $opacity = int ): AdapterInterface;
Establece el color de fondo de una imagen
public function blur( int $radius ): AdapterInterface;
Desenfoca una imagen
public function crop( int $width, int $height, int $offsetX = null, int $offsetY = null ): AdapterInterface;
Recorta una imagen al tamaño dado
public function flip( int $direction ): AdapterInterface;
Da la vuelta a la imagen a lo largo del eje horizontal o vertical
public function getHeight(): int
public function getImage()
public function getMime(): string
public function getRealpath()
public function getType(): int
public function getWidth(): int
public function liquidRescale( int $width, int $height, int $deltaX = int, int $rigidity = int ): AbstractAdapter;
Este método escala las imágenes usando el método de reescalado líquido. Solo para soporte Imagick
public function mask( AdapterInterface $watermark ): AdapterInterface;
Combina una imagen en otra
public function pixelate( int $amount ): AdapterInterface;
Pixela una imagen
public function reflection( int $height, int $opacity = int, bool $fadeIn = bool ): AdapterInterface;
Añade un reflejo a una imagen
public function render( string $ext = null, int $quality = int ): string;
Renderiza la imagen y devuelve la cadena binaria
public function resize( int $width = null, int $height = null, int $master = static-constant-access ): AdapterInterface;
Redimensiona la imagen al tamaño dado
public function rotate( int $degrees ): AdapterInterface;
Rota la imagen en la cantidad indicada
public function save( string $file = null, int $quality = int ): AdapterInterface;
Guarda la imagen
public function sharpen( int $amount ): AdapterInterface;
Ajusta la nitidez de la imagen en la cantidad indicada
public function text( string $text, mixed $offsetX = bool, mixed $offsetY = bool, int $opacity = int, string $color = string, int $size = int, string $fontfile = null ): AdapterInterface;
Añade un texto a un imagen con una opacidad especificada
public function watermark( AdapterInterface $watermark, int $offsetX = int, int $offsetY = int, int $opacity = int ): AdapterInterface;
Añade una marca de agua a una imagen con una opacidad especificada
Interface Phalcon\Image\Adapter\AdapterInterface
Código fuente en GitHub
Namespace |
Phalcon\Image\Adapter |
|
Uses |
Phalcon\Image\Enum |
Este fichero es parte del Framework Phalcon.
(c) Phalcon Team [email protected]
Para obtener toda la información sobre derechos de autor y licencias, por favor vea el archivo LICENSE.txt que se distribuyó con este código fuente.
Métodos
public function background( string $color, int $opacity = int ): AdapterInterface;
public function blur( int $radius ): AdapterInterface;
public function crop( int $width, int $height, int $offsetX = null, int $offsetY = null ): AdapterInterface;
public function flip( int $direction ): AdapterInterface;
public function mask( AdapterInterface $watermark ): AdapterInterface;
public function pixelate( int $amount ): AdapterInterface;
public function reflection( int $height, int $opacity = int, bool $fadeIn = bool ): AdapterInterface;
public function render( string $ext = null, int $quality = int ): string;
public function resize( int $width = null, int $height = null, int $master = static-constant-access ): AdapterInterface;
public function rotate( int $degrees ): AdapterInterface;
public function save( string $file = null, int $quality = int ): AdapterInterface;
public function sharpen( int $amount ): AdapterInterface;
public function text( string $text, int $offsetX = int, int $offsetY = int, int $opacity = int, string $color = string, int $size = int, string $fontfile = null ): AdapterInterface;
public function watermark( AdapterInterface $watermark, int $offsetX = int, int $offsetY = int, int $opacity = int ): AdapterInterface;
Class Phalcon\Image\Adapter\Gd
Código fuente en GitHub
Namespace |
Phalcon\Image\Adapter |
|
Uses |
Phalcon\Image\Enum, Phalcon\Image\Exception |
|
Extends |
AbstractAdapter |
Este fichero es parte del Framework Phalcon.
(c) Phalcon Team [email protected]
Para obtener toda la información sobre derechos de autor y licencias, por favor vea el archivo LICENSE.txt que se distribuyó con este código fuente.
Propiedades
//
protected static checked = false;
Métodos
public function __construct( string $file, int $width = null, int $height = null );
public function __destruct();
public static function check(): bool;
public static function getVersion(): string;
protected function processBackground( int $r, int $g, int $b, int $opacity );
protected function processBlur( int $radius );
protected function processCreate( int $width, int $height );
protected function processCrop( int $width, int $height, int $offsetX, int $offsetY );
protected function processFlip( int $direction );
protected function processMask( AdapterInterface $mask );
protected function processPixelate( int $amount );
protected function processReflection( int $height, int $opacity, bool $fadeIn );
protected function processRender( string $ext, int $quality );
protected function processResize( int $width, int $height );
protected function processRotate( int $degrees );
protected function processSave( string $file, int $quality );
protected function processSharpen( int $amount );
protected function processText( string $text, int $offsetX, int $offsetY, int $opacity, int $r, int $g, int $b, int $size, string $fontfile );
protected function processWatermark( AdapterInterface $watermark, int $offsetX, int $offsetY, int $opacity );
Class Phalcon\Image\Adapter\Imagick
Código fuente en GitHub
Namespace |
Phalcon\Image\Adapter |
|
Uses |
Phalcon\Image\Enum, Phalcon\Image\Exception |
|
Extends |
AbstractAdapter |
Phalcon\Image\Adapter\Imagick
Soporte para manipulación de imágenes. Permite cambiar el tamaño de las imágenes, recortar, etc.
$image = new \Phalcon\Image\Adapter\Imagick("upload/test.jpg");
$image->resize(200, 200)->rotate(90)->crop(100, 100);
if ($image->save()) {
echo "success";
}
Propiedades
//
protected static checked = false;
//
protected static version = 0;
Métodos
public function __construct( string $file, int $width = null, int $height = null );
Constructor \Phalcon\Image\Adapter\Imagick
public function __destruct();
Destruye la imagen cargada para liberar recursos.
public static function check(): bool;
Comprueba si Imagick está habilitado
public function getInternalImInstance(): \Imagick;
Obtiene una instancia
public function setResourceLimit( int $type, int $limit );
Establece los limites para un recurso particular en megabytes
@link https://php.net/manual/ru/imagick.constants.php#imagick.constants.resourcetypes
protected function processBackground( int $r, int $g, int $b, int $opacity );
Ejecuta un fondo.
protected function processBlur( int $radius );
Desenfoca una imagen
protected function processCrop( int $width, int $height, int $offsetX, int $offsetY );
Ejecuta un recorte.
protected function processFlip( int $direction );
Ejecuta un giro.
protected function processLiquidRescale( int $width, int $height, int $deltaX, int $rigidity );
Este método escala las imágenes usando el método de reescalado líquido. Solo para soporte Imagick
protected function processMask( AdapterInterface $image );
Combina una imagen en otra
protected function processPixelate( int $amount );
Pixela una imagen
protected function processReflection( int $height, int $opacity, bool $fadeIn );
Ejecuta un reflejo.
protected function processRender( string $extension, int $quality ): string;
Ejecuta un renderizado.
protected function processResize( int $width, int $height );
Ejecuta un cambio de tamaño.
protected function processRotate( int $degrees );
Ejecuta una rotación.
protected function processSave( string $file, int $quality );
Ejecuta un guardado.
protected function processSharpen( int $amount );
Ejecuta un ajuste de nitidez.
protected function processText( string $text, mixed $offsetX, mixed $offsetY, int $opacity, int $r, int $g, int $b, int $size, string $fontfile );
Ejecuta un texto
protected function processWatermark( AdapterInterface $image, int $offsetX, int $offsetY, int $opacity );
Ejecuta una marca de agua.
Class Phalcon\Image\Enum
Código fuente en GitHub
Este fichero es parte del Framework Phalcon.
(c) Phalcon Team [email protected]
Para obtener toda la información sobre derechos de autor y licencias, por favor vea el archivo LICENSE.txt que se distribuyó con este código fuente.
Constantes
const AUTO = 4;
const HEIGHT = 3;
const HORIZONTAL = 11;
const INVERSE = 5;
const NONE = 1;
const PRECISE = 6;
const TENSILE = 7;
const VERTICAL = 12;
const WIDTH = 2;
Class Phalcon\Image\Exception
Código fuente en GitHub
Namespace |
Phalcon\Image |
|
Extends |
\Phalcon\Exception |
Este fichero es parte del Framework Phalcon.
(c) Phalcon Team [email protected]
Para obtener toda la información sobre derechos de autor y licencias, por favor vea el archivo LICENSE.txt que se distribuyó con este código fuente.
Class Phalcon\Image\ImageFactory
Código fuente en GitHub
Namespace |
Phalcon\Image |
|
Uses |
Phalcon\Config, Phalcon\Factory\AbstractFactory, Phalcon\Helper\Arr, Phalcon\Image\Adapter\AdapterInterface |
|
Extends |
AbstractFactory |
Phalcon\Image/ImageFactory
Métodos
public function __construct( array $services = [] );
Constructor TagFactory.
public function load( mixed $config ): AdapterInterface;
Factoría para crear una instancia desde un objeto Config
public function newInstance( string $name, string $file, int $width = null, int $height = null ): AdapterInterface;
Crea una nueva instancia
protected function getAdapters(): array;