💿🐜 Antkeeper source code https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

152 lines
5.3 KiB

  1. /*
  2. * Copyright (C) 2023 Christopher J. Howard
  3. *
  4. * This file is part of Antkeeper source code.
  5. *
  6. * Antkeeper source code is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * Antkeeper source code is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with Antkeeper source code. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef ANTKEEPER_COLOR_ILLUMINANT_HPP
  20. #define ANTKEEPER_COLOR_ILLUMINANT_HPP
  21. #include "math/vector.hpp"
  22. namespace color {
  23. /**
  24. * CIE standard illuminants.
  25. *
  26. * @see https://en.wikipedia.org/wiki/Standard_illuminant
  27. */
  28. namespace illuminant {
  29. /// CIE 1931 2 Degree Standard Observer illuminants.
  30. namespace deg2 {
  31. template <class T>
  32. constexpr math::vector2<T> a = {T{0.44757}, T{0.40745}};
  33. template <class T>
  34. constexpr math::vector2<T> b = {T{0.34842}, T{0.35161}};
  35. template <class T>
  36. constexpr math::vector2<T> c = {T{0.31006}, T{0.31616}};
  37. template <class T>
  38. constexpr math::vector2<T> d50 = {T{0.34567}, T{0.35850}};
  39. template <class T>
  40. constexpr math::vector2<T> d55 = {T{0.33242}, T{0.34743}};
  41. template <class T>
  42. constexpr math::vector2<T> d65 = {T{0.31271}, T{0.32902}};
  43. template <class T>
  44. constexpr math::vector2<T> d75 = {T{0.29902}, T{0.31485}};
  45. template <class T>
  46. constexpr math::vector2<T> d93 = {T{0.28315}, T{0.29711}};
  47. template <class T>
  48. constexpr math::vector2<T> e = {T{0.33333}, T{0.33333}};
  49. template <class T>
  50. constexpr math::vector2<T> f1 = {T{0.31310}, T{0.33727}};
  51. template <class T>
  52. constexpr math::vector2<T> f2 = {T{0.37208}, T{0.37529}};
  53. template <class T>
  54. constexpr math::vector2<T> f3 = {T{0.40910}, T{0.39430}};
  55. template <class T>
  56. constexpr math::vector2<T> f4 = {T{0.44018}, T{0.40329}};
  57. template <class T>
  58. constexpr math::vector2<T> f5 = {T{0.31379}, T{0.34531}};
  59. template <class T>
  60. constexpr math::vector2<T> f6 = {T{0.37790}, T{0.38835}};
  61. template <class T>
  62. constexpr math::vector2<T> f7 = {T{0.31292}, T{0.32933}};
  63. template <class T>
  64. constexpr math::vector2<T> f8 = {T{0.34588}, T{0.35875}};
  65. template <class T>
  66. constexpr math::vector2<T> f9 = {T{0.37417}, T{0.37281}};
  67. template <class T>
  68. constexpr math::vector2<T> f10 = {T{0.34609}, T{0.35986}};
  69. template <class T>
  70. constexpr math::vector2<T> f11 = {T{0.38052}, T{0.37713}};
  71. template <class T>
  72. constexpr math::vector2<T> f12 = {T{0.43695}, T{0.40441}};
  73. template <class T>
  74. constexpr math::vector2<T> led_b1 = {T{0.4560}, T{0.4078}};
  75. template <class T>
  76. constexpr math::vector2<T> led_b2 = {T{0.4357}, T{0.4012}};
  77. template <class T>
  78. constexpr math::vector2<T> led_b3 = {T{0.3756}, T{0.3723}};
  79. template <class T>
  80. constexpr math::vector2<T> led_b4 = {T{0.3422}, T{0.3502}};
  81. template <class T>
  82. constexpr math::vector2<T> led_b5 = {T{0.3118}, T{0.3236}};
  83. template <class T>
  84. constexpr math::vector2<T> led_bh1 = {T{0.4474}, T{0.4066}};
  85. template <class T>
  86. constexpr math::vector2<T> led_rgb1 = {T{0.4557}, T{0.4211}};
  87. template <class T>
  88. constexpr math::vector2<T> led_v1 = {T{0.4560}, T{0.4548}};
  89. template <class T>
  90. constexpr math::vector2<T> led_v2 = {T{0.3781}, T{0.3775}};
  91. } // deg2
  92. /// CIE 1964 10 Degree Standard Observer illuminants.
  93. namespace deg10 {
  94. template <class T>
  95. constexpr math::vector2<T> a = {T{0.45117}, T{0.40594}};
  96. template <class T>
  97. constexpr math::vector2<T> b = {T{0.34980}, T{0.35270}};
  98. template <class T>
  99. constexpr math::vector2<T> c = {T{0.31039}, T{0.31905}};
  100. template <class T>
  101. constexpr math::vector2<T> d50 = {T{0.34773}, T{0.35952}};
  102. template <class T>
  103. constexpr math::vector2<T> d55 = {T{0.33411}, T{0.34877}};
  104. template <class T>
  105. constexpr math::vector2<T> d65 = {T{0.31382}, T{0.33100}};
  106. template <class T>
  107. constexpr math::vector2<T> d75 = {T{0.29968}, T{0.31740}};
  108. template <class T>
  109. constexpr math::vector2<T> d93 = {T{0.28327}, T{0.30043}};
  110. template <class T>
  111. constexpr math::vector2<T> e = {T{0.33333}, T{0.33333}};
  112. template <class T>
  113. constexpr math::vector2<T> f1 = {T{0.31811}, T{0.33559}};
  114. template <class T>
  115. constexpr math::vector2<T> f2 = {T{0.37925}, T{0.36733}};
  116. template <class T>
  117. constexpr math::vector2<T> f3 = {T{0.41761}, T{0.38324}};
  118. template <class T>
  119. constexpr math::vector2<T> f4 = {T{0.44920}, T{0.39074}};
  120. template <class T>
  121. constexpr math::vector2<T> f5 = {T{0.31975}, T{0.34246}};
  122. template <class T>
  123. constexpr math::vector2<T> f6 = {T{0.38660}, T{0.37847}};
  124. template <class T>
  125. constexpr math::vector2<T> f7 = {T{0.31569}, T{0.32960}};
  126. template <class T>
  127. constexpr math::vector2<T> f8 = {T{0.34902}, T{0.35939}};
  128. template <class T>
  129. constexpr math::vector2<T> f9 = {T{0.37829}, T{0.37045}};
  130. template <class T>
  131. constexpr math::vector2<T> f10 = {T{0.35090}, T{0.35444}};
  132. template <class T>
  133. constexpr math::vector2<T> f11 = {T{0.38541}, T{0.37123}};
  134. template <class T>
  135. constexpr math::vector2<T> f12 = {T{0.44256}, T{0.39717}};
  136. } // namespace deg10
  137. } // namespace illuminant
  138. } // namespace color
  139. #endif // ANTKEEPER_COLOR_ILLUMINANT_HPP