pub fn new(alpha: Vec<u8>, width: usize, height: usize, buffer: usize) -> BitmapGlyph {
        assert_eq!(
            alpha.len(),
            (width + buffer * 2) * (height + buffer * 2),
            "The data length must be equal to (width + buffer * 2) * (height + buffer * 2)."
        );

        BitmapGlyph {
            alpha,
            width,
            height,
            buffer,
        }
    }
/// 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.
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.
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 .
pub fn new(alpha: Vec<u8>, width: usize, height: usize, buffer: usize) -> BitmapGlyph {
        assert_eq!(
            alpha.len(),
            (width + buffer * 2) * (height + buffer * 2),
            "The data length must be equal to (width + buffer * 2) * (height + buffer * 2)."
        );
        BitmapGlyph {
            alpha,
            width,
            height,
            buffer,
        }
    }
pub fn new ( alpha : Vec < u8 > , width : usize , height : usize , buffer : usize ) -> BitmapGlyph { assert_eq ! ( alpha len ( ) ( width buffer 2 ) ( height buffer 2 ) " " ) ; BitmapGlyph { alpha , width , height , buffer , } }
Creates a new bitmap from scratch.
Creates a new bitmap from scratch .
alpha
Vec<u8>
width
usize
height
usize
buffer
usize
alpha
Vec<u8>
width
usize
height
usize
buffer
usize
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.
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 .