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_GlareGhostOperation.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_GlareGhostOperation.cc')
-rw-r--r-- | source/blender/compositor/operations/COM_GlareGhostOperation.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/source/blender/compositor/operations/COM_GlareGhostOperation.cc b/source/blender/compositor/operations/COM_GlareGhostOperation.cc index 7ba49c97244..22c8767632e 100644 --- a/source/blender/compositor/operations/COM_GlareGhostOperation.cc +++ b/source/blender/compositor/operations/COM_GlareGhostOperation.cc @@ -125,8 +125,7 @@ void GlareGhostOperation::generateGlare(float *data, MemoryBuffer *inputTile, No memset(tbuf1.getBuffer(), 0, - tbuf1.getWidth() * tbuf1.getHeight() * COM_data_type_num_channels(DataType::Color) * - sizeof(float)); + tbuf1.getWidth() * tbuf1.getHeight() * COM_DATA_TYPE_COLOR_CHANNELS * sizeof(float)); for (n = 1; n < settings->iter && (!breaked); n++) { for (y = 0; y < gbuf.getHeight() && (!breaked); y++) { v = ((float)y + 0.5f) / (float)gbuf.getHeight(); @@ -150,13 +149,11 @@ void GlareGhostOperation::generateGlare(float *data, MemoryBuffer *inputTile, No } memcpy(gbuf.getBuffer(), tbuf1.getBuffer(), - tbuf1.getWidth() * tbuf1.getHeight() * COM_data_type_num_channels(DataType::Color) * - sizeof(float)); + tbuf1.getWidth() * tbuf1.getHeight() * COM_DATA_TYPE_COLOR_CHANNELS * sizeof(float)); } memcpy(data, gbuf.getBuffer(), - gbuf.getWidth() * gbuf.getHeight() * COM_data_type_num_channels(DataType::Color) * - sizeof(float)); + gbuf.getWidth() * gbuf.getHeight() * COM_DATA_TYPE_COLOR_CHANNELS * sizeof(float)); } } // namespace blender::compositor |