[][src]Struct rqrr::SearchableImage

pub struct SearchableImage { /* fields omitted */ }

An black-and-white image that can be mutated on search for QR codes

During search for QR codes, some black zones will be recolored in 'different' shades of black. This is done to speed up the search and mitigate the impact of a huge zones.

Methods

impl SearchableImage[src]

pub fn from_dynamic(img: &DynamicImage) -> Self[src]

Given an image, create a searchable copy of it

This first converts the image to greyscale before filling its own buffer

pub fn from_bitmap<F>(w: usize, h: usize, fill: F) -> Self where
    F: FnMut(usize, usize) -> bool
[src]

Given a function with binary output, generate a searchable image

If the given function returns true the matching pixel will be 'black'.

pub fn from_greyscale<F>(w: usize, h: usize, fill: F) -> Self where
    F: FnMut(usize, usize) -> u8
[src]

Given a byte valued function, generate a searchable image

The values returned by the function are interpreted as luminance. i.e. a value of 0 is black, 255 is white.

pub fn width(&self) -> usize[src]

Return the width of the image

pub fn height(&self) -> usize[src]

Return the height of the image

Trait Implementations

impl Clone for SearchableImage[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Index<(Range<usize>, usize)> for SearchableImage[src]

type Output = [u8]

The returned type after indexing.

impl Index<Point> for SearchableImage[src]

type Output = u8

The returned type after indexing.

impl Index<(usize, usize)> for SearchableImage[src]

type Output = u8

The returned type after indexing.

impl IndexMut<(Range<usize>, usize)> for SearchableImage[src]

impl IndexMut<Point> for SearchableImage[src]

impl IndexMut<(usize, usize)> for SearchableImage[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.