pub struct TiledSurfacePlan { /* private fields */ }Expand description
Complete lossless surface partitioning plan covering 100% of a viewport at full 1:1 physical DPI without dropping scale.
Implementations§
Source§impl TiledSurfacePlan
Exact tile partitioning, coverage validation, and 1:1 pointer hit-testing for TiledSurfacePlan.
impl TiledSurfacePlan
Exact tile partitioning, coverage validation, and 1:1 pointer hit-testing for TiledSurfacePlan.
Sourcepub fn build(viewport: ViewportMetrics, limits: SurfaceTileLimit) -> Self
pub fn build(viewport: ViewportMetrics, limits: SurfaceTileLimit) -> Self
Partitions viewport into the minimum number of 1:1 physical tiles strictly obeying limits without dropping DPI.
§Arguments
ViewportMetrics- Authoritative lossless viewport metrics.SurfaceTileLimit- Hardware single-surface dimension and pixel-area ceiling.
§Returns
Self- Complete non-overlapping 1:1 physical tile plan covering 100% ofviewport.
Sourcepub fn covers_entire_viewport(&self) -> bool
pub fn covers_entire_viewport(&self) -> bool
Sourcepub fn hit_test_logical(
&self,
logical_x: f64,
logical_y: f64,
) -> Option<TileHitResult>
pub fn hit_test_logical( &self, logical_x: f64, logical_y: f64, ) -> Option<TileHitResult>
Resolves a logical pointer coordinate (logical_x, logical_y) to its owning surface tile and tile-local physical coordinates.
§Arguments
&Self- Tiled surface plan reference.f64- Pointer X coordinate in logical viewport space.f64- Pointer Y coordinate in logical viewport space.
§Returns
Option<TileHitResult>- Owning tile and physical coordinates, orNonewhen outside viewport bounds.
Sourcepub fn tile_local_to_logical(
&self,
tile_index: usize,
local_physical_x: f64,
local_physical_y: f64,
) -> Option<(f64, f64)>
pub fn tile_local_to_logical( &self, tile_index: usize, local_physical_x: f64, local_physical_y: f64, ) -> Option<(f64, f64)>
Converts a tile-local physical pixel coordinate back into exact global logical viewport coordinates.
§Arguments
&Self- Tiled surface plan reference.usize- Row-major index intotiles.f64- Tile-local physical X coordinate.f64- Tile-local physical Y coordinate.
§Returns
Option<(f64, f64)>- Global logical(x, y)coordinates, orNonewhentile_indexis invalid.
Source§impl TiledSurfacePlan
Implements impl #impl_generics #name #ty_generics #where_clause.
impl TiledSurfacePlan
Implements impl #impl_generics #name #ty_generics #where_clause.
pub fn get_viewport(&self) -> ViewportMetrics
pub fn get_limits(&self) -> SurfaceTileLimit
pub fn get_columns(&self) -> u32
pub fn get_rows(&self) -> u32
pub fn get_tiled(&self) -> bool
pub fn get_tiles(&self) -> &Vec<SurfaceTileRect>
Trait Implementations§
Source§impl Clone for TiledSurfacePlan
impl Clone for TiledSurfacePlan
Source§impl Debug for TiledSurfacePlan
impl Debug for TiledSurfacePlan
Source§impl PartialEq for TiledSurfacePlan
impl PartialEq for TiledSurfacePlan
impl StructuralPartialEq for TiledSurfacePlan
Auto Trait Implementations§
impl Forget for TiledSurfacePlan
impl Freeze for TiledSurfacePlan
impl Move for TiledSurfacePlan
impl RefUnwindSafe for TiledSurfacePlan
impl Send for TiledSurfacePlanwhere
RawVecInner: Send,
impl Sync for TiledSurfacePlanwhere
RawVecInner: Sync,
impl Unpin for TiledSurfacePlan
impl UnsafeUnpin for TiledSurfacePlan
impl UnwindSafe for TiledSurfacePlanwhere
RawVecInner: UnwindSafe,
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