pub fn volume_rendering_transfer_function(density: f64) -> (f64, f64, f64, f64)Expand description
A simple pre-integrated transfer function for direct volume rendering.
Maps scalar density values to RGBA colour. The mapping is designed to mimic a typical medical volume rendering preset:
| Density range | Colour | Interpretation |
|---|---|---|
| 0–0.1 | transparent black | air / background |
| 0.1–0.3 | semi-transparent blue | soft tissue |
| 0.3–0.6 | semi-opaque orange | dense soft tissue |
| 0.6–0.9 | opaque white-yellow | bone |
| 0.9–1.0 | fully opaque white | very dense material |
Density values outside [0, 1] are clamped to the nearest boundary.
§Returns
A tuple (R, G, B, A) where each component is in [0, 1].