pub struct RGBPixel;
Expand description
The marker type that indicates we are currently using a RGB888 pixel format
Trait Implementations
sourceimpl PixelFormat for RGBPixel
impl PixelFormat for RGBPixel
sourceconst PIXEL_SIZE: usize = 3usize
const PIXEL_SIZE: usize = 3usize
Number of bytes per pixel
sourceconst EFFECTIVE_PIXEL_SIZE: usize = 3usize
const EFFECTIVE_PIXEL_SIZE: usize = 3usize
Number of effective bytes per pixel, e.g. for BGRX pixel format, the size of pixel is 4 but the effective size is 3, since the 4th byte isn’t used Read more
sourcefn byte_at(r: u8, g: u8, b: u8, _a: u64, idx: usize) -> u8
fn byte_at(r: u8, g: u8, b: u8, _a: u64, idx: usize) -> u8
Encoding a pixel and returns the idx-th byte for the pixel
sourcefn can_be_saved() -> bool
fn can_be_saved() -> bool
Indicates if this pixel format can be saved as image. Note: Currently we only using RGB pixel format in the image crate, but later we may lift this restriction Read more
sourcefn blend_rect_fast(
target: &mut BitMapBackend<'_, RGBPixel>,
upper_left: (i32, i32),
bottom_right: (i32, i32),
r: u8,
g: u8,
b: u8,
a: f64
)
fn blend_rect_fast(
target: &mut BitMapBackend<'_, RGBPixel>,
upper_left: (i32, i32),
bottom_right: (i32, i32),
r: u8,
g: u8,
b: u8,
a: f64
)
The fast alpha blending algorithm for this pixel format Read more
sourcefn fill_rect_fast(
target: &mut BitMapBackend<'_, RGBPixel>,
upper_left: (i32, i32),
bottom_right: (i32, i32),
r: u8,
g: u8,
b: u8
)
fn fill_rect_fast(
target: &mut BitMapBackend<'_, RGBPixel>,
upper_left: (i32, i32),
bottom_right: (i32, i32),
r: u8,
g: u8,
b: u8
)
The fast rectangle filling algorithm Read more
sourcefn fill_vertical_line_fast(
target: &mut BitMapBackend<'_, Self>,
x: i32,
ys: (i32, i32),
r: u8,
g: u8,
b: u8
)
fn fill_vertical_line_fast(
target: &mut BitMapBackend<'_, Self>,
x: i32,
ys: (i32, i32),
r: u8,
g: u8,
b: u8
)
The fast vertical line filling algorithm Read more
sourcefn draw_pixel(
target: &mut BitMapBackend<'_, Self>,
point: (i32, i32),
(u8, u8, u8),
alpha: f64
)
fn draw_pixel(
target: &mut BitMapBackend<'_, Self>,
point: (i32, i32),
(u8, u8, u8),
alpha: f64
)
Drawing a single pixel in this format Read more
Auto Trait Implementations
impl RefUnwindSafe for RGBPixel
impl Send for RGBPixel
impl Sync for RGBPixel
impl Unpin for RGBPixel
impl UnwindSafe for RGBPixel
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more