This is supposed to create a large image out of a smaller one.
It does this by:
Creating a temporary power of 2 image.
It grabs the pixels of the original image and pastes it into the PO2 temporary image.
Should work but it doesn’t. Anyone know why?
private BufferedImage convertToPO2(BufferedImage img) {
BufferedImage tmpImg = null;
tmpImg = new BufferedImage(img.getWidth() * 2, img.getHeight() * 2, BufferedImage.TYPE_INT_ARGB);
double[] rPix = new double[img.getWidth() * img.getHeight() * 4];
for (int i = 0; i < 4; i++) {
rPix = img.getData().getSamples(0, 0, img.getWidth(), img.getHeight(), i, rPix);
tmpImg.getRaster().setSamples(0, 0, img.getWidth(), img.getHeight(), i, rPix);
}
return tmpImg;
}