diff options
author | Jeroen Bakker <jeroen@blender.org> | 2021-03-30 15:12:41 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2021-03-30 17:03:43 +0300 |
commit | 88e0ed32888f4a87ec1192e3b54aebe8686e029c (patch) | |
tree | 2659678f6a9adfd6605c7fb17b219b9166364ade /source/blender/compositor/operations/COM_BokehBlurOperation.cc | |
parent | b48a573adb1e8ba254c5b3ea58bf1bb2a013ce89 (diff) |
Cleanup: Use constexpr.
Diffstat (limited to 'source/blender/compositor/operations/COM_BokehBlurOperation.cc')
-rw-r--r-- | source/blender/compositor/operations/COM_BokehBlurOperation.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/compositor/operations/COM_BokehBlurOperation.cc b/source/blender/compositor/operations/COM_BokehBlurOperation.cc index 8d331758377..46f3de820ef 100644 --- a/source/blender/compositor/operations/COM_BokehBlurOperation.cc +++ b/source/blender/compositor/operations/COM_BokehBlurOperation.cc @@ -109,12 +109,13 @@ 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_NUM_CHANNELS_COLOR; + int offsetadd = getOffsetAdd() * COM_data_type_num_channels(DataType::Color); float m = this->m_bokehDimension / pixelSize; for (int ny = miny; ny < maxy; ny += step) { - int bufferindex = ((minx - bufferstartx) * COM_NUM_CHANNELS_COLOR) + - ((ny - bufferstarty) * COM_NUM_CHANNELS_COLOR * bufferwidth); + int bufferindex = ((minx - bufferstartx) * COM_data_type_num_channels(DataType::Color)) + + ((ny - bufferstarty) * COM_data_type_num_channels(DataType::Color) * + 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; |