pub trait OcrEngine: Send + Sync {
// Required methods
fn recognize(
&self,
image_data: &[u8],
width: u32,
height: u32,
dpi: u32,
) -> Result<OcrPageResult, String>;
fn supported_languages(&self) -> Vec<String>;
}Expand description
Trait for pluggable OCR engines.
Implementors provide character recognition on rasterized page images.
Required Methods§
Sourcefn recognize(
&self,
image_data: &[u8],
width: u32,
height: u32,
dpi: u32,
) -> Result<OcrPageResult, String>
fn recognize( &self, image_data: &[u8], width: u32, height: u32, dpi: u32, ) -> Result<OcrPageResult, String>
Recognize text in an image.
§Arguments
image_data- Raw pixel data (RGB, row-major).width- Image width in pixels.height- Image height in pixels.dpi- Resolution in dots per inch.
Sourcefn supported_languages(&self) -> Vec<String>
fn supported_languages(&self) -> Vec<String>
Return the list of supported languages.