util-box-filter

Perform a centered box filter (an average) - which means we might need to sample a half-texel off of either end of the filter, if the filter width is even (and it probably is)

Index

Functions

Functions

BoxFilter
                float4 BoxFilter(
                  DECLARE_TEXTURE2D_AND_SAMPLER_PARAM(
                    sourceTexture, 
                    samp),
                  float2 invTextureSize,
                  uint filterWidth,
                  float2 texCoord,
                  out float4 centerSample)
              
Description

Perform a centered box filter.

Called by svideo-to-rgb and composite-to-svideo.

Parameters
sourceTexture, samp

Type: DECLARE_TEXTURE2D_AND_SAMPLER_PARAM

A texture and sampler pair used to sample the texture to be filtered.

invTextureSize

Type: float2

The inverse of the texture size, equivalent to (1/sourceTexture.width, 1/sourceTexture.height)

filterWidth

Type: uint

The width of the filter, in texels.

texCoord

Type: float2

The texture coordinate for the center of the filter.

centerSample

Type: out float4

Outputs the texture sample from the center point of the filter (at texCoord).

Return Value
Type: float4

The result of the box filter.