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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//! PhotometricData trait - the abstraction layer for photometric data sources.
//!
//! This trait allows the photometric module to work with any data source
//! (LDT, IES, GLDF, etc.) without knowing the concrete type.
//!
//! When extracting to a standalone `bevy_photometry` crate, this file
//! can be copied as-is - it has no dependencies on `eulumdat`.
use Debug;
/// Trait for photometric data sources (LDT, IES, GLDF, etc.)
///
/// Implement this trait for your data type to use it with `PhotometricLight`.
///
/// # Example
///
/// ```ignore
/// use eulumdat_bevy::photometric::PhotometricData;
///
/// struct MyLightData {
/// intensities: Vec<Vec<f64>>,
/// // ...
/// }
///
/// impl PhotometricData for MyLightData {
/// fn sample(&self, c_angle: f64, g_angle: f64) -> f64 {
/// // Return intensity at the given angles
/// self.intensities[c_index][g_index]
/// }
/// // ... implement other methods
/// }
/// ```