[][src]Trait qrcode::render::Pixel

pub trait Pixel: Copy + Sized {
    type Image: Sized + 'static;
    type Canvas: Canvas<Pixel = Self, Image = Self::Image>;
    fn default_color(color: Color) -> Self;

    fn default_unit_size() -> (u32, u32) { ... }
}

Abstraction of an image pixel.

Associated Types

type Image: Sized + 'static

Type of the finalized image.

type Canvas: Canvas<Pixel = Self, Image = Self::Image>

The type that stores an intermediate buffer before finalizing to a concrete image

Loading content...

Required methods

fn default_color(color: Color) -> Self

Obtains the default pixel color when a module is dark or light.

Loading content...

Provided methods

fn default_unit_size() -> (u32, u32)

Obtains the default module size. The result must be at least 1×1.

Loading content...

Implementations on Foreign Types

impl<S: Primitive + 'static> Pixel for Luma<S>[src]

type Image = ImageBuffer<Self, Vec<S>>

type Canvas = (Self, Self::Image)

impl<S: Primitive + 'static> Pixel for LumaA<S>[src]

type Image = ImageBuffer<Self, Vec<S>>

type Canvas = (Self, Self::Image)

impl<S: Primitive + 'static> Pixel for Rgb<S>[src]

type Image = ImageBuffer<Self, Vec<S>>

type Canvas = (Self, Self::Image)

impl<S: Primitive + 'static> Pixel for Rgba<S>[src]

type Image = ImageBuffer<Self, Vec<S>>

type Canvas = (Self, Self::Image)

Loading content...

Implementors

impl Pixel for Dense1x2[src]

impl<'a> Pixel for Color<'a>[src]

type Canvas = Canvas<'a>

type Image = String

impl<P: Element> Pixel for P[src]

type Canvas = Canvas<Self>

type Image = String

Loading content...