@@ -110,26 +110,30 @@ namespace Langulus::Math
110
110
111
111
if (not initialized) {
112
112
// Attempt converting from any other kinds of numbers
113
+ constexpr auto DEF = Default; // workarounds for stupid
114
+ constexpr auto S = MemberCount; // gcc capture bugs >_<
115
+ constexpr auto IsR = IsReal; //
116
+
113
117
Typelists::Arithmetic::ForEachOr ([&]<class AS >{
114
118
if constexpr (not CT::Similar<InnerT, AS>) {
115
- AS all_as[TColor<T>::MemberCount ];
119
+ AS all_as[S ];
116
120
initialized = describe->ExtractData (all_as);
117
121
if (initialized) {
118
- if constexpr (TColor<T>::IsReal and CT::Integer<AS>) {
122
+ if constexpr (IsR and CT::Integer<AS>) {
119
123
// If we're initializing real color using integers,
120
124
// we have to divide by 255 and saturate (TODO)
121
- SIMD::Convert<TColor<T>::Default >(all_as, this ->all );
125
+ SIMD::Convert<DEF >(all_as, this ->all );
122
126
*this /= InnerT {255 };
123
127
}
124
- else if constexpr (not TColor<T>::IsReal and CT::Real<AS>) {
128
+ else if constexpr (not IsR and CT::Real<AS>) {
125
129
// If we're initializing integer color using reals,
126
130
// we have to multiply by 255 and saturate
127
131
SIMD::Multiply (all_as, AS {255 }, all_as);
128
132
SIMD::Min (all_as, InnerT {255 }, all_as);
129
133
SIMD::Max (all_as, InnerT {0 }, all_as);
130
- SIMD::Convert<TColor<T>::Default >(all_as, this ->all );
134
+ SIMD::Convert<DEF >(all_as, this ->all );
131
135
}
132
- else SIMD::Convert<TColor<T>::Default >(all_as, this ->all );
136
+ else SIMD::Convert<DEF >(all_as, this ->all );
133
137
}
134
138
return initialized > 0 ;
135
139
}
0 commit comments