Grafika\EditorInterface::crop PHP Method

crop() public method

Crop the image to the given dimension and position.
public crop ( grafika\ImageInterface &$image, integer $cropWidth, integer $cropHeight, string $position = 'center', integer $offsetX, integer $offsetY ) : grafika\EditorInterface
$image grafika\ImageInterface Instance of Image.
$cropWidth integer Crop width in pixels.
$cropHeight integer Crop Height in pixels.
$position string The crop position. Possible values top-left, top-center, top-right, center-left, center, center-right, bottom-left, bottom-center, bottom-right and smart. Defaults to center.
$offsetX integer Number of pixels to add to the X position of the crop.
$offsetY integer Number of pixels to add to the Y position of the crop.
return grafika\EditorInterface An instance of Editor.
    public function crop(&$image, $cropWidth, $cropHeight, $position = 'center', $offsetX = 0, $offsetY = 0);