pub struct Viewport { /* private fields */ }Expand description
A viewing region for displaying computer graphics.
Implementations
sourceimpl 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 RefUnwindSafe for Viewport
impl Send for Viewport
impl Sync for Viewport
impl Unpin for Viewport
impl UnwindSafe for Viewport
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
sourcefn into_color(self) -> To
fn into_color(self) -> To
Convert into color
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
Sets value as a parameter of self.