Table of Contents

Interface IDeviceEffectContext

Namespace
PaintDotNet.Direct2D1
Assembly
PaintDotNet.Windows.dll

Provides factory methods and other state management for effect and transform authors.
ID2D1EffectContext2

public interface IDeviceEffectContext : IDeviceEffectFactory, IDeviceColorContextFactory, ILookupTable3DFactory, IObjectRef, IIsDisposed, IDisposable, IInternalImpl
Inherited Members
Extension Methods

Remarks

This interface is passed to an effect implementation through the Initialize(IDeviceEffectContext, ITransformGraph) method. In order to prevent applications casually gaining access to this interface, and to separate reference counts between the public and private interfaces, it is not possible to call CreateRef() between the IDeviceContext and the IDeviceEffectContext. Each call to Initialize(IDeviceEffectContext, ITransformGraph) will be provided a different IDeviceEffectContext object. This interface tracks resource allocations for the effect. When the effect is released, the corresponding allocations will also be released.

Properties

Dpi

Gets the unit mapping that an effect will use for properties that could be in either dots per inch (dpi) or pixels.

Methods

CheckFeatureSupport(DeviceFeature, Span<byte>)

Checks whether an optional capability is supported by the D3D device.

CreateBlendTransform(int, in BlendDescription)

This creates a blend transform that can be inserted into a transform graph.

CreateBorderTransform(ExtendMode, ExtendMode)

Creates a transform that extends its input infinitely in every direction based on the passed in extend mode.

CreateBoundsAdjustmentTransform(RectInt32)

Creates and returns a bounds adjustment transform.

CreateOffsetTransform(Point2Int32)

Creates and returns an offset transform.

CreateResourceTexture(in Guid?, in ResourceTextureProperties, ExtentPtr<byte>, ResourceTextureStrides?)

Creates or finds the given resource texture, depending on whether a resource ID is specified. It also optionally initializes the texture with the specified data.

CreateTransformNodeFromEffect(IDeviceEffect)

Wraps an effect graph into a single transform node and then inserted into a transform graph. This allows an effect to aggregate other effects. This will typically be done in order to allow the effect properties to be re-expressed with a different contract, or to allow different components to integrate each-other’s effects.

FindResourceTexture(in Guid)

Finds the given resource texture if it has already been created with CreateResourceTexture(in Guid?, in ResourceTextureProperties, ExtentPtr<byte>, ResourceTextureStrides?) with the same Guid.

GetMaximumSupportedFeatureLevel(ReadOnlySpan<D3DFeatureLevel>)

Gets the maximum feature level from the provided list which is supported by the device. If none of the provided levels are supported, then this method returns null.

IsBufferPrecisionSupported(BufferPrecision)

Indicates whether the buffer precision is supported by the underlying Direct2D device.

IsShaderLoaded(in ShaderID)

This tests to see if the given shader is loaded.

LoadPixelShader(in ShaderID, ReadOnlySpan<byte>)

Loads the given shader by its unique ID. Loading the shader multiple times is ignored. When the shader is loaded it is also handed to the driver to JIT, if it hasn’t been already.