This interface has to implemented by ezcImageFilters classes to support geometry filters.
Source for this file: /ImageConversion/src/interfaces/geometry.php
Version: | //autogentag// |
SCALE_BOTH
= 1
|
Scale up and down, as fits |
SCALE_DOWN
= 2
|
Scale down only |
SCALE_UP
= 3
|
Scale up only |
public void |
crop(
$x
, $y
, $width
, $height
)
Crop filter. |
public void |
scale(
$width
, $height
, [ $direction
= ezcImageGeometryFilters::SCALE_BOTH] )
Scale filter. |
public void |
scaleExact(
$width
, $height
)
Scale exact filter. |
public void |
scaleHeight(
$height
, $direction
)
Scale after height filter. |
public void |
scalePercent(
$width
, $height
)
Scale percent measures filter. |
public void |
scaleWidth(
$width
, $direction
)
Scale after width filter. |
Crop filter.
Crop an image to a given size. This takes cartesian coordinates of a rect area to crop from the image. The cropped area will replace the old image resource (not the input image immediately, if you use the ezcImageConverter). Coordinates are given as integer values and are measured from the top left corner.
Name | Type | Description |
---|---|---|
$x |
int | Start cropping, x coordinate. |
$y |
int | Start cropping, y coordinate. |
$width |
int | Width of cropping area. |
$height |
int | Height of cropping area. |
Type | Description |
---|---|
ezcImageInvalidReferenceException |
If no valid resource for the active reference could be found. |
ezcImageFilterFailedException |
If the operation performed by the the filter failed. |
ezcBaseValueException |
If a submitted parameter was out of range or type. |
Scale filter.
General scale filter. Scales the image to fit into a given box size, determined by a given width and height value, measured in pixel. This method maintains the aspect ratio of the given image. Depending on the given direction value, this method performs the following scales:
Name | Type | Description |
---|---|---|
$width |
int | Scale to width |
$height |
int | Scale to height |
$direction |
int | Scale to which direction. |
Type | Description |
---|---|
ezcImageInvalidReferenceException |
If no valid resource for the active reference could be found. |
ezcImageFilterFailedException |
If the operation performed by the the filter failed. |
ezcBaseValueException |
If a submitted parameter was out of range or type. |
Scale exact filter.
Scale the image to a fixed given pixel size, no matter to which direction.
Name | Type | Description |
---|---|---|
$width |
int | Scale to width |
$height |
int | Scale to height |
Type | Description |
---|---|
ezcImageInvalidReferenceException |
If no valid resource for the active reference could be found. |
ezcImageFilterFailedException |
If the operation performed by the the filter failed. |
ezcBaseValueException |
If a submitted parameter was out of range or type. |
Scale after height filter.
Scales the image to a give height, measured in pixel. Scales the width automatically while keeping the ratio. The direction dictates, if an image may only be scaled self::SCALE_UP, self::SCALE_DOWN or if the scale may work in self::SCALE_BOTH directions.
Name | Type | Description |
---|---|---|
$height |
int | Scale to height |
$direction |
int | Scale to which direction |
Type | Description |
---|---|
ezcImageInvalidReferenceException |
If no valid resource for the active reference could be found. |
ezcImageFilterFailedException |
If the operation performed by the the filter failed. |
ezcBaseValueException |
If a submitted parameter was out of range or type. |
Scale percent measures filter.
Scale an image to a given percentage value size.
Name | Type | Description |
---|---|---|
$width |
int | Scale to width |
$height |
int | Scale to height |
Type | Description |
---|---|
ezcImageInvalidReferenceException |
If no valid resource for the active reference could be found. |
ezcImageFilterFailedException |
If the operation performed by the the filter failed. |
ezcBaseValueException |
If a submitted parameter was out of range or type. |
Scale after width filter.
Scales the image to a give width, measured in pixel. Scales the height automatically while keeping the ratio. The direction dictates, if an image may only be scaled self::SCALE_UP, self::SCALE_DOWN or if the scale may work in self::SCALE_BOTH directions.
Name | Type | Description |
---|---|---|
$width |
int | Scale to width |
$direction |
int | Scale to which direction |
Type | Description |
---|---|
ezcImageInvalidReferenceException |
If no valid resource for the active reference could be found. |
ezcImageFilterFailedException |
If the operation performed by the the filter failed. |
ezcBaseValueException |
If a submitted parameter was out of range or type. |