sightloom_core/error.rs
1//! Non-allocating core error definitions.
2
3/// An error produced by a core processing operation.
4#[derive(Clone, Copy, Debug, Eq, PartialEq)]
5pub enum CoreError {
6 /// A numeric input is NaN or infinite.
7 NonFinite,
8 /// Caller-owned storage has no room for another value.
9 InsufficientCapacity,
10 /// A suppression threshold is non-finite or outside `0.0..=1.0`.
11 InvalidThreshold,
12 /// Caller-owned NMS scratch is shorter than the detections slice.
13 InsufficientScratch,
14 /// A media time has a zero timescale.
15 InvalidMediaTime,
16}
17
18/// An error produced while constructing validated geometry.
19#[derive(Clone, Copy, Debug, Eq, PartialEq)]
20pub enum GeometryError {
21 /// At least one coordinate is NaN or infinite.
22 NonFinite,
23 /// A rectangle's right or bottom edge precedes its opposite edge.
24 InvertedBounds,
25 /// A line segment's endpoints are identical.
26 DegenerateSegment,
27 /// A polygon has fewer than three supplied points.
28 TooFewPoints,
29}