mod bounding_box;
mod errors;
mod ffi;
mod image_input;
mod ocr_engine;
mod ocr_line;
mod ocr_options;
mod ocr_result;
mod ocr_word;
pub use bounding_box::BoundingBox;
pub use bounding_box::Point;
pub use errors::OneOcrError;
pub use image_input::ImageInput;
pub use ocr_engine::OcrEngine;
pub use ocr_line::OcrLine;
pub use ocr_options::{OcrOptions, Resolution};
pub use ocr_result::OcrResult;
pub use ocr_word::OcrWord;
pub(crate) const ONE_OCR_MODEL_FILE_NAME: &str = "oneocr.onemodel";
pub(crate) const ONE_OCR_MODEL_KEY: &str = r#"kj)TGtrK>f]b[Piow.gU+nC@s""""""4"#;
macro_rules! check_ocr_call {
($call:expr, $err_msg:literal) => {
let res = $call;
if res != 0 {
return Err($crate::errors::OneOcrError::OcrApiError {
result: res,
message: $err_msg.to_string(),
});
}
};
}
pub(crate) use check_ocr_call;