add temp method

This commit is contained in:
Bella 2020-02-21 21:29:45 -05:00
parent 04ec2f8475
commit 537b2c10d3
1 changed files with 19 additions and 3 deletions

View File

@ -1,12 +1,15 @@
package me.zeroeightsix.kami.util; package me.zeroeightsix.kami.util;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.awt.image.DataBufferByte; import java.awt.image.DataBufferByte;
import java.awt.image.WritableRaster;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.nio.ByteOrder; import java.util.Objects;
import static org.lwjgl.BufferUtils.*;
/** /**
@ -28,5 +31,18 @@ public class WindowIcon {
// return null; // return null;
// } // }
// } // }
/*
public static ByteBuffer[] extractBytes() throws IOException {
BufferedImage bufferedImage = ImageIO.read(new File("kami.jpg"));
// ByteArrayOutputStream bos = new ByteArrayOutputStream();
// ImageIO.write(bufferedImage, "jpg", bos );
// byte [] data = bos.toByteArray();
WritableRaster raster = bufferedImage.getRaster();
DataBufferByte data = (DataBufferByte) raster.getDataBuffer();
return new ByteBuffer[]{ByteBuffer.wrap(data.getData())};
}
*/
} }