pub struct AaBuf {
pub width: usize,
pub height: usize,
/* private fields */
}Expand description
Anti-aliasing scratch buffer: 4 rows × (bitmap_width × 4) columns, 1 bit/pixel.
Bit packing is MSB-first (matching SplashBitmap Mono1 layout and the
renderAALine / clipAALine code in SplashXPathScanner.cc):
- Bit 7 of byte 0 is pixel 0 of the row.
- Left-edge mask for pixel x:
0xff >> (x & 7). - Right-edge mask for pixel x1 (exclusive):
(0xff00u16 >> (x1 & 7)) as u8.
height is always AA_SIZE (4). width is bitmap_width * AA_SIZE.
Fields§
§width: usizeWidth in pixels (= bitmap_width × AA_SIZE).
height: usizeAlways AA_SIZE (4).
Implementations§
Source§impl AaBuf
impl AaBuf
Sourcepub fn new(bitmap_width: usize) -> Self
pub fn new(bitmap_width: usize) -> Self
Create a new zeroed AA buffer for a bitmap of the given pixel width.
Sourcepub fn set_span(&mut self, row: usize, x0: usize, x1: usize)
pub fn set_span(&mut self, row: usize, x0: usize, x1: usize)
Set pixels [x0, x1) to 1 in the given row.
x0 and x1 are clamped to [0, width]. No-op if x0 ≥ x1.
§Panics
Panics if row >= height.
Auto Trait Implementations§
impl Freeze for AaBuf
impl RefUnwindSafe for AaBuf
impl Send for AaBuf
impl Sync for AaBuf
impl Unpin for AaBuf
impl UnsafeUnpin for AaBuf
impl UnwindSafe for AaBuf
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