pub struct VisualGeometry {
pub blitter: Blitter,
pub pixels: Size,
pub rendered_pixels: Size,
pub rendered_cells: Size,
pub pixels_per_cell: Size,
pub region_position: Position,
pub region_size: Size,
pub max_bitmap_pixels: Option<Size>,
}Expand description
The geometry of a Visual.
Inner values are calculated at the time of the call. A font change,
for example, could make all the fields invalid, except for pixels.
Fields§
§blitter: BlitterThe selected blitter.
pixels: SizeTrue internal size in pixels, following any resizing.
rendered_pixels: SizeRendered size in pixels, as handed to the blitter, following any scaling.
rendered_cells: SizeRendered size in cells, following any padding.
There’s padding whenever rendered_pixels is not evenly divided by scale.
pixels_per_cell: SizeA Cells size, in pixels.
region_position: PositionThe origin of the region to be rendered (top-left corner).
region_size: SizeThe size of the region to be rendered.
max_bitmap_pixels: Option<Size>The largest bitmap size that the terminal is willing to accept.
Or none if bitmaps are not supported.
Implementations§
Source§impl VisualGeometry
§methods
impl VisualGeometry
§methods
Sourcepub const fn rendered_pixels(&self) -> Size
pub const fn rendered_pixels(&self) -> Size
The rendered size in pixels, following any scaling.
Sourcepub const fn rendered_cells(&self) -> Size
pub const fn rendered_cells(&self) -> Size
The rendered size in cells, following any padding.
There’s padding whenever rendered_pixels is not evenly divided by blits_per_cell.
Sourcepub fn rendered_blits(&self) -> Size
pub fn rendered_blits(&self) -> Size
The rendered size in blits, following any padding.
Sourcepub const fn pixels_per_cell(&self) -> Size
pub const fn pixels_per_cell(&self) -> Size
A Cell’s size, in pixels.
Sourcepub fn blits_per_cell(&self) -> Size
pub fn blits_per_cell(&self) -> Size
A Cells size, in blitter blits.
Sourcepub const fn max_bitmap_pixels(&self) -> Option<Size>
pub const fn max_bitmap_pixels(&self) -> Option<Size>
Returns the maximum supported bitmap size, in pixels, or none if bitmaps are not supported.
Sourcepub fn max_bitmap_cells(&self) -> Option<Size>
pub fn max_bitmap_cells(&self) -> Option<Size>
Returns the maximum supported bitmap size, in Cells,
or none if bitmaps are not supported.
Sourcepub fn max_bitmap_blits(&self) -> Option<Size>
pub fn max_bitmap_blits(&self) -> Option<Size>
Returns the maximum supported bitmap size, in blits, using the current blitter, or none if bitmaps are not supported.
Sourcepub fn max_bitmap_blitter(&self, blitter: Blitter) -> Option<Size>
pub fn max_bitmap_blitter(&self, blitter: Blitter) -> Option<Size>
Returns the maximum supported bitmap size, in blits, using the provided blitter,
or none if bitmaps are not supported.
Trait Implementations§
Source§impl Clone for VisualGeometry
impl Clone for VisualGeometry
Source§fn clone(&self) -> VisualGeometry
fn clone(&self) -> VisualGeometry
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more