[][src]Trait bardecoder::extract::Extract

pub trait Extract<PREPD, LOC, DATA, ERROR> where
    ERROR: Fail
{ fn extract(&self, prepared: &PREPD, loc: LOC) -> Result<DATA, ERROR>; }

Extract data from a prepared image, given the location as determined by the Detect step

PREPD type should be the type if the image returned from the Prepare implementation LOC type should be the relevant enclosed type from the Location enum DATA type must equal the input type of the matching Decode implementation

Pre-implemented Extracts provided by this library that are included in the default Decoder:

Example

use bardecoder::extract::Extract;

struct MyExtractor {}

impl Extract<GrayImage, QRLocation, QRData, QRError> for MyExtractor {
    fn extract(&self, prepared: &GrayImage, loc: QRLocation) -> Result<QRData, QRError> {
        // extract data here
    }
}

with the corresponding impl Decode being the Example here

Required methods

fn extract(&self, prepared: &PREPD, loc: LOC) -> Result<DATA, ERROR>

Does the actual extracting

Loading content...

Implementors

impl Extract<ImageBuffer<Luma<u8>, Vec<u8>>, QRLocation, QRData, QRError> for QRExtractor[src]

Loading content...