Interface Compositor.Buffer
- Enclosing class:
Compositor
public static interface Compositor.Buffer
Buffer of pixels on which compositing operations can be performed.
- Since:
- 12 Feb 2013
- Author:
- Mark Taylor
-
Method Summary
Modifier and TypeMethodDescriptionbooleanaddSample(int index, float r, float g, float b, float alpha) Adds an RGBA sample to one pixel, using separate float scalars.booleanaddSample(int index, int rgba) Adds an RGBA sample to one pixel, using an RGBA integer.booleanaddSample(int index, int rgb, float alpha) Adds an RGBA sample to one pixel, using an RGB integer and separate float value.voidclear()Clears all samples from this buffer.inttoRgbInt(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 withBufferedImagesetRGBmethods) or, more efficiently, anRgbImagebuffer.- Parameters:
index- pixel index- Returns:
- ARGB integer
-