BufferedImage - Serabe/rinzelight GitHub Wiki
This is one of the few namespaces that is not gonna be fully documented.
The reason behind this decission is that if you need to use Buffered Image it is quite likely that you are writing your own effect so you really need to know what is happening in those functions. Anyway, here is a brief introduction.
As the name suggests, where dealing with images here. Right now, images are not a protocol yet (maybe for rinzelight 0.0.4), so most methods still expect an image structure and return a BufferedImage. The difference between create-empty-canvas
and create-new-canvas-for-image
is that the latter returns a new BufferedImage but the image is drawn on it.
There are several functions for getting and setting pixels from and to an image. Take a look at the create-sample-accessors
macro to know the available method for specific channels.
If you want to get the values for every channel, use get-pixels-int-array
. This method returns a one-dimensional int array with all the pixels values. For setting pixels values, use get-pixels-int-array
.
These two functions return and accept pixel-packet
instead of int-array.