SetConvolutionMonoKernel

IDirect3DDevice9Ex::SetConvolutionMonoKernel method

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

Syntax


HRESULT SetConvolutionMonoKernel(
  [in] UINT  Width,
  [in] UINT  Height,
  [infloat *RowWeights,
  [infloat *ColumnWeights
);

Parameters

Width [in]

Type: UINT

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

Height [in]

Type: UINT

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

RowWeights [in]

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.

ColumnWeights [in]

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

Header

D3d9.h

Library

D3D9.lib

See also

IDirect3DDevice9Ex

 

 

Community Additions

ADD
Show:
© 2016 Microsoft