pub struct CoverageTile {
pub width: u32,
pub height: u32,
pub data: Arc<Vec<u8>>,
}Expand description
An 8-bit coverage tile: width * height alpha samples, row-major.
The coverage is Arc-shared so a cached tile can be emitted as a
RenderBitmap (or composited) without copying the buffer.
Fields§
§width: u32Tile width in pixels.
height: u32Tile height in pixels.
data: Arc<Vec<u8>>width * height coverage bytes (0 = empty, 255 = fully covered).
Implementations§
Source§impl CoverageTile
impl CoverageTile
Sourcepub fn rasterize(path: &Path) -> Option<(Self, i32, i32)>
pub fn rasterize(path: &Path) -> Option<(Self, i32, i32)>
Rasterize a screen-space path to a coverage tile.
Returns the tile plus the integer (x, y) at which it must be
composited. The path’s sub-pixel position is baked into the coverage, so
compositing at the returned integer offset reproduces the anti-aliasing
of a direct fill at the original position. Returns None for an empty or
unrasterizable path.
Trait Implementations§
Source§impl Clone for CoverageTile
impl Clone for CoverageTile
Source§fn clone(&self) -> CoverageTile
fn clone(&self) -> CoverageTile
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CoverageTile
impl RefUnwindSafe for CoverageTile
impl Send for CoverageTile
impl Sync for CoverageTile
impl Unpin for CoverageTile
impl UnsafeUnpin for CoverageTile
impl UnwindSafe for CoverageTile
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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