[]
        
(Showing Draft Content)

GrapeCity.Documents.DX.Direct2D.Effects.ConvolveMatrix

Class ConvolveMatrix

Namespace
GrapeCity.Documents.DX.Direct2D.Effects
Assembly
GcDocs.DX.Windows.dll

Builtin ConvolveMatrix effect.

public class ConvolveMatrix : Effect, IDisposable, IUnknown
Inheritance
object
ConvolveMatrix
Implements
System.IDisposable
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

Constructors

ConvolveMatrix(IntPtr)

Initializes a new instance of the ConvolveMatrix class.

public ConvolveMatrix(IntPtr nativePtr)

Parameters

nativePtr System.IntPtr

The native pointer.

Properties

Bias

The effect applies the kernel matrix, the divisor, and then the bias is added to the result. The bias is unbounded and unitless.

public float Bias { get; set; }

Property Value

float

BorderMode

The mode used to calculate the border of the image, soft or hard. See BorderMode modes for more info.

public BorderMode BorderMode { get; set; }

Property Value

BorderMode

ClampOutput

Whether the effect clamps color values to between 0 and 1 before the effect passes the values to the next effect in the graph. The effect clamps the values before it premultiplies the alpha . if you set this to TRUE the effect will clamp the values. If you set this to FALSE, the effect will not clamp the color values, but other effects and the output surface may clamp the values if they are not of high enough precision.

public bool ClampOutput { get; set; }

Property Value

bool

Divisor

The kernel matrix is applied to a pixel and then the result is divided by this value. 0 behaves as a value of float epsilon.

public float Divisor { get; set; }

Property Value

float

KernelMatrix

The kernel matrix to be applied to the image. The kernel elements aren't bounded and are specified as floats. The first set of KernelSizeX numbers in the FLOAT[] corresponds to the first row in the kernel. The second set of KernelSizeX numbers correspond to the second row, and so on up to KernelSizeY rows.

public float[] KernelMatrix { get; set; }

Property Value

float[]

KernelOffset

Shifts the convolution kernel from a centered position on the output pixel to a position you specify left/right and up/down. The offset is defined in kernel units. With some offsets and kernel sizes, the convolution kernel’s samples won't land on a pixel image center. The pixel values for the kernel sample are computed by bilinear interpolation.

public Vector2 KernelOffset { get; set; }

Property Value

Vector2

KernelSizeX

The width of the kernel matrix. The units are specified in kernel units.

public int KernelSizeX { get; set; }

Property Value

int

KernelSizeY

The height of the kernel matrix. The units are specified in kernel units.

public int KernelSizeY { get; set; }

Property Value

int

KernelUnitLength

The size of one unit in the kernel. The units are in (DIPs/kernel unit), where a kernel unit is the size of the element in the convolution kernel. A value of 1 (DIP/kernel unit) corresponds to one pixel in a image at 96 DPI.

public float KernelUnitLength { get; set; }

Property Value

float

PreserveAlpha

Specifies whether the convolution kernel is applied to the alpha channel or only the color channels. If you set this to TRUE the convolution kernel is applied only to the color channels. If you set this to FALSE the convolution kernel is applied to all channels.

public bool PreserveAlpha { get; set; }

Property Value

bool

ScaleMode

The interpolation mode the effect uses to scale the image to the corresponding kernel unit length. There are six scale modes that range in quality and speed. If you don't select a mode, the effect uses the interpolation mode of the device context. See Scale modes for more info

public ConvoleMatrixScaleMode ScaleMode { get; set; }

Property Value

ConvoleMatrixScaleMode

Methods

Create(DeviceContext)

Initializes a new instance of ConvolveMatrix effect.

public static ConvolveMatrix Create(DeviceContext context)

Parameters

context DeviceContext

Returns

ConvolveMatrix