Struct sdf_glyph_renderer::BitmapGlyph [−][src]
pub struct BitmapGlyph { /* fields omitted */ }
Expand description
A raw bitmap containing only the alpha channel.
Implementations
Creates a new bitmap from scratch.
This constructor is useful when you already have a buffered glyph. If you have the alpha
bitmap but still need to buffer it (what you expect from most font renderers, for example),
use Self::from_unbuffered()
instead.
Panics
The caller is responsible for checking the integrity of the data. If the dimensions provided can’t describe the input data, this function will panic.
pub fn from_unbuffered(
alpha: &[u8],
width: usize,
height: usize,
buffer: usize
) -> BitmapGlyph
pub fn from_unbuffered(
alpha: &[u8],
width: usize,
height: usize,
buffer: usize
) -> BitmapGlyph
Creates a new bitmap from a raw data source, buffered by a given amount.
Most SDF glyphs are buffered a bit so that the outer edges can be properly captured. This constructor does the buffering for you.
Panics
The caller is responsible for checking the integrity of the data. If the dimensions provided can’t describe the input data, this function will panic.
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.