[][src]Trait qrcode::render::Canvas

pub trait Canvas: Sized {
type Pixel: Sized;
type Image: Sized;
    fn new(
        width: u32,
        height: u32,
        dark_pixel: Self::Pixel,
        light_pixel: Self::Pixel
    ) -> Self;
fn draw_dark_pixel(&mut self, x: u32, y: u32);
fn into_image(self) -> Self::Image; fn draw_dark_rect(&mut self, left: u32, top: u32, width: u32, height: u32) { ... } }

Rendering canvas of a QR code image.

Associated Types

type Pixel: Sized

type Image: Sized

Loading content...

Required methods

fn new(
    width: u32,
    height: u32,
    dark_pixel: Self::Pixel,
    light_pixel: Self::Pixel
) -> Self

Constructs a new canvas of the given dimensions.

fn draw_dark_pixel(&mut self, x: u32, y: u32)

Draws a single dark pixel at the (x, y) coordinate.

fn into_image(self) -> Self::Image

Finalize the canvas to a real image.

Loading content...

Provided methods

fn draw_dark_rect(&mut self, left: u32, top: u32, width: u32, height: u32)

Loading content...

Implementations on Foreign Types

impl<P: ImagePixel + 'static> Canvas for (P, ImageBuffer<P, Vec<P::Subpixel>>)[src]

type Pixel = P

type Image = ImageBuffer<P, Vec<P::Subpixel>>

fn draw_dark_rect(&mut self, left: u32, top: u32, width: u32, height: u32)[src]

Loading content...

Implementors

Loading content...