Struct plotters_bitmap::bitmap_pixel::RGBPixel

source ·
pub struct RGBPixel;
Expand description

The marker type that indicates we are currently using a RGB888 pixel format

Trait Implementations§

source§

impl PixelFormat for RGBPixel

source§

const PIXEL_SIZE: usize = 3usize

Number of bytes per pixel
source§

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
source§

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
source§

fn decode_pixel(data: &[u8]) -> (u8, u8, u8, u64)

Decode a pixel at the given location
source§

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
source§

fn blend_rect_fast( target: &mut BitMapBackend<'_, Self>, 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
source§

fn fill_rect_fast( target: &mut BitMapBackend<'_, Self>, upper_left: (i32, i32), bottom_right: (i32, i32), r: u8, g: u8, b: u8, )

The fast rectangle filling algorithm Read more
source§

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
source§

fn draw_pixel( target: &mut BitMapBackend<'_, Self>, point: (i32, i32), (r, g, b): (u8, u8, u8), alpha: f64, )

Drawing a single pixel in this format Read more

Auto Trait Implementations§

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.