pub struct TextureView { /* private fields */ }Expand description
A leaf drawing an externally rendered scene texture — a video frame, a
camera preview, a 3D view — by the id its producer registered it under
(for a frame source, texture::TextureRegistration::scene_texture_id).
texture_view places it with a TextureFit (given the texture’s own
extent, .source_size(..)), clips it to .corner_radius(..), and takes
an accessible .label(..). A texture view inside a retained subtree keeps
that subtree from being replayed from cache — see the widget’s own docs.
A declarative view of an externally rendered scene texture. See the
module docs.
Implementations§
Source§impl TextureView
impl TextureView
Sourcepub fn fit(self, fit: TextureFit) -> TextureView
pub fn fit(self, fit: TextureFit) -> TextureView
How the texture is placed in the box. Needs Self::source_size to
keep an aspect ratio; without it every fit fills the box.
Sourcepub fn source_size(self, size: Size) -> TextureView
pub fn source_size(self, size: Size) -> TextureView
The texture’s own extent (a video’s resolution), which fit keeps the
aspect ratio of. Only the ratio matters.
Sourcepub fn size(self, size: Size) -> TextureView
pub fn size(self, size: Size) -> TextureView
A fixed size, clamped into the parent’s constraints. Overrides
Self::expand when called after it.
Sourcepub fn expand(self) -> TextureView
pub fn expand(self) -> TextureView
Fill the parent’s maximum constraints — the default.
Sourcepub fn corner_radius(self, radius: f64) -> TextureView
pub fn corner_radius(self, radius: f64) -> TextureView
Clip the box to corners of radius; 0.0 (the default) is square.
Sourcepub fn label(self, label: impl Into<String>) -> TextureView
pub fn label(self, label: impl Into<String>) -> TextureView
An accessible label, contributing a Role::Image semantics node; an
unlabelled texture view is decorative and reports nothing.
Trait Implementations§
Source§impl Clone for TextureView
impl Clone for TextureView
Source§fn clone(&self) -> TextureView
fn clone(&self) -> TextureView
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TextureView
impl Debug for TextureView
Source§impl PartialEq for TextureView
impl PartialEq for TextureView
impl StructuralPartialEq for TextureView
Source§impl<State> View<State> for TextureViewwhere
State: 'static,
impl<State> View<State> for TextureViewwhere
State: 'static,
Source§type Element = TextureWidget
type Element = TextureWidget
Source§fn build(&self, _ctx: &mut BuildCtx<'_>) -> TextureWidget
fn build(&self, _ctx: &mut BuildCtx<'_>) -> TextureWidget
Source§fn rebuild(
&self,
prev: &TextureView,
element: &mut TextureWidget,
_ctx: &mut BuildCtx<'_>,
) -> ChangeFlags
fn rebuild( &self, prev: &TextureView, element: &mut TextureWidget, _ctx: &mut BuildCtx<'_>, ) -> ChangeFlags
prev (the previous view of the same type) against the live
element, mutating it in place and reporting what changed.Auto Trait Implementations§
impl Freeze for TextureView
impl RefUnwindSafe for TextureView
impl Send for TextureView
impl Sync for TextureView
impl Unpin for TextureView
impl UnsafeUnpin for TextureView
impl UnwindSafe for TextureView
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Source§impl<State, V> ViewSeq<State, One> for Vwhere
State: 'static,
V: View<State>,
impl<State, V> ViewSeq<State, One> for Vwhere
State: 'static,
V: View<State>,
Source§fn extend_views(self, out: &mut Vec<AnyView<State>>)
fn extend_views(self, out: &mut Vec<AnyView<State>>)
out — erasing each
with AnyView::new (a no-op for an element already an AnyView).