pub struct RasterSurface<'a> { /* private fields */ }Expand description
Composites terminal batches into caller-owned RGB storage.
Implementations§
Source§impl<'a> RasterSurface<'a>
impl<'a> RasterSurface<'a>
Sourcepub fn new(
size: PixelSize,
stride: usize,
content: &'a mut [Rgb],
output: &'a mut [Rgb],
) -> Option<Self>
pub fn new( size: PixelSize, stride: usize, content: &'a mut [Rgb], output: &'a mut [Rgb], ) -> Option<Self>
Both buffers use the same row stride, measured in pixels. Submit a full batch to initialize the visible area.
pub fn pixels(&self) -> &[Rgb]
Sourcepub fn apply_glyphs(
&mut self,
batch: &PaintBatch,
glyphs: &mut impl GlyphSource,
)
pub fn apply_glyphs( &mut self, batch: &PaintBatch, glyphs: &mut impl GlyphSource, )
Paints each visible display unit with a mask from the glyph source.
Sourcepub fn apply(
&mut self,
batch: &PaintBatch,
draw_text: impl FnMut(PixelRegion<'_>, RasterText<'_>),
)
pub fn apply( &mut self, batch: &PaintBatch, draw_text: impl FnMut(PixelRegion<'_>, RasterText<'_>), )
Applies a batch in order. Text callbacks can modify pixels inside the run or cursor clip.
Auto Trait Implementations§
impl<'a> !UnwindSafe for RasterSurface<'a>
impl<'a> Forget for RasterSurface<'a>
impl<'a> Freeze for RasterSurface<'a>
impl<'a> Move for RasterSurface<'a>
impl<'a> RefUnwindSafe for RasterSurface<'a>
impl<'a> Send for RasterSurface<'a>
impl<'a> Sync for RasterSurface<'a>
impl<'a> Unpin for RasterSurface<'a>
impl<'a> UnsafeUnpin for RasterSurface<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<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>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> 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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.