@@ -114,32 +114,59 @@ namespace std::experimental::io2d {
114114
115115 inline constexpr rgba_color::rgba_color () noexcept { }
116116 template <class T , ::std::enable_if_t <::std::is_integral_v<T>, _Color_is_integral>>
117- inline constexpr rgba_color::rgba_color (T r, T g, T b, T a)
117+ inline constexpr rgba_color::rgba_color (T r, T g, T b, T a) noexcept
118118 : _R(static_cast <float >(::std::min<float >(::std::max<float >((r / 255 .0F ), 0.0F), 1.0F)))
119119 , _G(static_cast <float >(::std::min<float >(::std::max<float >((g / 255 .0F ), 0.0F), 1.0F)))
120120 , _B(static_cast <float >(::std::min<float >(::std::max<float >((b / 255 .0F ), 0.0F), 1.0F)))
121121 , _A(static_cast <float >(::std::min<float >(::std::max<float >((a / 255 .0F ), 0.0F), 1.0F))) { }
122122 template <class T , ::std::enable_if_t <::std::is_floating_point_v<T>, _Color_is_floating>>
123- inline constexpr rgba_color::rgba_color (T r, T g, T b, T a)
123+ inline constexpr rgba_color::rgba_color (T r, T g, T b, T a) noexcept
124124 : _R(static_cast <float >(::std::min<T>(::std::max<T>(static_cast <float >(r), 0.0F), 1.0F)))
125125 , _G(static_cast <float >(::std::min<T>(::std::max<T>(static_cast <float >(g), 0.0F), 1.0F)))
126126 , _B(static_cast <float >(::std::min<T>(::std::max<T>(static_cast <float >(b), 0.0F), 1.0F)))
127127 , _A(static_cast <float >(::std::min<T>(::std::max<T>(static_cast <float >(a), 0.0F), 1.0F))) {
128128 }
129129
130- inline constexpr void rgba_color::r (float val) noexcept {
131- _R = val * _A;
132- }
133- inline constexpr void rgba_color::g (float val) noexcept {
134- _G = val * _A;
135- }
136- inline constexpr void rgba_color::b (float val) noexcept {
137- _B = val * _A;
138- }
139- inline constexpr void rgba_color::a (float val) noexcept {
140- _A = val;
141- }
130+ template <class T , ::std::enable_if_t <::std::is_integral_v<T>, _Color_is_integral> = _Color_is_integral_val>
131+ inline constexpr void r (T val) noexcept {
132+ _R = val * _A;
133+ }
134+
135+ template <class U , ::std::enable_if_t <::std::is_floating_point_v<U>, _Color_is_floating> = _Color_is_floating_val>
136+ inline constexpr void r (U val) noexcept {
137+ _R = val * _A;
138+ }
139+
140+ template <class T , ::std::enable_if_t <::std::is_integral_v<T>, _Color_is_integral> = _Color_is_integral_val>
141+ inline constexpr void g (T val) noexcept {
142+ _G = val * _A;
143+ }
142144
145+ template <class U , ::std::enable_if_t <::std::is_floating_point_v<U>, _Color_is_floating> = _Color_is_floating_val>
146+ inline constexpr void g (U val) noexcept {
147+ _G = val * _A;
148+ }
149+
150+ template <class T , ::std::enable_if_t <::std::is_integral_v<T>, _Color_is_integral> = _Color_is_integral_val>
151+ inline constexpr void b (T val) noexcept {
152+ _B = val * _A;
153+ }
154+
155+ template <class U , ::std::enable_if_t <::std::is_floating_point_v<U>, _Color_is_floating> = _Color_is_floating_val>
156+ inline constexpr void b (U val) noexcept {
157+ _B = val * _A;
158+ }
159+
160+ template <class T , ::std::enable_if_t <::std::is_integral_v<T>, _Color_is_integral> = _Color_is_integral_val>
161+ inline constexpr void a (T val) noexcept {
162+ _A = val;
163+ }
164+
165+ template <class U , ::std::enable_if_t <::std::is_floating_point_v<U>, _Color_is_floating> = _Color_is_floating_val>
166+ inline constexpr void a (U val) noexcept {
167+ _A = val;
168+ }
169+
143170 inline constexpr float rgba_color::r () const noexcept {
144171 return _R;
145172 }
@@ -154,15 +181,15 @@ namespace std::experimental::io2d {
154181 }
155182
156183 template <class T , ::std::enable_if_t <::std::is_integral_v<T>, _Color_is_integral>>
157- inline constexpr rgba_color& rgba_color::operator *=(T rhs) {
184+ inline constexpr rgba_color& rgba_color::operator *=(T rhs) noexcept {
158185 r (::std::min (r () * rhs / 255 .0F , 1 .0F ));
159186 g (::std::min (g () * rhs / 255 .0F , 1 .0F ));
160187 b (::std::min (b () * rhs / 255 .0F , 1 .0F ));
161188 a (::std::min (a () * rhs / 255 .0F , 1 .0F ));
162189 return *this ;
163190 }
164191 template <class U , ::std::enable_if_t <::std::is_floating_point_v<U>, _Color_is_floating>>
165- inline constexpr rgba_color& rgba_color::operator *=(U rhs) {
192+ inline constexpr rgba_color& rgba_color::operator *=(U rhs) noexcept {
166193 r (::std::min (r () * rhs, 1 .0F ));
167194 g (::std::min (g () * rhs, 1 .0F ));
168195 b (::std::min (b () * rhs, 1 .0F ));
@@ -178,7 +205,7 @@ namespace std::experimental::io2d {
178205 }
179206
180207 template <class T , ::std::enable_if_t <::std::is_floating_point_v<T>, _Color_is_floating>>
181- inline constexpr rgba_color operator *(const rgba_color& lhs, T rhs) {
208+ inline constexpr rgba_color operator *(const rgba_color& lhs, T rhs) noexcept {
182209 rhs = ::std::max (::std::min (rhs, 1 .0F ), 0 .0F );
183210 return {
184211 ::std::min (lhs.r() * rhs, 1.0F),
@@ -189,7 +216,7 @@ namespace std::experimental::io2d {
189216 }
190217
191218 template <class T , ::std::enable_if_t <::std::is_integral_v<T>, _Color_is_integral>>
192- inline constexpr rgba_color operator *(const rgba_color& lhs, T rhs) {
219+ inline constexpr rgba_color operator *(const rgba_color& lhs, T rhs) noexcept {
193220 rhs = ::std::max (::std::min (rhs, 1 .0F ), 0 .0F );
194221 return {
195222 ::std::min (lhs.r() * rhs / 255.0F, 1.0F),
@@ -200,7 +227,7 @@ namespace std::experimental::io2d {
200227 }
201228
202229 template <class T , ::std::enable_if_t <::std::is_floating_point_v<T>, _Color_is_floating>>
203- inline constexpr rgba_color operator *(T lhs, const rgba_color& rhs) {
230+ inline constexpr rgba_color operator *(T lhs, const rgba_color& rhs) noexcept {
204231 lhs = ::std::max (::std::min (lhs, 1 .0F ), 0 .0F );
205232 return {
206233 ::std::min (lhs * rhs.r(), 1.0F),
@@ -211,7 +238,7 @@ namespace std::experimental::io2d {
211238 }
212239
213240 template <class T , ::std::enable_if_t <::std::is_integral_v<T>, _Color_is_integral>>
214- inline constexpr rgba_color operator *(T lhs, const rgba_color& rhs) {
241+ inline constexpr rgba_color operator *(T lhs, const rgba_color& rhs) noexcept {
215242 lhs = ::std::max (::std::min (lhs, 1 .0F ), 0 .0F );
216243 return {
217244 ::std::min (lhs / 255 .0F * rhs.r(), 1.0F),
0 commit comments