| 1 | use crate::{ScaledFloat, SourceChromaticities}; |
| 2 | |
| 3 | /// Get the gamma that should be substituted for images conforming to the sRGB color space. |
| 4 | pub fn substitute_gamma() -> ScaledFloat { |
| 5 | // Value taken from https://www.w3.org/TR/2003/REC-PNG-20031110/#11sRGB |
| 6 | ScaledFloat::from_scaled(val:45455) |
| 7 | } |
| 8 | |
| 9 | /// Get the chromaticities that should be substituted for images conforming to the sRGB color space. |
| 10 | pub fn substitute_chromaticities() -> SourceChromaticities { |
| 11 | // Values taken from https://www.w3.org/TR/2003/REC-PNG-20031110/#11sRGB |
| 12 | SourceChromaticities { |
| 13 | white: ( |
| 14 | ScaledFloat::from_scaled(val:31270), |
| 15 | ScaledFloat::from_scaled(val:32900), |
| 16 | ), |
| 17 | red: ( |
| 18 | ScaledFloat::from_scaled(val:64000), |
| 19 | ScaledFloat::from_scaled(val:33000), |
| 20 | ), |
| 21 | green: ( |
| 22 | ScaledFloat::from_scaled(val:30000), |
| 23 | ScaledFloat::from_scaled(val:60000), |
| 24 | ), |
| 25 | blue: ( |
| 26 | ScaledFloat::from_scaled(val:15000), |
| 27 | ScaledFloat::from_scaled(val:6000), |
| 28 | ), |
| 29 | } |
| 30 | } |
| 31 | |