1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//! Integer types supported by the overlay engine.
//!
//! # Coordinate range
//!
//! For an `N`-bit engine, keep **every x and y coordinate**, across all inputs to
//! an operation, in the inclusive range `-2^(N - 2)..=2^(N - 2) - 1`:
//!
//! | Engine | Minimum | Maximum |
//! | --- | ---: | ---: |
//! | `i16` | -16,384 | 16,383 |
//! | `i32` | -1,073,741,824 | 1,073,741,823 |
//! | `i64` | -4,611,686,018,427,387,904 | 4,611,686,018,427,387,903 |
//!
//! The maximum coordinate difference is `D = I::MAX`; sums of two products
//! fit in `I::Wide` because `2 * D^2 < 2^(2*N - 1)`. Intersection numerators
//! use extended-width products. Area accumulation must allow partial sums to
//! wrap even though the final contour area fits. Integer input bounds are not
//! checked at runtime.
//!
//! ## Floating-point conversion
//!
//! These limits concern the integer coordinates after conversion, not the
//! original floating-point coordinates. For an explicit conservative bound,
//! use [`FloatPointAdapter::with_coordinate_bits`](i_float::adapter::FloatPointAdapter::with_coordinate_bits)
//! with `coordinate_bits = I::BITS - 3`. This bounds the converted magnitude by
//! `2^(N - 3)` (8,192 for `i16`), with both endpoints included. A custom unchecked
//! scale must respect the integer range too.
use IntNumber;
use SortKey;
use ;
/// An integer type supported by the overlay engine.
///
/// This trait is sealed. The supported integer engines are [`i16`], [`i32`],
/// and [`i64`].
/// See the [coordinate range](self) required by the integer APIs.