I have an array of bytes which represents JPEG image. Is there any way to convert it directly to RGB array?
What i'm doing now is first create Buffered Image
and thet get RGB array from it. Maybe, there is less expensive way to do this?
BufferedImage bufImage = new BufferedImage(640, 480, BufferedImage.TYPE_INT_RGB);
ByteArrayInputStream stream = new ByteArrayInputStream(jpegBytes);
bufImage = ImageIO.read(stream);
int[] ib = bufImage.getRGB(0, 0, bufImage.getWidth(), bufImage.getHeight(), null, 0, bufImage.getWidth());