filter

fun filter(operation: BufferedImageOp)

Replaces the recording with the result of applying operation to it. Does nothing while this layer has no content.

For example, a Gaussian blur is a pair of java.awt.image.ConvolveOps, one across and one down, and a tint is a java.awt.image.RescaleOp.

The pixels are premultiplied, so an operation that mixes neighboring pixels, such as a blur, mixes in no color from transparent ones.

The operation runs over the buffer at the resolution it was recorded at, so one measured in pixels - a convolution kernel - reaches further across a recording made at a smaller scale. An operation that changes the buffer's dimensions leaves size as it was: the recording still stands for the same user-space area, and draw draws it into that area.

Parameters

operation

the operation to apply.