I recently got in touch with Java 8 and I'm trying to learn Lambda expressions. I want to do some graphics calculations, my code so far:
IntStream.range(0, (screenSize.width * screenSize.height)).parallel().forEach(id -> {
int x = id % screenSize.width;
int y = ((id-x) / screenSize.width);
/*look up what color this pixel is.*/
});
Now all this Code is for graphics, everything is basic Math (plus, minus, multiply, modulo), except for bufferedImage.getRGB(x, y)
and operations with java.awt.Color
, and it can be done for each pixel seperately.
Now the question: Is it possible to run this on the GPU? Or is this even automatically GPU-based? (I remember reading this somewhere, but I'm not sure)