Prepare the texture sampler for monochrome convolution filtering on a single-color texture.
HRESULT SetConvolutionMonoKernel( [in] UINT Width, [in] UINT Height, [in] float *RowWeights, [in] float *ColumnWeights );
- Width [in]
The width of the filter kernel; ranging from 1 - D3DCONVOLUTIONMONO_MAXWIDTH. The default value is 1.
- Height [in]
The height of the filter kernel; ranging from 1 - D3DCONVOLUTIONMONO_MAXHEIGHT. 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.
If the method succeeds, the return value is D3D_OK.
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.
- 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.