Expand description
The effects of the WinUI composition API (phase 6, scoped): the effect descriptions an effect factory is made from (the FerroUI form of the Win2D effects WinUI takes), the factory, and the loaded graph its brushes draw.
The descriptions are the effects the drawing contexts of FerroUI can
express: a Gaussian blur (the blur effect of the drawing context), an
opacity, a cross-fade of two sources, composites in every mode but
MaskInvert, a colour fill, blends, colour matrices (saturation, tint,
invert, grayscale, luminance to alpha), an arithmetic composite with a
colour, an alpha mask, a border that tiles a surface and scene lighting
(winui-materials.md). A graph with another effect or mode loads with the
status Other, and its brushes draw nothing.
Structs§
- Alpha
Mask Effect - Keeps its source where its mask is opaque (Win2D
AlphaMaskEffect): the source multiplied by the alpha of the mask. - Arithmetic
Composite Effect - Combines two sources channel by channel as
MultiplyAmount * s1 * s2 + Source1Amount * s1 + Source2Amount * s2 + Offseton premultiplied colours (Win2DArithmeticCompositeEffect). Animatable:MultiplyAmount,Source1Amount,Source2Amount,Offset. - Blend
Effect - Mixes a foreground into a background (Win2D
BlendEffect). - Border
Effect - Extends its source beyond its edges (Win2D
BorderEffect): a surface brush source tiles over the area of the brush when an edge behaviour isWrap(orMirror, drawn asWrap); any other source, orClampon both sides, is drawn as it is. - Color
Matrix Effect - Transforms the colours of its source by a matrix (Win2D
ColorMatrixEffect). - Color
Source Effect - Fills the area with a colour (Win2D
ColorSourceEffect). Animatable:Color. - Composite
Effect - Draws its sources over each other, in order (Win2D
CompositeEffect). - Composition
Effect Factory - Creates the brushes of one effect graph (WinUI
Microsoft.UI.Composition.CompositionEffectFactory), made byCompositor::create_effect_factory. - Composition
Effect Source Parameter - A named leaf of an effect graph that a brush is bound to (WinUI
Microsoft.UI.Composition.CompositionEffectSourceParameter): the input of the effect thatCompositionEffectBrush::set_source_parameterfills with a composition brush, or the composed children of the layer visual whose effect the brush is. - Cross
Fade Effect - Blends two sources by a weight (Win2D
CrossFadeEffect):source1at weight 0,source2at weight 1. Animatable:Weight(also asCrossFade, the name of the Win2D member). - Gaussian
Blur Effect - Blurs its source (Win2D
GaussianBlurEffect). Animatable:BlurAmount. - Grayscale
Effect - Turns its source grey (Win2D
GrayscaleEffect). - Invert
Effect - Inverts the colours of its source (Win2D
InvertEffect). - Luminance
ToAlpha Effect - Turns the luminance of its source into alpha (Win2D
LuminanceToAlphaEffect): black with the luminance as its alpha. - Opacity
Effect - Multiplies the alpha of its source (Win2D
OpacityEffect). Animatable:Opacity. - Saturation
Effect - Changes the saturation of its source (Win2D
SaturationEffect): a colour matrix (ColorMatrix::saturation). Animatable:Saturation. - Scene
Lighting Effect - The lighting of the lights that reach the visual that paints the brush
(WinUI
Microsoft.UI.Composition.Effects.SceneLightingEffect): the sum, for every point of the brush, of the ambient lights timesAmbientAmountand of the diffuse light of the other lights timesDiffuseAmount, opaque. Animatable:AmbientAmount,DiffuseAmount,SpecularAmount,SpecularShine. - Shadow
Effect - The shadow of its source (Win2D
ShadowEffect): the alpha of the source in the shadow colour, blurred. Animatable:BlurAmount,ShadowColor. - Tint
Effect - Multiplies the channels of its source by a colour (Win2D
TintEffect). Animatable:Color.
Enums§
- Blend
Effect Mode - How a blend effect mixes its foreground into its background (Win2D
BlendEffectMode, the modes of Direct2D’s blend effect). - Canvas
Composite - How a composite effect combines its sources (Win2D
CanvasComposite): each source is composed onto what the sources before it made. - Canvas
Edge Behavior - How a border effect extends its source beyond its edges (Win2D
CanvasEdgeBehavior). - Composition
Effect Factory Error - Why an effect factory did not load its effect: the
ExtendedErrorof WinUI’s factory, as a value. - Composition
Effect Factory Load Status - Whether an effect factory loaded its effect (WinUI
Microsoft.UI.Composition.CompositionEffectFactoryLoadStatus). - Effect
Border Mode - How a blur treats the edges of its input (Win2D
EffectBorderMode):Softfades the edges (the blur reads transparent pixels beyond its area),Hardkeeps them (the blur reads its source beyond the area and its output is cut to the area). - Effect
Optimization - The speed and quality trade-off of an effect (Win2D
EffectOptimization). - Graphics
Effect - An effect description (WinUI
IGraphicsEffect): one of the Win2D effects of this module. - Graphics
Effect Source - An input of an effect (WinUI
IGraphicsEffectSource): a source parameter that a brush is bound to, or another effect.
Functions§
- blur_
amount_ to_ radius - Converts the
BlurAmountof a Win2D blur (the standard deviation of the Gaussian, in device independent pixels) to the radius of the blur effect of the drawing contexts, which both backends turn into a standard deviation as0.288675 * radius + 0.5. An amount of 0.5 or less is no blur.