Table of Contents

Property ColorContext

Namespace
PaintDotNet.Effects.Gpu
Assembly
PaintDotNet.Effects.Core.dll

ColorContext

Gets the Direct2D color context of the document, which defines the working space (color space) of the document and layer IGpuEffectInputImages, and for the effect's rendering.

This is affected by the effect's GpuEffectColorContext, which can be changed by overriding the OnInitializeRenderInfo(IGpuEffectRenderInfo) method and setting the ColorContext property. The default is WorkingSpaceLinear, which results in the linear gamma version of the document's color space.

IDeviceColorContext ColorContext { get; }

Property Value

IDeviceColorContext

Remarks

This color context may not be the same one defined by the document itself. The actual color context will depend on the value specified for ColorContext.

To access the document's original color context, cast this IGpuEffectDocumentInfo2 object to the base IEffectDocumentInfo interface and access the ColorContext property. You can then create a Direct2D color context using a method such as CreateColorContext(IColorContext), which is implemented by IDeviceContext and IDeviceEffectContext.