pub struct PixelBand<'a> { /* private fields */ }Expand description
Zero-copy borrowed horizontal row band of a Framebuffer enabling safe multi-threaded parallel rasterization.
Implementations§
Source§impl<'a> PixelBand<'a>
Zero-copy band rasterization primitives for PixelBand.
impl<'a> PixelBand<'a>
Zero-copy band rasterization primitives for PixelBand.
Sourcepub fn row_slice_mut(&mut self, y: u32) -> Option<&mut [u8]>
pub fn row_slice_mut(&mut self, y: u32) -> Option<&mut [u8]>
Sourcepub fn two_row_slices_mut(
&mut self,
y_a: u32,
y_b: u32,
) -> Option<(&mut [u8], &mut [u8])>
pub fn two_row_slices_mut( &mut self, y_a: u32, y_b: u32, ) -> Option<(&mut [u8], &mut [u8])>
Returns two disjoint mutable row slices for global physical rows y_a < y_b owned by this band.
§Arguments
&Self- Mutable pixel band.u32- Upper global physical Y row coordinate (y_a < y_b).u32- Lower global physical Y row coordinate (y_b > y_a).
§Returns
Option<(&mut [u8], &mut [u8])>- Pair of disjoint mutable row slices(row_a, row_b).
Sourcepub fn clear(&mut self, color: Color)
pub fn clear(&mut self, color: Color)
Fills the entire band with solid color using 32-byte wide auto-vectorized stores.
§Arguments
&Self- Mutable pixel band.Color- Clear color.
Sourcepub fn fill_span(&mut self, x0: u32, x1: u32, y: u32, color: Color)
pub fn fill_span(&mut self, x0: u32, x1: u32, y: u32, color: Color)
Fills or Porter-Duff blends horizontal span [x0, x1) on global row y.
§Arguments
&Self- Mutable pixel band.u32- Inclusive start X coordinate.u32- Exclusive end X coordinate.u32- Global physical Y coordinate.Color- Foreground RGBA color.
Sourcepub fn fill_span_linear(&mut self, x0: u32, x1: u32, y: u32, color: Color)
pub fn fill_span_linear(&mut self, x0: u32, x1: u32, y: u32, color: Color)
Fills or LUT linear-light blends horizontal span [x0, x1) on global row y.
§Arguments
&Self- Mutable pixel band.u32- Inclusive start X coordinate.u32- Exclusive end X coordinate.u32- Global physical Y coordinate.Color- Foreground RGBA color.
Sourcepub fn fill_span_linear_luts(
&mut self,
x0: u32,
x1: u32,
y: u32,
luts: &[[u8; 256]; 4],
)
pub fn fill_span_linear_luts( &mut self, x0: u32, x1: u32, y: u32, luts: &[[u8; 256]; 4], )
Composites horizontal span [x0, x1) on global row y using precomputed bit-exact 256-entry linear-light channel LUTs.
§Arguments
&Self- Mutable pixel band.u32- Inclusive start X coordinate.u32- Exclusive end X coordinate.u32- Global physical Y coordinate.&[[u8; 256]; 4]- Precomputed per-channel lookup tables.
Sourcepub fn blend_shadow_span_const_alpha(
&mut self,
x0: u32,
x1: u32,
y: u32,
color: Color,
alpha_f: f32,
)
pub fn blend_shadow_span_const_alpha( &mut self, x0: u32, x1: u32, y: u32, color: Color, alpha_f: f32, )
Composites a constant-opacity horizontal shadow span [x0, x1) on global row y with L1 LUT linear light and IGN dithering.
§Arguments
&Self- Mutable pixel band.u32- Inclusive start X coordinate.u32- Exclusive end X coordinate.u32- Global physical Y coordinate.Color- Shadow tint RGB.f32- Continuous shadow opacity in[0.0, 1.0].
Sourcepub fn blend_glyph_row(
&mut self,
dx: u32,
dy: u32,
coverage: &[u8],
color: Color,
) -> usize
pub fn blend_glyph_row( &mut self, dx: u32, dy: u32, coverage: &[u8], color: Color, ) -> usize
Blends a contiguous glyph alpha coverage row onto global row dy starting at dx.
§Arguments
&Self- Mutable pixel band.u32- Destination starting X coordinate.u32- Global destination Y coordinate.&[u8]- Glyph alpha coverage slice.Color- Foreground text color.
§Returns
usize- Number of non-zero coverage pixels shaded.
Sourcepub fn blend_pixel(&mut self, x: u32, y: u32, color: Color)
pub fn blend_pixel(&mut self, x: u32, y: u32, color: Color)
Blends color over global pixel (x, y) using fast integer Porter-Duff source-over.
§Arguments
&Self- Mutable pixel band.u32- X pixel coordinate.u32- Global Y pixel coordinate.Color- Foreground color.
Sourcepub fn blend_pixel_linear_dithered(
&mut self,
x: u32,
y: u32,
color: Color,
dither: f32,
)
pub fn blend_pixel_linear_dithered( &mut self, x: u32, y: u32, color: Color, dither: f32, )
Blends color over global pixel (x, y) using L1 LUT linear-light compositing with optional sub-LSB dithering.
§Arguments
&Self- Mutable pixel band.u32- X pixel coordinate.u32- Global Y pixel coordinate.Color- Foreground color.f32- Normalized dither offset in[-0.5, 0.5].
Sourcepub fn blend_pixel_f32_dithered(
&mut self,
x: u32,
y: u32,
color: Color,
alpha_f: f32,
dither: f32,
)
pub fn blend_pixel_f32_dithered( &mut self, x: u32, y: u32, color: Color, alpha_f: f32, dither: f32, )
Blends a foreground RGB color with continuous floating-point opacity alpha_f onto global pixel (x, y) via L1 LUT linear light.
§Arguments
&Self- Mutable pixel band.u32- X pixel coordinate.u32- Global Y pixel coordinate.Color- Foreground RGB tint.f32- Continuous opacity in[0.0, 1.0].f32- Normalized dither offset in[-0.5, 0.5].
Sourcepub fn set_pixel_rgba(&mut self, x: u32, y: u32, rgba: [u8; 4])
pub fn set_pixel_rgba(&mut self, x: u32, y: u32, rgba: [u8; 4])
Writes raw RGBA8 bytes directly to global pixel (x, y) when owned by this band.
§Arguments
&Self- Mutable pixel band.u32- X pixel coordinate.u32- Global Y pixel coordinate.[u8; 4]- Target RGBA8 pixel bytes.
Sourcepub fn lerp_pixel_from_saved_linear(
&mut self,
x: u32,
y: u32,
saved_rgba: [u8; 4],
cov: f32,
)
pub fn lerp_pixel_from_saved_linear( &mut self, x: u32, y: u32, saved_rgba: [u8; 4], cov: f32, )
Blends the current rasterized pixel at (x, y) back toward saved_rgba using linear-light clip coverage cov.
§Arguments
&Self- Mutable pixel band.u32- X pixel coordinate.u32- Global Y pixel coordinate.[u8; 4]- Pre-command saved RGBA8 pixel bytes.f32- Clip mask coverage in[0.0, 1.0](1.0keeps current pixel,0.0restoressaved_rgba).