pub struct MsdfAtlas {
pub width: u32,
pub height: u32,
pub texture: Vec<u8>,
pub uv_map: HashMap<u16, UvRect>,
}Expand description
A packed atlas of MSDF glyph tiles, ready for GPU upload.
The atlas texture is stored as an RGB byte slice (texture), three bytes
per pixel. Each pixel encodes signed distances in the R, G, and B channels
for the corresponding colored edge of the glyph outline.
Fields§
§width: u32Atlas width in pixels.
height: u32Atlas height in pixels.
texture: Vec<u8>Raw RGB texture data: width * height * 3 bytes.
uv_map: HashMap<u16, UvRect>UV coordinates for each glyph ID within the atlas.
Implementations§
Source§impl MsdfAtlas
impl MsdfAtlas
Source§impl MsdfAtlas
impl MsdfAtlas
Sourcepub fn to_gpu_descriptor(&self) -> GpuAtlasDescriptor
pub fn to_gpu_descriptor(&self) -> GpuAtlasDescriptor
Produce a GPU-ready descriptor for this MSDF atlas.
Returns GpuAtlasFormat::Rgb8Unorm (3 bytes per pixel) with the raw
RGB texture data. glyph_metrics is empty for the same reason as for
SdfAtlas::to_gpu_descriptor.
Auto Trait Implementations§
impl Freeze for MsdfAtlas
impl RefUnwindSafe for MsdfAtlas
impl Send for MsdfAtlas
impl Sync for MsdfAtlas
impl Unpin for MsdfAtlas
impl UnsafeUnpin for MsdfAtlas
impl UnwindSafe for MsdfAtlas
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more