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 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 image. The native atlas currently supports dimensions up to 1022 pixels.
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.
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