diff options
author | Jeroen Bakker <jeroen@blender.org> | 2021-05-25 18:03:54 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2021-05-25 18:03:54 +0300 |
commit | 00955cd31eda95aca619842064d22663af4c812b (patch) | |
tree | 85a4650d260f2fdc250d433d51d7309b77f08510 /source/blender/blenkernel/intern/attribute_math.cc | |
parent | fd94e033446c72fb92048a9864c1d539fccde59a (diff) |
Revert "Blenlib: Explicit Colors."
This reverts commit fd94e033446c72fb92048a9864c1d539fccde59a.
does not compile against latest master.
Diffstat (limited to 'source/blender/blenkernel/intern/attribute_math.cc')
-rw-r--r-- | source/blender/blenkernel/intern/attribute_math.cc | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/attribute_math.cc b/source/blender/blenkernel/intern/attribute_math.cc index 5cdf329effb..4ff3a6ceff5 100644 --- a/source/blender/blenkernel/intern/attribute_math.cc +++ b/source/blender/blenkernel/intern/attribute_math.cc @@ -18,21 +18,18 @@ namespace blender::attribute_math { -ColorGeometryMixer::ColorGeometryMixer(MutableSpan<ColorGeometry4f> output_buffer, - ColorGeometry4f default_color) +Color4fMixer::Color4fMixer(MutableSpan<Color4f> output_buffer, Color4f default_color) : buffer_(output_buffer), default_color_(default_color), total_weights_(output_buffer.size(), 0.0f) { - buffer_.fill(ColorGeometry4f(0.0f, 0.0f, 0.0f, 0.0f)); + buffer_.fill(Color4f(0, 0, 0, 0)); } -void ColorGeometryMixer::mix_in(const int64_t index, - const ColorGeometry4f &color, - const float weight) +void Color4fMixer::mix_in(const int64_t index, const Color4f &color, const float weight) { BLI_assert(weight >= 0.0f); - ColorGeometry4f &output_color = buffer_[index]; + Color4f &output_color = buffer_[index]; output_color.r += color.r * weight; output_color.g += color.g * weight; output_color.b += color.b * weight; @@ -40,11 +37,11 @@ void ColorGeometryMixer::mix_in(const int64_t index, total_weights_[index] += weight; } -void ColorGeometryMixer::finalize() +void Color4fMixer::finalize() { for (const int64_t i : buffer_.index_range()) { const float weight = total_weights_[i]; - ColorGeometry4f &output_color = buffer_[i]; + Color4f &output_color = buffer_[i]; if (weight > 0.0f) { const float weight_inv = 1.0f / weight; output_color.r *= weight_inv; |