ru.yandex.qatools.ashot.cropper.ImageCropper Maven / Gradle / Ivy
package ru.yandex.qatools.ashot.cropper;
import ru.yandex.qatools.ashot.Screenshot;
import ru.yandex.qatools.ashot.coordinates.Coords;
import java.awt.image.BufferedImage;
import java.io.Serializable;
import java.util.Set;
/**
* @author Pavel Zorin
*/
public abstract class ImageCropper implements Serializable {
public Screenshot crop(BufferedImage image, Set cropArea) {
return cropArea.isEmpty()
? new Screenshot(image)
: cropScreenshot(image, cropArea);
}
protected abstract Screenshot cropScreenshot(BufferedImage image, Set coordsToCompare);
}