pub trait Extract<PREPD, LOC, DATA, ERROR> {
// Required method
fn extract(&self, prepared: &PREPD, loc: LOC) -> Result<DATA, ERROR>;
}Expand description
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