Struct passpartout_printer::image_drawer::ImageDrawer
source · [−]pub struct ImageDrawer<'a> { /* private fields */ }
Expand description
A structure that provides means to draw whole images to the easel.
Implementations
sourceimpl<'a> ImageDrawer<'a>
impl<'a> ImageDrawer<'a>
pub fn new(easel: &'a mut Easel, size_x: u32, size_y: u32) -> ImageDrawer<'a>
sourcepub fn draw_top_border(&mut self) -> Result<(), Box<dyn Error>>
pub fn draw_top_border(&mut self) -> Result<(), Box<dyn Error>>
Draw the top white border for centering the image along the y-axis.
If the image completely fills the y axis of the easel, this method does no drawing.
sourcepub fn handle_pixel(
&mut self,
rgba: &mut Rgba<u8>,
x: u32,
y: u32
) -> Result<(), Box<dyn Error>>
pub fn handle_pixel(
&mut self,
rgba: &mut Rgba<u8>,
x: u32,
y: u32
) -> Result<(), Box<dyn Error>>
Process the next pixel from a given image.
Pixels are not drawn to the screen unless we’ve hit the end of a row and must draw or there is a color change where we will draw everything up to the current pixel. If you want to draw a pixel by itself, use Easel::draw_pixel() instead.
Arguments
rgba
: The RGBA pixel to handle.x
: The x coordinate of the pixel in image coordinates.y
: The x coordinate of the pixel in image coordinates.
Auto Trait Implementations
impl<'a> RefUnwindSafe for ImageDrawer<'a>
impl<'a> Send for ImageDrawer<'a>
impl<'a> Sync for ImageDrawer<'a>
impl<'a> Unpin for ImageDrawer<'a>
impl<'a> !UnwindSafe for ImageDrawer<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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