diff options
author | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-07-25 22:01:01 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-25 14:01:01 +0100 |
commit | 045ca00486e62c89a4da5f880f6f52016e4dd14a (patch) | |
tree | f77f40fbaed328b0d6b54a98adb49d7dd9b38229 /src/main/java/cc/polyfrost/oneconfig/images | |
parent | 8a01f36d1021159f2c49ae8083febc046a4a8502 (diff) | |
download | OneConfig-045ca00486e62c89a4da5f880f6f52016e4dd14a.tar.gz OneConfig-045ca00486e62c89a4da5f880f6f52016e4dd14a.tar.bz2 OneConfig-045ca00486e62c89a4da5f880f6f52016e4dd14a.zip |
fix: stop using internal asset classes everywhere (#69)
* fix: stop using internal asset classes everywhere
new: add wrapper classes for NanoVG rendering and rename original Image wrapper to OneImage
* I love regex
Co-authored-by: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/images')
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/images/OneImage.java (renamed from src/main/java/cc/polyfrost/oneconfig/images/Image.java) | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/images/Image.java b/src/main/java/cc/polyfrost/oneconfig/images/OneImage.java index 16957c1..20bfc2c 100644 --- a/src/main/java/cc/polyfrost/oneconfig/images/Image.java +++ b/src/main/java/cc/polyfrost/oneconfig/images/OneImage.java @@ -20,53 +20,53 @@ import java.util.Objects; /** An Image wrapper class that is used by the OneConfig system.*/ @SuppressWarnings("unused") -public class Image { +public class OneImage { private static final Logger LOGGER = LogManager.getLogger("OneConfig Images"); private BufferedImage image; private Graphics2D graphics = null; private final int width, height; /** - * Create a new Image from the file. This can be as a resource location inside your JAR. + * Create a new OneImage from the file. This can be as a resource location inside your JAR. * @param filePath The path to the image file. */ - public Image(String filePath) throws IOException { - image = ImageIO.read(Objects.requireNonNull(Image.class.getResourceAsStream(filePath))); + public OneImage(String filePath) throws IOException { + image = ImageIO.read(Objects.requireNonNull(OneImage.class.getResourceAsStream(filePath))); width = image.getWidth(); height = image.getHeight(); } /** - * Create a new Image from the file. + * Create a new OneImage from the file. * @param is InputStream to the image file. */ - public Image(InputStream is) throws IOException { + public OneImage(InputStream is) throws IOException { image = ImageIO.read(is); width = image.getWidth(); height = image.getHeight(); } /** - * Create a new Image from the file. + * Create a new OneImage from the file. * @param file File to the image file. */ - public Image(File file) throws IOException { + public OneImage(File file) throws IOException { image = ImageIO.read(Objects.requireNonNull(file)); width = image.getWidth(); height = image.getHeight(); } /** - * Create a new Image from the BufferedImage. + * Create a new OneImage from the BufferedImage. */ - public Image(BufferedImage image) { + public OneImage(BufferedImage image) { this.image = image; width = image.getWidth(); height = image.getHeight(); } /** Create a new blank image with the specified width and height. */ - public Image(int width, int height) { + public OneImage(int width, int height) { this.width = width; this.height = height; image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); |