pub struct ZoomLevel(/* private fields */);Expand description
The map tile zoom level for the Second Life main map
Implementations§
Source§impl ZoomLevel
impl ZoomLevel
Sourcepub fn tile_size(&self) -> u16
pub fn tile_size(&self) -> u16
returns the map tile size in number of regions at this zoom level
This applies to both dimensions equally since both regions and map tiles are square
Sourcepub fn tile_size_in_pixels(&self) -> u32
pub fn tile_size_in_pixels(&self) -> u32
returns the map tile size in pixels at this zoom level
This applies to both dimensions equally since both regions and map tiles are square
Sourcepub fn map_tile_corner(&self, _: &GridCoordinates) -> GridCoordinates
pub fn map_tile_corner(&self, _: &GridCoordinates) -> GridCoordinates
returns the lower left (lowest coordinate for each axis) coordinate of the map tile containing the given grid coordinates at this zoom level
That is the coordinates used for the file name of the map tile at this zoom level that contains the region (or gap where a region could be) given by the grid coordinates
Sourcepub fn pixels_per_region(&self) -> u16
pub fn pixels_per_region(&self) -> u16
returns the size of a region in pixels in a map tile of this zoom level
The size applies to both dimensions equally since both regions and map tiles are square
Sourcepub fn pixels_per_meter(&self) -> f32
pub fn pixels_per_meter(&self) -> f32
returns the number of pixels per meter at this zoom level
Sourcepub fn max_zoom_level_to_fit_regions_into_output_image(
region_x: u16,
region_y: u16,
output_x: u32,
output_y: u32,
) -> Result<Self, ZoomFitError>
pub fn max_zoom_level_to_fit_regions_into_output_image( region_x: u16, region_y: u16, output_x: u32, output_y: u32, ) -> Result<Self, ZoomFitError>
returns the zoom level that is the highest zoom level that makes sense to use if we want to fit a given area of regions into a given image size assuming we want to always have one map tile pixel on one output pixel
§Errors
returns an error if any of the parameters are zero or in the (theoretically impossible if the algorithm is correct) case that ZoomLevel::try_new() returns an error on the calculated value