java - Color of setPixel -


found example:

raster.setpixel( pf, jj, clr ); 

but clr has 4 elements:

static int[] clr = {0, 0, 0, 255};  

why? 4th element mean? doesn't work without it, throws arrayindexoutofboundsexception.

as per comment, confirmed raster if of type writableraster.

first, exception

it doesn't work without it, throws arrayindexoutofboundsexception.

from documentation, aioobe thrown if coordinates not in bounds, or if given array small hold input.

now represent 4 input given in array,

the input array define sample each bands of raster. if call example, writableraster#getnumbands should return 4.

but whare bands ?

here visual representation of array of 3 samples represent :

enter image description here

now fourth band, i'm pretty sure alpha sample. well, @ least 1 of them alpha can't confirm 1 can modify order of bands when creating raster.


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -