Home COM GDI+ WebBrowser Data Access

IDXTConvolution Interface

 

IID_IDXTConvolution

{7BA7F8AF-E5EA-11D1-81DD-0000F87557DB}

 

 

This interface performs image convolutions for DXSurface objects.

 

Remarks

Image convolution is more commonly known as filtering. Convolution works by combining the colors of surrounding samples to determine the color of a sample on the destination surface. The way in which surrounding pixels are combined is determined by a filter, which is a rectangular matrix of numbers. Each number in the matrix is a weighting for the pixel at that position. The contributions from each weighting are added to produce the output color on the destination surface. Negative weighting values are subtracted from the total. Each filter matrix has a center pixel that is scanned over each sample of the input image to produce the output image.

The filter matrix has a width and height that determine how many pixels of the source image will contribute to the color of the destination's center pixel. Most matrices are square and have an odd number of rows and columns, though you can define custom filters of arbitrary size. There are also predefined filters described in the DXCONVFILTERTYPE enumeration.

Sometimes convolution can reduce or increase the brightness of an image. To compensate, you can define a bias that is added to the filtered result.
 

 

Methods in VTable order

IUnknown Methods

Description

QueryInterface

Returns pointers to supported interfaces.

AddRef

Increments reference count.

Release

Decrements reference count.

IDXTConvolution Members

Description

SetFilterType

Sets the selected filter type for the convolution.

GetFilterType

Retrieves the selected filter type for the convolution.

SetCustomFilter

Sets the convolution to use a custom filter.

SetConvertToGray

Sets a value that indicates whether the filter output color is converted to grayscale.

GetConvertToGray

Retrieves a value that indicates whether the filter output color is converted to grayscale.

SetBias

Sets the bias value used for the convolution.

GetBias

Retrieves the bias value used for the convolution.

SetExcludeAlpha

Sets a value that indicates whether the alpha channel should be filtered with the color data.

GetExcludeAlpha

Retrieves a value that indicates whether the alpha channel should be filtered along with the color data.

 

SetFilterType

 

FUNCTION IDXTConvolution_SetFilterType ( _
  BYVAL
pthis AS DWORD PTR _
, BYVAL
eType AS LONG _
  ) AS LONG

  LOCAL
HRESULT AS LONG
  CALL DWORD
@@pthis[3] USING IDXTConvolution_SetFilterType (pthis, eType) TO HRESULT
  FUNCTION =
HRESULT

END FUNCTION
 

 

GetFilterType

 

FUNCTION IDXTConvolution_GetFilterType ( _
  BYVAL
pthis AS DWORD PTR _
, BYREF
peType AS LONG _
  ) AS LONG

  LOCAL
HRESULT AS LONG
  CALL DWORD
@@pthis[4] USING IDXTConvolution_GetFilterType (pthis, peType) TO HRESULT
  FUNCTION =
HRESULT

END FUNCTION
 

 

SetCustomFilter

 

FUNCTION IDXTConvolution_SetCustomFilter ( _
  BYVAL
pthis AS DWORD PTR _
, BYVAL
pFilter AS DWORD _
, BYVAL
prmSize AS apiSIZE _
  ) AS LONG

  LOCAL
HRESULT AS LONG
  CALL DWORD
@@pthis[5] USING IDXTConvolution_SetCustomFilter (pthis, pFilter, prmSize) TO HRESULT
  FUNCTION =
HRESULT

END FUNCTION
 

 

SetConvertToGray

 

FUNCTION IDXTConvolution_SetConvertToGray ( _
  BYVAL
pthis AS DWORD PTR _
, BYVAL
bConvertToGray AS LONG _
  ) AS LONG

  LOCAL
HRESULT AS LONG
  CALL DWORD
@@pthis[6] USING IDXTConvolution_SetConvertToGray (pthis, bConvertToGray) TO HRESULT
  FUNCTION =
HRESULT

END FUNCTION
 

 

GetConvertToGray

 

FUNCTION IDXTConvolution_GetConvertToGray ( _
  BYVAL
pthis AS DWORD PTR _
, BYREF
pbConvertToGray AS LONG _
  ) AS LONG

  LOCAL
HRESULT AS LONG
  CALL DWORD
@@pthis[7] USING IDXTConvolution_GetConvertToGray (pthis, pbConvertToGray) TO HRESULT
  FUNCTION =
HRESULT

END FUNCTION
 

 

SetBias

 

FUNCTION IDXTConvolution_SetBias ( _
  BYVAL
pthis AS DWORD PTR _
, BYVAL
Bias AS SINGLE _
  ) AS LONG

  LOCAL
HRESULT AS LONG
  CALL DWORD
@@pthis[8] USING IDXTConvolution_SetBias (pthis, Bias) TO HRESULT
  FUNCTION =
HRESULT

END FUNCTION
 

 

GetBias

 

FUNCTION IDXTConvolution_GetBias ( _
  BYVAL
pthis AS DWORD PTR _
, BYREF
pBias AS SINGLE _
  ) AS LONG

  LOCAL
HRESULT AS LONG
  CALL DWORD
@@pthis[9] USING IDXTConvolution_GetBias (pthis, pBias) TO HRESULT
  FUNCTION =
HRESULT

END FUNCTION
 

 

SetExcludeAlpha

 

FUNCTION IDXTConvolution_SetExcludeAlpha ( _
  BYVAL
pthis AS DWORD PTR _
, BYVAL
bExcludeAlpha AS LONG _
  ) AS LONG

  LOCAL
HRESULT AS LONG
  CALL DWORD
@@pthis[10] USING IDXTConvolution_SetExcludeAlpha (pthis, bExcludeAlpha) TO HRESULT
  FUNCTION =
HRESULT

END FUNCTION
 

 

GetExcludeAlpha

 

FUNCTION IDXTConvolution_GetExcludeAlpha ( _
  BYVAL
pthis AS DWORD PTR _
, BYREF
pbExcludeAlpha AS LONG _
  ) AS LONG

  LOCAL
HRESULT AS LONG
  CALL DWORD
@@pthis[11] USING IDXTConvolution_GetExcludeAlpha (pthis, pbExcludeAlpha) TO HRESULT
  FUNCTION =
HRESULT

END FUNCTION
 

 

Page last updated on Monday, 03 April 2006 19:50:14 +0200