LuminanceToAlphaEffect Class |
Namespace: Microsoft.Graphics.Canvas.Effects
public sealed class LuminanceToAlphaEffect : ICanvasEffect, IGraphicsEffect, IGraphicsEffectSource, ICanvasImage, IDisposable
The LuminanceToAlphaEffect type exposes the following members.
Name | Description | |
---|---|---|
LuminanceToAlphaEffect | Initializes a new instance of the LuminanceToAlphaEffect class. |
Name | Description | |
---|---|---|
BufferPrecision | Specifies what precision to use for intermediate buffers when drawing this effect. | |
CacheOutput | Enables caching the output from drawing this effect. | |
Name | Attaches a user-defined name string to the effect. | |
Source | Gets or sets the input source for LuminanceToAlpha effect. |
Name | Description | |
---|---|---|
Dispose | Releases all resources used by the effect. | |
GetBounds(ICanvasResourceCreator) | Retrieves the bounds of this LuminanceToAlphaEffect. | |
GetBounds(ICanvasResourceCreator, Matrix3x2) | Retrieves the bounds of this LuminanceToAlphaEffect. | |
GetInvalidRectangles | Queries what regions of the effect output have changed since it was last drawn. | |
GetRequiredSourceRectangle | Queries what part of an effect source image is needed to draw an output region. | |
GetRequiredSourceRectangles | Queries what parts of the effect source images are needed to draw an output region. | |
InvalidateSourceRectangle | Notifies the effect that one of its source images has changed. |
This effect sets the alpha channel of the output to the luminance of the input image using the color matrix:
This effect consumes and outputs premultiplied alpha images. It won't work on straight alpha images unless they are fully opaque.
Note: because images are stored in a gamma-compensated format, before you calculate the luminance for an image you may wish to first perform inverse gamma correction to get the true color values for the image. Since images are normally stored at 2.2 gamma, you can use GammaTransferEffect with an exponent of (1/2.2).
This Windows Runtime type corresponds to the D2D Luminance to alpha effect.