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
//! Tools related to pixel mapping for undistortion
pub use ;
pub use ;
pub use ;
/// Mapping between raw image pixels and detector working-frame pixels.
///
/// The working frame is the coordinate system used by sampling/fitting stages.
/// For distortion-aware processing this is typically an undistorted pixel frame.
///
/// Implement this trait to plug in a custom distortion model. Both methods
/// must be approximate inverses of each other. Return `None` if a point
/// cannot be mapped (e.g. it falls outside the valid distortion domain).
///
/// Built-in implementations: [`CameraModel`] (Brown-Conrady radial-tangential)
/// and [`DivisionModel`] (single-parameter division model).
///
/// # Example
///
/// ```
/// use ringgrid::PixelMapper;
///
/// struct Identity;
///
/// impl PixelMapper for Identity {
/// fn image_to_working_pixel(&self, p: [f64; 2]) -> Option<[f64; 2]> {
/// Some(p)
/// }
/// fn working_to_image_pixel(&self, p: [f64; 2]) -> Option<[f64; 2]> {
/// Some(p)
/// }
/// }
/// ```