public class RgbImage
extends java.lang.Object
BufferedImage
constants
TYPE_INT_RGB
and TYPE_INT_ARGB
.
The values in the buffer are therefore the same as those used by
BufferedImage
setRGB
/getRGB
,
but can (presumably) be manipulated more efficiently by addressing the
array here directly.
These RGB values are also the same as those used by Compositor
.
Note: in tests, painting a colour on the image's
graphics context does not seem to give exactly the expected result
in terms of ARGB values in the buffer, though it's not far off.
See the RgbImageTest
testcase for more discussion.
Modifier and Type | Method | Description |
---|---|---|
static RgbImage |
createRgbImage(int width,
int height,
boolean hasAlpha) |
Constructs an RgbImage.
|
int[] |
getBuffer() |
Returns the data as a modifiable int array.
|
java.awt.image.BufferedImage |
getImage() |
Returns the data as a BufferedImage.
|
public java.awt.image.BufferedImage getImage()
public int[] getBuffer()
public static RgbImage createRgbImage(int width, int height, boolean hasAlpha)
width
- width in pixelsheight
- height in pixelshasAlpha
- true for ARGB, false for RGBCopyright © 2018 Central Laboratory of the Research Councils. All Rights Reserved.