CompositionVisual
struct · ferroui-base · v0.5.0
struct CompositionVisual
A node of the composition visual tree.
Members
rotation_angle_in_degreesset_rotation_angle_in_degreesrotation_axisset_rotation_axisrelative_offset_adjustmentset_relative_offset_adjustmentrelative_size_adjustmentset_relative_size_adjustmenteffective_sizeis_hit_test_visibleset_is_hit_test_visibleis_pixel_snapping_enabledset_is_pixel_snapping_enabledborder_modeset_border_modebackface_visibilityset_backface_visibilitycomposite_modeset_composite_modeparent_for_transformset_parent_for_transformvisibleset_visibleopacityset_opacityclip_to_boundsset_clip_to_boundsoffsetset_offsettranslationset_translationsizeset_sizeanchor_pointset_anchor_pointcenter_pointset_center_pointrotation_angleset_rotation_angleorientationset_orientationscaleset_scaletransform_matrixset_transform_matrixadorner_is_clippedset_adorner_is_clippedeffectset_effectrender_optionsset_render_optionstext_optionsset_text_optionscompositorobjectimplicit_animationsset_implicit_animationsis_disposeddisposechildrenrootparentadorned_visualset_adorned_visualcache_modeset_cache_modecomposition_clipset_composition_clipdisable_sub_tree_bounds_hit_test_optimizationopacity_maskset_opacity_masktagset_taghit_testhit_test_geometry
rotation_angle_in_degrees
fn rotation_angle_in_degrees(self: &Self) -> f32
The rotation about the rotation axis in degrees: a view of
rotation_angle.
Deviation (winui-composition.md): not an animation target of its own;
animate RotationAngle.
set_rotation_angle_in_degrees
fn set_rotation_angle_in_degrees(self: &Self, value: f32)
rotation_axis
fn rotation_axis(self: &Self) -> Vector3D
The axis rotation_angle rotates about
(default (0, 0, 1); animatable as RotationAxis).
Deviation (winui-composition.md): an axis along Z (or a zero axis)
rotates in the plane; any other axis rotates in 3D, of which the 2D
renderers show the projection, as for Orientation.
set_rotation_axis
fn set_rotation_axis(self: &Self, value: Vector3D)
relative_offset_adjustment
fn relative_offset_adjustment(self: &Self) -> Vector3D
The part of the size of the parent added to the offset: the offset of
the visual is Offset + RelativeOffsetAdjustment * parent size
(animatable as RelativeOffsetAdjustment; Z is not adjusted, the
parent has no depth).
set_relative_offset_adjustment
fn set_relative_offset_adjustment(self: &Self, value: Vector3D)
relative_size_adjustment
fn relative_size_adjustment(self: &Self) -> Vector
The part of the size of the parent added to the size: the size of
the visual is Size + RelativeSizeAdjustment * parent size
(animatable as RelativeSizeAdjustment). (1, 1) with a zero Size
makes the visual as large as its parent.
set_relative_size_adjustment
fn set_relative_size_adjustment(self: &Self, value: Vector)
effective_size
fn effective_size(self: &Self) -> Vector
The size of the visual with its relative size adjustment applied: what
is rendered and hit tested. size is the Size
property alone.
is_hit_test_visible
fn is_hit_test_visible(self: &Self) -> bool
Whether the visual and its subtree take part in hit testing (default
true).
set_is_hit_test_visible
fn set_is_hit_test_visible(self: &Self, value: bool)
is_pixel_snapping_enabled
fn is_pixel_snapping_enabled(self: &Self) -> bool
Whether the offset of the visual is snapped to device pixels.
Deviation (winui-composition.md): the translation of the transform of the visual relative to its parent is rounded to device pixels of its target, not its position in the window.
set_is_pixel_snapping_enabled
fn set_is_pixel_snapping_enabled(self: &Self, value: bool)
border_mode
fn border_mode(self: &Self) -> CompositionBorderMode
How the edges of the visual are antialiased. Stored only.
set_border_mode
fn set_border_mode(self: &Self, value: CompositionBorderMode)
backface_visibility
fn backface_visibility(self: &Self) -> CompositionBackfaceVisibility
Whether the back of the visual is shown when it is turned in 3D. Stored only.
set_backface_visibility
fn set_backface_visibility(self: &Self, value: CompositionBackfaceVisibility)
composite_mode
fn composite_mode(self: &Self) -> CompositionCompositeMode
How the visual is blended with what is behind it. Stored only.
set_composite_mode
fn set_composite_mode(self: &Self, value: CompositionCompositeMode)
parent_for_transform
fn parent_for_transform(self: &Self) -> Option<Rc<CompositionVisual>>
The visual whose coordinate space the transform of this visual is
relative to, instead of its parent: the visual is drawn where its
parent is, in the place its offset and transform give it inside
parent_for_transform.
Deviation (winui-composition.md): the two visuals must be in one tree (otherwise the transform is relative to the parent); clips and opacity still come from the parent chain.
set_parent_for_transform
fn set_parent_for_transform(self: &Self, value: Option<Rc<CompositionVisual>>)
visible
fn visible(self: &Self) -> bool
set_visible
fn set_visible(self: &Self, value: bool)
opacity
fn opacity(self: &Self) -> f32
set_opacity
fn set_opacity(self: &Self, value: f32)
clip_to_bounds
fn clip_to_bounds(self: &Self) -> bool
set_clip_to_bounds
fn set_clip_to_bounds(self: &Self, value: bool)
offset
fn offset(self: &Self) -> Vector3D
set_offset
fn set_offset(self: &Self, value: Vector3D)
translation
fn translation(self: &Self) -> Vector3D
set_translation
fn set_translation(self: &Self, value: Vector3D)
size
fn size(self: &Self) -> Vector
set_size
fn set_size(self: &Self, value: Vector)
anchor_point
fn anchor_point(self: &Self) -> Vector
set_anchor_point
fn set_anchor_point(self: &Self, value: Vector)
center_point
fn center_point(self: &Self) -> Vector3D
set_center_point
fn set_center_point(self: &Self, value: Vector3D)
rotation_angle
fn rotation_angle(self: &Self) -> f32
set_rotation_angle
fn set_rotation_angle(self: &Self, value: f32)
orientation
fn orientation(self: &Self) -> Quaternion
set_orientation
fn set_orientation(self: &Self, value: Quaternion)
scale
fn scale(self: &Self) -> Vector3D
set_scale
fn set_scale(self: &Self, value: Vector3D)
transform_matrix
fn transform_matrix(self: &Self) -> Matrix
set_transform_matrix
fn set_transform_matrix(self: &Self, value: Matrix)
adorner_is_clipped
fn adorner_is_clipped(self: &Self) -> bool
Whether the adorner is clipped by the clips of the adorned visual and its ancestors.
set_adorner_is_clipped
fn set_adorner_is_clipped(self: &Self, value: bool)
effect
fn effect(self: &Self) -> Option<std::sync::Arc<dyn IImmutableEffect>>
set_effect
fn set_effect(self: &Self, value: Option<std::sync::Arc<dyn IImmutableEffect>>)
render_options
fn render_options(self: &Self) -> RenderOptions
set_render_options
fn set_render_options(self: &Self, value: RenderOptions)
text_options
fn text_options(self: &Self) -> TextOptions
set_text_options
fn set_text_options(self: &Self, value: TextOptions)
compositor
fn compositor(self: &Self) -> &Rc<Compositor>
object
fn object(self: &Self) -> &CompositionObject
The embedded CompositionObject.
implicit_animations
fn implicit_animations(self: &Self) -> Option<Rc<ImplicitAnimationCollection>>
The collection of implicit animations attached to this object.
set_implicit_animations
fn set_implicit_animations(self: &Self, value: Option<Rc<ImplicitAnimationCollection>>)
is_disposed
fn is_disposed(self: &Self) -> bool
dispose
fn dispose(self: &Self)
children
fn children(self: &Self) -> &Rc<CompositionVisualCollection>
The children of the visual.
root
fn root(self: &Self) -> Option<Rc<CompositionTarget>>
parent
fn parent(self: &Self) -> Option<Rc<CompositionVisual>>
adorned_visual
fn adorned_visual(self: &Self) -> Option<Rc<CompositionVisual>>
The visual this visual is an adorner of: its transform follows that visual.
set_adorned_visual
fn set_adorned_visual(self: &Self, value: Option<Rc<CompositionVisual>>)
cache_mode
fn cache_mode(self: &Self) -> Option<Rc<CompositionBitmapCache>>
set_cache_mode
fn set_cache_mode(self: &Self, value: Option<Rc<CompositionBitmapCache>>)
composition_clip
fn composition_clip(self: &Self) -> Option<Rc<CompositionClip>>
The WinUI clip of the visual (Visual.Clip): an
InsetClip or a
RectangleClip, applied in the coordinates
of the visual, after its transform, to its content and children.
Deviation (winui-composition.md): WinUI names it Clip; here clip
is the geometry clip of the upstream compositor, so the WinUI member
is composition_clip. Both may be set; the visible area is their
intersection.
set_composition_clip
fn set_composition_clip(self: &Self, value: Option<Rc<CompositionClip>>)
disable_sub_tree_bounds_hit_test_optimization
fn disable_sub_tree_bounds_hit_test_optimization(self: &Self) -> bool
opacity_mask
fn opacity_mask(self: &Self) -> Option<Rc<dyn IBrush>>
set_opacity_mask
fn set_opacity_mask(self: &Self, value: Option<Rc<dyn IBrush>>)
tag
fn tag(self: &Self) -> Option<Rc<dyn Any>>
set_tag
fn set_tag(self: &Self, value: Option<Rc<dyn Any>>)
hit_test
fn hit_test(self: &Self, point: Point) -> bool
Whether the content of the visual is hit at a point in its own coordinates.
hit_test_geometry
fn hit_test_geometry(self: &Self, geometry: &Ref<Geometry>) -> IntersectionResult
How the content of the visual intersects a geometry in its own coordinates.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyErasedDestructorIntoEitherCompositionExperimentalAcrylicVisualHooksVisualUnorderedCollectionHooks<CompositionVisual>CompositionSolidColorVisualHooksCompositionSurfaceVisualHooksLayerVisualHooksRedirectVisualHooksShapeVisualHooksSpriteVisualHooksCompositionVisualHooksCompositionContainerVisualHooksIRegisterForSerializationICompositionObjectHostICompositionObjectAnimationsAsCompositionObjectICompositionObjectICompositorSerializableCompositionVisualCollectionHooks<CompositionVisual>
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.