Struct qrcode::render::Renderer [] [src]

pub struct Renderer<'a, P: Pixel> { /* fields omitted */ }

A QR code renderer. This is a builder type which converts a bool-vector into an image.

Methods

impl<'a, P: Pixel> Renderer<'a, P>
[src]

[src]

Creates a new renderer.

[src]

Sets color of a dark module. Default is opaque black.

[src]

Sets color of a light module. Default is opaque white.

[src]

Whether to include the quiet zone in the generated image.

[src]

Deprecated since 0.4.0

: use .module_dimensions(width, width) instead

Sets the size of each module in pixels. Default is 8px.

[src]

Sets the size of each module in pixels. Default is 8×8.

[src]

Deprecated since 0.4.0

: use .min_dimensions(width, width) instead

[src]

Sets the minimum total image size in pixels, including the quiet zone if applicable. The renderer will try to find the dimension as small as possible, such that each module in the QR code has uniform size (no distortion).

For instance, a version 1 QR code has 19 modules across including the quiet zone. If we request an image of size ≥200×200, we get that each module's size should be 11×11, so the actual image size will be 209×209.

[src]

Sets the maximum total image size in pixels, including the quiet zone if applicable. The renderer will try to find the dimension as large as possible, such that each module in the QR code has uniform size (no distortion).

For instance, a version 1 QR code has 19 modules across including the quiet zone. If we request an image of size ≤200×200, we get that each module's size should be 10×10, so the actual image size will be 190×190.

The module size is at least 1×1, so if the restriction is too small, the final image can be larger than the input.

[src]

Deprecated since 0.4.0

: renamed to .build() to de-emphasize the image connection

Renders the QR code into an image.

[src]

Renders the QR code into an image.

Trait Implementations

Auto Trait Implementations

impl<'a, P> Send for Renderer<'a, P> where
    P: Send

impl<'a, P> Sync for Renderer<'a, P> where
    P: Sync