pub struct LcdMaskBuilder { /* private fields */ }Expand description
Accumulator for an LcdMask. Build the gray buffer with one or
more with_paths calls (each opens an AGG rasterizer scope), then
finalize to apply the 5-tap filter and produce the packed mask.
Implementations§
Source§impl LcdMaskBuilder
impl LcdMaskBuilder
Sourcepub fn new(mask_w: u32, mask_h: u32) -> Self
pub fn new(mask_w: u32, mask_h: u32) -> Self
Allocate a zeroed builder for an mask_w × mask_h output mask.
The internal gray buffer is (3 × mask_w) × mask_h bytes.
Sourcepub fn with_clip(self, clip: Option<(f64, f64, f64, f64)>) -> Self
pub fn with_clip(self, clip: Option<(f64, f64, f64, f64)>) -> Self
Set a clip rectangle in screen-space (mask pixel coords). All
subsequent with_paths calls render only inside the clip;
pixels outside it stay zero in the gray buffer (and therefore
produce zero coverage in the final filtered mask). Builder-style;
chain after new.
Sourcepub fn with_fill_rule(self, fill_rule: FillRule) -> Self
pub fn with_fill_rule(self, fill_rule: FillRule) -> Self
Set the fill rule used by subsequent path rasterization.
Sourcepub fn with_paths<F>(&mut self, transform: &TransAffine, f: F)
pub fn with_paths<F>(&mut self, transform: &TransAffine, f: F)
Open an AGG rasterizer scope and let f add as many paths as
it likes via the supplied &mut FnMut(&mut PathStorage). All
paths share transform, with X supersampled by 3 inside the
scope. Lifetimes prevent us from keeping the renderer alive
across separate method calls (it borrows self.gray), so the
closure pattern scopes the borrow precisely.
Sourcepub fn finalize(self) -> LcdMask
pub fn finalize(self) -> LcdMask
Apply the 5-tap low-pass filter to the gray buffer and return
the packed mask. Consumes the builder; callers usually composite
the result via [LcdBuffer::composite_mask] or
composite_lcd_mask.
Auto Trait Implementations§
impl Freeze for LcdMaskBuilder
impl RefUnwindSafe for LcdMaskBuilder
impl Send for LcdMaskBuilder
impl Sync for LcdMaskBuilder
impl Unpin for LcdMaskBuilder
impl UnsafeUnpin for LcdMaskBuilder
impl UnwindSafe for LcdMaskBuilder
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
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>
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>
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