|
@@ -0,0 +1,18 @@
|
|
|
+package xyz.tbvns.powerGD;
|
|
|
+
|
|
|
+import com.badlogic.gdx.graphics.Pixmap;
|
|
|
+
|
|
|
+import java.awt.image.BufferedImage;
|
|
|
+
|
|
|
+public class Utils {
|
|
|
+ private BufferedImage pixmapToBufferedImage(Pixmap img) {
|
|
|
+ int w = img.getWidth(), h = img.getHeight();
|
|
|
+
|
|
|
+ int[] pixels = new int[w * h];
|
|
|
+ img.getPixels().asIntBuffer().get(pixels);
|
|
|
+
|
|
|
+ BufferedImage out = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
|
|
|
+ out.setRGB(0, 0, w, h, pixels, 0, w);
|
|
|
+ return out;
|
|
|
+ }
|
|
|
+}
|