Filter

interface Filter

Interface for View filters.

A filter is in charge of rendering a precomputed texture of a View.

Filter defines a computeBorder. The border is the amount of pixels, the generated texture should be grown from each side: left, top, right and bottom. For example, a Gauissan Blur effect would require a bigger texture to blur the edges.

Filter defines how to render the precomputed texture of the View inside the render method.

Filters are usually ComposedFilter or ShaderFilter

Inheritors

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open fun computeBorder(texWidth: Int, texHeight: Int): MarginInt

The number of pixels the passed texture should be bigger at each direction: left, right, top, left.

Link copied to clipboard
fun Filter.getBorder(texWidth: Int, texHeight: Int): MarginInt
Link copied to clipboard
abstract fun render(ctx: RenderContext, matrix: Matrix, texture: Texture, texWidth: Int, texHeight: Int, renderColorMul: RGBA, blendMode: BlendMode, filterScale: Double)

The method in charge of rendering the texture transformed using ctx and matrix. The method receives a texture that should be the original image with computeBorder additional pixels on each side.

Link copied to clipboard
fun Filter.renderToTextureWithBorder(ctx: RenderContext, matrix: Matrix, texture: Texture, texWidth: Int, texHeight: Int, filterScale: Double, block: (Texture, matrix: Matrix) -> Unit)
Link copied to clipboard
fun Filter.renderToTextureWithBorderUnsafe(ctx: RenderContext, matrix: Matrix, texture: Texture, texWidth: Int, texHeight: Int, filterScale: Double, result: RenderToTextureResult = RenderToTextureResult()): RenderToTextureResult