Interface Compositor.Buffer
- Enclosing class:
Compositor
public static interface Compositor.Buffer
Buffer of pixels on which compositing operations can be performed.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addSample
(int index, float r, float g, float b, float alpha) Adds an RGBA sample to one pixel, using separate float scalars.boolean
addSample
(int index, int rgba) Adds an RGBA sample to one pixel, using an RGBA integer.boolean
addSample
(int index, int rgb, float alpha) Adds an RGBA sample to one pixel, using an RGB integer and separate float value.void
clear()
Clears all samples from this buffer.int
toRgbInt
(int index) Returns the result of compositing all the added samples as a non-premultiplied ARGB integer.
-
Method Details
-
clear
void clear()Clears all samples from this buffer. -
addSample
boolean addSample(int index, float r, float g, float b, float alpha) Adds an RGBA sample to one pixel, using separate float scalars.- Parameters:
index
- pixel indexr
- red value, 0-1g
- green value, 0-1b
- blue value, 0-1alpha
- alpha value, 0-1- Returns:
- true if saturation has been reached, that is further samples added to this pixel will have no effect
-
addSample
boolean addSample(int index, int rgb, float alpha) Adds an RGBA sample to one pixel, using an RGB integer and separate float value.- Parameters:
index
- pixel indexrgb
- integer containing RGB in lower 24 bits; highest byte is ignoredalpha
- alpha value, 0-1- Returns:
- true if saturation has been reached, that is further samples added to this pixel will have no effect
-
addSample
boolean addSample(int index, int rgba) Adds an RGBA sample to one pixel, using an RGBA integer.- Parameters:
index
- pixel indexrgba
- integer containing RGBA values one per byte- Returns:
- true if saturation has been reached, that is further samples added to this pixel will have no effect
-
toRgbInt
int toRgbInt(int index) Returns the result of compositing all the added samples as a non-premultiplied ARGB integer. This is suitable for use withBufferedImage
setRGB
methods) or, more efficiently, anRgbImage
buffer.- Parameters:
index
- pixel index- Returns:
- ARGB integer
-