Monday, September 1, 2014

How can I create a raster from a custom Pixel array?


(Copied from stackoverflow to get extra help: java - How can I create a raster from a custom Pixel array? - Game Development Stack Exchange)


I have a rasterizer that I am building. It will first load a .obj file and create points to draw. Then, an image will be plastered over the wire frame and from there become an image on the next frame. The details are:


Load vectors from file

create a wire frame from the points

overlay an image

create raster from Pixel[] array

create BufferedImage

draw to screen

The last three steps repeat after loading the vectors.


My Pixel class just stores an RGB value, as well as I have an RGB class which specifies how much Red, Green, and Blue. (public Pixel(RGB rgb))


With an array of these Pixels, I want to make a Raster. How can I create a Raster with raw pixel data? the colors are 64-bit if that helps (private static final long RED, GREEN, BLUE; in RGB instance within Pixel instance)



No comments:

Post a Comment