pub struct Sampling {
pub center: [f64; 2],
pub texel: f64,
pub block: f64,
pub at: [f64; 2],
pub pixel: Option<[i64; 2]>,
}Expand description
How the loupe magnifies: what is at window physical pixel p lands
at at + (p - center) × scale.
Fields§
§center: [f64; 2]The centre of the displayed pixel under the pointer, in window physical pixels.
texel: f64The side of a displayed pixel on screen, in physical pixels: the zoom from 100 % up (an image pixel), else 1 (a screen pixel).
block: f64The side of a displayed pixel in the loupe, in physical pixels: a whole number.
at: [f64; 2]The loupe’s centre, in window physical pixels, placed so that its blocks fall on whole pixels.
pixel: Option<[i64; 2]>The image pixel under the pointer, when over the image.
Implementations§
Source§impl Sampling
impl Sampling
Sourcepub fn new(
m: &Mapping,
pointer: Pos2,
magnification: u32,
loupe_center: Pos2,
) -> Sampling
pub fn new( m: &Mapping, pointer: Pos2, magnification: u32, loupe_center: Pos2, ) -> Sampling
The sampling for a pointer (points) over a mapping, at a
magnification, the loupe centred near loupe_center (points).
Sourcepub fn map(&self, p: [f64; 2]) -> [f64; 2]
pub fn map(&self, p: [f64; 2]) -> [f64; 2]
A window physical position, magnified into the loupe.
Sourcepub fn map_rect(&self, r: [f64; 4]) -> [f64; 4]
pub fn map_rect(&self, r: [f64; 4]) -> [f64; 4]
A rectangle in window physical pixels ([x0, y0, x1, y1]),
magnified into the loupe.
Sourcepub fn center_block(&self) -> [f64; 4]
pub fn center_block(&self) -> [f64; 4]
The centre pixel’s square in the loupe, in physical pixels.
Trait Implementations§
impl Copy for Sampling
impl StructuralPartialEq for Sampling
Auto Trait Implementations§
impl Freeze for Sampling
impl RefUnwindSafe for Sampling
impl Send for Sampling
impl Sync for Sampling
impl Unpin for Sampling
impl UnsafeUnpin for Sampling
impl UnwindSafe for Sampling
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
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§impl<F, T, S> SimdInto<T, S> for Fwhere
T: SimdFrom<F, S>,
S: Simd,
impl<F, T, S> SimdInto<T, S> for Fwhere
T: SimdFrom<F, S>,
S: Simd,
§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.