pub struct LiveImageHandle { /* private fields */ }Expand description
A handle to a LiveImage, for the UI thread: the size and status of
what it shows, where it shows it, and the mapping between its points and
the source’s pixels. Clone is an Rc clone; !Send.
It owns the widget’s Signals from construction, so it works before the widget mounts, and they stay the same across a switch of source. It does not keep the widget alive: once the widget is gone, it has no placement.
Implementations§
Source§impl LiveImageHandle
impl LiveImageHandle
Sourcepub fn new() -> Self
pub fn new() -> Self
A handle for a widget not built yet, which takes it with
LiveImage::with_handle.
Sourcepub fn source(&self) -> Option<LiveImageSource>
pub fn source(&self) -> Option<LiveImageSource>
The source the widget shows; None until a widget took the handle.
Sourcepub fn status(&self) -> Signal<LiveImageStatus>
pub fn status(&self) -> Signal<LiveImageStatus>
The source’s status as the window’s last layout saw it: the same Signal across switches of source.
Sourcepub fn frame_size(&self) -> Signal<Option<(u32, u32)>>
pub fn frame_size(&self) -> Signal<Option<(u32, u32)>>
The frame size layout uses: the source’s buffer, else its size hint, as the window’s last layout saw it. The same Signal across switches of source.
Sourcepub fn geometry(&self) -> Option<ImageGeometry>
pub fn geometry(&self) -> Option<ImageGeometry>
The placement of the last layout, widget-local: the one paint draws
and the mappings below use. None before the first layout, with no
frame size, or once the widget is gone.
Sourcepub fn map_to_source(&self, local: Point) -> Option<(u32, u32)>
pub fn map_to_source(&self, local: Point) -> Option<(u32, u32)>
The source pixel whose displayed square contains the widget-local
point local; None on the letterbox, outside the widget, or
without a placement. A pointer handler’s positions are widget-local.
Sourcepub fn map_to_source_clamped(&self, local: Point) -> Option<(u32, u32)>
pub fn map_to_source_clamped(&self, local: Point) -> Option<(u32, u32)>
The source pixel nearest local: the point is clamped into the
picture first, for a drag that leaves it. None only without a
placement.
Sourcepub fn map_to_source_f32(&self, local: Point) -> Option<(f32, f32)>
pub fn map_to_source_f32(&self, local: Point) -> Option<(f32, f32)>
Continuous source coordinates of local, unclamped: pixel k spans
[k, k + 1).
Sourcepub fn map_from_source(&self, rect: PixelRect) -> Option<Rect>
pub fn map_from_source(&self, rect: PixelRect) -> Option<Rect>
Where the source pixels of rect are displayed, widget-local: to
place an overlay on what the picture shows.
Sourcepub fn stats(&self) -> LiveImageStats
pub fn stats(&self) -> LiveImageStats
The source’s counters and, while the widget is mounted, its attachment’s; zero attachment counters otherwise.
Trait Implementations§
Source§impl Clone for LiveImageHandle
impl Clone for LiveImageHandle
Source§fn clone(&self) -> LiveImageHandle
fn clone(&self) -> LiveImageHandle
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 LiveImageHandle
impl Debug for LiveImageHandle
Auto Trait Implementations§
impl !RefUnwindSafe for LiveImageHandle
impl !Send for LiveImageHandle
impl !Sync for LiveImageHandle
impl !UnwindSafe for LiveImageHandle
impl Freeze for LiveImageHandle
impl Unpin for LiveImageHandle
impl UnsafeUnpin for LiveImageHandle
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more