pub struct PixfmtGray8<'a> { /* private fields */ }Expand description
Pixel format for non-premultiplied Gray8 (1 byte per pixel).
Port of C++ pixfmt_alpha_blend_gray<blender_gray<gray8>, rendering_buf, 1, 0>.
Each pixel is a single byte representing luminance.
Since there is no alpha channel stored in the buffer, pixel() always
returns a=255. Blending uses the source color’s alpha to interpolate
the gray value.
Implementations§
Source§impl<'a> PixfmtGray8<'a>
impl<'a> PixfmtGray8<'a>
Trait Implementations§
Source§impl<'a> PixelFormat for PixfmtGray8<'a>
impl<'a> PixelFormat for PixfmtGray8<'a>
type ColorType = Gray8
fn width(&self) -> u32
fn height(&self) -> u32
Source§fn copy_pixel(&mut self, x: i32, y: i32, c: &Gray8)
fn copy_pixel(&mut self, x: i32, y: i32, c: &Gray8)
Copy (overwrite) a single pixel at (x, y) with color
c.Source§fn copy_hline(&mut self, x: i32, y: i32, len: u32, c: &Gray8)
fn copy_hline(&mut self, x: i32, y: i32, len: u32, c: &Gray8)
Copy (overwrite) a horizontal line of
len pixels with color c.Source§fn blend_pixel(&mut self, x: i32, y: i32, c: &Gray8, cover: CoverType)
fn blend_pixel(&mut self, x: i32, y: i32, c: &Gray8, 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: &Gray8, cover: CoverType)
fn blend_hline(&mut self, x: i32, y: i32, len: u32, c: &Gray8, cover: CoverType)
Blend a horizontal line of
len pixels at (x, y) with uniform color and coverage.Auto Trait Implementations§
impl<'a> Freeze for PixfmtGray8<'a>
impl<'a> RefUnwindSafe for PixfmtGray8<'a>
impl<'a> !Send for PixfmtGray8<'a>
impl<'a> !Sync for PixfmtGray8<'a>
impl<'a> Unpin for PixfmtGray8<'a>
impl<'a> !UnwindSafe for PixfmtGray8<'a>
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