Struct MovedRegion
pub struct MovedRegion {
pub source: Rect,
pub delta: Vec2,
}Expand description
A copy as a host that composites the target elsewhere sees it: the rectangle it reads and how far it moves it, in the coordinates of the scene the target is drawn into (an embedded app’s region in a desktop section), before that scene is rasterised.
Fields§
§source: Rect§delta: Vec2Implementations§
§impl MovedRegion
impl MovedRegion
pub fn of(copy: &DeviceCopy, scale: f64) -> MovedRegion
pub fn of(copy: &DeviceCopy, scale: f64) -> MovedRegion
copy, made in a target of scale device pixels per unit of the
scene it is drawn with.
pub fn destination(&self) -> Rect
pub fn destination(&self) -> Rect
Where the copy lands.
pub fn transformed(&self, transform: Affine) -> Option<MovedRegion>
pub fn transformed(&self, transform: Affine) -> Option<MovedRegion>
The same copy in the coordinates transform maps into, or None
when it rotates or skews (a copy moves rows and columns as they are).
pub fn device(
&self,
to_device: Affine,
_: (u32, u32),
) -> Option<(DeviceCopy, Vec<Rect>)>
pub fn device( &self, to_device: Affine, _: (u32, u32), ) -> Option<(DeviceCopy, Vec<Rect>)>
The copy in a width × height target that to_device maps this
region’s coordinates into: the whole device pixels of the source
that land inside the target, and where the destination is not
covered by them (its antialiased edges, what would land outside),
to repaint. None when the delta is not a whole number of device
pixels, to_device rotates or skews, or nothing lands.
Trait Implementations§
§impl Clone for MovedRegion
impl Clone for MovedRegion
§fn clone(&self) -> MovedRegion
fn clone(&self) -> MovedRegion
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for MovedRegion
impl Debug for MovedRegion
§impl PartialEq for MovedRegion
impl PartialEq for MovedRegion
impl Copy for MovedRegion
impl StructuralPartialEq for MovedRegion
Auto Trait Implementations§
impl Freeze for MovedRegion
impl RefUnwindSafe for MovedRegion
impl Send for MovedRegion
impl Sync for MovedRegion
impl Unpin for MovedRegion
impl UnsafeUnpin for MovedRegion
impl UnwindSafe for MovedRegion
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
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> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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