style cleanup: compositor
authorCampbell Barton <ideasman42@gmail.com>
Fri, 3 Aug 2012 10:19:13 +0000 (10:19 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 3 Aug 2012 10:19:13 +0000 (10:19 +0000)
30 files changed:
source/blender/compositor/COM_compositor.h
source/blender/compositor/intern/COM_ExecutionGroup.h
source/blender/compositor/intern/COM_ExecutionSystem.h
source/blender/compositor/intern/COM_MemoryBuffer.cpp
source/blender/compositor/intern/COM_NodeOperation.h
source/blender/compositor/intern/COM_OpenCLDevice.cpp
source/blender/compositor/intern/COM_OpenCLDevice.h
source/blender/compositor/intern/COM_WorkScheduler.cpp
source/blender/compositor/intern/COM_compositor.cpp
source/blender/compositor/nodes/COM_ChannelMatteNode.cpp
source/blender/compositor/operations/COM_BokehBlurOperation.cpp
source/blender/compositor/operations/COM_BokehBlurOperation.h
source/blender/compositor/operations/COM_ChannelMatteOperation.cpp
source/blender/compositor/operations/COM_ChromaMatteOperation.cpp
source/blender/compositor/operations/COM_ColorMatteOperation.cpp
source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.cpp
source/blender/compositor/operations/COM_DifferenceMatteOperation.cpp
source/blender/compositor/operations/COM_DilateErodeOperation.cpp
source/blender/compositor/operations/COM_DilateErodeOperation.h
source/blender/compositor/operations/COM_DirectionalBlurOperation.cpp
source/blender/compositor/operations/COM_DirectionalBlurOperation.h
source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp
source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp
source/blender/compositor/operations/COM_LuminanceMatteOperation.cpp
source/blender/compositor/operations/COM_OpenCLKernels.cl.h
source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp
source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp
source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h
source/blender/compositor/operations/COM_WriteBufferOperation.cpp
source/blender/compositor/operations/COM_WriteBufferOperation.h

index cd1615c909449efec4f0c8ad011e034b7e5b542c..4e955ea3df19291695db7998065af877a25912b3 100644 (file)
@@ -297,7 +297,7 @@ extern "C" {
  *     - output nodes can have different priorities in the WorkScheduler.
  * This is implemented in the COM_execute function.
  */
-void COM_execute(RenderDatard, bNodeTree *editingtree, int rendering);
+void COM_execute(RenderData *rd, bNodeTree *editingtree, int rendering);
 
 /**
  * @brief Return a list of highlighted bnodes pointers.
@@ -310,7 +310,7 @@ void COM_startReadHighlights(void);
  * @param bnode
  * @return 
  */
-int COM_isHighlightedbNode(bNodebnode);
+int COM_isHighlightedbNode(bNode *bnode);
 
 #ifdef __cplusplus
 }
index e890715cafe80622fc77c54d0dab13760b5fcc51..a87b40af89ddd1e84d43a7e6de4b4212f8830a17 100644 (file)
@@ -316,7 +316,7 @@ public:
         * @brief get all inputbuffers needed to calculate an chunk
         * @note all inputbuffers must be executed
         * @param chunkNumber the chunk to be calculated
-        * @return MemoryBuffer** the inputbuffers
+        * @return (MemoryBuffer **) the inputbuffers
         */
        MemoryBuffer **getInputBuffersCPU();
 
@@ -324,7 +324,7 @@ public:
         * @brief get all inputbuffers needed to calculate an chunk
         * @note all inputbuffers must be executed
         * @param chunkNumber the chunk to be calculated
-        * @return MemoryBuffer** the inputbuffers
+        * @return (MemoryBuffer **) the inputbuffers
         */
        MemoryBuffer **getInputBuffersOpenCL(int chunkNumber);
 
index 4f6780c8d0b2d976798e950bd5509e1958f4fb98..ac849bf4f6cae1b1dae6132933f654f1ba79a817 100644 (file)
@@ -153,7 +153,7 @@ public:
         * @brief Create a new ExecutionSystem and initialize it with the
         * editingtree.
         *
-        * @param editingtree [bNodeTree*]
+        * @param editingtree [bNodeTree *]
         * @param rendering [true false]
         */
        ExecutionSystem(RenderData *rd, bNodeTree *editingtree, bool rendering, bool fastcalculation);
index eae98a1211f454b1e891cd897ac1ad9983ec0b62..3b8fbd6d708fb2b39a78bdf817580d4b0ba39969 100644 (file)
@@ -248,7 +248,7 @@ static void imp2radangle(float A, float B, float C, float F, float *a, float *b,
                        *b = sqrtf(F2 / d);
                        *ecc = *a / *b;
                }
-               // incr theta by 0.5*pi (angle of major axis)
+               /* incr theta by 0.5 * pi (angle of major axis) */
                *th = 0.5f * (atan2f(B, AmC) + (float)M_PI);
        }
 }
index 9b6d574e321742e2dfe2fb55d49f4af61a9fd5da..a9cf281b02f88166bc0d8703f9cd74480870d387 100644 (file)
@@ -148,7 +148,7 @@ public:
         * @param memoryBuffers all input MemoryBuffer's needed
         * @param outputBuffer the outputbuffer to write to
         */
-       virtual void executeOpenCLRegion(OpenCLDevicedevice, rcti *rect,
+       virtual void executeOpenCLRegion(OpenCLDevice *device, rcti *rect,
                                         unsigned int chunkNumber, MemoryBuffer **memoryBuffers, MemoryBuffer *outputBuffer) {}
 
        /**
@@ -163,7 +163,7 @@ public:
         * @param clMemToCleanUp all created cl_mem references must be added to this list. Framework will clean this after execution
         * @param clKernelsToCleanUp all created cl_kernel references must be added to this list. Framework will clean this after execution
         */
-       virtual void executeOpenCL(OpenCLDevicedevice, MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, MemoryBuffer **inputMemoryBuffers, list<cl_mem> *clMemToCleanUp, list<cl_kernel> *clKernelsToCleanUp) {}
+       virtual void executeOpenCL(OpenCLDevice *device, MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, MemoryBuffer **inputMemoryBuffers, list<cl_mem> *clMemToCleanUp, list<cl_kernel> *clKernelsToCleanUp) {}
        virtual void deinitExecution();
 
        bool isResolutionSet() {
index 63f7568177988ef08a5a217285dc124451b30911..be5936b495e96f391e80b108298799e87acd1ae6 100644 (file)
@@ -67,7 +67,7 @@ void OpenCLDevice::execute(WorkPackage *work)
 }
 cl_mem OpenCLDevice::COM_clAttachMemoryBufferToKernelParameter(cl_kernel kernel, int parameterIndex, int offsetIndex, list<cl_mem> *cleanup, MemoryBuffer **inputMemoryBuffers, SocketReader *reader)
 {
-       return COM_clAttachMemoryBufferToKernelParameter(kernel, parameterIndex, offsetIndex, cleanup, inputMemoryBuffers, (ReadBufferOperation*)reader);
+       return COM_clAttachMemoryBufferToKernelParameter(kernel, parameterIndex, offsetIndex, cleanup, inputMemoryBuffers, (ReadBufferOperation *)reader);
 }
 
 cl_mem OpenCLDevice::COM_clAttachMemoryBufferToKernelParameter(cl_kernel kernel, int parameterIndex, int offsetIndex, list<cl_mem> *cleanup, MemoryBuffer **inputMemoryBuffers, ReadBufferOperation *reader)
@@ -106,7 +106,7 @@ void OpenCLDevice::COM_clAttachMemoryBufferOffsetToKernelParameter(cl_kernel ker
        }
 }
 
-void OpenCLDevice::COM_clAttachSizeToKernelParameter(cl_kernel kernel, int offsetIndex, NodeOperationoperation)
+void OpenCLDevice::COM_clAttachSizeToKernelParameter(cl_kernel kernel, int offsetIndex, NodeOperation *operation)
 {
        if (offsetIndex != -1) {
                cl_int error;
@@ -133,7 +133,7 @@ void OpenCLDevice::COM_clEnqueueRange(cl_kernel kernel, MemoryBuffer *outputMemo
        if (error != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error));  }
 }
 
-void OpenCLDevice::COM_clEnqueueRange(cl_kernel kernel, MemoryBuffer *outputMemoryBuffer, int offsetIndex, NodeOperationoperation)
+void OpenCLDevice::COM_clEnqueueRange(cl_kernel kernel, MemoryBuffer *outputMemoryBuffer, int offsetIndex, NodeOperation *operation)
 {
        cl_int error;
        const int width = outputMemoryBuffer->getWidth();
index f1a1e31c9300e7fc1aac394acf6433e25acedf99..2021cacabcceec93f682a331781f8502c0917f3b 100644 (file)
@@ -100,9 +100,9 @@ public:
        cl_mem COM_clAttachMemoryBufferToKernelParameter(cl_kernel kernel, int parameterIndex, int offsetIndex, list<cl_mem> *cleanup, MemoryBuffer **inputMemoryBuffers, ReadBufferOperation *reader);
        void COM_clAttachMemoryBufferOffsetToKernelParameter(cl_kernel kernel, int offsetIndex, MemoryBuffer *memoryBuffers);
        void COM_clAttachOutputMemoryBufferToKernelParameter(cl_kernel kernel, int parameterIndex, cl_mem clOutputMemoryBuffer);
-       void COM_clAttachSizeToKernelParameter(cl_kernel kernel, int offsetIndex, NodeOperationoperation);
+       void COM_clAttachSizeToKernelParameter(cl_kernel kernel, int offsetIndex, NodeOperation *operation);
        void COM_clEnqueueRange(cl_kernel kernel, MemoryBuffer *outputMemoryBuffer);
-       void COM_clEnqueueRange(cl_kernel kernel, MemoryBuffer *outputMemoryBuffer, int offsetIndex, NodeOperationoperation);
+       void COM_clEnqueueRange(cl_kernel kernel, MemoryBuffer *outputMemoryBuffer, int offsetIndex, NodeOperation *operation);
        cl_kernel COM_clCreateKernel(const char *kernelname, list<cl_kernel> *clKernelsToCleanUp);
 };
 
index 7d4134aca13e8c2699fd3c4487f89ca4eb368d1a..849c4affd9ccb3e6860368700440eae70fe7cb83 100644 (file)
@@ -77,20 +77,20 @@ void ** g_highlightedNodesRead;
 
 #define HIGHLIGHT(wp) \
 { \
-       ExecutionGroupgroup = wp->getExecutionGroup(); \
+       ExecutionGroup *group = wp->getExecutionGroup(); \
        if (group->isComplex()) { \
-               NodeOperationoperation = group->getOutputNodeOperation(); \
-               if (operation->isWriteBufferOperation()) {\
-                       WriteBufferOperation *writeOperation = (WriteBufferOperation*)operation;\
+               NodeOperation *operation = group->getOutputNodeOperation(); \
+               if (operation->isWriteBufferOperation()) { \
+                       WriteBufferOperation *writeOperation = (WriteBufferOperation *)operation; \
                        NodeOperation *complexOperation = writeOperation->getInput(); \
                        bNode *node = complexOperation->getbNode(); \
                        if (node) { \
                                if (node->original) { \
-                                       node = node->original;\
-                               }\
-                               if (g_highlightIndex < MAX_HIGHLIGHT) {\
-                                       g_highlightedNodes[g_highlightIndex++] = node;\
-                               }\
+                                       node = node->original; \
+                               } \
+                               if (g_highlightIndex < MAX_HIGHLIGHT) { \
+                                       g_highlightedNodes[g_highlightIndex++] = node; \
+                               } \
                        } \
                } \
        } \
@@ -103,18 +103,18 @@ void COM_startReadHighlights()
        }
        
        g_highlightedNodesRead = g_highlightedNodes;
-       g_highlightedNodes = new void*[MAX_HIGHLIGHT];
+       g_highlightedNodes = new void *[MAX_HIGHLIGHT];
        g_highlightIndex = 0;
        for (int i = 0 ; i < MAX_HIGHLIGHT; i++) {
                g_highlightedNodes[i] = 0;
        }
 }
 
-int COM_isHighlightedbNode(bNodebnode)
+int COM_isHighlightedbNode(bNode *bnode)
 {
        if (!g_highlightedNodesRead) return false;
        for (int i = 0 ; i < MAX_HIGHLIGHT; i++) {
-               voidp = g_highlightedNodesRead[i];
+               void *p = g_highlightedNodesRead[i];
                if (!p) return false;
                if (p == bnode) return true;
        }
index ab64f8f7bf18f93113c816c6c9943885fe5ded78..2402f9a11638a7f3f39b4754fb356982bee40395 100644 (file)
@@ -54,7 +54,7 @@ void COM_execute(RenderData *rd, bNodeTree *editingtree, int rendering)
        }
 
 
-       /* set progress bar to 0% and status to init compositing*/
+       /* set progress bar to 0% and status to init compositing */
        editingtree->progress(editingtree->prh, 0.0);
 
        bool twopass = (editingtree->flag&NTREE_TWO_PASS) > 0 && !rendering;
index 69f396396602f97aedad83874594da669d353e06..eab921863e917df82978e236061d028cef8645bd 100644 (file)
@@ -45,13 +45,13 @@ void ChannelMatteNode::convertToOperations(ExecutionSystem *graph, CompositorCon
        switch (node->custom1) {
                case CMP_NODE_CHANNEL_MATTE_CS_RGB:
                        break;
-               case CMP_NODE_CHANNEL_MATTE_CS_HSV: /*HSV*/
+               case CMP_NODE_CHANNEL_MATTE_CS_HSV: /* HSV */
                        convert = new ConvertRGBToHSVOperation();
                        break;
-               case CMP_NODE_CHANNEL_MATTE_CS_YUV: /*YUV*/
+               case CMP_NODE_CHANNEL_MATTE_CS_YUV: /* YUV */
                        convert = new ConvertRGBToYUVOperation();
                        break;
-               case CMP_NODE_CHANNEL_MATTE_CS_YCC: /*YCC*/
+               case CMP_NODE_CHANNEL_MATTE_CS_YCC: /* YCC */
                        convert = new ConvertRGBToYCCOperation();
                        ((ConvertRGBToYCCOperation *)convert)->setMode(0); /* BLI_YCC_ITU_BT601 */
                        break;
index a3d685de9a6fcf06534ca052479d81b5a579face..7d190332c37de5006ffaf6f316b98df537e8d017 100644 (file)
@@ -193,7 +193,7 @@ bool BokehBlurOperation::determineDependingAreaOfInterest(rcti *input, ReadBuffe
        return false;
 }
 
-void BokehBlurOperation::executeOpenCL(OpenCLDevicedevice,
+void BokehBlurOperation::executeOpenCL(OpenCLDevice *device,
                                        MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, 
                                        MemoryBuffer **inputMemoryBuffers, list<cl_mem> *clMemToCleanUp, 
                                        list<cl_kernel> *clKernelsToCleanUp) 
index eef5429c409960ebb7e8fd211c9318416313f5d8..646587197a9517893d01f0fe5196d06f7ba05ac9 100644 (file)
@@ -59,6 +59,6 @@ public:
 
        void setSize(float size) { this->m_size = size; this->m_sizeavailable = true; }
        
-       void executeOpenCL(OpenCLDevicedevice, MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, MemoryBuffer **inputMemoryBuffers, list<cl_mem> *clMemToCleanUp, list<cl_kernel> *clKernelsToCleanUp);
+       void executeOpenCL(OpenCLDevice *device, MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, MemoryBuffer **inputMemoryBuffers, list<cl_mem> *clMemToCleanUp, list<cl_kernel> *clKernelsToCleanUp);
 };
 #endif
index 85f606fafdf1801b6e70c1b242ab9f6d67167cae..e0e68f902891335b124f05c2ebfe87ec0a404c02 100644 (file)
@@ -100,7 +100,7 @@ void ChannelMatteOperation::executePixel(float *outputValue, float x, float y, P
        /* flip because 0.0 is transparent, not 1.0 */
        alpha = 1.0f - alpha;
        
-       /* test range*/
+       /* test range */
        if (alpha > limit_max) {
                alpha = inColor[3]; /*whatever it was prior */
        }
index 85a19d7c60fffc4dc8a451972e4fae8cf417dd7d..4be03e9d9149224142bec81e86cebcdcf6498717 100644 (file)
@@ -65,7 +65,7 @@ void ChromaMatteOperation::executePixel(float *outputValue, float x, float y, Pi
         */
 
        /* Algorithm from book "Video Demistified," does not include the spill reduction part */
-       /* find theta, the angle that the color space should be rotated based on key*/
+       /* find theta, the angle that the color space should be rotated based on key */
        theta = atan2(inKey[2], inKey[1]);
 
        /*rotate the cb and cr into x/z space */
index 5326e397494aaa1df0a284a3cf99bce6c688a821..26fbd99b43aeca73da9376239470ede2897fdf69 100644 (file)
@@ -75,7 +75,7 @@ void ColorMatteOperation::executePixel(float *outputValue, float x, float y, Pix
            /* hue */ ((h_wrap = 2.f * fabsf(inColor[0] - inKey[0])) < hue || (2.f - h_wrap) < hue)
            )
        {
-               outputValue[0] = 0.0f; /*make transparent*/
+               outputValue[0] = 0.0f; /* make transparent */
        }
 
        else { /*pixel is outside key color */
index 80416bbccdf83574518ea597a6d3b7a5b4123f1b..e3f95eac3b4f1c150744e64189313f0cd1b4f338 100644 (file)
@@ -71,7 +71,7 @@ void ConvertDepthToRadiusOperation::initExecution()
        this->m_dof_sp = (float)minsz / (16.f / this->m_cam_lens);    // <- == aspect * MIN2(img->x, img->y) / tan(0.5f * fov);
        
        if (this->m_blurPostOperation) {
-               m_blurPostOperation->setSigma(m_aperture*128.0f);
+               m_blurPostOperation->setSigma(m_aperture * 128.0f);
        }
 }
 
@@ -87,9 +87,9 @@ void ConvertDepthToRadiusOperation::executePixel(float *outputValue, float x, fl
                
                // bug #6656 part 2b, do not rescale
 #if 0
-               bcrad = 0.5f*fabs(aperture*(dof_sp*(cam_invfdist - iZ) - 1.f));
+               bcrad = 0.5f * fabs(aperture * (dof_sp * (cam_invfdist - iZ) - 1.0f));
                // scale crad back to original maximum and blend
-               crad->rect[px] = bcrad + wts->rect[px]*(scf*crad->rect[px] - bcrad);
+               crad->rect[px] = bcrad + wts->rect[px] * (scf * crad->rect[px] - bcrad);
 #endif
                radius = 0.5f * fabsf(this->m_aperture * (this->m_dof_sp * (this->m_inverseFocalDistance - iZ) - 1.f));
                // 'bug' #6615, limit minimum radius to 1 pixel, not really a solution, but somewhat mitigates the problem
index ed3799fff5e0dea108530b65e33d7288a30989d5..a95d1eec2903e388071fa8c06a8775d7b3d8e577 100644 (file)
@@ -64,7 +64,7 @@ void DifferenceMatteOperation::executePixel(float *outputValue, float x, float y
        /* average together the distances */
        difference = difference / 3.0f;
 
-       /*make 100% transparent*/
+       /* make 100% transparent */
        if (difference < tolerance) {
                outputValue[0] = 0.0f;
        }
@@ -81,7 +81,7 @@ void DifferenceMatteOperation::executePixel(float *outputValue, float x, float y
                }
        }
        else {
-               /*foreground object*/
+               /* foreground object */
                outputValue[0] = inColor1[3];
        }
 }
index 2752c6a7b90ee1113f43146d12050c492106badb..0890bc750492ddee4905a6f2ba00fb5b34e29fe0 100644 (file)
@@ -234,7 +234,7 @@ bool DilateDistanceOperation::determineDependingAreaOfInterest(rcti *input, Read
        return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
 }
 
-void DilateDistanceOperation::executeOpenCL(OpenCLDevicedevice,
+void DilateDistanceOperation::executeOpenCL(OpenCLDevice *device,
                                             MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer,
                                             MemoryBuffer **inputMemoryBuffers, list<cl_mem> *clMemToCleanUp,
                                             list<cl_kernel> *clKernelsToCleanUp)
@@ -291,7 +291,7 @@ void ErodeDistanceOperation::executePixel(float *color, int x, int y, void *data
        color[0] = value;
 }
 
-void ErodeDistanceOperation::executeOpenCL(OpenCLDevicedevice,
+void ErodeDistanceOperation::executeOpenCL(OpenCLDevice *device,
                                            MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer,
                                            MemoryBuffer **inputMemoryBuffers, list<cl_mem> *clMemToCleanUp,
                                            list<cl_kernel> *clKernelsToCleanUp)
index 8c3eefb97e44c638419be228ca266c074d3a021a..bd044e79fbe6fbece99cdbd305897192d50b474f 100644 (file)
@@ -99,7 +99,7 @@ public:
        void setDistance(float distance) { this->m_distance = distance; }
        bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
        
-       void executeOpenCL(OpenCLDevicedevice,
+       void executeOpenCL(OpenCLDevice *device,
                           MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, 
                           MemoryBuffer **inputMemoryBuffers, list<cl_mem> *clMemToCleanUp,
                           list<cl_kernel> *clKernelsToCleanUp);
@@ -113,7 +113,7 @@ public:
         */
        void executePixel(float *color, int x, int y, void *data);
 
-       void executeOpenCL(OpenCLDevicedevice,
+       void executeOpenCL(OpenCLDevice *device,
                           MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, 
                           MemoryBuffer **inputMemoryBuffers, list<cl_mem> *clMemToCleanUp, 
                           list<cl_kernel> *clKernelsToCleanUp);
index 5e6ff2c7da1d08d070794c626ad22e03d4139064..34bf9db77cef585bf8e831948834b934fe136400 100644 (file)
@@ -101,7 +101,7 @@ void DirectionalBlurOperation::executePixel(float *color, int x, int y, void *da
        mul_v4_v4fl(color, col2, 1.0f / (iterations+1));
 }
 
-void DirectionalBlurOperation::executeOpenCL(OpenCLDevicedevice,
+void DirectionalBlurOperation::executeOpenCL(OpenCLDevice *device,
                                        MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, 
                                        MemoryBuffer **inputMemoryBuffers, list<cl_mem> *clMemToCleanUp, 
                                        list<cl_kernel> *clKernelsToCleanUp) 
index cc49e947f9575181bb6c04f1f9946cd5672ce343..4de435a14181dd6728edbc6e98070a1542179ba5 100644 (file)
@@ -56,7 +56,7 @@ public:
        
        void setData(NodeDBlurData *data) { this->m_data = data; }
 
-       void executeOpenCL(OpenCLDevicedevice,
+       void executeOpenCL(OpenCLDevice *device,
                                               MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, 
                                               MemoryBuffer **inputMemoryBuffers, list<cl_mem> *clMemToCleanUp, 
                                               list<cl_kernel> *clKernelsToCleanUp);
index 7c5614c0de15c26ea1fe733363e699ad1c673ea5..847e58176755a4acf057d21f4f5870ed46d4aed0 100644 (file)
@@ -907,7 +907,7 @@ static void do_createEdgeLocationBuffer(unsigned int t, unsigned int rw, unsigne
         * or outer edge.
         *
         * Allocation is done by requesting 4 bytes "sizeof(int)" per pixel, even
-        * though gbuf[] is declared as unsigned short* (2 bytes) because we don't
+        * though gbuf[] is declared as (unsigned short *) (2 bytes) because we don't
         * store the pixel indexes, we only store x,y location of pixel in buffer.
         *
         * This does make the assumption that x and y can fit in 16 unsigned bits
index fd70d0d329a15e3e999ab13c6c6196e8fe95110b..f7ad3115f24825506a5d4197d84f53764c481077 100644 (file)
@@ -257,14 +257,14 @@ void GaussianBlurReferenceOperation::updateGauss()
 {
        int i;
        int x = MAX2(m_radx, m_rady);
-       this->m_maintabs = (float**)MEM_mallocN(x * sizeof(float *), "gauss array");
+       this->m_maintabs = (float **)MEM_mallocN(x * sizeof(float *), "gauss array");
        for (i = 0; i < x; i++)
                m_maintabs[i] = make_gausstab(i + 1);
 }
 
 void GaussianBlurReferenceOperation::executePixel(float *color, int x, int y, void *data)
 {
-       MemoryBuffer *memorybuffer = (MemoryBuffer*)data;
+       MemoryBuffer *memorybuffer = (MemoryBuffer *)data;
        float *buffer = memorybuffer->getBuffer();
        float *gausstabx, *gausstabcenty;
        float *gausstaby, *gausstabcentx;
index 7f637c127c1ff92b200f4d2f693601dffa684bad..31aae18992b7170b6b985d1145afb9b45e4211dd 100644 (file)
@@ -55,7 +55,7 @@ void LuminanceMatteOperation::executePixel(float *outputValue, float x, float y,
         * outputValue[0] = max(inputValue[3], min(high, max(low, ((inColor[0]-low)/(high-low))))
         */
                
-       /* test range*/
+       /* test range */
        if (inColor[0] > high) {
                alpha = 1.f;
        }
index cc18039c5b1dd449a0153d430eec3f657a392c50..7f60f97dfe8b03a09643986af801d7fe12867b98 100644 (file)
@@ -41,7 +41,7 @@ const char * clkernelstoh_COM_OpenCLKernels_cl = "/*\n" \
 "      float4 color = {0.0f,0.0f,0.0f,0.0f};\n" \
 "      float4 multiplyer = {0.0f,0.0f,0.0f,0.0f};\n" \
 "      float4 bokeh;\n" \
-"      const float radius2 = radius*2.0f;\n" \
+"      const float radius2 = radius * 2.0f;\n" \
 "      const int2 realCoordinate = coords + offsetOutput;\n" \
 "\n" \
 "      tempBoundingBox = read_imagef(boundingBox, SAMPLER_NEAREST, coords).s0;\n" \
@@ -56,10 +56,10 @@ const char * clkernelstoh_COM_OpenCLKernels_cl = "/*\n" \
 "              float2 uv;\n" \
 "              int2 inputXy;\n" \
 "\n" \
-"              for (ny = minXY.y, inputXy.y = ny - offsetInput.y ; ny < maxXY.y ; ny +=step, inputXy.y+=step) {\n" \
+"              for (ny = minXY.y, inputXy.y = ny - offsetInput.y ; ny < maxXY.y ; ny += step, inputXy.y += step) {\n" \
 "                      uv.y = ((realCoordinate.y-ny)/radius2)*bokehImageDim.y+bokehImageCenter.y;\n" \
 "\n" \
-"                      for (nx = minXY.x, inputXy.x = nx - offsetInput.x; nx < maxXY.x ; nx +=step, inputXy.x+=step) {\n" \
+"                      for (nx = minXY.x, inputXy.x = nx - offsetInput.x; nx < maxXY.x ; nx += step, inputXy.x += step) {\n" \
 "                              uv.x = ((realCoordinate.x-nx)/radius2)*bokehImageDim.x+bokehImageCenter.x;\n" \
 "                              bokeh = read_imagef(bokehImage, SAMPLER_NEAREST, uv);\n" \
 "                              color += bokeh * read_imagef(inputImage, SAMPLER_NEAREST, inputXy);\n" \
@@ -117,7 +117,7 @@ const char * clkernelstoh_COM_OpenCLKernels_cl = "/*\n" \
 "                                                              float2 uv = { 256.0f + dx * 256.0f / tempSize, 256.0f + dy * 256.0f / tempSize};\n" \
 "                                                              bokeh = read_imagef(bokehImage, SAMPLER_NEAREST, uv);\n" \
 "                                                              readColor = read_imagef(inputImage, SAMPLER_NEAREST, inputCoordinate);\n" \
-"                                                              color_accum += bokeh*readColor;\n" \
+"                                                              color_accum += bokeh * readColor;\n" \
 "                                                              multiplier_accum += bokeh;\n" \
 "                                                      }\n" \
 "                                              }\n" \
@@ -152,7 +152,7 @@ const char * clkernelstoh_COM_OpenCLKernels_cl = "/*\n" \
 "              const float deltaY = (realCoordinate.y - ny);\n" \
 "              for (nx = minXY.x, inputXy.x = nx - offsetInput.x; nx < maxXY.x ; nx ++, inputXy.x++) {\n" \
 "                      const float deltaX = (realCoordinate.x - nx);\n" \
-"                      const float measuredDistance = deltaX*deltaX+deltaY*deltaY;\n" \
+"                      const float measuredDistance = deltaX * deltaX + deltaY * deltaY;\n" \
 "                      if (measuredDistance <= distanceSquared) {\n" \
 "                              value = max(value, read_imagef(inputImage, SAMPLER_NEAREST, inputXy).s0);\n" \
 "                      }\n" \
@@ -183,7 +183,7 @@ const char * clkernelstoh_COM_OpenCLKernels_cl = "/*\n" \
 "              for (nx = minXY.x, inputXy.x = nx - offsetInput.x; nx < maxXY.x ; nx ++, inputXy.x++) {\n" \
 "                      const float deltaX = (realCoordinate.x - nx);\n" \
 "                      const float deltaY = (realCoordinate.y - ny);\n" \
-"                      const float measuredDistance = deltaX*deltaX+deltaY*deltaY;\n" \
+"                      const float measuredDistance = deltaX * deltaX + deltaY * deltaY;\n" \
 "                      if (measuredDistance <= distanceSquared) {\n" \
 "                              value = min(value, read_imagef(inputImage, SAMPLER_NEAREST, inputXy).s0);\n" \
 "                      }\n" \
index e28e77a5f5e2d7e7a5c0cbd0ee1ac6430f8c59a2..dcf9262d6460413db1f960a59cede571b33019ef 100644 (file)
@@ -79,10 +79,10 @@ bool ProjectorLensDistortionOperation::determineDependingAreaOfInterest(rcti *in
                newInput.xmin = input->xmin - this->m_kr2 - 2;
                newInput.xmax = input->xmax + this->m_kr2 + 2;
        } else {
-               newInput.xmin = input->xmin - 7; //(0.25f*20*1)+2 == worse case dispersion
+               newInput.xmin = input->xmin - 7;  /* (0.25f * 20 * 1) + 2 == worse case dispersion */
                newInput.ymin = input->ymin;
                newInput.ymax = input->ymax;
-               newInput.xmax = input->xmax + 7; //(0.25f*20*1)+2 == worse case dispersion
+               newInput.xmax = input->xmax + 7;  /* (0.25f * 20 * 1) + 2 == worse case dispersion */
        }
        return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
 }
index 66d7e9d4d99a8058043e76a71d2a1d95613af5b4..cd2438ecd12ed9eeca071ddfc39a7b71d6d79cd0 100644 (file)
@@ -63,22 +63,22 @@ void VariableSizeBokehBlurOperation::initExecution()
 }
 struct VariableSizeBokehBlurTileData
 {
-       MemoryBuffercolor;
-       MemoryBufferbokeh;
-       MemoryBuffersize;
+       MemoryBuffer *color;
+       MemoryBuffer *bokeh;
+       MemoryBuffer *size;
        int maxBlur;
 };
 
 void *VariableSizeBokehBlurOperation::initializeTileData(rcti *rect)
 {
        VariableSizeBokehBlurTileData *data = new VariableSizeBokehBlurTileData();
-       data->color = (MemoryBuffer*)this->m_inputProgram->initializeTileData(rect);
-       data->bokeh = (MemoryBuffer*)this->m_inputBokehProgram->initializeTileData(rect);
-       data->size = (MemoryBuffer*)this->m_inputSizeProgram->initializeTileData(rect);
+       data->color = (MemoryBuffer *)this->m_inputProgram->initializeTileData(rect);
+       data->bokeh = (MemoryBuffer *)this->m_inputBokehProgram->initializeTileData(rect);
+       data->size = (MemoryBuffer *)this->m_inputSizeProgram->initializeTileData(rect);
 
 
        rcti rect2;
-       this->determineDependingAreaOfInterest(rect, (ReadBufferOperation*)this->m_inputSizeProgram, &rect2);
+       this->determineDependingAreaOfInterest(rect, (ReadBufferOperation *)this->m_inputSizeProgram, &rect2);
        data->maxBlur = (int)data->size->getMaximumValue(&rect2);
        CLAMP(data->maxBlur, 1.0f, this->m_maxBlur);
        return data;
@@ -86,18 +86,18 @@ void *VariableSizeBokehBlurOperation::initializeTileData(rcti *rect)
 
 void VariableSizeBokehBlurOperation::deinitializeTileData(rcti *rect, void *data)
 {
-       VariableSizeBokehBlurTileData* result = (VariableSizeBokehBlurTileData*)data;
+       VariableSizeBokehBlurTileData *result = (VariableSizeBokehBlurTileData *)data;
        delete result;
 }
 
 void VariableSizeBokehBlurOperation::executePixel(float *color, int x, int y, void *data)
 {
-       VariableSizeBokehBlurTileData* tileData = (VariableSizeBokehBlurTileData*)data;
-       MemoryBufferinputProgramBuffer = tileData->color;
-       MemoryBufferinputBokehBuffer = tileData->bokeh;
-       MemoryBufferinputSizeBuffer = tileData->size;
-       floatinputSizeFloatBuffer = inputSizeBuffer->getBuffer();
-       floatinputProgramFloatBuffer = inputProgramBuffer->getBuffer();
+       VariableSizeBokehBlurTileData *tileData = (VariableSizeBokehBlurTileData *)data;
+       MemoryBuffer *inputProgramBuffer = tileData->color;
+       MemoryBuffer *inputBokehBuffer = tileData->bokeh;
+       MemoryBuffer *inputSizeBuffer = tileData->size;
+       float *inputSizeFloatBuffer = inputSizeBuffer->getBuffer();
+       float *inputProgramFloatBuffer = inputProgramBuffer->getBuffer();
        float readColor[4];
        float bokeh[4];
        float tempSize[4];
@@ -126,13 +126,13 @@ void VariableSizeBokehBlurOperation::executePixel(float *color, int x, int y, vo
                add_v4_fl(multiplier_accum, 1.0f);
                float sizeCenter = tempSize[0];
                
-               const int addXStep = QualityStepHelper::getStep()*COM_NUMBER_OF_CHANNELS;
+               const int addXStep = QualityStepHelper::getStep() * COM_NUMBER_OF_CHANNELS;
                
                if (sizeCenter > this->m_threshold) {
                        for (int ny = miny; ny < maxy; ny += QualityStepHelper::getStep()) {
                                float dy = ny - y;
                                int offsetNy = ny * inputSizeBuffer->getWidth() * COM_NUMBER_OF_CHANNELS;
-                               int offsetNxNy = offsetNy + (minx*COM_NUMBER_OF_CHANNELS);
+                               int offsetNxNy = offsetNy + (minx * COM_NUMBER_OF_CHANNELS);
                                for (int nx = minx; nx < maxx; nx += QualityStepHelper::getStep()) {
                                        if (nx != x || ny != y) 
                                        {
@@ -162,7 +162,7 @@ void VariableSizeBokehBlurOperation::executePixel(float *color, int x, int y, vo
 
 }
 
-void VariableSizeBokehBlurOperation::executeOpenCL(OpenCLDevicedevice,
+void VariableSizeBokehBlurOperation::executeOpenCL(OpenCLDevice *device,
                                        MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, 
                                        MemoryBuffer **inputMemoryBuffers, list<cl_mem> *clMemToCleanUp, 
                                        list<cl_kernel> *clKernelsToCleanUp) 
@@ -256,10 +256,10 @@ void InverseSearchRadiusOperation::initExecution()
        this->m_inputRadius = this->getInputSocketReader(0);
 }
 
-void* InverseSearchRadiusOperation::initializeTileData(rcti *rect) 
+voi *InverseSearchRadiusOperation::initializeTileData(rcti *rect)
 {
        MemoryBuffer * data = new MemoryBuffer(NULL, rect);
-       floatbuffer = data->getBuffer();
+       float *buffer = data->getBuffer();
        int x, y;
        int width = this->m_inputRadius->getWidth();
        int height = this->m_inputRadius->getHeight();
@@ -312,14 +312,14 @@ void* InverseSearchRadiusOperation::initializeTileData(rcti *rect)
 
 void InverseSearchRadiusOperation::executePixel(float *color, int x, int y, void *data) 
 {
-       MemoryBuffer *buffer = (MemoryBuffer*)data;
+       MemoryBuffer *buffer = (MemoryBuffer *)data;
        buffer->readNoCheck(color, x, y);
 }
 
 void InverseSearchRadiusOperation::deinitializeTileData(rcti *rect, void *data) 
 {
        if (data) {
-               MemoryBuffer* mb = (MemoryBuffer*)data;
+               MemoryBuffer *mb = (MemoryBuffer *)data;
                delete mb;
        }
 }
@@ -339,10 +339,10 @@ void InverseSearchRadiusOperation::determineResolution(unsigned int resolution[]
 bool InverseSearchRadiusOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
 {
        rcti newRect;
-       newRect.ymin = input->ymin*DIVIDER - m_maxBlur;
-       newRect.ymax = input->ymax*DIVIDER + m_maxBlur;
-       newRect.xmin = input->xmin*DIVIDER - m_maxBlur;
-       newRect.xmax = input->xmax*DIVIDER + m_maxBlur;
+       newRect.ymin = input->ymin * DIVIDER - m_maxBlur;
+       newRect.ymax = input->ymax * DIVIDER + m_maxBlur;
+       newRect.xmin = input->xmin * DIVIDER - m_maxBlur;
+       newRect.xmax = input->xmax * DIVIDER + m_maxBlur;
        return NodeOperation::determineDependingAreaOfInterest(&newRect, readOperation, output);
 }
 #endif
index e5430545323375b113b1efe4f671308bde6a53af..f53d54f8c2c42929014af843ce274ed631eed8d4 100644 (file)
@@ -66,7 +66,7 @@ public:
 
        void setThreshold(float threshold) { this->m_threshold = threshold; }
 
-       void executeOpenCL(OpenCLDevicedevice, MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, MemoryBuffer **inputMemoryBuffers, list<cl_mem> *clMemToCleanUp, list<cl_kernel> *clKernelsToCleanUp);
+       void executeOpenCL(OpenCLDevice *device, MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, MemoryBuffer **inputMemoryBuffers, list<cl_mem> *clMemToCleanUp, list<cl_kernel> *clKernelsToCleanUp);
 };
 
 #ifdef COM_DEFOCUS_SEARCH
@@ -88,7 +88,7 @@ public:
         * Initialize the execution
         */
        void initExecution();
-       voidinitializeTileData(rcti *rect);
+       void *initializeTileData(rcti *rect);
        void deinitializeTileData(rcti *rect, void *data);
        
        /**
index 0a31a6e170bad206556012d9add905e13e0d5753..06ec5b51efd2ccc0ee546c00bf632cc4e5d1e2f8 100644 (file)
@@ -110,7 +110,7 @@ void WriteBufferOperation::executeRegion(rcti *rect, unsigned int tileNumber)
        memoryBuffer->setCreatedState();
 }
 
-void WriteBufferOperation::executeOpenCLRegion(OpenCLDevicedevice, rcti *rect, unsigned int chunkNumber, MemoryBuffer **inputMemoryBuffers, MemoryBuffer *outputBuffer)
+void WriteBufferOperation::executeOpenCLRegion(OpenCLDevice *device, rcti *rect, unsigned int chunkNumber, MemoryBuffer **inputMemoryBuffers, MemoryBuffer *outputBuffer)
 {
        float *outputFloatBuffer = outputBuffer->getBuffer();
        cl_int error;
index 1aa93c658cb92f0284a92639c405986b94679161..f1632689dbe120ad45b40ba56edace75c5d37540 100644 (file)
@@ -44,7 +44,7 @@ public:
        void executeRegion(rcti *rect, unsigned int tileNumber);
        void initExecution();
        void deinitExecution();
-       void executeOpenCLRegion(OpenCLDevicedevice, rcti *rect, unsigned int chunkNumber, MemoryBuffer **memoryBuffers, MemoryBuffer *outputBuffer);
+       void executeOpenCLRegion(OpenCLDevice *device, rcti *rect, unsigned int chunkNumber, MemoryBuffer **memoryBuffers, MemoryBuffer *outputBuffer);
        void readResolutionFromInputSocket();
        inline NodeOperation *getInput() {
                return m_input;