pub struct ViewportMapping { /* private fields */ }Expand description
Caller-declared mapping from viewport units to source-image pixels.
Implementations§
Source§impl ViewportMapping
impl ViewportMapping
pub const fn new( viewport_dimensions: PixelDimensions, scale_x: RationalScale, scale_y: RationalScale, ) -> Self
Sourcepub fn for_source(
viewport_dimensions: PixelDimensions,
source_dimensions: PixelDimensions,
) -> Self
pub fn for_source( viewport_dimensions: PixelDimensions, source_dimensions: PixelDimensions, ) -> Self
Builds the canonical exact viewport-to-source rational mapping.
pub const fn viewport_dimensions(self) -> PixelDimensions
pub const fn scale_x(self) -> RationalScale
pub const fn scale_y(self) -> RationalScale
Trait Implementations§
Source§impl Clone for ViewportMapping
impl Clone for ViewportMapping
Source§fn clone(&self) -> ViewportMapping
fn clone(&self) -> ViewportMapping
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ViewportMapping
Source§impl Debug for ViewportMapping
impl Debug for ViewportMapping
Source§impl<'de> Deserialize<'de> for ViewportMapping
impl<'de> Deserialize<'de> for ViewportMapping
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ViewportMapping
Source§impl JsonSchema for ViewportMapping
impl JsonSchema for ViewportMapping
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for ViewportMapping
impl PartialEq for ViewportMapping
Source§impl Serialize for ViewportMapping
impl Serialize for ViewportMapping
impl StructuralPartialEq for ViewportMapping
Auto Trait Implementations§
impl Freeze for ViewportMapping
impl RefUnwindSafe for ViewportMapping
impl Send for ViewportMapping
impl Sync for ViewportMapping
impl Unpin for ViewportMapping
impl UnsafeUnpin for ViewportMapping
impl UnwindSafe for ViewportMapping
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