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→ pixelsp / 3, channelsp % 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>
impl<'a> PixfmtRgba32Lcd<'a>
Sourcepub fn new(rbuf: &'a mut RowAccessor, lut: &'a LcdDistributionLut) -> Self
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>
impl<'a> PixelFormat for PixfmtRgba32Lcd<'a>
Source§fn blend_solid_hspan(
&mut self,
x: i32,
y: i32,
len: u32,
c: &Rgba8,
covers: &[CoverType],
)
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.
type ColorType = Rgba8
fn width(&self) -> u32
fn height(&self) -> u32
Source§fn copy_pixel(&mut self, x: i32, y: i32, c: &Rgba8)
fn copy_pixel(&mut self, x: i32, y: i32, c: &Rgba8)
c.Source§fn copy_hline(&mut self, x: i32, y: i32, len: u32, c: &Rgba8)
fn copy_hline(&mut self, x: i32, y: i32, len: u32, c: &Rgba8)
len pixels with color c.Source§fn blend_pixel(&mut self, x: i32, y: i32, c: &Rgba8, cover: CoverType)
fn blend_pixel(&mut self, x: i32, y: i32, c: &Rgba8, cover: CoverType)
c and coverage cover.