FilterPrimitive

sealed class FilterPrimitive(source)

A primitive of a FilterEffect: it computes an image from its inputs, which is the input of the next primitive and, when it has a result name, of later primitives that refer to it. Lengths are in the units of the FilterEffect.primitiveUnits.

Inheritors

Types

Link copied to clipboard
class Blend(var input: FilterInput = FilterInput.Previous, var input2: FilterInput, var mode: MixBlendMode = MixBlendMode.NORMAL) : FilterPrimitive

input blended with input2, its backdrop, by mode

Link copied to clipboard

a color channel of DisplacementMap

Link copied to clipboard
class ColorMatrix(var input: FilterInput = FilterInput.Previous, var values: List<Double>) : FilterPrimitive

The colors of the input multiplied by a 4×5 matrix of values, row by row, like feColorMatrix with type="matrix"; use saturate, hueRotate and luminanceToAlpha for its other types

Link copied to clipboard
class ComponentTransfer(var input: FilterInput = FilterInput.Previous, var red: FilterPrimitive.TransferFunction = TransferFunction.Identity, var green: FilterPrimitive.TransferFunction = TransferFunction.Identity, var blue: FilterPrimitive.TransferFunction = TransferFunction.Identity, var alpha: FilterPrimitive.TransferFunction = TransferFunction.Identity) : FilterPrimitive

every channel of the input mapped by its transfer function

Link copied to clipboard
class Composite(var input: FilterInput = FilterInput.Previous, var input2: FilterInput, var operator: FilterPrimitive.CompositeOperator = CompositeOperator.OVER, var k1: Double = 0.0, var k2: Double = 0.0, var k3: Double = 0.0, var k4: Double = 0.0) : FilterPrimitive

input combined with input2 by operator; the arithmetic operator computes k1·i·i2 + k2·i + k3·i2 + k4

Link copied to clipboard

the Porter-Duff operators of feComposite, and its arithmetic operator

Link copied to clipboard
class DisplacementMap(var input: FilterInput = FilterInput.Previous, var input2: FilterInput, var scale: Double = 0.0, var xChannel: FilterPrimitive.Channel = Channel.A, var yChannel: FilterPrimitive.Channel = Channel.A) : FilterPrimitive

the pixels of input moved by the channels of input2, by scale

Link copied to clipboard
class DropShadow(var input: FilterInput = FilterInput.Previous, var dx: Double = 2.0, var dy: Double = 2.0, var stdDeviation: Vector2 = Vector2(2.0, 2.0), var color: ColorRGBa = ColorRGBa.BLACK) : FilterPrimitive

a shadow of the input: its alpha blurred, moved and colored, under the input

Link copied to clipboard
class Flood(var color: ColorRGBa) : FilterPrimitive

an image of a single color

Link copied to clipboard
class GaussianBlur(var input: FilterInput = FilterInput.Previous, var stdDeviation: Vector2) : FilterPrimitive

a Gaussian blur with standard deviations along the x and y axes

Link copied to clipboard
class Image(val content: GroupNode, var size: Vector2? = null, var aspectRatio: AspectRatio = AspectRatio.DEFAULT, var href: String? = null) : FilterPrimitive

An image, like feImage: content is drawn in user space when size is null, like an element that feImage refers to, otherwise the content, of size, is fitted into the subregion by aspectRatio, like an image file

Link copied to clipboard
class Merge(val inputs: List<FilterInput>) : FilterPrimitive

the inputs drawn over each other, the first at the bottom

Link copied to clipboard
class Morphology(var input: FilterInput = FilterInput.Previous, var dilate: Boolean, var radius: Vector2) : FilterPrimitive

the input made thinner (dilate false) or fatter by a rectangle of radius

Link copied to clipboard
class Offset(var input: FilterInput = FilterInput.Previous, var dx: Double, var dy: Double) : FilterPrimitive

the input moved by (dx, dy)

Link copied to clipboard
class Tile(var input: FilterInput = FilterInput.Previous) : FilterPrimitive

the subregion of the input repeated over the subregion of the primitive, like feTile

Link copied to clipboard
sealed interface TransferFunction

a transfer function of a color channel, like the feFunc elements of feComponentTransfer

Link copied to clipboard
class Turbulence(var baseFrequency: Vector2, var octaves: Int = 1, var seed: Double = 0.0, var fractalNoise: Boolean = false) : FilterPrimitive

Perlin turbulence, like feTurbulence: fractalNoise sums noise, otherwise the absolute values of noise are summed. It computes the same noise as browsers for the same seed.

Properties

Link copied to clipboard
Link copied to clipboard
abstract val inputs: List<FilterInput>

the inputs, in the order of in and in2

Link copied to clipboard

the name of the result, null when only the next primitive uses it

Link copied to clipboard

the subregion that the result of the primitive is clipped to, null for the default subregion