CompositionLight
struct · ferroui-base · v0.5.0
struct CompositionLight
A light (WinUI Microsoft.UI.Composition.CompositionLight): it lights
the visuals of targets and their subtrees, minus the
visuals of exclusions_from_targets
and their subtrees, while it is_enabled. A visual
that some enabled light reaches shows its content multiplied by the sum
of the lights that reach it, so it is dark where none of them shines.
Deviation (winui-composition.md): the lighting is a light map drawn over
the content of each lit visual, see server::LitContent.
Members
compositorobjectis_disposeddisposetype_nametargetsexclusions_from_targetsset_xaml_bindingxaml_idis_enabledset_is_enabled
compositor
fn compositor(self: &Self) -> &Rc<Compositor>
object
fn object(self: &Self) -> &CompositionObject
The embedded CompositionObject.
is_disposed
fn is_disposed(self: &Self) -> bool
dispose
fn dispose(self: &Self)
Disposes the light and its two collections: the visuals it lit are drawn without it from the next frame.
type_name
fn type_name(self: &Self) -> &'static str
The name of the concrete class, for messages.
targets
fn targets(self: &Self) -> &Rc<VisualUnorderedCollection>
Targets: the visuals the light lights, with their subtrees.
exclusions_from_targets
fn exclusions_from_targets(self: &Self) -> &Rc<VisualUnorderedCollection>
ExclusionsFromTargets: the visuals, with their subtrees, the light
does not light although they are in the subtree of a target.
set_xaml_binding
fn set_xaml_binding(self: &Self, id: Option<String>, scope: Option<Rc<CompositionVisual>>)
Binds the light to a XAML light (XamlLight.CompositionLight): the
light then also lights the XAML brushes that target the id id
(XamlLight.AddTargetBrush) where they are drawn in the subtree of
scope, the visual of the element whose Lights holds the XAML
light. None unbinds it. Called by XamlLight.
xaml_id
fn xaml_id(self: &Self) -> Option<String>
The id of the XAML light the light is bound to, if any.
is_enabled
fn is_enabled(self: &Self) -> bool
IsEnabled (default true): a disabled light lights nothing, and
the visuals it targets are drawn as if it did not exist.
set_is_enabled
fn set_is_enabled(self: &Self, value: bool)
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyErasedDestructorIntoEitherCompositionLightHooksAmbientLightHooksDistantLightHooksPointLightHooksSpotLightHooksIRegisterForSerializationICompositionObjectHostICompositionObjectAnimationsAsCompositionObjectICompositionObjectICompositorSerializable
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.