pub struct MaskedRgb565Surface<'a, R = IntegerRasterizer> { /* private fields */ }Expand description
A caller-owned RGB565 surface with one packed opacity bit per pixel.
The surface doubles as a TileRenderer for Shape display lists.
Rendering clears only mask bits in damaged tiles; color words underneath
transparent pixels are intentionally left unspecified.
Implementations§
Source§impl<'a> MaskedRgb565Surface<'a, IntegerRasterizer>
impl<'a> MaskedRgb565Surface<'a, IntegerRasterizer>
Source§impl<'a, R> MaskedRgb565Surface<'a, R>
impl<'a, R> MaskedRgb565Surface<'a, R>
Sourcepub fn with_rasterizer(
width: u32,
height: u32,
stride_pixels: usize,
pixels: &'a mut [u16],
mask_stride_bytes: usize,
mask: &'a mut [u8],
tile_size: TileSize,
rasterizer: R,
) -> Result<Self, SurfaceError>
pub fn with_rasterizer( width: u32, height: u32, stride_pixels: usize, pixels: &'a mut [u16], mask_stride_bytes: usize, mask: &'a mut [u8], tile_size: TileSize, rasterizer: R, ) -> Result<Self, SurfaceError>
Creates a transparent surface using an explicit shape rasterizer.
Sourcepub fn bitmap_view(&self) -> BitmapView<'_>
pub fn bitmap_view(&self) -> BitmapView<'_>
Borrows the retained pixels and mask as a transparent sprite resource.
Sourcepub const fn rasterizer(&self) -> &R
pub const fn rasterizer(&self) -> &R
Returns the selected rasterization policy.
Sourcepub fn rasterizer_mut(&mut self) -> &mut R
pub fn rasterizer_mut(&mut self) -> &mut R
Returns the selected rasterization policy mutably.
Trait Implementations§
Source§impl<R> TileRenderer<Shape, ()> for MaskedRgb565Surface<'_, R>where
R: TileRasterizer<Shape>,
impl<R> TileRenderer<Shape, ()> for MaskedRgb565Surface<'_, R>where
R: TileRasterizer<Shape>,
Source§type Error = SurfaceError
type Error = SurfaceError
The backing renderer error.
Source§fn object_coverage(
&self,
object: Instance<'_, Shape>,
tile: Bounds,
(): &(),
) -> TileCoverage
fn object_coverage( &self, object: Instance<'_, Shape>, tile: Bounds, (): &(), ) -> TileCoverage
Source§fn object_change(
&self,
old: Instance<'_, Shape>,
new: Instance<'_, Shape>,
tile: Bounds,
(): &(),
) -> TileChange
fn object_change( &self, old: Instance<'_, Shape>, new: Instance<'_, Shape>, tile: Bounds, (): &(), ) -> TileChange
Returns the proof status behind the old/new change decision.
Source§fn clear_tile(&mut self) -> Result<(), Self::Error>
fn clear_tile(&mut self) -> Result<(), Self::Error>
Clears the active tile to the renderer’s background color.
Source§fn draw_item(
&mut self,
object: Instance<'_, Shape>,
(): &(),
) -> Result<(), Self::Error>
fn draw_item( &mut self, object: Instance<'_, Shape>, (): &(), ) -> Result<(), Self::Error>
Draws an object after applying its transform, clipped to the active tile. Read more
Source§fn flush_tile<'b>(
&'b mut self,
) -> impl Future<Output = Result<(), Self::Error>> + 'bwhere
Shape: 'b,
fn flush_tile<'b>(
&'b mut self,
) -> impl Future<Output = Result<(), Self::Error>> + 'bwhere
Shape: 'b,
Flushes the active tile to the backing display.
Source§fn preflight<const N: usize>(
&mut self,
_frame: FrameView<'_, I, N>,
_resources: &R,
) -> Result<(), Self::Error>
fn preflight<const N: usize>( &mut self, _frame: FrameView<'_, I, N>, _resources: &R, ) -> Result<(), Self::Error>
Resolves resources and optionally prepares the frame before display
writes. Read more
Source§fn object_may_change(
&self,
old: Instance<'_, I>,
new: Instance<'_, I>,
tile: Bounds,
resources: &R,
) -> bool
fn object_may_change( &self, old: Instance<'_, I>, new: Instance<'_, I>, tile: Bounds, resources: &R, ) -> bool
Source§fn prefers_clear_before_full(&self) -> bool
fn prefers_clear_before_full(&self) -> bool
Returns whether this backend prefers a clear even when a proven
TileCoverage::Full item will immediately initialize the whole tile. Read moreAuto Trait Implementations§
impl<'a, R = IntegerRasterizer> !UnwindSafe for MaskedRgb565Surface<'a, R>
impl<'a, R> Freeze for MaskedRgb565Surface<'a, R>where
R: Freeze,
impl<'a, R> RefUnwindSafe for MaskedRgb565Surface<'a, R>where
R: RefUnwindSafe,
impl<'a, R> Send for MaskedRgb565Surface<'a, R>where
R: Send,
impl<'a, R> Sync for MaskedRgb565Surface<'a, R>where
R: Sync,
impl<'a, R> Unpin for MaskedRgb565Surface<'a, R>where
R: Unpin,
impl<'a, R> UnsafeUnpin for MaskedRgb565Surface<'a, R>where
R: UnsafeUnpin,
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