pub struct Image { /* private fields */ }Expand description
Immutable, shared RGBA8 pixels. Loading and decoding are the host application’s responsibility.
Implementations§
Source§impl Image
impl Image
Sourcepub const ATLAS_MAX_DIMENSION: u32 = 1022
pub const ATLAS_MAX_DIMENSION: u32 = 1022
Maximum width or height (in pixels) packed into the shared 2048×2048 GPU image atlas.
Sourcepub const MAX_DIMENSION: u32 = 4096
pub const MAX_DIMENSION: u32 = 4096
Maximum width or height (in pixels) accepted for standalone RGBA images.
Sourcepub fn rgba(width: u32, height: u32, pixels: Vec<u8>) -> Option<Self>
pub fn rgba(width: u32, height: u32, pixels: Vec<u8>) -> Option<Self>
Construct a bounded RGBA8 image (up to 4096×4096, <= 64 MiB).
Images up to 1022×1022 pack into the shared atlas; larger images render via standalone GPU textures.
Sourcepub fn msdf(
width: u32,
height: u32,
px_range: f32,
pixels: Vec<u8>,
) -> Option<Self>
pub fn msdf( width: u32, height: u32, px_range: f32, pixels: Vec<u8>, ) -> Option<Self>
Construct a Multi-Channel Signed Distance Field (MSDF) RGBA8 image (px_range > 0)
for resolution-independent vector rendering in the GLES fragment shader.
Sourcepub fn is_atlas_eligible(&self) -> bool
pub fn is_atlas_eligible(&self) -> bool
Whether this image fits in the shared 2048×2048 GPU image atlas (<= 1022×1022).
pub fn msdf_px_range(&self) -> f32
pub fn width(&self) -> u32
pub fn height(&self) -> u32
pub fn pixels(&self) -> &[u8] ⓘ
pub fn id(&self) -> u32
Trait Implementations§
impl StructuralPartialEq for Image
Auto Trait Implementations§
impl Forget for Image
impl Freeze for Image
impl Move for Image
impl RefUnwindSafe for Image
impl Send for Image
impl Sync for Image
impl Unpin for Image
impl UnsafeUnpin for Image
impl UnwindSafe for Image
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