WaveFilter

class WaveFilter(amplitude: Vector2D = Vector2D(10, 10), crestDistance: Vector2D = Vector2D(16, 16), cyclesPerSecond: Vector2D = Vector2D(1, 1), time: TimeSpan = 0.seconds) : ShaderFilter

A Wave Filter that distorts the texture using waves.

amplitudeX, amplitudeY is the maximum x and y amplitudes of the waves. crestCountX and crestCountY is the number of crests of waves per axis cyclesPerSecondX and cyclesPerSecondY is the number of times the animation would repeat over a second time is the elapsed time of the animation

Constructors

Link copied to clipboard
constructor(amplitude: Vector2D = Vector2D(10, 10), crestDistance: Vector2D = Vector2D(16, 16), cyclesPerSecond: Vector2D = Vector2D(1, 1), time: TimeSpan = 0.seconds)

Types

Link copied to clipboard
Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard

Maximum amplitude of the wave on the X,Y axis

Link copied to clipboard

Distance between crests in the X,Y axis

Link copied to clipboard

Number of repetitions of the animation on the X,Y axis per second

Link copied to clipboard
open override var filtering: Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The elapsed time for the animation

Functions

Link copied to clipboard
open override 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
open override 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