|
1 | 1 | use core::fmt; |
2 | 2 |
|
| 3 | +/// Errors returned by demosaicing operations. |
3 | 4 | #[derive(Debug)] |
4 | 5 | pub enum DemosaicError { |
5 | | - /// Input buffer length doesn't match width * height |
6 | | - InputSizeMismatch { expected: usize, got: usize }, |
7 | | - /// Output buffer length doesn't match 3 * width * height |
8 | | - OutputSizeMismatch { expected: usize, got: usize }, |
9 | | - /// Algorithm not supported for this CFA pattern |
10 | | - UnsupportedAlgorithm { algorithm: &'static str, cfa: &'static str }, |
11 | | - /// Image too small for the chosen algorithm |
12 | | - ImageTooSmall { min_width: usize, min_height: usize }, |
| 6 | + /// Input buffer length doesn't match width * height. |
| 7 | + InputSizeMismatch { |
| 8 | + /// Expected number of elements. |
| 9 | + expected: usize, |
| 10 | + /// Actual number of elements. |
| 11 | + got: usize, |
| 12 | + }, |
| 13 | + /// Output buffer length doesn't match 3 * width * height. |
| 14 | + OutputSizeMismatch { |
| 15 | + /// Expected number of elements. |
| 16 | + expected: usize, |
| 17 | + /// Actual number of elements. |
| 18 | + got: usize, |
| 19 | + }, |
| 20 | + /// Algorithm not supported for this CFA pattern. |
| 21 | + UnsupportedAlgorithm { |
| 22 | + /// Name of the algorithm. |
| 23 | + algorithm: &'static str, |
| 24 | + /// CFA type (e.g. "Bayer", "X-Trans"). |
| 25 | + cfa: &'static str, |
| 26 | + }, |
| 27 | + /// Image too small for the chosen algorithm. |
| 28 | + ImageTooSmall { |
| 29 | + /// Minimum required width. |
| 30 | + min_width: usize, |
| 31 | + /// Minimum required height. |
| 32 | + min_height: usize, |
| 33 | + }, |
13 | 34 | } |
14 | 35 |
|
15 | 36 | impl fmt::Display for DemosaicError { |
|
0 commit comments