Skip to main content

MaskedRgb565Surface

Struct MaskedRgb565Surface 

Source
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>

Source

pub fn new( width: u32, height: u32, stride_pixels: usize, pixels: &'a mut [u16], mask_stride_bytes: usize, mask: &'a mut [u8], tile_size: TileSize, ) -> Result<Self, SurfaceError>

Creates a transparent surface using the built-in integer rasterizer.

Source§

impl<'a, R> MaskedRgb565Surface<'a, R>

Source

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.

Source

pub fn bitmap_view(&self) -> BitmapView<'_>

Borrows the retained pixels and mask as a transparent sprite resource.

Source

pub const fn rasterizer(&self) -> &R

Returns the selected rasterization policy.

Source

pub fn rasterizer_mut(&mut self) -> &mut R

Returns the selected rasterization policy mutably.

Trait Implementations§

Source§

impl<R> TileRenderer<Shape, ()> for MaskedRgb565Surface<'_, R>

Source§

type Error = SurfaceError

The backing renderer error.
Source§

fn viewport(&self) -> Bounds

Returns the stable viewport used for this render.
Source§

fn tile_size(&self) -> TileSize

Returns the damage tile dimensions.
Source§

fn object_coverage( &self, object: Instance<'_, Shape>, tile: Bounds, (): &(), ) -> TileCoverage

Classifies the pixels this backend would produce for object in tile. Read more
Source§

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 begin_tile(&mut self, tile: Bounds) -> Result<(), Self::Error>

Selects the active tile.
Source§

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>

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>> + 'b
where 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>

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

Returns whether replacing old with new may change this backend’s tile-local output. Read more
Source§

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 more
Source§

fn finish_frame<'a>( &'a mut self, ) -> impl Future<Output = Result<(), Self::Error>> + 'a
where I: 'a, R: 'a,

Completes any tile transfers still owned by the backend. Read more

Auto 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.