wordfeud_ocr/error.rs
1use crate::layout::Segment;
2use thiserror::Error;
3
4/// Errors that can occur when recognizing the board
5#[derive(Debug, Error)]
6pub enum Error {
7 /// The detected board is not square
8 #[error("Board not square {0}")]
9 BoardNotSquare(f32),
10 /// The board could not be segmented
11 #[error("Failed to create layout")]
12 LayoutFailed(Segment),
13 /// An error from the [image](https://github.com/image-rs/image) library
14 #[error("Image error")]
15 ImageError(#[from] image::error::ImageError),
16}