Class ImageUtils
java.lang.Object
io.github.jspinak.brobot.imageUtils.ImageUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
int
getFreeNumber
(String path) getFreePath
(String path) Searches for the first free filename with the given base path name.getFreePath
(String prefix, String suffix) matToPattern
(org.bytedeco.opencv.opencv_core.Mat mat, String name) Saves the Mat as a .png to file and creates a Pattern object.saveBuffImgToFile
(BufferedImage bufferedImage, String path) saveRegionToFile
(Region region, String path) Saves the region to file as a .png file.saveScreenshotToFile
(String path) boolean
writeAllWithUniqueFilename
(List<org.bytedeco.opencv.opencv_core.Mat> mats, List<String> filenames) boolean
writeWithUniqueFilename
(org.bytedeco.opencv.opencv_core.Mat mat, String nameWithoutFiletype)
-
Constructor Details
-
ImageUtils
-
-
Method Details
-
saveRegionToFile
Saves the region to file as a .png file.- Parameters:
region
- The region to savepath
- The base path name: the first free filename will be used based on the base path name and an available number.- Returns:
- The path name used to save the file.
-
saveBuffImgToFile
-
saveScreenshotToFile
-
getFreePath
Searches for the first free filename with the given base path name.- Parameters:
path
- the base path name- Returns:
- the path name with the first free filename
-
getFreePath
-
getFreePath
-
getFreeNumber
public int getFreeNumber() -
getFreeNumber
-
matToPattern
Saves the Mat as a .png to file and creates a Pattern object.- Parameters:
mat
- the Mat to savename
- name without filetype, saved as .png, overwrites a file with the same name- Returns:
- a Pattern object
-
writeWithUniqueFilename
public boolean writeWithUniqueFilename(org.bytedeco.opencv.opencv_core.Mat mat, String nameWithoutFiletype) -
writeAllWithUniqueFilename
-