sightloom-core 0.1.0

Portable geometry, detections, NMS, zones, and event core for SightLoom
Documentation
//! Non-allocating core error definitions.

/// An error produced by a core processing operation.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum CoreError {
    /// A numeric input is NaN or infinite.
    NonFinite,
    /// Caller-owned storage has no room for another value.
    InsufficientCapacity,
    /// A suppression threshold is non-finite or outside `0.0..=1.0`.
    InvalidThreshold,
    /// Caller-owned NMS scratch is shorter than the detections slice.
    InsufficientScratch,
    /// A media time has a zero timescale.
    InvalidMediaTime,
}

/// An error produced while constructing validated geometry.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum GeometryError {
    /// At least one coordinate is NaN or infinite.
    NonFinite,
    /// A rectangle's right or bottom edge precedes its opposite edge.
    InvertedBounds,
    /// A line segment's endpoints are identical.
    DegenerateSegment,
    /// A polygon has fewer than three supplied points.
    TooFewPoints,
}