pub enum RenderOutput {
Greyscale(Bitmap),
Color(ColorBitmap),
Sdf {
width: u32,
height: u32,
data: Vec<u8>,
},
Lcd(LcdBitmap),
Msdf {
width: u32,
height: u32,
data: Vec<u8>,
},
}Expand description
Unified per-glyph render output.
Lets a rendering pipeline return greyscale, color, SDF, LCD subpixel, or multi-channel SDF output through a single channel so callers can handle a mixed set of glyphs uniformly.
Variants§
Greyscale(Bitmap)
A greyscale coverage bitmap.
Color(ColorBitmap)
An RGBA color bitmap (color fonts).
Sdf
A single-channel signed-distance-field tile (width * height bytes).
Fields
Lcd(LcdBitmap)
An LCD subpixel bitmap (three bytes per pixel: R, G, B channels).
Used for ClearType / FreeType LCD rendering to achieve sub-pixel horizontal precision on colour LCD displays.
Msdf
A multi-channel signed-distance-field tile.
MSDF encodes the distance field across three independent colour channels
to resolve corner artefacts that appear in single-channel SDF at large
magnifications. The data layout is width * height * 3 bytes (RGB).
Implementations§
Source§impl RenderOutput
impl RenderOutput
Sourcepub fn into_bitmap(self) -> Option<Bitmap>
pub fn into_bitmap(self) -> Option<Bitmap>
Extracts the greyscale Bitmap from a RenderOutput::Greyscale variant,
returning None for all other variants.
Trait Implementations§
Source§impl Clone for RenderOutput
impl Clone for RenderOutput
Source§fn clone(&self) -> RenderOutput
fn clone(&self) -> RenderOutput
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RenderOutput
impl Debug for RenderOutput
Source§impl From<RenderOutput> for Option<Bitmap>
impl From<RenderOutput> for Option<Bitmap>
Source§fn from(output: RenderOutput) -> Self
fn from(output: RenderOutput) -> Self
Converts a RenderOutput into Some(Bitmap) for the greyscale variant,
or None for all other variants.