diff --git a/src/bounding_box.rs b/src/bounding_box.rs index 1a7f9bf..73eef3c 100644 --- a/src/bounding_box.rs +++ b/src/bounding_box.rs @@ -3,7 +3,7 @@ use serde::Serialize; use crate::ffi::RawBBox; /// This `Point` struct represents a point in 2D space with X and Y coordinates. -#[derive(Debug, Clone, Copy, Default, Serialize)] +#[derive(Debug, Clone, Copy, Default, Serialize, PartialEq)] pub struct Point { pub x: f32, pub y: f32, @@ -16,7 +16,7 @@ impl std::fmt::Display for Point { } /// This `BoundingBox` struct represents a bounding box in 2D space, used for OCR to tightly enclose detected text. -#[derive(Debug, Clone, Copy, Default, Serialize)] +#[derive(Debug, Clone, Copy, Default, Serialize, PartialEq)] pub struct BoundingBox { pub top_left: Point, pub top_right: Point, diff --git a/src/ocr_options.rs b/src/ocr_options.rs index a982b0b..5f63f04 100644 --- a/src/ocr_options.rs +++ b/src/ocr_options.rs @@ -1,12 +1,12 @@ /// A simple width×height pair. -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct Resolution { pub width: i32, pub height: i32, } /// Configuration for OCR processing behavior. -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct OcrOptions { /// The maximum number of lines that can be recognized. /// Default is 100, range is 0-1000. diff --git a/src/ocr_word.rs b/src/ocr_word.rs index 2ec7636..970035e 100644 --- a/src/ocr_word.rs +++ b/src/ocr_word.rs @@ -11,7 +11,7 @@ use crate::check_ocr_call; /// The `OcrWord` struct represents a word recognized by the OCR engine. /// It contains the recognized word, its confidence score, and its bounding box. -#[derive(Debug, Serialize)] +#[derive(Debug, Clone, Serialize, PartialEq)] pub struct OcrWord { pub text: String, pub confidence: f32,