Partager via


IDirect3DDevice9Ex::SetConvolutionMonoKernel 

IDirect3DDevice9Ex::SetConvolutionMonoKernel

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

  HRESULT 
  SetConvolutionMonoKernel(
  UINT Width,
  UINT Height,
  float* RowWeights,
  float* ColumnWeights
);

Parameters

  • Width
    [in] The width of the filter kernel; ranging from 1 - 7. The default value is 1.
  • Height
    [in] The height of the filter kernel; ranging from 1 - 7. The default value is 1.
  • RowWeights
    [in] 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.
  • ColumnWeights
    [in] 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 Values

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 D3D performs convolution.

Restrictions include:

  • The filter specified by this method is recorded in state blocks as a part of D3DSBT_PIXELSTATE.
  • The texture sampler ignores the following sampler states: D3DTSS_MIPFILTER, D3DTSS_MINFILTER and D3DTSS_MAGFILTER.
  • The only texture address mode supported is: D3DPTADDRESSCAPS_BORDER; the border color is always 0.
  • This method is not supported for mip-maps.
  • Using a non-monochrome texture with convolution filtering will generate a driver error.

See Also

IDirect3DDevice9Ex Interface