From e9616c82bd10a5444478d4b86fa4a8dea2041f09 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Wed, 31 Mar 2021 09:24:14 +0200 Subject: 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. --- source/blender/compositor/operations/COM_BokehBlurOperation.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'source/blender/compositor/operations/COM_BokehBlurOperation.cc') 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; -- cgit v1.2.3