Skip to main content

PixfmtRgba32Lcd

Struct PixfmtRgba32Lcd 

Source
pub struct PixfmtRgba32Lcd<'a> { /* private fields */ }
Expand description

LCD subpixel pixel format for RGBA32 rendering buffers.

Adapted from C++ pixfmt_rgb24_lcd for RGBA32 (4 bytes per pixel) buffers. Reports width as actual_width * 3 so the rasterizer operates at 3x horizontal resolution. Each “subpixel” maps to one R, G, or B channel of an actual RGBA pixel:

  • Subpixel sp → pixel sp / 3, channel sp % 3 (0=R, 1=G, 2=B)
  • Byte offset: (sp / 3) * 4 + (sp % 3)

The blend_solid_hspan method distributes each coverage value across 5 neighboring subpixels (tertiary, secondary, primary, secondary, tertiary) using the LcdDistributionLut, matching the C++ implementation exactly.

Implementations§

Source§

impl<'a> PixfmtRgba32Lcd<'a>

Source

pub fn new(rbuf: &'a mut RowAccessor, lut: &'a LcdDistributionLut) -> Self

Create a new LCD pixel format wrapping an RGBA32 rendering buffer.

Trait Implementations§

Source§

impl<'a> PixelFormat for PixfmtRgba32Lcd<'a>

Source§

fn blend_solid_hspan( &mut self, x: i32, y: i32, len: u32, c: &Rgba8, covers: &[CoverType], )

LCD subpixel coverage distribution — the core of LCD rendering.

Distributes each coverage value across 5 neighboring subpixel positions (tertiary, secondary, primary, secondary, tertiary) using the LUT, then blends the distributed coverage into the RGBA buffer.

Exact port of C++ pixfmt_rgb24_lcd::blend_solid_hspan, adapted for RGBA32 byte layout.

Source§

type ColorType = Rgba8

Source§

fn width(&self) -> u32

Source§

fn height(&self) -> u32

Source§

fn pixel(&self, x: i32, y: i32) -> Rgba8

Get the pixel color at (x, y).
Source§

fn copy_pixel(&mut self, x: i32, y: i32, c: &Rgba8)

Copy (overwrite) a single pixel at (x, y) with color c.
Source§

fn copy_hline(&mut self, x: i32, y: i32, len: u32, c: &Rgba8)

Copy (overwrite) a horizontal line of len pixels with color c.
Source§

fn blend_pixel(&mut self, x: i32, y: i32, c: &Rgba8, cover: CoverType)

Blend a single pixel at (x, y) with color c and coverage cover.
Source§

fn blend_hline(&mut self, x: i32, y: i32, len: u32, c: &Rgba8, cover: CoverType)

Blend a horizontal line of len pixels at (x, y) with uniform color and coverage.
Source§

fn blend_color_hspan( &mut self, x: i32, y: i32, len: u32, colors: &[Rgba8], covers: &[CoverType], cover: CoverType, )

Blend a horizontal span with per-pixel colors and optional per-pixel coverage. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for PixfmtRgba32Lcd<'a>

§

impl<'a> RefUnwindSafe for PixfmtRgba32Lcd<'a>

§

impl<'a> !Send for PixfmtRgba32Lcd<'a>

§

impl<'a> !Sync for PixfmtRgba32Lcd<'a>

§

impl<'a> Unpin for PixfmtRgba32Lcd<'a>

§

impl<'a> !UnwindSafe for PixfmtRgba32Lcd<'a>

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.