diff options
author | Jeroen Bakker <jeroen@blender.org> | 2021-03-31 10:24:14 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2021-03-31 12:00:07 +0300 |
commit | e9616c82bd10a5444478d4b86fa4a8dea2041f09 (patch) | |
tree | e42bf8ef6212cb070576de6bf7d40d25e93411d6 /source/blender/compositor/operations/COM_SunBeamsOperation.cc | |
parent | 645fc0c7679423667eb25a77bbd8fb2626d71080 (diff) |
Cleanup: use constexpr for num channels.
Don't assume all compilers are smart. MSVC doesn't inline the call away like CLANG and GCC did.
Diffstat (limited to 'source/blender/compositor/operations/COM_SunBeamsOperation.cc')
-rw-r--r-- | source/blender/compositor/operations/COM_SunBeamsOperation.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/compositor/operations/COM_SunBeamsOperation.cc b/source/blender/compositor/operations/COM_SunBeamsOperation.cc index 46fc716b2d7..839eeb9ff8f 100644 --- a/source/blender/compositor/operations/COM_SunBeamsOperation.cc +++ b/source/blender/compositor/operations/COM_SunBeamsOperation.cc @@ -140,8 +140,7 @@ template<int fxu, int fxv, int fyu, int fyv> struct BufferLineAccumulator { falloff_factor = dist_max > dist_min ? dr / (float)(dist_max - dist_min) : 0.0f; - float *iter = input->getBuffer() + - COM_data_type_num_channels(DataType::Color) * (x + input->getWidth() * y); + float *iter = input->getBuffer() + COM_DATA_TYPE_COLOR_CHANNELS * (x + input->getWidth() * y); return iter; } @@ -170,7 +169,7 @@ template<int fxu, int fxv, int fyu, int fyv> struct BufferLineAccumulator { if ((int)(co[0] - source[0]) == 0 && (int)(co[1] - source[1]) == 0) { copy_v4_v4(output, - input->getBuffer() + COM_data_type_num_channels(DataType::Color) * + input->getBuffer() + COM_DATA_TYPE_COLOR_CHANNELS * ((int)source[0] + input->getWidth() * (int)source[1])); return; } @@ -211,7 +210,7 @@ template<int fxu, int fxv, int fyu, int fyv> struct BufferLineAccumulator { /* decrement u */ x -= fxu; y -= fyu; - buffer -= (fxu + fyu * buffer_width) * COM_data_type_num_channels(DataType::Color); + buffer -= (fxu + fyu * buffer_width) * COM_DATA_TYPE_COLOR_CHANNELS; /* decrement v (in steps of dv < 1) */ v_local -= dv; @@ -220,7 +219,7 @@ template<int fxu, int fxv, int fyu, int fyv> struct BufferLineAccumulator { x -= fxv; y -= fyv; - buffer -= (fxv + fyv * buffer_width) * COM_data_type_num_channels(DataType::Color); + buffer -= (fxv + fyv * buffer_width) * COM_DATA_TYPE_COLOR_CHANNELS; } } |