From 88e0ed32888f4a87ec1192e3b54aebe8686e029c Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Tue, 30 Mar 2021 14:12:41 +0200 Subject: Cleanup: Use constexpr. --- source/blender/compositor/operations/COM_BokehBlurOperation.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 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 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; -- cgit v1.2.3