Filter

open class Filter(shader: Shader? = null, watcher: ShaderWatcher? = null) : AutoCloseable(source)

The Filter class represents a rendering filter used to process graphical content by applying shaders and other configurations. This class provides mechanisms to apply the filter to color buffers, manage shader parameters, and handle associated rendering operations such as clip rectangles and blending modes.

The Filter class supports a flexible set of parameters, enabling it to accommodate different use cases and rendering scenarios. It can operate on various combinations of source and target color buffers or render targets, as well as optionally handle depth buffers.

Parameters

shader

The optional Shader instance to be used by the filter.

watcher

The optional ShaderWatcher to dynamically manage the shader during execution.

Inheritors

Constructors

Link copied to clipboard
constructor(shader: Shader? = null, watcher: ShaderWatcher? = null)

Creates a new filter instance, optionally initializing it with a shader or shader watcher.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

parameter map

Functions

Link copied to clipboard
open fun apply(source: Array<ColorBuffer>, target: Array<ColorBuffer>, clip: Rectangle? = null)

Applies a filter operation using the given source and target arrays of ColorBuffer. Optionally, a clipping rectangle can be used to define the region for the filter operation.

fun apply(source: Array<ColorBuffer>, target: ColorBuffer, clip: Rectangle? = null)

Applies a filter operation using the given source array of ColorBuffer and the target ColorBuffer. Optionally, a clipping rectangle can be used to define the region for the filter operation.

fun apply(source: Array<ColorBuffer>, target: RenderTarget, clip: Rectangle? = null)

Applies a filter operation using the given source and target using a shader program. Optionally, a clipping rectangle can be used to define the region for the filter operation. Custom shader parameters are applied where applicable.

fun apply(source: ColorBuffer, target: Array<ColorBuffer>, clip: Rectangle? = null)

Applies a filter operation using the given source ColorBuffer and target array of ColorBuffer. Optionally, a clipping rectangle can be used to define the region for the filter operation.

fun apply(source: ColorBuffer, target: ColorBuffer, clip: Rectangle? = null)
Link copied to clipboard
open override fun close()
Link copied to clipboard
open fun destroy()

Releases resources associated with this filter, including those allocated for the shader. This method should be called when the filter is no longer needed to ensure proper cleanup and avoid resource leaks.

Link copied to clipboard
fun untrack()