pub struct Viewport { /* private fields */ }
Expand description
A viewing region for displaying computer graphics.
Implementations§
Source§impl Viewport
impl Viewport
Sourcepub fn with_physical_size(size: Size<u32>, scale_factor: f64) -> Viewport
pub fn with_physical_size(size: Size<u32>, scale_factor: f64) -> Viewport
Creates a new Viewport
with the given physical dimensions and scale
factor.
Sourcepub fn physical_size(&self) -> Size<u32>
pub fn physical_size(&self) -> Size<u32>
Returns the physical size of the Viewport
.
Sourcepub fn physical_width(&self) -> u32
pub fn physical_width(&self) -> u32
Returns the physical width of the Viewport
.
Sourcepub fn physical_height(&self) -> u32
pub fn physical_height(&self) -> u32
Returns the physical height of the Viewport
.
Sourcepub fn logical_size(&self) -> Size<f32>
pub fn logical_size(&self) -> Size<f32>
Returns the logical size of the Viewport
.
Sourcepub fn scale_factor(&self) -> f64
pub fn scale_factor(&self) -> f64
Returns the scale factor of the Viewport
.
Sourcepub fn projection(&self) -> Transformation
pub fn projection(&self) -> Transformation
Returns the projection transformation of the Viewport
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Viewport
impl RefUnwindSafe for Viewport
impl Send for Viewport
impl Sync for Viewport
impl Unpin for Viewport
impl UnwindSafe for Viewport
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>
Converts
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>
Converts
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