[][src]Struct tesseract::plumbing::TessBaseAPI

pub struct TessBaseAPI(_);

Wrapper around tesseract::TessBaseAPI

Implementations

impl TessBaseAPI[src]

pub fn new() -> TessBaseAPI[src]

pub fn init_2(
    &mut self,
    datapath: Option<&CStr>,
    language: Option<&CStr>
) -> Result<(), TessBaseAPIInitError>
[src]

Wrapper for Init-2 and TessBaseAPIInit3

Start tesseract

pub fn set_image_2(&mut self, pix: &Pix)[src]

Wrapper for SetImage-2

pub fn set_image_1(
    &mut self,
    image_data: &[u8],
    width: c_int,
    height: c_int,
    bytes_per_pixel: c_int,
    bytes_per_line: c_int
) -> Result<(), TessBaseAPISetImageSafetyError>
[src]

Wrapper for SetImage-1

pub fn set_source_resolution(&mut self, ppi: c_int)[src]

Wrapper for SetSourceResolution

pub fn set_variable(
    &mut self,
    name: &CStr,
    value: &CStr
) -> Result<(), TessBaseAPISetVariableError>
[src]

Wrapper for SetVariable

pub fn recognize(&mut self) -> Result<(), TessBaseAPIRecogniseError>[src]

Wrapper for Recognize

Recognize the image. Returns Ok(()) on success and Err(()) otherwise. It is currently unclear to me what would make it error.

It could take a progress argument (monitor). If there is appetite for this, let me know and I could try and implement it.

pub fn get_utf8_text(
    &mut self
) -> Result<TesseractText, TessBaseAPIGetUTF8TextError>
[src]

Wrapper for GetUTF8Text

Get the text out of an image.

Can return an error (null pointer), but it is not clear to me what would cause this.

This will implicitly call recognize if required.

Trait Implementations

impl Default for TessBaseAPI[src]

impl Drop for TessBaseAPI[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.