diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-06-26 05:22:05 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-06-26 05:22:05 +0400 |
commit | 6a1d82490e49d1f5d73b5082516b087d44010fb8 (patch) | |
tree | 0650cce3c1d47db6c5de1f4f2ba05b619c412f09 /source/blender/compositor/operations/COM_BokehBlurOperation.cpp | |
parent | 7a0ab62d3f65f3b28da2a6ba9916c21132f8ea0d (diff) |
use m_ prefix for compositor class members (all compositor operations).
Diffstat (limited to 'source/blender/compositor/operations/COM_BokehBlurOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_BokehBlurOperation.cpp | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/source/blender/compositor/operations/COM_BokehBlurOperation.cpp b/source/blender/compositor/operations/COM_BokehBlurOperation.cpp index 9fe5abcb075..fb06f6d3761 100644 --- a/source/blender/compositor/operations/COM_BokehBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_BokehBlurOperation.cpp @@ -37,11 +37,11 @@ BokehBlurOperation::BokehBlurOperation() : NodeOperation() this->setComplex(true); this->setOpenCL(true); - this->size = 1.0f; + this->m_size = 1.0f; - this->inputProgram = NULL; - this->inputBokehProgram = NULL; - this->inputBoundingBoxReader = NULL; + this->m_inputProgram = NULL; + this->m_inputBokehProgram = NULL; + this->m_inputBoundingBoxReader = NULL; } void *BokehBlurOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers) @@ -52,12 +52,12 @@ void *BokehBlurOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBu void BokehBlurOperation::initExecution() { - this->inputProgram = getInputSocketReader(0); - this->inputBokehProgram = getInputSocketReader(1); - this->inputBoundingBoxReader = getInputSocketReader(2); + this->m_inputProgram = getInputSocketReader(0); + this->m_inputBokehProgram = getInputSocketReader(1); + this->m_inputBoundingBoxReader = getInputSocketReader(2); - int width = inputBokehProgram->getWidth(); - int height = inputBokehProgram->getHeight(); + int width = this->m_inputBokehProgram->getWidth(); + int height = this->m_inputBokehProgram->getHeight(); float dimension; if (width < height) { @@ -66,9 +66,9 @@ void BokehBlurOperation::initExecution() else { dimension = height; } - this->bokehMidX = width / 2.0f; - this->bokehMidY = height / 2.0f; - this->bokehDimension = dimension / 2.0f; + this->m_bokehMidX = width / 2.0f; + this->m_bokehMidY = height / 2.0f; + this->m_bokehDimension = dimension / 2.0f; QualityStepHelper::initExecution(COM_QH_INCREASE); } @@ -78,7 +78,7 @@ void BokehBlurOperation::executePixel(float *color, int x, int y, MemoryBuffer * float tempBoundingBox[4]; float bokeh[4]; - inputBoundingBoxReader->read(tempBoundingBox, x, y, COM_PS_NEAREST, inputBuffers); + this->m_inputBoundingBoxReader->read(tempBoundingBox, x, y, COM_PS_NEAREST, inputBuffers); if (tempBoundingBox[0] > 0.0f) { float multiplier_accum[4] = {0.0f, 0.0f, 0.0f, 0.0f}; MemoryBuffer *inputBuffer = (MemoryBuffer *)data; @@ -86,7 +86,7 @@ void BokehBlurOperation::executePixel(float *color, int x, int y, MemoryBuffer * int bufferwidth = inputBuffer->getWidth(); int bufferstartx = inputBuffer->getRect()->xmin; int bufferstarty = inputBuffer->getRect()->ymin; - int pixelSize = this->size * this->getWidth() / 100.0f; + int pixelSize = this->m_size * this->getWidth() / 100.0f; int miny = y - pixelSize; int maxy = y + pixelSize; @@ -102,13 +102,13 @@ void BokehBlurOperation::executePixel(float *color, int x, int y, MemoryBuffer * int step = getStep(); int offsetadd = getOffsetAdd(); - float m = this->bokehDimension / pixelSize; + float m = this->m_bokehDimension / pixelSize; for (int ny = miny; ny < maxy; ny += step) { int bufferindex = ((minx - bufferstartx) * 4) + ((ny - bufferstarty) * 4 * bufferwidth); for (int nx = minx; nx < maxx; nx += step) { - float u = this->bokehMidX - (nx - x) * m; - float v = this->bokehMidY - (ny - y) * m; - inputBokehProgram->read(bokeh, u, v, COM_PS_NEAREST, inputBuffers); + float u = this->m_bokehMidX - (nx - x) * m; + float v = this->m_bokehMidY - (ny - y) * m; + this->m_inputBokehProgram->read(bokeh, u, v, COM_PS_NEAREST, inputBuffers); madd_v4_v4v4(color_accum, bokeh, &buffer[bufferindex]); add_v4_v4(multiplier_accum, bokeh); bufferindex += offsetadd; @@ -120,15 +120,15 @@ void BokehBlurOperation::executePixel(float *color, int x, int y, MemoryBuffer * color[3] = color_accum[3] * (1.0f / multiplier_accum[3]); } else { - inputProgram->read(color, x, y, COM_PS_NEAREST, inputBuffers); + this->m_inputProgram->read(color, x, y, COM_PS_NEAREST, inputBuffers); } } void BokehBlurOperation::deinitExecution() { - this->inputProgram = NULL; - this->inputBokehProgram = NULL; - this->inputBoundingBoxReader = NULL; + this->m_inputProgram = NULL; + this->m_inputBokehProgram = NULL; + this->m_inputBoundingBoxReader = NULL; } bool BokehBlurOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) @@ -136,10 +136,10 @@ bool BokehBlurOperation::determineDependingAreaOfInterest(rcti *input, ReadBuffe rcti newInput; rcti bokehInput; - newInput.xmax = input->xmax + (size * this->getWidth() / 100.0f); - newInput.xmin = input->xmin - (size * this->getWidth() / 100.0f); - newInput.ymax = input->ymax + (size * this->getWidth() / 100.0f); - newInput.ymin = input->ymin - (size * this->getWidth() / 100.0f); + newInput.xmax = input->xmax + (this->m_size * this->getWidth() / 100.0f); + newInput.xmin = input->xmin - (this->m_size * this->getWidth() / 100.0f); + newInput.ymax = input->ymax + (this->m_size * this->getWidth() / 100.0f); + newInput.ymin = input->ymin - (this->m_size * this->getWidth() / 100.0f); NodeOperation *operation = getInputOperation(1); bokehInput.xmax = operation->getWidth(); @@ -169,12 +169,12 @@ void BokehBlurOperation::executeOpenCL(OpenCLDevice* device, if (!kernel) { kernel = device->COM_clCreateKernel("bokehBlurKernel", NULL); } - cl_int radius = this->getWidth() * this->size / 100.0f; + cl_int radius = this->getWidth() * this->m_size / 100.0f; cl_int step = this->getStep(); - device->COM_clAttachMemoryBufferToKernelParameter(kernel, 0, -1, clMemToCleanUp, inputMemoryBuffers, this->inputBoundingBoxReader); - device->COM_clAttachMemoryBufferToKernelParameter(kernel, 1, 4, clMemToCleanUp, inputMemoryBuffers, this->inputProgram); - device->COM_clAttachMemoryBufferToKernelParameter(kernel, 2, -1, clMemToCleanUp, inputMemoryBuffers, this->inputBokehProgram); + device->COM_clAttachMemoryBufferToKernelParameter(kernel, 0, -1, clMemToCleanUp, inputMemoryBuffers, this->m_inputBoundingBoxReader); + device->COM_clAttachMemoryBufferToKernelParameter(kernel, 1, 4, clMemToCleanUp, inputMemoryBuffers, this->m_inputProgram); + device->COM_clAttachMemoryBufferToKernelParameter(kernel, 2, -1, clMemToCleanUp, inputMemoryBuffers, this->m_inputBokehProgram); device->COM_clAttachOutputMemoryBufferToKernelParameter(kernel, 3, clOutputBuffer); device->COM_clAttachMemoryBufferOffsetToKernelParameter(kernel, 5, outputMemoryBuffer); clSetKernelArg(kernel, 6, sizeof(cl_int), &radius); |