IDirect3DDevice9Ex::SetConvolutionMonoKernel method (d3d9.h)

Prepare the texture sampler for monochrome convolution filtering on a single-color texture.

Syntax

HRESULT SetConvolutionMonoKernel(
  [in] UINT  width,
  [in] UINT  height,
  [in] float *rows,
  [in] float *columns
);

Parameters

[in] width

Type: UINT

The width of the filter kernel; ranging from 1 - D3DCONVOLUTIONMONO_MAXWIDTH. The default value is 1.

[in] height

Type: UINT

The height of the filter kernel; ranging from 1 - D3DCONVOLUTIONMONO_MAXHEIGHT. The default value is 1.

[in] rows

Type: float*

An array of weights, one weight for each kernel sub-element in the width. This parameter must be NULL, which will set the weights equal to the default value.

[in] columns

Type: float*

An array of weights, one weight for each kernel sub-element in the height. This parameter must be NULL, which will set the weights equal to the default value.

Return value

Type: HRESULT

If the method succeeds, the return value is D3D_OK.

Remarks

This method is designed to filter a single color texture. A monochrome convolution filter is a 2D box filter with all of the weights set to 1.0; the filter kernel resolution ranges from 1 x 1 to 7 x 7. When monochrome texture filtering is set to a texture sampler and texture sampling is performed at location, then Direct3D performs convolution.

Restrictions include:

  • The filter specified by this method is recorded in state blocks as a part of D3DSBT_PIXELSTATE.
  • The only texture address mode supported is: D3DPTADDRESSCAPS_BORDER; the border color is always 0.
  • This method is not supported for mipmaps.
  • Using a non-monochrome texture with convolution filtering will generate a driver error.

Requirements

Requirement Value
Target Platform Windows
Header d3d9.h
Library D3D9.lib

See also

IDirect3DDevice9Ex