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_FastGaussianBlurOperation.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_FastGaussianBlurOperation.cc')
-rw-r--r-- | source/blender/compositor/operations/COM_FastGaussianBlurOperation.cc | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cc b/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cc index cd6bb3952bf..2be6e4d1be7 100644 --- a/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cc +++ b/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cc @@ -90,18 +90,18 @@ void *FastGaussianBlurOperation::initializeTileData(rcti *rect) this->m_sy = this->m_data.sizey * this->m_size / 2.0f; if ((this->m_sx == this->m_sy) && (this->m_sx > 0.0f)) { - for (c = 0; c < COM_data_type_num_channels(DataType::Color); c++) { + for (c = 0; c < COM_DATA_TYPE_COLOR_CHANNELS; c++) { IIR_gauss(copy, this->m_sx, c, 3); } } else { if (this->m_sx > 0.0f) { - for (c = 0; c < COM_data_type_num_channels(DataType::Color); c++) { + for (c = 0; c < COM_DATA_TYPE_COLOR_CHANNELS; c++) { IIR_gauss(copy, this->m_sx, c, 1); } } if (this->m_sy > 0.0f) { - for (c = 0; c < COM_data_type_num_channels(DataType::Color); c++) { + for (c = 0; c < COM_DATA_TYPE_COLOR_CHANNELS; c++) { IIR_gauss(copy, this->m_sy, c, 2); } } @@ -318,9 +318,8 @@ void *FastGaussianBlurValueOperation::initializeTileData(rcti *rect) if (this->m_overlay == FAST_GAUSS_OVERLAY_MIN) { float *src = newBuf->getBuffer(); float *dst = copy->getBuffer(); - for (int i = copy->getWidth() * copy->getHeight(); i != 0; i--, - src += COM_data_type_num_channels(DataType::Value), - dst += COM_data_type_num_channels(DataType::Value)) { + for (int i = copy->getWidth() * copy->getHeight(); i != 0; + i--, src += COM_DATA_TYPE_VALUE_CHANNELS, dst += COM_DATA_TYPE_VALUE_CHANNELS) { if (*src < *dst) { *dst = *src; } @@ -329,9 +328,8 @@ void *FastGaussianBlurValueOperation::initializeTileData(rcti *rect) else if (this->m_overlay == FAST_GAUSS_OVERLAY_MAX) { float *src = newBuf->getBuffer(); float *dst = copy->getBuffer(); - for (int i = copy->getWidth() * copy->getHeight(); i != 0; i--, - src += COM_data_type_num_channels(DataType::Value), - dst += COM_data_type_num_channels(DataType::Value)) { + for (int i = copy->getWidth() * copy->getHeight(); i != 0; + i--, src += COM_DATA_TYPE_VALUE_CHANNELS, dst += COM_DATA_TYPE_VALUE_CHANNELS) { if (*src > *dst) { *dst = *src; } |