Class Compositor
java.lang.Object
com.codename1.art.Compositor
Software compositing of ARGB pixel arrays.
Uses the formulas of the W3C Compositing and Blending specification: the blended color is
mixed with the layer's color by the backdrop's alpha, then composited source-over. Pixels
are non-premultiplied 0xAARRGGBB ints, as Image.getRGB returns them.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe scratch spaceblend(int, int, BlendMode, float, double[])needs, in doubles. -
Method Summary
Modifier and TypeMethodDescriptionstatic intComposites one pixel and returns the result.static intBlends one pixel without allocating, for loops over many pixels.static voidCompositessrcoverdstin place.
-
Field Details
-
SCRATCH
public static final int SCRATCHThe scratch spaceblend(int, int, BlendMode, float, double[])needs, in doubles.- See Also:
-
-
Method Details
-
composite
Composites
srcoverdstin place.Parameters
src: the layer's pixelsdst: the backdrop, overwritten with the result; same length assrcmode: how colors combineopacity: the layer's opacity, 0 to 1, applied on top of each pixel's own alpha
-
blend
Composites one pixel and returns the result.
Parameters
src: the layer's pixeldst: the backdrop pixelmode: how colors combineopacity: the layer's opacity, 0 to 1
-
blend
Blends one pixel without allocating, for loops over many pixels.
Parameters
src: the layer's pixeldst: the backdrop pixelmode: how colors combineopacity: the layer's opacity, 0 to 1scratch: at leastSCRATCHdoubles, reused across calls
Returns
the composited pixel
-