Skip to content

Commit 0c73db8

Browse files
committed
- Updated documentation for scaleImage and getBufferedImage
1 parent 0b25dad commit 0c73db8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

MekHQ/src/mekhq/utilities/ImageUtilities.java

+15
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ public static ImageIcon scaleImageIcon(ImageIcon icon, int size, boolean scaleBy
122122
*
123123
* @return A scaled {@link Image}, resized to the specified target dimension while maintaining the aspect ratio. If
124124
* the provided {@link Image} is {@code null}, returns an empty {@link Image}.
125+
*
126+
* @author Illiani
127+
* @since 0.50.05
125128
*/
126129
public static Image scaleImage(Image image, int size, boolean scaleByWidth) {
127130
if (image == null) {
@@ -143,6 +146,18 @@ public static Image scaleImage(Image image, int size, boolean scaleByWidth) {
143146
return getBufferedImage(image, width, height);
144147
}
145148

149+
/**
150+
* Creates a high-quality, scaled {@link BufferedImage} with the specified dimensions.
151+
*
152+
* @param image The source {@link Image} to be scaled. Must not be {@code null}.
153+
* @param width The target width for the scaled image.
154+
* @param height The target height for the scaled image.
155+
*
156+
* @return A {@link BufferedImage} scaled to the specified dimensions with high-quality rendering.
157+
*
158+
* @author Illiani
159+
* @since 0.50.05
160+
*/
146161
private static BufferedImage getBufferedImage(Image image, int width, int height) {
147162
// Create a new BufferedImage with the desired dimensions
148163
BufferedImage scaledImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);

0 commit comments

Comments
 (0)