/** * Create an int value ([a]rgb) from the given color array (rgb[a]), the result can be used for buffered images. * * @param color * to be converted may be of length 3 or 4, not <code>null</code>. * @return the color as an int holding argb. */ public static int convertBytesToARGBInt( byte[] color ) { int result = convertBytesToRGBInt( color ); if ( color.length == 4 ) { result = color[3] & 0x000000FF; result <<= 8; } return result; }
for ( int x = 0; x < width; x++ ) { imageBuffer.get( color ); resultImage.setRGB( x, y, convertBytesToRGBInt( color ) );