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_BokehBlurOperation.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_BokehBlurOperation.cc')
-rw-r--r-- | source/blender/compositor/operations/COM_BokehBlurOperation.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/compositor/operations/COM_BokehBlurOperation.cc b/source/blender/compositor/operations/COM_BokehBlurOperation.cc index 46f3de820ef..3f98732b403 100644 --- a/source/blender/compositor/operations/COM_BokehBlurOperation.cc +++ b/source/blender/compositor/operations/COM_BokehBlurOperation.cc @@ -109,13 +109,12 @@ void BokehBlurOperation::executePixel(float output[4], int x, int y, void *data) maxx = MIN2(maxx, input_rect.xmax); int step = getStep(); - int offsetadd = getOffsetAdd() * COM_data_type_num_channels(DataType::Color); + int offsetadd = getOffsetAdd() * COM_DATA_TYPE_COLOR_CHANNELS; float m = this->m_bokehDimension / pixelSize; for (int ny = miny; ny < maxy; ny += step) { - int bufferindex = ((minx - bufferstartx) * COM_data_type_num_channels(DataType::Color)) + - ((ny - bufferstarty) * COM_data_type_num_channels(DataType::Color) * - bufferwidth); + int bufferindex = ((minx - bufferstartx) * COM_DATA_TYPE_COLOR_CHANNELS) + + ((ny - bufferstarty) * COM_DATA_TYPE_COLOR_CHANNELS * bufferwidth); for (int nx = minx; nx < maxx; nx += step) { float u = this->m_bokehMidX - (nx - x) * m; float v = this->m_bokehMidY - (ny - y) * m; |