mirror of
https://github.com/Intervention/image.git
synced 2025-08-29 08:40:33 +02:00
Merge branch 'develop' into feature/standard-rules
This commit is contained in:
@@ -20,7 +20,7 @@ class Collection implements CollectionInterface, IteratorAggregate, Countable
|
|||||||
/**
|
/**
|
||||||
* Static constructor
|
* Static constructor
|
||||||
*
|
*
|
||||||
* @param array $items
|
* @param array $items
|
||||||
* @return self
|
* @return self
|
||||||
*/
|
*/
|
||||||
public static function create(array $items = []): self
|
public static function create(array $items = []): self
|
||||||
@@ -61,7 +61,7 @@ class Collection implements CollectionInterface, IteratorAggregate, Countable
|
|||||||
/**
|
/**
|
||||||
* Append new item to collection
|
* Append new item to collection
|
||||||
*
|
*
|
||||||
* @param mixed $item
|
* @param mixed $item
|
||||||
* @return CollectionInterface
|
* @return CollectionInterface
|
||||||
*/
|
*/
|
||||||
public function push($item): CollectionInterface
|
public function push($item): CollectionInterface
|
||||||
@@ -102,7 +102,7 @@ class Collection implements CollectionInterface, IteratorAggregate, Countable
|
|||||||
/**
|
/**
|
||||||
* Return item at given position starting at 0
|
* Return item at given position starting at 0
|
||||||
*
|
*
|
||||||
* @param integer $key
|
* @param integer $key
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function getAtPosition(int $key = 0, $default = null): mixed
|
public function getAtPosition(int $key = 0, $default = null): mixed
|
||||||
|
@@ -16,7 +16,7 @@ class StringColorDecoder extends AbstractDecoder implements DecoderInterface
|
|||||||
/**
|
/**
|
||||||
* Decode CMYK color strings
|
* Decode CMYK color strings
|
||||||
*
|
*
|
||||||
* @param mixed $input
|
* @param mixed $input
|
||||||
* @return ImageInterface|ColorInterface
|
* @return ImageInterface|ColorInterface
|
||||||
*/
|
*/
|
||||||
public function decode(mixed $input): ImageInterface|ColorInterface
|
public function decode(mixed $input): ImageInterface|ColorInterface
|
||||||
|
@@ -16,7 +16,7 @@ class StringColorDecoder extends AbstractDecoder implements DecoderInterface
|
|||||||
/**
|
/**
|
||||||
* Decode hsl color strings
|
* Decode hsl color strings
|
||||||
*
|
*
|
||||||
* @param mixed $input
|
* @param mixed $input
|
||||||
* @return ImageInterface|ColorInterface
|
* @return ImageInterface|ColorInterface
|
||||||
*/
|
*/
|
||||||
public function decode(mixed $input): ImageInterface|ColorInterface
|
public function decode(mixed $input): ImageInterface|ColorInterface
|
||||||
|
@@ -16,7 +16,7 @@ class StringColorDecoder extends AbstractDecoder implements DecoderInterface
|
|||||||
/**
|
/**
|
||||||
* Decode hsv/hsb color strings
|
* Decode hsv/hsb color strings
|
||||||
*
|
*
|
||||||
* @param mixed $input
|
* @param mixed $input
|
||||||
* @return ImageInterface|ColorInterface
|
* @return ImageInterface|ColorInterface
|
||||||
*/
|
*/
|
||||||
public function decode(mixed $input): ImageInterface|ColorInterface
|
public function decode(mixed $input): ImageInterface|ColorInterface
|
||||||
|
@@ -16,7 +16,7 @@ class HexColorDecoder extends AbstractDecoder implements DecoderInterface
|
|||||||
/**
|
/**
|
||||||
* Decode hexadecimal rgb colors with and without transparency
|
* Decode hexadecimal rgb colors with and without transparency
|
||||||
*
|
*
|
||||||
* @param mixed $input
|
* @param mixed $input
|
||||||
* @return ImageInterface|ColorInterface
|
* @return ImageInterface|ColorInterface
|
||||||
*/
|
*/
|
||||||
public function decode(mixed $input): ImageInterface|ColorInterface
|
public function decode(mixed $input): ImageInterface|ColorInterface
|
||||||
|
@@ -12,151 +12,151 @@ use Intervention\Image\Interfaces\ImageInterface;
|
|||||||
class HtmlColornameDecoder extends HexColorDecoder implements DecoderInterface
|
class HtmlColornameDecoder extends HexColorDecoder implements DecoderInterface
|
||||||
{
|
{
|
||||||
protected static $names = [
|
protected static $names = [
|
||||||
'lightsalmon' => '#ffa07a',
|
'lightsalmon' => '#ffa07a',
|
||||||
'salmon' => '#fa8072',
|
'salmon' => '#fa8072',
|
||||||
'darksalmon' => '#e9967a',
|
'darksalmon' => '#e9967a',
|
||||||
'lightcoral' => '#f08080',
|
'lightcoral' => '#f08080',
|
||||||
'indianred' => '#cd5c5c',
|
'indianred' => '#cd5c5c',
|
||||||
'crimson' => '#dc143c',
|
'crimson' => '#dc143c',
|
||||||
'firebrick' => '#b22222',
|
'firebrick' => '#b22222',
|
||||||
'red' => '#ff0000',
|
'red' => '#ff0000',
|
||||||
'darkred' => '#8b0000',
|
'darkred' => '#8b0000',
|
||||||
'coral' => '#ff7f50',
|
'coral' => '#ff7f50',
|
||||||
'tomato' => '#ff6347',
|
'tomato' => '#ff6347',
|
||||||
'orangered' => '#ff4500',
|
'orangered' => '#ff4500',
|
||||||
'gold' => '#ffd700',
|
'gold' => '#ffd700',
|
||||||
'orange' => '#ffa500',
|
'orange' => '#ffa500',
|
||||||
'darkorange' => '#ff8c00',
|
'darkorange' => '#ff8c00',
|
||||||
'lightyellow' => '#ffffe0',
|
'lightyellow' => '#ffffe0',
|
||||||
'lemonchiffon' => '#fffacd',
|
'lemonchiffon' => '#fffacd',
|
||||||
'lightgoldenrodyellow' => '#fafad2',
|
'lightgoldenrodyellow' => '#fafad2',
|
||||||
'papayawhip' => '#ffefd5',
|
'papayawhip' => '#ffefd5',
|
||||||
'moccasin' => '#ffe4b5',
|
'moccasin' => '#ffe4b5',
|
||||||
'peachpuff' => '#ffdab9',
|
'peachpuff' => '#ffdab9',
|
||||||
'palegoldenrod' => '#eee8aa',
|
'palegoldenrod' => '#eee8aa',
|
||||||
'khaki' => '#f0e68c',
|
'khaki' => '#f0e68c',
|
||||||
'darkkhaki' => '#bdb76b',
|
'darkkhaki' => '#bdb76b',
|
||||||
'yellow' => '#ffff00',
|
'yellow' => '#ffff00',
|
||||||
'lawngreen' => '#7cfc00',
|
'lawngreen' => '#7cfc00',
|
||||||
'chartreuse' => '#7fff00',
|
'chartreuse' => '#7fff00',
|
||||||
'limegreen' => '#32cd32',
|
'limegreen' => '#32cd32',
|
||||||
'lime' => '#00ff00',
|
'lime' => '#00ff00',
|
||||||
'forestgreen' => '#228b22',
|
'forestgreen' => '#228b22',
|
||||||
'green' => '#008000',
|
'green' => '#008000',
|
||||||
'darkgreen' => '#006400',
|
'darkgreen' => '#006400',
|
||||||
'greenyellow' => '#adff2f',
|
'greenyellow' => '#adff2f',
|
||||||
'yellowgreen' => '#9acd32',
|
'yellowgreen' => '#9acd32',
|
||||||
'springgreen' => '#00ff7f',
|
'springgreen' => '#00ff7f',
|
||||||
'mediumspringgreen' => '#00fa9a',
|
'mediumspringgreen' => '#00fa9a',
|
||||||
'lightgreen' => '#90ee90',
|
'lightgreen' => '#90ee90',
|
||||||
'palegreen' => '#98fb98',
|
'palegreen' => '#98fb98',
|
||||||
'darkseagreen' => '#8fbc8f',
|
'darkseagreen' => '#8fbc8f',
|
||||||
'mediumseagre' => 'en #3cb371',
|
'mediumseagre' => 'en #3cb371',
|
||||||
'seagreen' => '#2e8b57',
|
'seagreen' => '#2e8b57',
|
||||||
'olive' => '#808000',
|
'olive' => '#808000',
|
||||||
'darkolivegreen' => '#556b2f',
|
'darkolivegreen' => '#556b2f',
|
||||||
'olivedrab' => '#6b8e23',
|
'olivedrab' => '#6b8e23',
|
||||||
'lightcyan' => '#e0ffff',
|
'lightcyan' => '#e0ffff',
|
||||||
'cyan' => '#00ffff',
|
'cyan' => '#00ffff',
|
||||||
'aqua' => '#00ffff',
|
'aqua' => '#00ffff',
|
||||||
'aquamarine' => '#7fffd4',
|
'aquamarine' => '#7fffd4',
|
||||||
'mediumaquamarine' => '#66cdaa',
|
'mediumaquamarine' => '#66cdaa',
|
||||||
'paleturquoise' => '#afeeee',
|
'paleturquoise' => '#afeeee',
|
||||||
'turquoise' => '#40e0d0',
|
'turquoise' => '#40e0d0',
|
||||||
'mediumturquoise' => '#48d1cc',
|
'mediumturquoise' => '#48d1cc',
|
||||||
'darkturquoise' => '#00ced1',
|
'darkturquoise' => '#00ced1',
|
||||||
'lightseagreen' => '#20b2aa',
|
'lightseagreen' => '#20b2aa',
|
||||||
'cadetblue' => '#5f9ea0',
|
'cadetblue' => '#5f9ea0',
|
||||||
'darkcyan' => '#008b8b',
|
'darkcyan' => '#008b8b',
|
||||||
'teal' => '#008080',
|
'teal' => '#008080',
|
||||||
'powderblue' => '#b0e0e6',
|
'powderblue' => '#b0e0e6',
|
||||||
'lightblue' => '#add8e6',
|
'lightblue' => '#add8e6',
|
||||||
'lightskyblue' => '#87cefa',
|
'lightskyblue' => '#87cefa',
|
||||||
'skyblue' => '#87ceeb',
|
'skyblue' => '#87ceeb',
|
||||||
'deepskyblue' => '#00bfff',
|
'deepskyblue' => '#00bfff',
|
||||||
'lightsteelblue' => '#b0c4de',
|
'lightsteelblue' => '#b0c4de',
|
||||||
'dodgerblue' => '#1e90ff',
|
'dodgerblue' => '#1e90ff',
|
||||||
'cornflowerblue' => '#6495ed',
|
'cornflowerblue' => '#6495ed',
|
||||||
'steelblue' => '#4682b4',
|
'steelblue' => '#4682b4',
|
||||||
'royalblue' => '#4169e1',
|
'royalblue' => '#4169e1',
|
||||||
'blue' => '#0000ff',
|
'blue' => '#0000ff',
|
||||||
'mediumblue' => '#0000cd',
|
'mediumblue' => '#0000cd',
|
||||||
'darkblue' => '#00008b',
|
'darkblue' => '#00008b',
|
||||||
'navy' => '#000080',
|
'navy' => '#000080',
|
||||||
'midnightblue' => '#191970',
|
'midnightblue' => '#191970',
|
||||||
'mediumslateblue' => '#7b68ee',
|
'mediumslateblue' => '#7b68ee',
|
||||||
'slateblue' => '#6a5acd',
|
'slateblue' => '#6a5acd',
|
||||||
'darkslateblue' => '#483d8b',
|
'darkslateblue' => '#483d8b',
|
||||||
'lavender' => '#e6e6fa',
|
'lavender' => '#e6e6fa',
|
||||||
'thistle' => '#d8bfd8',
|
'thistle' => '#d8bfd8',
|
||||||
'plum' => '#dda0dd',
|
'plum' => '#dda0dd',
|
||||||
'violet' => '#ee82ee',
|
'violet' => '#ee82ee',
|
||||||
'orchid' => '#da70d6',
|
'orchid' => '#da70d6',
|
||||||
'fuchsia' => '#ff00ff',
|
'fuchsia' => '#ff00ff',
|
||||||
'magenta' => '#ff00ff',
|
'magenta' => '#ff00ff',
|
||||||
'mediumorchid' => '#ba55d3',
|
'mediumorchid' => '#ba55d3',
|
||||||
'mediumpurple' => '#9370db',
|
'mediumpurple' => '#9370db',
|
||||||
'blueviolet' => '#8a2be2',
|
'blueviolet' => '#8a2be2',
|
||||||
'darkviolet' => '#9400d3',
|
'darkviolet' => '#9400d3',
|
||||||
'darkorchid' => '#9932cc',
|
'darkorchid' => '#9932cc',
|
||||||
'darkmagenta' => '#8b008b',
|
'darkmagenta' => '#8b008b',
|
||||||
'purple' => '#800080',
|
'purple' => '#800080',
|
||||||
'indigo' => '#4b0082',
|
'indigo' => '#4b0082',
|
||||||
'pink' => '#ffc0cb',
|
'pink' => '#ffc0cb',
|
||||||
'lightpink' => '#ffb6c1',
|
'lightpink' => '#ffb6c1',
|
||||||
'hotpink' => '#ff69b4',
|
'hotpink' => '#ff69b4',
|
||||||
'deeppink' => '#ff1493',
|
'deeppink' => '#ff1493',
|
||||||
'palevioletred' => '#db7093',
|
'palevioletred' => '#db7093',
|
||||||
'mediumvioletred' => '#c71585',
|
'mediumvioletred' => '#c71585',
|
||||||
'white' => '#ffffff',
|
'white' => '#ffffff',
|
||||||
'snow' => '#fffafa',
|
'snow' => '#fffafa',
|
||||||
'honeydew' => '#f0fff0',
|
'honeydew' => '#f0fff0',
|
||||||
'mintcream' => '#f5fffa',
|
'mintcream' => '#f5fffa',
|
||||||
'azure' => '#f0ffff',
|
'azure' => '#f0ffff',
|
||||||
'aliceblue' => '#f0f8ff',
|
'aliceblue' => '#f0f8ff',
|
||||||
'ghostwhite' => '#f8f8ff',
|
'ghostwhite' => '#f8f8ff',
|
||||||
'whitesmoke' => '#f5f5f5',
|
'whitesmoke' => '#f5f5f5',
|
||||||
'seashell' => '#fff5ee',
|
'seashell' => '#fff5ee',
|
||||||
'beige' => '#f5f5dc',
|
'beige' => '#f5f5dc',
|
||||||
'oldlace' => '#fdf5e6',
|
'oldlace' => '#fdf5e6',
|
||||||
'floralwhite' => '#fffaf0',
|
'floralwhite' => '#fffaf0',
|
||||||
'ivory' => '#fffff0',
|
'ivory' => '#fffff0',
|
||||||
'antiquewhite' => '#faebd7',
|
'antiquewhite' => '#faebd7',
|
||||||
'linen' => '#faf0e6',
|
'linen' => '#faf0e6',
|
||||||
'lavenderblush' => '#fff0f5',
|
'lavenderblush' => '#fff0f5',
|
||||||
'mistyrose' => '#ffe4e1',
|
'mistyrose' => '#ffe4e1',
|
||||||
'gainsboro' => '#dcdcdc',
|
'gainsboro' => '#dcdcdc',
|
||||||
'lightgray' => '#d3d3d3',
|
'lightgray' => '#d3d3d3',
|
||||||
'silver' => '#c0c0c0',
|
'silver' => '#c0c0c0',
|
||||||
'darkgray' => '#a9a9a9',
|
'darkgray' => '#a9a9a9',
|
||||||
'gray' => '#808080',
|
'gray' => '#808080',
|
||||||
'dimgray' => '#696969',
|
'dimgray' => '#696969',
|
||||||
'lightslategray' => '#778899',
|
'lightslategray' => '#778899',
|
||||||
'slategray' => '#708090',
|
'slategray' => '#708090',
|
||||||
'darkslategray' => '#2f4f4f',
|
'darkslategray' => '#2f4f4f',
|
||||||
'black' => '#000000',
|
'black' => '#000000',
|
||||||
'cornsilk' => '#fff8dc',
|
'cornsilk' => '#fff8dc',
|
||||||
'blanchedalmond' => '#ffebcd',
|
'blanchedalmond' => '#ffebcd',
|
||||||
'bisque' => '#ffe4c4',
|
'bisque' => '#ffe4c4',
|
||||||
'navajowhite' => '#ffdead',
|
'navajowhite' => '#ffdead',
|
||||||
'wheat' => '#f5deb3',
|
'wheat' => '#f5deb3',
|
||||||
'burlywood' => '#deb887',
|
'burlywood' => '#deb887',
|
||||||
'tan' => '#d2b48c',
|
'tan' => '#d2b48c',
|
||||||
'rosybrown' => '#bc8f8f',
|
'rosybrown' => '#bc8f8f',
|
||||||
'sandybrown' => '#f4a460',
|
'sandybrown' => '#f4a460',
|
||||||
'goldenrod' => '#daa520',
|
'goldenrod' => '#daa520',
|
||||||
'peru' => '#cd853f',
|
'peru' => '#cd853f',
|
||||||
'chocolate' => '#d2691e',
|
'chocolate' => '#d2691e',
|
||||||
'saddlebrown' => '#8b4513',
|
'saddlebrown' => '#8b4513',
|
||||||
'sienna' => '#a0522d',
|
'sienna' => '#a0522d',
|
||||||
'brown' => '#a52a2a',
|
'brown' => '#a52a2a',
|
||||||
'maroon' => '#800000',
|
'maroon' => '#800000',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decode html color names
|
* Decode html color names
|
||||||
*
|
*
|
||||||
* @param mixed $input
|
* @param mixed $input
|
||||||
* @return ImageInterface|ColorInterface
|
* @return ImageInterface|ColorInterface
|
||||||
*/
|
*/
|
||||||
public function decode(mixed $input): ImageInterface|ColorInterface
|
public function decode(mixed $input): ImageInterface|ColorInterface
|
||||||
|
@@ -16,7 +16,7 @@ class StringColorDecoder extends AbstractDecoder implements DecoderInterface
|
|||||||
/**
|
/**
|
||||||
* Decode rgb color strings
|
* Decode rgb color strings
|
||||||
*
|
*
|
||||||
* @param mixed $input
|
* @param mixed $input
|
||||||
* @return ImageInterface|ColorInterface
|
* @return ImageInterface|ColorInterface
|
||||||
*/
|
*/
|
||||||
public function decode(mixed $input): ImageInterface|ColorInterface
|
public function decode(mixed $input): ImageInterface|ColorInterface
|
||||||
|
@@ -11,7 +11,7 @@ abstract class DriverSpecializedEncoder extends DriverSpecialized implements Enc
|
|||||||
/**
|
/**
|
||||||
* Get return value of callback through output buffer
|
* Get return value of callback through output buffer
|
||||||
*
|
*
|
||||||
* @param callable $callback
|
* @param callable $callback
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function getBuffered(callable $callback): string
|
protected function getBuffered(callable $callback): string
|
||||||
|
@@ -17,7 +17,7 @@ class BlendTransparencyModifier extends DriverSpecialized implements ModifierInt
|
|||||||
public function apply(ImageInterface $image): ImageInterface
|
public function apply(ImageInterface $image): ImageInterface
|
||||||
{
|
{
|
||||||
// decode blending color
|
// decode blending color
|
||||||
$color = $this->driver()->handleInput(
|
$color = $this->driver()->handleInput(
|
||||||
$this->color ? $this->color : $image->blendingColor()
|
$this->color ? $this->color : $image->blendingColor()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -19,7 +19,7 @@ class ResizeModifier extends DriverSpecialized implements ModifierInterface
|
|||||||
{
|
{
|
||||||
public function apply(ImageInterface $image): ImageInterface
|
public function apply(ImageInterface $image): ImageInterface
|
||||||
{
|
{
|
||||||
$resizeTo = $this->getAdjustedSize($image);
|
$resizeTo = $this->getAdjustedSize($image);
|
||||||
foreach ($image as $frame) {
|
foreach ($image as $frame) {
|
||||||
$this->resizeFrame($frame, $resizeTo);
|
$this->resizeFrame($frame, $resizeTo);
|
||||||
}
|
}
|
||||||
|
@@ -17,7 +17,7 @@ class BlendTransparencyModifier extends DriverSpecialized implements ModifierInt
|
|||||||
public function apply(ImageInterface $image): ImageInterface
|
public function apply(ImageInterface $image): ImageInterface
|
||||||
{
|
{
|
||||||
// decode blending color
|
// decode blending color
|
||||||
$color = $this->driver()->handleInput(
|
$color = $this->driver()->handleInput(
|
||||||
$this->color ? $this->color : $image->blendingColor()
|
$this->color ? $this->color : $image->blendingColor()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -11,8 +11,8 @@ class EncodedImage extends File implements EncodedImageInterface
|
|||||||
/**
|
/**
|
||||||
* Create new instance
|
* Create new instance
|
||||||
*
|
*
|
||||||
* @param string $data
|
* @param string $data
|
||||||
* @param string $mediaType
|
* @param string $mediaType
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
protected string $data,
|
protected string $data,
|
||||||
|
@@ -15,7 +15,7 @@ class File implements FileInterface
|
|||||||
/**
|
/**
|
||||||
* Create new instance
|
* Create new instance
|
||||||
*
|
*
|
||||||
* @param string $data
|
* @param string $data
|
||||||
*/
|
*/
|
||||||
public function __construct(protected string $data)
|
public function __construct(protected string $data)
|
||||||
{
|
{
|
||||||
@@ -25,7 +25,7 @@ class File implements FileInterface
|
|||||||
* Save encoded image data in file system
|
* Save encoded image data in file system
|
||||||
*
|
*
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
* @param string $filepath
|
* @param string $filepath
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function save(string $filepath): void
|
public function save(string $filepath): void
|
||||||
|
@@ -97,8 +97,8 @@ class Point implements PointInterface
|
|||||||
/**
|
/**
|
||||||
* Sets both X and Y coordinate
|
* Sets both X and Y coordinate
|
||||||
*
|
*
|
||||||
* @param integer $x
|
* @param integer $x
|
||||||
* @param integer $y
|
* @param integer $y
|
||||||
* @return Point
|
* @return Point
|
||||||
*/
|
*/
|
||||||
public function setPosition(int $x, int $y): self
|
public function setPosition(int $x, int $y): self
|
||||||
@@ -112,8 +112,8 @@ class Point implements PointInterface
|
|||||||
/**
|
/**
|
||||||
* Rotate point ccw around pivot
|
* Rotate point ccw around pivot
|
||||||
*
|
*
|
||||||
* @param float $angle
|
* @param float $angle
|
||||||
* @param Point $pivot
|
* @param Point $pivot
|
||||||
* @return Point
|
* @return Point
|
||||||
*/
|
*/
|
||||||
public function rotate(float $angle, Point $pivot): self
|
public function rotate(float $angle, Point $pivot): self
|
||||||
|
@@ -116,7 +116,7 @@ class Polygon implements IteratorAggregate, Countable, ArrayAccess, DrawableInte
|
|||||||
/**
|
/**
|
||||||
* Determine if point exists at given offset
|
* Determine if point exists at given offset
|
||||||
*
|
*
|
||||||
* @param mixed $offset
|
* @param mixed $offset
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function offsetExists($offset): bool
|
public function offsetExists($offset): bool
|
||||||
@@ -397,7 +397,7 @@ class Polygon implements IteratorAggregate, Countable, ArrayAccess, DrawableInte
|
|||||||
/**
|
/**
|
||||||
* Move all points by given amount on the x-axis
|
* Move all points by given amount on the x-axis
|
||||||
*
|
*
|
||||||
* @param int $amount
|
* @param int $amount
|
||||||
* @return Polygon
|
* @return Polygon
|
||||||
*/
|
*/
|
||||||
public function movePointsX(int $amount): self
|
public function movePointsX(int $amount): self
|
||||||
|
@@ -200,7 +200,7 @@ class RectangleResizer
|
|||||||
/**
|
/**
|
||||||
* Scale given size to cover target size
|
* Scale given size to cover target size
|
||||||
*
|
*
|
||||||
* @param SizeInterface $size Size to be resized
|
* @param SizeInterface $size Size to be resized
|
||||||
* @return SizeInterface
|
* @return SizeInterface
|
||||||
*/
|
*/
|
||||||
public function cover(SizeInterface $size): SizeInterface
|
public function cover(SizeInterface $size): SizeInterface
|
||||||
@@ -223,7 +223,7 @@ class RectangleResizer
|
|||||||
/**
|
/**
|
||||||
* Scale given size to contain target size
|
* Scale given size to contain target size
|
||||||
*
|
*
|
||||||
* @param SizeInterface $size Size to be resized
|
* @param SizeInterface $size Size to be resized
|
||||||
* @return SizeInterface
|
* @return SizeInterface
|
||||||
*/
|
*/
|
||||||
public function contain(SizeInterface $size): SizeInterface
|
public function contain(SizeInterface $size): SizeInterface
|
||||||
@@ -246,7 +246,7 @@ class RectangleResizer
|
|||||||
/**
|
/**
|
||||||
* Scale given size to contain target size but prevent upsizing
|
* Scale given size to contain target size but prevent upsizing
|
||||||
*
|
*
|
||||||
* @param SizeInterface $size Size to be resized
|
* @param SizeInterface $size Size to be resized
|
||||||
* @return SizeInterface
|
* @return SizeInterface
|
||||||
*/
|
*/
|
||||||
public function containDown(SizeInterface $size): SizeInterface
|
public function containDown(SizeInterface $size): SizeInterface
|
||||||
@@ -278,8 +278,8 @@ class RectangleResizer
|
|||||||
/**
|
/**
|
||||||
* Crop target size out of given size at given position (i.e. move the pivot point)
|
* Crop target size out of given size at given position (i.e. move the pivot point)
|
||||||
*
|
*
|
||||||
* @param SizeInterface $size
|
* @param SizeInterface $size
|
||||||
* @param string $position
|
* @param string $position
|
||||||
* @return SizeInterface
|
* @return SizeInterface
|
||||||
*/
|
*/
|
||||||
public function crop(SizeInterface $size, string $position = 'top-left'): SizeInterface
|
public function crop(SizeInterface $size, string $position = 'top-left'): SizeInterface
|
||||||
|
@@ -911,7 +911,7 @@ final class Image implements ImageInterface
|
|||||||
/**
|
/**
|
||||||
* ALias of self::toJpeg2000()
|
* ALias of self::toJpeg2000()
|
||||||
*
|
*
|
||||||
* @param mixed $options
|
* @param mixed $options
|
||||||
* @return EncodedImageInterface
|
* @return EncodedImageInterface
|
||||||
*/
|
*/
|
||||||
public function toJp2(mixed ...$options): EncodedImageInterface
|
public function toJp2(mixed ...$options): EncodedImageInterface
|
||||||
|
@@ -61,7 +61,7 @@ interface ColorInterface
|
|||||||
/**
|
/**
|
||||||
* Retrieve the color channel by its classname
|
* Retrieve the color channel by its classname
|
||||||
*
|
*
|
||||||
* @param string $classname
|
* @param string $classname
|
||||||
* @return ColorChannelInterface
|
* @return ColorChannelInterface
|
||||||
*/
|
*/
|
||||||
public function channel(string $classname): ColorChannelInterface;
|
public function channel(string $classname): ColorChannelInterface;
|
||||||
|
@@ -9,7 +9,7 @@ interface ColorspaceInterface
|
|||||||
/**
|
/**
|
||||||
* Convert given color to the format of the current colorspace
|
* Convert given color to the format of the current colorspace
|
||||||
*
|
*
|
||||||
* @param ColorInterface $color
|
* @param ColorInterface $color
|
||||||
* @return ColorInterface
|
* @return ColorInterface
|
||||||
*/
|
*/
|
||||||
public function importColor(ColorInterface $color): ColorInterface;
|
public function importColor(ColorInterface $color): ColorInterface;
|
||||||
|
@@ -16,7 +16,7 @@ interface DrawableInterface
|
|||||||
/**
|
/**
|
||||||
* Set the background color of the drawable object
|
* Set the background color of the drawable object
|
||||||
*
|
*
|
||||||
* @param mixed $color
|
* @param mixed $color
|
||||||
* @return DrawableInterface
|
* @return DrawableInterface
|
||||||
*/
|
*/
|
||||||
public function setBackgroundColor(mixed $color): DrawableInterface;
|
public function setBackgroundColor(mixed $color): DrawableInterface;
|
||||||
|
@@ -9,7 +9,7 @@ interface FileInterface
|
|||||||
/**
|
/**
|
||||||
* Save data in given path in file system
|
* Save data in given path in file system
|
||||||
*
|
*
|
||||||
* @param string $filepath
|
* @param string $filepath
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function save(string $filepath): void;
|
public function save(string $filepath): void;
|
||||||
|
@@ -109,7 +109,7 @@ interface ImageInterface extends IteratorAggregate, Countable
|
|||||||
* string values must represent a percentage value between '0%' and '100%'
|
* string values must represent a percentage value between '0%' and '100%'
|
||||||
* and the respective frame position is only determined approximately.
|
* and the respective frame position is only determined approximately.
|
||||||
*
|
*
|
||||||
* @param int|string $position
|
* @param int|string $position
|
||||||
* @return ImageInterface
|
* @return ImageInterface
|
||||||
*/
|
*/
|
||||||
public function removeAnimation(int|string $position = 0): ImageInterface;
|
public function removeAnimation(int|string $position = 0): ImageInterface;
|
||||||
@@ -216,7 +216,7 @@ interface ImageInterface extends IteratorAggregate, Countable
|
|||||||
* Set blending color will have no effect unless image is converted into a format
|
* Set blending color will have no effect unless image is converted into a format
|
||||||
* which does not support transparency.
|
* which does not support transparency.
|
||||||
*
|
*
|
||||||
* @param mixed $color
|
* @param mixed $color
|
||||||
* @return ImageInterface
|
* @return ImageInterface
|
||||||
*/
|
*/
|
||||||
public function setBlendingColor(mixed $color): ImageInterface;
|
public function setBlendingColor(mixed $color): ImageInterface;
|
||||||
@@ -239,7 +239,7 @@ interface ImageInterface extends IteratorAggregate, Countable
|
|||||||
/**
|
/**
|
||||||
* Set given icc color profile to image
|
* Set given icc color profile to image
|
||||||
*
|
*
|
||||||
* @param ProfileInterface $profile
|
* @param ProfileInterface $profile
|
||||||
* @return ImageInterface
|
* @return ImageInterface
|
||||||
*/
|
*/
|
||||||
public function setProfile(ProfileInterface $profile): ImageInterface;
|
public function setProfile(ProfileInterface $profile): ImageInterface;
|
||||||
@@ -263,7 +263,7 @@ interface ImageInterface extends IteratorAggregate, Countable
|
|||||||
/**
|
/**
|
||||||
* Sharpen the current image with given strength
|
* Sharpen the current image with given strength
|
||||||
*
|
*
|
||||||
* @param int $amount
|
* @param int $amount
|
||||||
* @return ImageInterface
|
* @return ImageInterface
|
||||||
*/
|
*/
|
||||||
public function sharpen(int $amount = 10): ImageInterface;
|
public function sharpen(int $amount = 10): ImageInterface;
|
||||||
@@ -278,7 +278,7 @@ interface ImageInterface extends IteratorAggregate, Countable
|
|||||||
/**
|
/**
|
||||||
* Adjust brightness of the current image
|
* Adjust brightness of the current image
|
||||||
*
|
*
|
||||||
* @param int $level
|
* @param int $level
|
||||||
* @return ImageInterface
|
* @return ImageInterface
|
||||||
*/
|
*/
|
||||||
public function brightness(int $level): ImageInterface;
|
public function brightness(int $level): ImageInterface;
|
||||||
@@ -286,7 +286,7 @@ interface ImageInterface extends IteratorAggregate, Countable
|
|||||||
/**
|
/**
|
||||||
* Adjust color contrast of the current image
|
* Adjust color contrast of the current image
|
||||||
*
|
*
|
||||||
* @param int $level
|
* @param int $level
|
||||||
* @return ImageInterface
|
* @return ImageInterface
|
||||||
*/
|
*/
|
||||||
public function contrast(int $level): ImageInterface;
|
public function contrast(int $level): ImageInterface;
|
||||||
@@ -294,7 +294,7 @@ interface ImageInterface extends IteratorAggregate, Countable
|
|||||||
/**
|
/**
|
||||||
* Apply gamma correction on the current image
|
* Apply gamma correction on the current image
|
||||||
*
|
*
|
||||||
* @param float $gamma
|
* @param float $gamma
|
||||||
* @return ImageInterface
|
* @return ImageInterface
|
||||||
*/
|
*/
|
||||||
public function gamma(float $gamma): ImageInterface;
|
public function gamma(float $gamma): ImageInterface;
|
||||||
@@ -302,9 +302,9 @@ interface ImageInterface extends IteratorAggregate, Countable
|
|||||||
/**
|
/**
|
||||||
* Adjust the intensity of the RGB color channels
|
* Adjust the intensity of the RGB color channels
|
||||||
*
|
*
|
||||||
* @param int $red
|
* @param int $red
|
||||||
* @param int $green
|
* @param int $green
|
||||||
* @param int $blue
|
* @param int $blue
|
||||||
* @return ImageInterface
|
* @return ImageInterface
|
||||||
*/
|
*/
|
||||||
public function colorize(int $red = 0, int $green = 0, int $blue = 0): ImageInterface;
|
public function colorize(int $red = 0, int $green = 0, int $blue = 0): ImageInterface;
|
||||||
@@ -349,18 +349,18 @@ interface ImageInterface extends IteratorAggregate, Countable
|
|||||||
/**
|
/**
|
||||||
* Rotate current image by given angle
|
* Rotate current image by given angle
|
||||||
*
|
*
|
||||||
* @param float $angle
|
* @param float $angle
|
||||||
* @param string $background
|
* @param string $background
|
||||||
* @return ImageInterface
|
* @return ImageInterface
|
||||||
*/
|
*/
|
||||||
public function rotate(float $angle, mixed $background = 'ffffff'): ImageInterface;
|
public function rotate(float $angle, mixed $background = 'ffffff'): ImageInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draw text on image
|
* Draw text on image
|
||||||
*
|
*
|
||||||
* @param string $text
|
* @param string $text
|
||||||
* @param int $x
|
* @param int $x
|
||||||
* @param int $y
|
* @param int $y
|
||||||
* @param callable|FontInterface $font
|
* @param callable|FontInterface $font
|
||||||
* @return ImageInterface
|
* @return ImageInterface
|
||||||
*/
|
*/
|
||||||
@@ -526,11 +526,11 @@ interface ImageInterface extends IteratorAggregate, Countable
|
|||||||
/**
|
/**
|
||||||
* Place another image into the current image instance
|
* Place another image into the current image instance
|
||||||
*
|
*
|
||||||
* @param mixed $element
|
* @param mixed $element
|
||||||
* @param string $position
|
* @param string $position
|
||||||
* @param int $offset_x
|
* @param int $offset_x
|
||||||
* @param int $offset_y
|
* @param int $offset_y
|
||||||
* @param int $opacity
|
* @param int $opacity
|
||||||
* @return ImageInterface
|
* @return ImageInterface
|
||||||
*/
|
*/
|
||||||
public function place(
|
public function place(
|
||||||
@@ -561,8 +561,8 @@ interface ImageInterface extends IteratorAggregate, Countable
|
|||||||
/**
|
/**
|
||||||
* Draw a single pixel at given position defined by the coordinates x and y in a given color.
|
* Draw a single pixel at given position defined by the coordinates x and y in a given color.
|
||||||
*
|
*
|
||||||
* @param int $x
|
* @param int $x
|
||||||
* @param int $y
|
* @param int $y
|
||||||
* @param mixed $color
|
* @param mixed $color
|
||||||
* @return ImageInterface
|
* @return ImageInterface
|
||||||
*/
|
*/
|
||||||
|
@@ -9,7 +9,7 @@ interface InputHandlerInterface
|
|||||||
/**
|
/**
|
||||||
* Try to decode the given input with each decoder of the the handler chain
|
* Try to decode the given input with each decoder of the the handler chain
|
||||||
*
|
*
|
||||||
* @param mixed $input
|
* @param mixed $input
|
||||||
* @return ImageInterface|ColorInterface
|
* @return ImageInterface|ColorInterface
|
||||||
*/
|
*/
|
||||||
public function handle($input): ImageInterface|ColorInterface;
|
public function handle($input): ImageInterface|ColorInterface;
|
||||||
|
@@ -23,8 +23,8 @@ interface PointInterface
|
|||||||
/**
|
/**
|
||||||
* Set position of point
|
* Set position of point
|
||||||
*
|
*
|
||||||
* @param int $x
|
* @param int $x
|
||||||
* @param int $y
|
* @param int $y
|
||||||
* @return PointInterface
|
* @return PointInterface
|
||||||
*/
|
*/
|
||||||
public function setPosition(int $x, int $y): PointInterface;
|
public function setPosition(int $x, int $y): PointInterface;
|
||||||
|
@@ -16,7 +16,7 @@ interface ResolutionInterface
|
|||||||
/**
|
/**
|
||||||
* Set resolution on x-axix
|
* Set resolution on x-axix
|
||||||
*
|
*
|
||||||
* @param float $x
|
* @param float $x
|
||||||
* @return ResolutionInterface
|
* @return ResolutionInterface
|
||||||
*/
|
*/
|
||||||
public function setX(float $x): ResolutionInterface;
|
public function setX(float $x): ResolutionInterface;
|
||||||
@@ -31,7 +31,7 @@ interface ResolutionInterface
|
|||||||
/**
|
/**
|
||||||
* Set resolution on y-axis
|
* Set resolution on y-axis
|
||||||
*
|
*
|
||||||
* @param float $y
|
* @param float $y
|
||||||
* @return ResolutionInterface
|
* @return ResolutionInterface
|
||||||
*/
|
*/
|
||||||
public function setY(float $y): ResolutionInterface;
|
public function setY(float $y): ResolutionInterface;
|
||||||
|
@@ -95,7 +95,7 @@ interface SizeInterface
|
|||||||
* Calculate the relative position to another Size
|
* Calculate the relative position to another Size
|
||||||
* based on the pivot point settings of both sizes.
|
* based on the pivot point settings of both sizes.
|
||||||
*
|
*
|
||||||
* @param SizeInterface $size
|
* @param SizeInterface $size
|
||||||
* @return PointInterface
|
* @return PointInterface
|
||||||
*/
|
*/
|
||||||
public function relativePositionTo(SizeInterface $size): PointInterface;
|
public function relativePositionTo(SizeInterface $size): PointInterface;
|
||||||
|
@@ -29,10 +29,10 @@ class ChannelTest extends TestCase
|
|||||||
$this->assertInstanceOf(Channel::class, $channel);
|
$this->assertInstanceOf(Channel::class, $channel);
|
||||||
|
|
||||||
$this->expectException(ColorException::class);
|
$this->expectException(ColorException::class);
|
||||||
$channel = new Channel();
|
new Channel();
|
||||||
|
|
||||||
$this->expectException(ColorException::class);
|
$this->expectException(ColorException::class);
|
||||||
$channel = new Channel(normalized: 2);
|
new Channel(normalized: 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testConstructorFail(): void
|
public function testConstructorFail(): void
|
||||||
|
@@ -29,10 +29,10 @@ class ChannelTest extends TestCase
|
|||||||
$this->assertInstanceOf(Hue::class, $channel);
|
$this->assertInstanceOf(Hue::class, $channel);
|
||||||
|
|
||||||
$this->expectException(ColorException::class);
|
$this->expectException(ColorException::class);
|
||||||
$channel = new Hue();
|
new Hue();
|
||||||
|
|
||||||
$this->expectException(ColorException::class);
|
$this->expectException(ColorException::class);
|
||||||
$channel = new Hue(normalized: 2);
|
new Hue(normalized: 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testConstructorFail(): void
|
public function testConstructorFail(): void
|
||||||
|
@@ -30,10 +30,10 @@ class ChannelTest extends TestCase
|
|||||||
$this->assertInstanceOf(Hue::class, $channel);
|
$this->assertInstanceOf(Hue::class, $channel);
|
||||||
|
|
||||||
$this->expectException(ColorException::class);
|
$this->expectException(ColorException::class);
|
||||||
$channel = new Hue();
|
new Hue();
|
||||||
|
|
||||||
$this->expectException(ColorException::class);
|
$this->expectException(ColorException::class);
|
||||||
$channel = new Hue(normalized: 2);
|
new Hue(normalized: 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testConstructorFail(): void
|
public function testConstructorFail(): void
|
||||||
|
@@ -28,10 +28,10 @@ class ChannelTest extends TestCase
|
|||||||
$this->assertInstanceOf(Channel::class, $channel);
|
$this->assertInstanceOf(Channel::class, $channel);
|
||||||
|
|
||||||
$this->expectException(ColorException::class);
|
$this->expectException(ColorException::class);
|
||||||
$channel = new Channel();
|
new Channel();
|
||||||
|
|
||||||
$this->expectException(ColorException::class);
|
$this->expectException(ColorException::class);
|
||||||
$channel = new Channel(normalized: 2);
|
new Channel(normalized: 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testConstructorFail(): void
|
public function testConstructorFail(): void
|
||||||
|
@@ -22,6 +22,6 @@ class ColorProcessorTest extends TestCase
|
|||||||
public function testNativeToColor(): void
|
public function testNativeToColor(): void
|
||||||
{
|
{
|
||||||
$processor = new ColorProcessor(new Colorspace());
|
$processor = new ColorProcessor(new Colorspace());
|
||||||
$result = $processor->nativeToColor(new ImagickPixel('rgb(255, 55, 0)'));
|
$processor->nativeToColor(new ImagickPixel('rgb(255, 55, 0)'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user