class Transformation implements FilterInterface, ManipulatorInterface
A transformation filter
Methods
__construct(ImagineInterface $imagine = null)
Class constructor. |
||
ImageInterface |
applyFilter(ImageInterface $image, FilterInterface $filter)
Applies a given FilterInterface onto given ImageInterface and returns modified ImageInterface |
|
array |
getFilters()
Returns a list of filters sorted by their priority. |
|
ImageInterface |
apply(ImageInterface $image)
Applies scheduled transformation to ImageInterface instance Returns processed ImageInterface instance |
|
ManipulatorInterface |
copy()
Copies current source image into a new ImageInterface instance |
|
ManipulatorInterface |
crop(PointInterface $start, BoxInterface $size)
Crops a specified box out of the source image (modifies the source image) Returns cropped self |
|
ManipulatorInterface |
flipHorizontally()
Flips current image using horizontal axis |
|
ManipulatorInterface |
flipVertically()
Flips current image using vertical axis |
|
ManipulatorInterface |
strip()
Remove all profiles and comments |
|
ManipulatorInterface |
paste(ImageInterface $image, PointInterface $start)
Pastes an image into a parent image Throws exceptions if image exceeds parent image borders or if paste operation fails |
|
ManipulatorInterface |
applyMask(ImageInterface $mask)
Applies a given mask to current image's alpha channel |
|
ManipulatorInterface |
fill(FillInterface $fill)
Fills image with provided filling, by replacing each pixel's color in the current image with corresponding color from FillInterface, and returns modified image |
|
ManipulatorInterface |
resize(BoxInterface $size, string $filter = ImageInterface::FILTER_UNDEFINED)
Resizes current image and returns self |
|
ManipulatorInterface |
rotate(integer $angle, ColorInterface $background = null)
Rotates an image at the given angle. |
|
ManipulatorInterface |
save(string $path = null, array $options = array())
Saves the image at a specified path, the target file extension is used to determine file format, only jpg, jpeg, gif, png, wbmp and xbm are supported |
|
ManipulatorInterface |
show(string $format, array $options = array())
Outputs the image content |
|
ManipulatorInterface |
thumbnail(BoxInterface $size, string $mode = ImageInterface::THUMBNAIL_INSET, string $filter = ImageInterface::FILTER_UNDEFINED)
Generates a thumbnail from a current image Returns it as a new image, doesn't modify the current image |
|
Transformation |
add(FilterInterface $filter, int $priority)
Registers a given FilterInterface in an internal array of filters for later application to an instance of ImageInterface |
Details
at line 63
public
__construct(ImagineInterface $imagine = null)
Class constructor.
at line 78
public ImageInterface
applyFilter(ImageInterface $image, FilterInterface $filter)
Applies a given FilterInterface onto given ImageInterface and returns modified ImageInterface
at line 95
public array
getFilters()
Returns a list of filters sorted by their priority.
Filters with same priority will be returned in the order they were added.
at line 112
public ImageInterface
apply(ImageInterface $image)
Applies scheduled transformation to ImageInterface instance Returns processed ImageInterface instance
at line 124
public ManipulatorInterface
copy()
Copies current source image into a new ImageInterface instance
at line 132
public ManipulatorInterface
crop(PointInterface $start, BoxInterface $size)
Crops a specified box out of the source image (modifies the source image) Returns cropped self
at line 140
public ManipulatorInterface
flipHorizontally()
Flips current image using horizontal axis
at line 148
public ManipulatorInterface
flipVertically()
Flips current image using vertical axis
at line 156
public ManipulatorInterface
strip()
Remove all profiles and comments
at line 164
public ManipulatorInterface
paste(ImageInterface $image, PointInterface $start)
Pastes an image into a parent image Throws exceptions if image exceeds parent image borders or if paste operation fails
Returns source image
at line 172
public ManipulatorInterface
applyMask(ImageInterface $mask)
Applies a given mask to current image's alpha channel
at line 180
public ManipulatorInterface
fill(FillInterface $fill)
Fills image with provided filling, by replacing each pixel's color in the current image with corresponding color from FillInterface, and returns modified image
at line 188
public ManipulatorInterface
resize(BoxInterface $size, string $filter = ImageInterface::FILTER_UNDEFINED)
Resizes current image and returns self
at line 196
public ManipulatorInterface
rotate(integer $angle, ColorInterface $background = null)
Rotates an image at the given angle.
Optional $background can be used to specify the fill color of the empty area of rotated image.
at line 204
public ManipulatorInterface
save(string $path = null, array $options = array())
Saves the image at a specified path, the target file extension is used to determine file format, only jpg, jpeg, gif, png, wbmp and xbm are supported
at line 212
public ManipulatorInterface
show(string $format, array $options = array())
Outputs the image content
at line 220
public ManipulatorInterface
thumbnail(BoxInterface $size, string $mode = ImageInterface::THUMBNAIL_INSET, string $filter = ImageInterface::FILTER_UNDEFINED)
Generates a thumbnail from a current image Returns it as a new image, doesn't modify the current image
at line 233
public Transformation
add(FilterInterface $filter, int $priority)
Registers a given FilterInterface in an internal array of filters for later application to an instance of ImageInterface