diff --git a/SConstruct b/SConstruct index a0fdf4b9fe3..6cb2da36ccd 100644 --- a/SConstruct +++ b/SConstruct @@ -451,7 +451,7 @@ if not os.path.isdir ( B.root_build_dir): if not os.path.isdir ( B.root_build_dir + 'data_headers'): os.makedirs ( B.root_build_dir + 'data_headers' ) # use for includes -env['DATA_HEADERS'] = "#" + env['BF_BUILDDIR'] + "/data_headers" +env['DATA_HEADERS'] = os.path.join(os.path.abspath(env['BF_BUILDDIR']), "data_headers") def ensure_data(FILE_FROM, FILE_TO, VAR_NAME): if os.sep == "\\": FILE_FROM = FILE_FROM.replace("/", "\\") diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index 938d11400a6..911b6b00b98 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -2486,7 +2486,7 @@ static ImBuf *do_adjustment_impl(SeqRenderData context, Sequence *seq, float cfr seqbasep = BKE_sequence_seqbase(&ed->seqbase, seq); - if (seq->machine > 0) { + if (seq->machine > 1) { i = BKE_sequencer_give_ibuf_seqbase(context, cfra, seq->machine - 1, seqbasep); } diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 59f178973ad..419abb7b27a 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -3774,7 +3774,7 @@ Sequence *BKE_sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoad return seq; } #else // WITH_AUDASPACE -Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo *seq_load) +Sequence *BKE_sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo *seq_load) { (void) C; (void) seqbasep; diff --git a/source/blender/compositor/COM_defines.h b/source/blender/compositor/COM_defines.h index e11048b23f3..3cc161a5877 100644 --- a/source/blender/compositor/COM_defines.h +++ b/source/blender/compositor/COM_defines.h @@ -107,4 +107,6 @@ typedef enum OrderOfChunks { #define COM_NUMBER_OF_CHANNELS 4 +#define COM_BLUR_BOKEH_PIXELS 512 + #endif diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.cpp b/source/blender/compositor/intern/COM_ExecutionGroup.cpp index 46a0db7af2d..30875afcb3f 100644 --- a/source/blender/compositor/intern/COM_ExecutionGroup.cpp +++ b/source/blender/compositor/intern/COM_ExecutionGroup.cpp @@ -186,7 +186,7 @@ void ExecutionGroup::deinitExecution() this->m_cachedReadOperations.clear(); this->m_bTree = NULL; } -void ExecutionGroup::determineResolution(unsigned int resolution[]) +void ExecutionGroup::determineResolution(unsigned int resolution[2]) { NodeOperation *operation = this->getOutputNodeOperation(); resolution[0] = operation->getWidth(); diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.h b/source/blender/compositor/intern/COM_ExecutionGroup.h index a87b40af89d..c7a7d06134e 100644 --- a/source/blender/compositor/intern/COM_ExecutionGroup.h +++ b/source/blender/compositor/intern/COM_ExecutionGroup.h @@ -270,13 +270,13 @@ public: * @brief determine the resolution of this ExecutionGroup * @param resolution */ - void determineResolution(unsigned int resolution[]); + void determineResolution(unsigned int resolution[2]); /** * @brief set the resolution of this executiongroup * @param resolution */ - void setResolution(unsigned int resolution[]) { this->m_width = resolution[0]; this->m_height = resolution[1]; } + void setResolution(unsigned int resolution[2]) { this->m_width = resolution[0]; this->m_height = resolution[1]; } /** * @brief get the width of this execution group diff --git a/source/blender/compositor/intern/COM_InputSocket.cpp b/source/blender/compositor/intern/COM_InputSocket.cpp index 94cb5ff5396..a9c280e0367 100644 --- a/source/blender/compositor/intern/COM_InputSocket.cpp +++ b/source/blender/compositor/intern/COM_InputSocket.cpp @@ -54,7 +54,7 @@ SocketConnection *InputSocket::getConnection() return this->m_connection; } -void InputSocket::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) +void InputSocket::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) { if (this->isConnected()) { this->m_connection->getFromSocket()->determineResolution(resolution, preferredResolution); diff --git a/source/blender/compositor/intern/COM_InputSocket.h b/source/blender/compositor/intern/COM_InputSocket.h index 5d0923ff204..259479015aa 100644 --- a/source/blender/compositor/intern/COM_InputSocket.h +++ b/source/blender/compositor/intern/COM_InputSocket.h @@ -89,7 +89,7 @@ public: * @param resolution the result of this operation * @param preferredResolution the preferrable resolution as no resolution could be determined */ - void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]); + void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); /** * @brief Notifies the Input of the data type (via a SocketConnection) diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.h b/source/blender/compositor/intern/COM_MemoryBuffer.h index f64603ed5d9..5d0d9c97450 100644 --- a/source/blender/compositor/intern/COM_MemoryBuffer.h +++ b/source/blender/compositor/intern/COM_MemoryBuffer.h @@ -26,14 +26,12 @@ class MemoryBuffer; #define _COM_MemoryBuffer_h_ #include "COM_ExecutionGroup.h" -#include "BLI_rect.h" #include "COM_MemoryProxy.h" extern "C" { - //#include "BLI_threads.h" #include "BLI_math.h" + #include "BLI_rect.h" } -//#include /** * @brief state of a memory buffer @@ -147,6 +145,18 @@ public: const int dx = x - this->m_rect.xmin; const int dy = y - this->m_rect.ymin; const int offset = (this->m_chunkWidth * dy + dx) * COM_NUMBER_OF_CHANNELS; + + BLI_assert(offset >= 0); + BLI_assert(offset < this->determineBufferSize() * COM_NUMBER_OF_CHANNELS); + BLI_assert(x >= this->m_rect.xmin && x < this->m_rect.xmax && + y >= this->m_rect.ymin && y < this->m_rect.ymax); + +#if 0 + /* always true */ + BLI_assert((int)(MEM_allocN_len(this->m_buffer) / sizeof(*this->m_buffer)) == + (int)(this->determineBufferSize() * COM_NUMBER_OF_CHANNELS)); +#endif + copy_v4_v4(result, &this->m_buffer[offset]); } diff --git a/source/blender/compositor/intern/COM_NodeOperation.cpp b/source/blender/compositor/intern/COM_NodeOperation.cpp index 9baab584d9e..bae884d713e 100644 --- a/source/blender/compositor/intern/COM_NodeOperation.cpp +++ b/source/blender/compositor/intern/COM_NodeOperation.cpp @@ -38,7 +38,7 @@ NodeOperation::NodeOperation() : NodeBase() this->m_btree = NULL; } -void NodeOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) +void NodeOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) { unsigned int temp[2]; unsigned int temp2[2]; diff --git a/source/blender/compositor/intern/COM_NodeOperation.h b/source/blender/compositor/intern/COM_NodeOperation.h index a9cf281b02f..93a19529d34 100644 --- a/source/blender/compositor/intern/COM_NodeOperation.h +++ b/source/blender/compositor/intern/COM_NodeOperation.h @@ -96,7 +96,7 @@ public: * @param resolution the result of this operation * @param preferredResolution the preferrable resolution as no resolution could be determined */ - virtual void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]); + virtual void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); /** * @brief isOutputOperation determines whether this operation is an output of the ExecutionSystem during rendering or editing. @@ -174,7 +174,7 @@ public: * @brief set the resolution * @param resolution the resolution to set */ - void setResolution(unsigned int resolution[]) { + void setResolution(unsigned int resolution[2]) { if (!isResolutionSet()) { this->m_width = resolution[0]; this->m_height = resolution[1]; diff --git a/source/blender/compositor/intern/COM_OutputSocket.cpp b/source/blender/compositor/intern/COM_OutputSocket.cpp index 865ab0472e8..f23a48979da 100644 --- a/source/blender/compositor/intern/COM_OutputSocket.cpp +++ b/source/blender/compositor/intern/COM_OutputSocket.cpp @@ -33,7 +33,7 @@ OutputSocket::OutputSocket(DataType datatype) : Socket(datatype) int OutputSocket::isOutputSocket() const { return true; } const int OutputSocket::isConnected() const { return this->m_connections.size() != 0; } -void OutputSocket::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) +void OutputSocket::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) { NodeBase *node = this->getNode(); if (node->isOperation()) { diff --git a/source/blender/compositor/intern/COM_OutputSocket.h b/source/blender/compositor/intern/COM_OutputSocket.h index 4810e1ae065..dc5ca27cbda 100644 --- a/source/blender/compositor/intern/COM_OutputSocket.h +++ b/source/blender/compositor/intern/COM_OutputSocket.h @@ -59,7 +59,7 @@ public: * @param resolution the result of this operation * @param preferredResolution the preferrable resolution as no resolution could be determined */ - void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]); + void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); /** * @brief determine the actual data type and channel info. diff --git a/source/blender/compositor/intern/COM_SingleThreadedNodeOperation.cpp b/source/blender/compositor/intern/COM_SingleThreadedNodeOperation.cpp index d14b8c48c89..7d1184cb356 100644 --- a/source/blender/compositor/intern/COM_SingleThreadedNodeOperation.cpp +++ b/source/blender/compositor/intern/COM_SingleThreadedNodeOperation.cpp @@ -33,9 +33,9 @@ void SingleThreadedNodeOperation::initExecution() initMutex(); } -void SingleThreadedNodeOperation::executePixel(float *color, int x, int y, void *data) +void SingleThreadedNodeOperation::executePixel(float output[4], int x, int y, void *data) { - this->m_cachedInstance->readNoCheck(color, x, y); + this->m_cachedInstance->readNoCheck(output, x, y); } void SingleThreadedNodeOperation::deinitExecution() diff --git a/source/blender/compositor/intern/COM_SingleThreadedNodeOperation.h b/source/blender/compositor/intern/COM_SingleThreadedNodeOperation.h index 68951eab507..45325be18a9 100644 --- a/source/blender/compositor/intern/COM_SingleThreadedNodeOperation.h +++ b/source/blender/compositor/intern/COM_SingleThreadedNodeOperation.h @@ -39,7 +39,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); /** * Initialize the execution diff --git a/source/blender/compositor/intern/COM_Socket.h b/source/blender/compositor/intern/COM_Socket.h index 5607d2f4569..2aebe262594 100644 --- a/source/blender/compositor/intern/COM_Socket.h +++ b/source/blender/compositor/intern/COM_Socket.h @@ -73,7 +73,7 @@ public: const virtual int isConnected() const; int isInputSocket() const; int isOutputSocket() const; - virtual void determineResolution(int resolution[], unsigned int preferredResolution[]) {} + virtual void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) {} void setEditorSocket(bNodeSocket *editorSocket) { this->m_editorSocket = editorSocket; } bNodeSocket *getbNodeSocket() const { return this->m_editorSocket; } diff --git a/source/blender/compositor/intern/COM_SocketReader.h b/source/blender/compositor/intern/COM_SocketReader.h index 736dd2fc8b6..279ca8ebdb8 100644 --- a/source/blender/compositor/intern/COM_SocketReader.h +++ b/source/blender/compositor/intern/COM_SocketReader.h @@ -63,7 +63,7 @@ protected: * @param y the y-coordinate of the pixel to calculate in image space * @param inputBuffers chunks that can be read by their ReadBufferOperation. */ - virtual void executePixel(float *result, float x, float y, PixelSampler sampler) {} + virtual void executePixel(float output[4], float x, float y, PixelSampler sampler) {} /** * @brief calculate a single pixel @@ -74,8 +74,8 @@ protected: * @param inputBuffers chunks that can be read by their ReadBufferOperation. * @param chunkData chunk specific data a during execution time. */ - virtual void executePixel(float *result, int x, int y, void *chunkData) { - executePixel(result, x, y, COM_PS_NEAREST); + virtual void executePixel(float output[4], int x, int y, void *chunkData) { + executePixel(output, x, y, COM_PS_NEAREST); } /** @@ -88,7 +88,7 @@ protected: * @param dy * @param inputBuffers chunks that can be read by their ReadBufferOperation. */ - virtual void executePixel(float *result, float x, float y, float dx, float dy) {} + virtual void executePixel(float output[4], float x, float y, float dx, float dy) {} public: inline void read(float *result, float x, float y, PixelSampler sampler) { diff --git a/source/blender/compositor/nodes/COM_BokehBlurNode.cpp b/source/blender/compositor/nodes/COM_BokehBlurNode.cpp index f45572fe4ae..434fcf2a608 100644 --- a/source/blender/compositor/nodes/COM_BokehBlurNode.cpp +++ b/source/blender/compositor/nodes/COM_BokehBlurNode.cpp @@ -36,24 +36,42 @@ BokehBlurNode::BokehBlurNode(bNode *editorNode) : Node(editorNode) void BokehBlurNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context) { - BokehBlurOperation *operation = new BokehBlurOperation(); InputSocket *inputSizeSocket = this->getInputSocket(2); bool connectedSizeSocket = inputSizeSocket->isConnected(); - const bNodeSocket *sock = this->getInputSocket(2)->getbNodeSocket(); - const float size = ((const bNodeSocketValueFloat *)sock->default_value)->value; + if (connectedSizeSocket) { + VariableSizeBokehBlurOperation *operation = new VariableSizeBokehBlurOperation(); - this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph); - this->getInputSocket(1)->relinkConnections(operation->getInputSocket(1), 1, graph); - this->getInputSocket(2)->relinkConnections(operation->getInputSocket(3), 2, graph); - this->getInputSocket(3)->relinkConnections(operation->getInputSocket(2), 3, graph); - //operation->setSize(((bNodeSocketValueFloat *)this->getInputSocket(2)->getbNodeSocket()->default_value)->value); - operation->setQuality(context->getQuality()); - operation->setbNode(this->getbNode()); - graph->addOperation(operation); - this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket()); + this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph); + this->getInputSocket(1)->relinkConnections(operation->getInputSocket(1), 1, graph); + this->getInputSocket(2)->relinkConnections(operation->getInputSocket(2), 2, graph); + operation->setQuality(context->getQuality()); + operation->setbNode(this->getbNode()); + graph->addOperation(operation); + this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket()); + + operation->setThreshold(0.0f); + + /* TODO, we need to know the max input pixel of the input, this value is arbitrary! */ + operation->setMaxBlur(100.0f); + operation->setDoScaleSize(true); + } + else { + BokehBlurOperation *operation = new BokehBlurOperation(); + + const bNodeSocket *sock = this->getInputSocket(2)->getbNodeSocket(); + const float size = ((const bNodeSocketValueFloat *)sock->default_value)->value; + + this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph); + this->getInputSocket(1)->relinkConnections(operation->getInputSocket(1), 1, graph); + this->getInputSocket(2)->relinkConnections(operation->getInputSocket(3), 2, graph); + this->getInputSocket(3)->relinkConnections(operation->getInputSocket(2), 3, graph); + //operation->setSize(((bNodeSocketValueFloat *)this->getInputSocket(2)->getbNodeSocket()->default_value)->value); + operation->setQuality(context->getQuality()); + operation->setbNode(this->getbNode()); + graph->addOperation(operation); + this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket()); - if (!connectedSizeSocket) { operation->setSize(size); } } diff --git a/source/blender/compositor/operations/COM_AlphaOverKeyOperation.cpp b/source/blender/compositor/operations/COM_AlphaOverKeyOperation.cpp index 406a98f81e9..6cc9aae4553 100644 --- a/source/blender/compositor/operations/COM_AlphaOverKeyOperation.cpp +++ b/source/blender/compositor/operations/COM_AlphaOverKeyOperation.cpp @@ -27,7 +27,7 @@ AlphaOverKeyOperation::AlphaOverKeyOperation() : MixBaseOperation() /* pass */ } -void AlphaOverKeyOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void AlphaOverKeyOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor1[4]; float inputOverColor[4]; @@ -38,18 +38,18 @@ void AlphaOverKeyOperation::executePixel(float *outputValue, float x, float y, P this->m_inputColor2Operation->read(inputOverColor, x, y, sampler); if (inputOverColor[3] <= 0.0f) { - copy_v4_v4(outputValue, inputColor1); + copy_v4_v4(output, inputColor1); } else if (value[0] == 1.0f && inputOverColor[3] >= 1.0f) { - copy_v4_v4(outputValue, inputOverColor); + copy_v4_v4(output, inputOverColor); } else { float premul = value[0] * inputOverColor[3]; float mul = 1.0f - premul; - outputValue[0] = (mul * inputColor1[0]) + premul * inputOverColor[0]; - outputValue[1] = (mul * inputColor1[1]) + premul * inputOverColor[1]; - outputValue[2] = (mul * inputColor1[2]) + premul * inputOverColor[2]; - outputValue[3] = (mul * inputColor1[3]) + value[0] * inputOverColor[3]; + output[0] = (mul * inputColor1[0]) + premul * inputOverColor[0]; + output[1] = (mul * inputColor1[1]) + premul * inputOverColor[1]; + output[2] = (mul * inputColor1[2]) + premul * inputOverColor[2]; + output[3] = (mul * inputColor1[3]) + value[0] * inputOverColor[3]; } } diff --git a/source/blender/compositor/operations/COM_AlphaOverKeyOperation.h b/source/blender/compositor/operations/COM_AlphaOverKeyOperation.h index 5f430efb98e..fa884bacf49 100644 --- a/source/blender/compositor/operations/COM_AlphaOverKeyOperation.h +++ b/source/blender/compositor/operations/COM_AlphaOverKeyOperation.h @@ -39,6 +39,6 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/compositor/operations/COM_AlphaOverMixedOperation.cpp b/source/blender/compositor/operations/COM_AlphaOverMixedOperation.cpp index b94486b5b4f..111dc899e1d 100644 --- a/source/blender/compositor/operations/COM_AlphaOverMixedOperation.cpp +++ b/source/blender/compositor/operations/COM_AlphaOverMixedOperation.cpp @@ -27,7 +27,7 @@ AlphaOverMixedOperation::AlphaOverMixedOperation() : MixBaseOperation() this->m_x = 0.0f; } -void AlphaOverMixedOperation::executePixel(float outputValue[4], float x, float y, PixelSampler sampler) +void AlphaOverMixedOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor1[4]; float inputOverColor[4]; @@ -38,20 +38,20 @@ void AlphaOverMixedOperation::executePixel(float outputValue[4], float x, float this->m_inputColor2Operation->read(inputOverColor, x, y, sampler); if (inputOverColor[3] <= 0.0f) { - copy_v4_v4(outputValue, inputColor1); + copy_v4_v4(output, inputColor1); } else if (value[0] == 1.0f && inputOverColor[3] >= 1.0f) { - copy_v4_v4(outputValue, inputOverColor); + copy_v4_v4(output, inputOverColor); } else { float addfac = 1.0f - this->m_x + inputOverColor[3] * this->m_x; float premul = value[0] * addfac; float mul = 1.0f - value[0] * inputOverColor[3]; - outputValue[0] = (mul * inputColor1[0]) + premul * inputOverColor[0]; - outputValue[1] = (mul * inputColor1[1]) + premul * inputOverColor[1]; - outputValue[2] = (mul * inputColor1[2]) + premul * inputOverColor[2]; - outputValue[3] = (mul * inputColor1[3]) + value[0] * inputOverColor[3]; + output[0] = (mul * inputColor1[0]) + premul * inputOverColor[0]; + output[1] = (mul * inputColor1[1]) + premul * inputOverColor[1]; + output[2] = (mul * inputColor1[2]) + premul * inputOverColor[2]; + output[3] = (mul * inputColor1[3]) + value[0] * inputOverColor[3]; } } diff --git a/source/blender/compositor/operations/COM_AlphaOverMixedOperation.h b/source/blender/compositor/operations/COM_AlphaOverMixedOperation.h index 308f139884d..91128454783 100644 --- a/source/blender/compositor/operations/COM_AlphaOverMixedOperation.h +++ b/source/blender/compositor/operations/COM_AlphaOverMixedOperation.h @@ -41,7 +41,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); void setX(float x) { this->m_x = x; } }; diff --git a/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.cpp b/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.cpp index dad43f3b179..ac7906f2f98 100644 --- a/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.cpp +++ b/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.cpp @@ -27,7 +27,7 @@ AlphaOverPremultiplyOperation::AlphaOverPremultiplyOperation() : MixBaseOperatio /* pass */ } -void AlphaOverPremultiplyOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void AlphaOverPremultiplyOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor1[4]; float inputOverColor[4]; @@ -39,18 +39,18 @@ void AlphaOverPremultiplyOperation::executePixel(float *outputValue, float x, fl /* Zero alpha values should still permit an add of RGB data */ if (inputOverColor[3] < 0.0f) { - copy_v4_v4(outputValue, inputColor1); + copy_v4_v4(output, inputColor1); } else if (value[0] == 1.0f && inputOverColor[3] >= 1.0f) { - copy_v4_v4(outputValue, inputOverColor); + copy_v4_v4(output, inputOverColor); } else { float mul = 1.0f - value[0] * inputOverColor[3]; - outputValue[0] = (mul * inputColor1[0]) + value[0] * inputOverColor[0]; - outputValue[1] = (mul * inputColor1[1]) + value[0] * inputOverColor[1]; - outputValue[2] = (mul * inputColor1[2]) + value[0] * inputOverColor[2]; - outputValue[3] = (mul * inputColor1[3]) + value[0] * inputOverColor[3]; + output[0] = (mul * inputColor1[0]) + value[0] * inputOverColor[0]; + output[1] = (mul * inputColor1[1]) + value[0] * inputOverColor[1]; + output[2] = (mul * inputColor1[2]) + value[0] * inputOverColor[2]; + output[3] = (mul * inputColor1[3]) + value[0] * inputOverColor[3]; } } diff --git a/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.h b/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.h index 37ddc6dcda5..d6e9e31c35f 100644 --- a/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.h +++ b/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.h @@ -39,7 +39,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/compositor/operations/COM_AntiAliasOperation.cpp b/source/blender/compositor/operations/COM_AntiAliasOperation.cpp index 27ba2ef51f6..12bf651992e 100644 --- a/source/blender/compositor/operations/COM_AntiAliasOperation.cpp +++ b/source/blender/compositor/operations/COM_AntiAliasOperation.cpp @@ -42,14 +42,14 @@ void AntiAliasOperation::initExecution() NodeOperation::initMutex(); } -void AntiAliasOperation::executePixel(float *color, int x, int y, void *data) +void AntiAliasOperation::executePixel(float output[4], int x, int y, void *data) { if (y < 0 || (unsigned int)y >= this->m_height || x < 0 || (unsigned int)x >= this->m_width) { - color[0] = 0.0f; + output[0] = 0.0f; } else { int offset = y * this->m_width + x; - color[0] = this->m_buffer[offset] / 255.0f; + output[0] = this->m_buffer[offset] / 255.0f; } } diff --git a/source/blender/compositor/operations/COM_AntiAliasOperation.h b/source/blender/compositor/operations/COM_AntiAliasOperation.h index 7489d2e393a..385d59fec3c 100644 --- a/source/blender/compositor/operations/COM_AntiAliasOperation.h +++ b/source/blender/compositor/operations/COM_AntiAliasOperation.h @@ -43,7 +43,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_BilateralBlurOperation.cpp b/source/blender/compositor/operations/COM_BilateralBlurOperation.cpp index 1db3ecb2db8..5f5eca96378 100644 --- a/source/blender/compositor/operations/COM_BilateralBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_BilateralBlurOperation.cpp @@ -46,7 +46,7 @@ void BilateralBlurOperation::initExecution() QualityStepHelper::initExecution(COM_QH_INCREASE); } -void BilateralBlurOperation::executePixel(float *color, int x, int y, void *data) +void BilateralBlurOperation::executePixel(float output[4], int x, int y, void *data) { // read the determinator color at x, y, this will be used as the reference color for the determinator float determinatorReferenceColor[4]; @@ -82,13 +82,13 @@ void BilateralBlurOperation::executePixel(float *color, int x, int y, void *data } if (blurDivider > 0.0f) { - mul_v4_v4fl(color, blurColor, 1.0f / blurDivider); + mul_v4_v4fl(output, blurColor, 1.0f / blurDivider); } else { - color[0] = 0.0f; - color[1] = 0.0f; - color[2] = 0.0f; - color[3] = 1.0f; + output[0] = 0.0f; + output[1] = 0.0f; + output[2] = 0.0f; + output[3] = 1.0f; } } diff --git a/source/blender/compositor/operations/COM_BilateralBlurOperation.h b/source/blender/compositor/operations/COM_BilateralBlurOperation.h index c1b5f764f01..8def90941ab 100644 --- a/source/blender/compositor/operations/COM_BilateralBlurOperation.h +++ b/source/blender/compositor/operations/COM_BilateralBlurOperation.h @@ -38,7 +38,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_BokehBlurOperation.cpp b/source/blender/compositor/operations/COM_BokehBlurOperation.cpp index 7d126eb0539..b31974487ed 100644 --- a/source/blender/compositor/operations/COM_BokehBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_BokehBlurOperation.cpp @@ -74,7 +74,7 @@ void BokehBlurOperation::initExecution() QualityStepHelper::initExecution(COM_QH_INCREASE); } -void BokehBlurOperation::executePixel(float *color, int x, int y, void *data) +void BokehBlurOperation::executePixel(float output[4], int x, int y, void *data) { float color_accum[4]; float tempBoundingBox[4]; @@ -124,13 +124,13 @@ void BokehBlurOperation::executePixel(float *color, int x, int y, void *data) bufferindex += offsetadd; } } - color[0] = color_accum[0] * (1.0f / multiplier_accum[0]); - color[1] = color_accum[1] * (1.0f / multiplier_accum[1]); - color[2] = color_accum[2] * (1.0f / multiplier_accum[2]); - color[3] = color_accum[3] * (1.0f / multiplier_accum[3]); + output[0] = color_accum[0] * (1.0f / multiplier_accum[0]); + output[1] = color_accum[1] * (1.0f / multiplier_accum[1]); + output[2] = color_accum[2] * (1.0f / multiplier_accum[2]); + output[3] = color_accum[3] * (1.0f / multiplier_accum[3]); } else { - this->m_inputProgram->read(color, x, y, COM_PS_NEAREST); + this->m_inputProgram->read(output, x, y, COM_PS_NEAREST); } } diff --git a/source/blender/compositor/operations/COM_BokehBlurOperation.h b/source/blender/compositor/operations/COM_BokehBlurOperation.h index 646587197a9..37483d3dc69 100644 --- a/source/blender/compositor/operations/COM_BokehBlurOperation.h +++ b/source/blender/compositor/operations/COM_BokehBlurOperation.h @@ -43,7 +43,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_BokehImageOperation.cpp b/source/blender/compositor/operations/COM_BokehImageOperation.cpp index d7de201e9df..b87be33eca1 100644 --- a/source/blender/compositor/operations/COM_BokehImageOperation.cpp +++ b/source/blender/compositor/operations/COM_BokehImageOperation.cpp @@ -30,10 +30,8 @@ BokehImageOperation::BokehImageOperation() : NodeOperation() } void BokehImageOperation::initExecution() { - this->m_centerX = getWidth() / 2; - this->m_centerY = getHeight() / 2; - this->m_center[0] = this->m_centerX; - this->m_center[1] = this->m_centerY; + this->m_center[0] = getWidth() / 2; + this->m_center[1] = getHeight() / 2; this->m_inverseRounding = 1.0f - this->m_data->rounding; this->m_circularDistance = getWidth() / 2; this->m_flapRad = (float)(M_PI * 2) / this->m_data->flaps; @@ -47,14 +45,14 @@ void BokehImageOperation::initExecution() } void BokehImageOperation::detemineStartPointOfFlap(float r[2], int flapNumber, float distance) { - r[0] = sinf(this->m_flapRad * flapNumber + this->m_flapRadAdd) * distance + this->m_centerX; - r[1] = cosf(this->m_flapRad * flapNumber + this->m_flapRadAdd) * distance + this->m_centerY; + r[0] = sinf(this->m_flapRad * flapNumber + this->m_flapRadAdd) * distance + this->m_center[0]; + r[1] = cosf(this->m_flapRad * flapNumber + this->m_flapRadAdd) * distance + this->m_center[1]; } float BokehImageOperation::isInsideBokeh(float distance, float x, float y) { float insideBokeh = 0.0f; - const float deltaX = x - this->m_centerX; - const float deltaY = y - this->m_centerY; + const float deltaX = x - this->m_center[0]; + const float deltaY = y - this->m_center[1]; float closestPoint[2]; float lineP1[2]; float lineP2[2]; @@ -87,7 +85,7 @@ float BokehImageOperation::isInsideBokeh(float distance, float x, float y) } return insideBokeh; } -void BokehImageOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void BokehImageOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float shift = this->m_data->lensshift; float shift2 = shift / 2.0f; @@ -96,16 +94,16 @@ void BokehImageOperation::executePixel(float *color, float x, float y, PixelSamp float insideBokehMed = isInsideBokeh(distance - fabsf(shift2 * distance), x, y); float insideBokehMin = isInsideBokeh(distance - fabsf(shift * distance), x, y); if (shift < 0) { - color[0] = insideBokehMax; - color[1] = insideBokehMed; - color[2] = insideBokehMin; + output[0] = insideBokehMax; + output[1] = insideBokehMed; + output[2] = insideBokehMin; } else { - color[0] = insideBokehMin; - color[1] = insideBokehMed; - color[2] = insideBokehMax; + output[0] = insideBokehMin; + output[1] = insideBokehMed; + output[2] = insideBokehMax; } - color[3] = (insideBokehMax + insideBokehMed + insideBokehMin) / 3.0f; + output[3] = (insideBokehMax + insideBokehMed + insideBokehMin) / 3.0f; } void BokehImageOperation::deinitExecution() @@ -118,8 +116,8 @@ void BokehImageOperation::deinitExecution() } } -void BokehImageOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) +void BokehImageOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) { - resolution[0] = 512; - resolution[1] = 512; + resolution[0] = COM_BLUR_BOKEH_PIXELS; + resolution[1] = COM_BLUR_BOKEH_PIXELS; } diff --git a/source/blender/compositor/operations/COM_BokehImageOperation.h b/source/blender/compositor/operations/COM_BokehImageOperation.h index a797d0fca53..fe86e162eb2 100644 --- a/source/blender/compositor/operations/COM_BokehImageOperation.h +++ b/source/blender/compositor/operations/COM_BokehImageOperation.h @@ -30,8 +30,6 @@ private: NodeBokehImage *m_data; float m_center[2]; - float m_centerX; - float m_centerY; float m_inverseRounding; float m_circularDistance; float m_flapRad; @@ -47,7 +45,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution @@ -59,7 +57,7 @@ public: */ void deinitExecution(); - void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]); + void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); void setData(NodeBokehImage *data) { this->m_data = data; } void deleteDataOnFinish() { this->m_deleteData = true; } diff --git a/source/blender/compositor/operations/COM_BoxMaskOperation.cpp b/source/blender/compositor/operations/COM_BoxMaskOperation.cpp index a0fb37f4310..52f84462761 100644 --- a/source/blender/compositor/operations/COM_BoxMaskOperation.cpp +++ b/source/blender/compositor/operations/COM_BoxMaskOperation.cpp @@ -44,7 +44,7 @@ void BoxMaskOperation::initExecution() this->m_aspectRatio = ((float)this->getWidth()) / this->getHeight(); } -void BoxMaskOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void BoxMaskOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputMask[4]; float inputValue[4]; @@ -70,40 +70,40 @@ void BoxMaskOperation::executePixel(float *color, float x, float y, PixelSampler switch (this->m_maskType) { case CMP_NODE_MASKTYPE_ADD: if (inside) { - color[0] = max(inputMask[0], inputValue[0]); + output[0] = max(inputMask[0], inputValue[0]); } else { - color[0] = inputMask[0]; + output[0] = inputMask[0]; } break; case CMP_NODE_MASKTYPE_SUBTRACT: if (inside) { - color[0] = inputMask[0] - inputValue[0]; - CLAMP(color[0], 0, 1); + output[0] = inputMask[0] - inputValue[0]; + CLAMP(output[0], 0, 1); } else { - color[0] = inputMask[0]; + output[0] = inputMask[0]; } break; case CMP_NODE_MASKTYPE_MULTIPLY: if (inside) { - color[0] = inputMask[0] * inputValue[0]; + output[0] = inputMask[0] * inputValue[0]; } else { - color[0] = 0; + output[0] = 0; } break; case CMP_NODE_MASKTYPE_NOT: if (inside) { if (inputMask[0] > 0.0f) { - color[0] = 0; + output[0] = 0; } else { - color[0] = inputValue[0]; + output[0] = inputValue[0]; } } else { - color[0] = inputMask[0]; + output[0] = inputMask[0]; } break; } diff --git a/source/blender/compositor/operations/COM_BoxMaskOperation.h b/source/blender/compositor/operations/COM_BoxMaskOperation.h index 5a6745d9a9b..f39d74829d4 100644 --- a/source/blender/compositor/operations/COM_BoxMaskOperation.h +++ b/source/blender/compositor/operations/COM_BoxMaskOperation.h @@ -45,7 +45,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_BrightnessOperation.cpp b/source/blender/compositor/operations/COM_BrightnessOperation.cpp index 9a6a930c7c9..0613540250c 100644 --- a/source/blender/compositor/operations/COM_BrightnessOperation.cpp +++ b/source/blender/compositor/operations/COM_BrightnessOperation.cpp @@ -37,7 +37,7 @@ void BrightnessOperation::initExecution() this->m_inputContrastProgram = this->getInputSocketReader(2); } -void BrightnessOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void BrightnessOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputValue[4]; float a, b; @@ -65,10 +65,10 @@ void BrightnessOperation::executePixel(float *color, float x, float y, PixelSamp b = a * (brightness + delta); } - color[0] = a * inputValue[0] + b; - color[1] = a * inputValue[1] + b; - color[2] = a * inputValue[2] + b; - color[3] = inputValue[3]; + output[0] = a * inputValue[0] + b; + output[1] = a * inputValue[1] + b; + output[2] = a * inputValue[2] + b; + output[3] = inputValue[3]; } void BrightnessOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_BrightnessOperation.h b/source/blender/compositor/operations/COM_BrightnessOperation.h index 2a6200ad9df..1c8eda63e94 100644 --- a/source/blender/compositor/operations/COM_BrightnessOperation.h +++ b/source/blender/compositor/operations/COM_BrightnessOperation.h @@ -40,7 +40,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_CalculateMeanOperation.cpp b/source/blender/compositor/operations/COM_CalculateMeanOperation.cpp index b0cfdb44736..a2954a20e90 100644 --- a/source/blender/compositor/operations/COM_CalculateMeanOperation.cpp +++ b/source/blender/compositor/operations/COM_CalculateMeanOperation.cpp @@ -42,9 +42,9 @@ void CalculateMeanOperation::initExecution() NodeOperation::initMutex(); } -void CalculateMeanOperation::executePixel(float *color, int x, int y, void *data) +void CalculateMeanOperation::executePixel(float output[4], int x, int y, void *data) { - color[0] = this->m_result; + output[0] = this->m_result; } void CalculateMeanOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_CalculateMeanOperation.h b/source/blender/compositor/operations/COM_CalculateMeanOperation.h index 09727533306..53edea4977e 100644 --- a/source/blender/compositor/operations/COM_CalculateMeanOperation.h +++ b/source/blender/compositor/operations/COM_CalculateMeanOperation.h @@ -46,7 +46,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.cpp b/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.cpp index de602ba1dd6..e8268adff7a 100644 --- a/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.cpp +++ b/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.cpp @@ -31,9 +31,9 @@ CalculateStandardDeviationOperation::CalculateStandardDeviationOperation() : Cal /* pass */ } -void CalculateStandardDeviationOperation::executePixel(float *color, int x, int y, void *data) +void CalculateStandardDeviationOperation::executePixel(float output[4], int x, int y, void *data) { - color[0] = this->m_standardDeviation; + output[0] = this->m_standardDeviation; } void *CalculateStandardDeviationOperation::initializeTileData(rcti *rect) diff --git a/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.h b/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.h index 311cedd7d32..92c4b7fa4a0 100644 --- a/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.h +++ b/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.h @@ -39,7 +39,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); void *initializeTileData(rcti *rect); diff --git a/source/blender/compositor/operations/COM_ChangeHSVOperation.cpp b/source/blender/compositor/operations/COM_ChangeHSVOperation.cpp index 7a6a22e5c05..e6e93774685 100644 --- a/source/blender/compositor/operations/COM_ChangeHSVOperation.cpp +++ b/source/blender/compositor/operations/COM_ChangeHSVOperation.cpp @@ -39,17 +39,17 @@ void ChangeHSVOperation::deinitExecution() this->m_inputOperation = NULL; } -void ChangeHSVOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void ChangeHSVOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor1[4]; this->m_inputOperation->read(inputColor1, x, y, sampler); - outputValue[0] = inputColor1[0] + (this->m_hue - 0.5f); - if (outputValue[0] > 1.0f) outputValue[0] -= 1.0f; - else if (outputValue[0] < 0.0f) outputValue[0] += 1.0f; - outputValue[1] = inputColor1[1] * this->m_saturation; - outputValue[2] = inputColor1[2] * this->m_value; - outputValue[3] = inputColor1[3]; + output[0] = inputColor1[0] + (this->m_hue - 0.5f); + if (output[0] > 1.0f) output[0] -= 1.0f; + else if (output[0] < 0.0f) output[0] += 1.0f; + output[1] = inputColor1[1] * this->m_saturation; + output[2] = inputColor1[2] * this->m_value; + output[3] = inputColor1[3]; } diff --git a/source/blender/compositor/operations/COM_ChangeHSVOperation.h b/source/blender/compositor/operations/COM_ChangeHSVOperation.h index e5660e44f73..57e5dc991e9 100644 --- a/source/blender/compositor/operations/COM_ChangeHSVOperation.h +++ b/source/blender/compositor/operations/COM_ChangeHSVOperation.h @@ -49,7 +49,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); void setHue(float hue) { this->m_hue = hue; } void setSaturation(float saturation) { this->m_saturation = saturation; } diff --git a/source/blender/compositor/operations/COM_ChannelMatteOperation.cpp b/source/blender/compositor/operations/COM_ChannelMatteOperation.cpp index e0e68f90289..234a1c7b1e5 100644 --- a/source/blender/compositor/operations/COM_ChannelMatteOperation.cpp +++ b/source/blender/compositor/operations/COM_ChannelMatteOperation.cpp @@ -83,7 +83,7 @@ void ChannelMatteOperation::deinitExecution() this->m_inputImageProgram = NULL; } -void ChannelMatteOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void ChannelMatteOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inColor[4]; float alpha; @@ -116,6 +116,6 @@ void ChannelMatteOperation::executePixel(float *outputValue, float x, float y, P */ /* don't make something that was more transparent less transparent */ - outputValue[0] = min(alpha, inColor[3]); + output[0] = min(alpha, inColor[3]); } diff --git a/source/blender/compositor/operations/COM_ChannelMatteOperation.h b/source/blender/compositor/operations/COM_ChannelMatteOperation.h index a02d0618a4c..17f84965f63 100644 --- a/source/blender/compositor/operations/COM_ChannelMatteOperation.h +++ b/source/blender/compositor/operations/COM_ChannelMatteOperation.h @@ -59,7 +59,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); void initExecution(); void deinitExecution(); diff --git a/source/blender/compositor/operations/COM_ChromaMatteOperation.cpp b/source/blender/compositor/operations/COM_ChromaMatteOperation.cpp index 4be03e9d914..c2406abaa65 100644 --- a/source/blender/compositor/operations/COM_ChromaMatteOperation.cpp +++ b/source/blender/compositor/operations/COM_ChromaMatteOperation.cpp @@ -44,7 +44,7 @@ void ChromaMatteOperation::deinitExecution() this->m_inputKeyProgram = NULL; } -void ChromaMatteOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void ChromaMatteOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inKey[4]; float inImage[4]; @@ -88,14 +88,14 @@ void ChromaMatteOperation::executePixel(float *outputValue, float x, float y, Pi /* don't make something that was more transparent less transparent */ if (alpha < inImage[3]) { - outputValue[0] = alpha; + output[0] = alpha; } else { - outputValue[0] = inImage[3]; + output[0] = inImage[3]; } } else { /*pixel is outside key color */ - outputValue[0] = inImage[3]; /* make pixel just as transparent as it was before */ + output[0] = inImage[3]; /* make pixel just as transparent as it was before */ } } diff --git a/source/blender/compositor/operations/COM_ChromaMatteOperation.h b/source/blender/compositor/operations/COM_ChromaMatteOperation.h index 37b58fa45ed..adebb7a30c2 100644 --- a/source/blender/compositor/operations/COM_ChromaMatteOperation.h +++ b/source/blender/compositor/operations/COM_ChromaMatteOperation.h @@ -42,7 +42,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); void initExecution(); void deinitExecution(); diff --git a/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cpp b/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cpp index 33e6db22ef4..dfbbef8c56e 100644 --- a/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cpp +++ b/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cpp @@ -49,7 +49,7 @@ void ColorBalanceASCCDLOperation::initExecution() this->m_inputColorOperation = this->getInputSocketReader(1); } -void ColorBalanceASCCDLOperation::executePixel(float *outputColor, float x, float y, PixelSampler sampler) +void ColorBalanceASCCDLOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor[4]; float value[4]; @@ -61,10 +61,10 @@ void ColorBalanceASCCDLOperation::executePixel(float *outputColor, float x, floa fac = min(1.0f, fac); const float mfac = 1.0f - fac; - outputColor[0] = mfac * inputColor[0] + fac *colorbalance_cdl(inputColor[0], this->m_lift[0], this->m_gamma[0], this->m_gain[0]); - outputColor[1] = mfac * inputColor[1] + fac *colorbalance_cdl(inputColor[1], this->m_lift[1], this->m_gamma[1], this->m_gain[1]); - outputColor[2] = mfac * inputColor[2] + fac *colorbalance_cdl(inputColor[2], this->m_lift[2], this->m_gamma[2], this->m_gain[2]); - outputColor[3] = inputColor[3]; + output[0] = mfac * inputColor[0] + fac *colorbalance_cdl(inputColor[0], this->m_lift[0], this->m_gamma[0], this->m_gain[0]); + output[1] = mfac * inputColor[1] + fac *colorbalance_cdl(inputColor[1], this->m_lift[1], this->m_gamma[1], this->m_gain[1]); + output[2] = mfac * inputColor[2] + fac *colorbalance_cdl(inputColor[2], this->m_lift[2], this->m_gamma[2], this->m_gain[2]); + output[3] = inputColor[3]; } diff --git a/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.h b/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.h index d6361ea16ba..17fb5f67be9 100644 --- a/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.h +++ b/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.h @@ -49,7 +49,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.cpp b/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.cpp index b0691925361..7e9c10df0a9 100644 --- a/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.cpp +++ b/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.cpp @@ -54,7 +54,7 @@ void ColorBalanceLGGOperation::initExecution() this->m_inputColorOperation = this->getInputSocketReader(1); } -void ColorBalanceLGGOperation::executePixel(float *outputColor, float x, float y, PixelSampler sampler) +void ColorBalanceLGGOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor[4]; float value[4]; @@ -66,10 +66,10 @@ void ColorBalanceLGGOperation::executePixel(float *outputColor, float x, float y fac = min(1.0f, fac); const float mfac = 1.0f - fac; - outputColor[0] = mfac * inputColor[0] + fac *colorbalance_lgg(inputColor[0], this->m_lift[0], this->m_gamma_inv[0], this->m_gain[0]); - outputColor[1] = mfac * inputColor[1] + fac *colorbalance_lgg(inputColor[1], this->m_lift[1], this->m_gamma_inv[1], this->m_gain[1]); - outputColor[2] = mfac * inputColor[2] + fac *colorbalance_lgg(inputColor[2], this->m_lift[2], this->m_gamma_inv[2], this->m_gain[2]); - outputColor[3] = inputColor[3]; + output[0] = mfac * inputColor[0] + fac * colorbalance_lgg(inputColor[0], this->m_lift[0], this->m_gamma_inv[0], this->m_gain[0]); + output[1] = mfac * inputColor[1] + fac * colorbalance_lgg(inputColor[1], this->m_lift[1], this->m_gamma_inv[1], this->m_gain[1]); + output[2] = mfac * inputColor[2] + fac * colorbalance_lgg(inputColor[2], this->m_lift[2], this->m_gamma_inv[2], this->m_gain[2]); + output[3] = inputColor[3]; } diff --git a/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.h b/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.h index c3d44c53e53..edc824475c2 100644 --- a/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.h +++ b/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.h @@ -50,7 +50,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_ColorCorrectionOperation.cpp b/source/blender/compositor/operations/COM_ColorCorrectionOperation.cpp index ebc818b0f7e..b7a3f43237a 100644 --- a/source/blender/compositor/operations/COM_ColorCorrectionOperation.cpp +++ b/source/blender/compositor/operations/COM_ColorCorrectionOperation.cpp @@ -40,7 +40,7 @@ void ColorCorrectionOperation::initExecution() this->m_inputMask = this->getInputSocketReader(1); } -void ColorCorrectionOperation::executePixel(float *output, float x, float y, PixelSampler sampler) +void ColorCorrectionOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputImageColor[4]; float inputMask[4]; diff --git a/source/blender/compositor/operations/COM_ColorCorrectionOperation.h b/source/blender/compositor/operations/COM_ColorCorrectionOperation.h index 685413741fa..018e67b7ada 100644 --- a/source/blender/compositor/operations/COM_ColorCorrectionOperation.h +++ b/source/blender/compositor/operations/COM_ColorCorrectionOperation.h @@ -44,7 +44,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_ColorCurveOperation.cpp b/source/blender/compositor/operations/COM_ColorCurveOperation.cpp index 88bd673a19f..44784837301 100644 --- a/source/blender/compositor/operations/COM_ColorCurveOperation.cpp +++ b/source/blender/compositor/operations/COM_ColorCurveOperation.cpp @@ -58,7 +58,7 @@ void ColorCurveOperation::initExecution() } -void ColorCurveOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void ColorCurveOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { CurveMapping *cumap = this->m_curveMapping; CurveMapping *workingCopy = (CurveMapping *)MEM_dupallocN(cumap); @@ -77,18 +77,18 @@ void ColorCurveOperation::executePixel(float *color, float x, float y, PixelSamp this->m_inputImageProgram->read(image, x, y, sampler); if (*fac >= 1.0f) - curvemapping_evaluate_premulRGBF(workingCopy, color, image); + curvemapping_evaluate_premulRGBF(workingCopy, output, image); else if (*fac <= 0.0f) { - copy_v3_v3(color, image); + copy_v3_v3(output, image); } else { float col[4], mfac = 1.0f - *fac; curvemapping_evaluate_premulRGBF(workingCopy, col, image); - color[0] = mfac * image[0] + *fac * col[0]; - color[1] = mfac * image[1] + *fac * col[1]; - color[2] = mfac * image[2] + *fac * col[2]; + output[0] = mfac * image[0] + *fac * col[0]; + output[1] = mfac * image[1] + *fac * col[1]; + output[2] = mfac * image[2] + *fac * col[2]; } - color[3] = image[3]; + output[3] = image[3]; MEM_freeN(workingCopy); } @@ -126,7 +126,7 @@ void ConstantLevelColorCurveOperation::initExecution() curvemapping_set_black_white(this->m_curveMapping, this->m_black, this->m_white); } -void ConstantLevelColorCurveOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void ConstantLevelColorCurveOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float fac[4]; float image[4]; @@ -136,18 +136,18 @@ void ConstantLevelColorCurveOperation::executePixel(float *color, float x, float this->m_inputImageProgram->read(image, x, y, sampler); if (*fac >= 1.0f) - curvemapping_evaluate_premulRGBF(this->m_curveMapping, color, image); + curvemapping_evaluate_premulRGBF(this->m_curveMapping, output, image); else if (*fac <= 0.0f) { - copy_v3_v3(color, image); + copy_v3_v3(output, image); } else { float col[4], mfac = 1.0f - *fac; curvemapping_evaluate_premulRGBF(this->m_curveMapping, col, image); - color[0] = mfac * image[0] + *fac * col[0]; - color[1] = mfac * image[1] + *fac * col[1]; - color[2] = mfac * image[2] + *fac * col[2]; + output[0] = mfac * image[0] + *fac * col[0]; + output[1] = mfac * image[1] + *fac * col[1]; + output[2] = mfac * image[2] + *fac * col[2]; } - color[3] = image[3]; + output[3] = image[3]; } void ConstantLevelColorCurveOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_ColorCurveOperation.h b/source/blender/compositor/operations/COM_ColorCurveOperation.h index beb2e16298a..063873c6443 100644 --- a/source/blender/compositor/operations/COM_ColorCurveOperation.h +++ b/source/blender/compositor/operations/COM_ColorCurveOperation.h @@ -41,7 +41,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution @@ -70,7 +70,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_ColorMatteOperation.cpp b/source/blender/compositor/operations/COM_ColorMatteOperation.cpp index 26fbd99b43a..d73196e42f5 100644 --- a/source/blender/compositor/operations/COM_ColorMatteOperation.cpp +++ b/source/blender/compositor/operations/COM_ColorMatteOperation.cpp @@ -44,7 +44,7 @@ void ColorMatteOperation::deinitExecution() this->m_inputKeyProgram = NULL; } -void ColorMatteOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void ColorMatteOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inColor[4]; float inKey[4]; @@ -75,11 +75,11 @@ 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 */ + output[0] = 0.0f; /* make transparent */ } else { /*pixel is outside key color */ - outputValue[0] = inColor[3]; /* make pixel just as transparent as it was before */ + output[0] = inColor[3]; /* make pixel just as transparent as it was before */ } } diff --git a/source/blender/compositor/operations/COM_ColorMatteOperation.h b/source/blender/compositor/operations/COM_ColorMatteOperation.h index de7c4dd8ce2..582a94e1873 100644 --- a/source/blender/compositor/operations/COM_ColorMatteOperation.h +++ b/source/blender/compositor/operations/COM_ColorMatteOperation.h @@ -42,7 +42,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); void initExecution(); void deinitExecution(); diff --git a/source/blender/compositor/operations/COM_ColorRampOperation.cpp b/source/blender/compositor/operations/COM_ColorRampOperation.cpp index edd7df89c81..1618c83aece 100644 --- a/source/blender/compositor/operations/COM_ColorRampOperation.cpp +++ b/source/blender/compositor/operations/COM_ColorRampOperation.cpp @@ -43,12 +43,12 @@ void ColorRampOperation::initExecution() this->m_inputProgram = this->getInputSocketReader(0); } -void ColorRampOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void ColorRampOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float values[4]; this->m_inputProgram->read(values, x, y, sampler); - do_colorband(this->m_colorBand, values[0], color); + do_colorband(this->m_colorBand, values[0], output); } void ColorRampOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_ColorRampOperation.h b/source/blender/compositor/operations/COM_ColorRampOperation.h index c5f3fe449de..96d9a525e1e 100644 --- a/source/blender/compositor/operations/COM_ColorRampOperation.h +++ b/source/blender/compositor/operations/COM_ColorRampOperation.h @@ -38,7 +38,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_ColorSpillOperation.cpp b/source/blender/compositor/operations/COM_ColorSpillOperation.cpp index 2c0bfc10bb0..152b10709fb 100644 --- a/source/blender/compositor/operations/COM_ColorSpillOperation.cpp +++ b/source/blender/compositor/operations/COM_ColorSpillOperation.cpp @@ -84,7 +84,7 @@ void ColorSpillOperation::deinitExecution() this->m_inputFacReader = NULL; } -void ColorSpillOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void ColorSpillOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float fac[4]; float input[4]; @@ -93,13 +93,13 @@ void ColorSpillOperation::executePixel(float *outputValue, float x, float y, Pix float rfac = min(1.0f, fac[0]); float map = calculateMapValue(rfac, input); if (map > 0.0f) { - outputValue[0] = input[0] + this->m_rmut * (this->m_settings->uspillr * map); - outputValue[1] = input[1] + this->m_gmut * (this->m_settings->uspillg * map); - outputValue[2] = input[2] + this->m_bmut * (this->m_settings->uspillb * map); - outputValue[3] = input[3]; + output[0] = input[0] + this->m_rmut * (this->m_settings->uspillr * map); + output[1] = input[1] + this->m_gmut * (this->m_settings->uspillg * map); + output[2] = input[2] + this->m_bmut * (this->m_settings->uspillb * map); + output[3] = input[3]; } else { - copy_v4_v4(outputValue, input); + copy_v4_v4(output, input); } } float ColorSpillOperation::calculateMapValue(float fac, float *input) diff --git a/source/blender/compositor/operations/COM_ColorSpillOperation.h b/source/blender/compositor/operations/COM_ColorSpillOperation.h index ea443f2a5a1..94ff78c37b2 100644 --- a/source/blender/compositor/operations/COM_ColorSpillOperation.h +++ b/source/blender/compositor/operations/COM_ColorSpillOperation.h @@ -46,7 +46,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); void initExecution(); void deinitExecution(); diff --git a/source/blender/compositor/operations/COM_CombineChannelsOperation.cpp b/source/blender/compositor/operations/COM_CombineChannelsOperation.cpp index 354fe51c068..ded686bb5de 100644 --- a/source/blender/compositor/operations/COM_CombineChannelsOperation.cpp +++ b/source/blender/compositor/operations/COM_CombineChannelsOperation.cpp @@ -79,24 +79,24 @@ void CombineChannelsOperation::deinitExecution() } -void CombineChannelsOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void CombineChannelsOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float input[4]; /// @todo: remove if statements if (this->m_inputChannel1Operation) { this->m_inputChannel1Operation->read(input, x, y, sampler); - color[0] = input[0]; + output[0] = input[0]; } if (this->m_inputChannel2Operation) { this->m_inputChannel2Operation->read(input, x, y, sampler); - color[1] = input[0]; + output[1] = input[0]; } if (this->m_inputChannel3Operation) { this->m_inputChannel3Operation->read(input, x, y, sampler); - color[2] = input[0]; + output[2] = input[0]; } if (this->m_inputChannel4Operation) { this->m_inputChannel4Operation->read(input, x, y, sampler); - color[3] = input[0]; + output[3] = input[0]; } } diff --git a/source/blender/compositor/operations/COM_CombineChannelsOperation.h b/source/blender/compositor/operations/COM_CombineChannelsOperation.h index ff1251a3949..460eb9bdcb1 100644 --- a/source/blender/compositor/operations/COM_CombineChannelsOperation.h +++ b/source/blender/compositor/operations/COM_CombineChannelsOperation.h @@ -33,7 +33,7 @@ private: SocketReader *m_inputChannel4Operation; public: CombineChannelsOperation(); - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); void initExecution(); void deinitExecution(); diff --git a/source/blender/compositor/operations/COM_CompositorOperation.cpp b/source/blender/compositor/operations/COM_CompositorOperation.cpp index cba8c753d6a..141d071dddc 100644 --- a/source/blender/compositor/operations/COM_CompositorOperation.cpp +++ b/source/blender/compositor/operations/COM_CompositorOperation.cpp @@ -158,7 +158,7 @@ void CompositorOperation::executeRegion(rcti *rect, unsigned int tileNumber) } } -void CompositorOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) +void CompositorOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) { int width = this->m_rd->xsch * this->m_rd->size / 100; int height = this->m_rd->ysch * this->m_rd->size / 100; diff --git a/source/blender/compositor/operations/COM_CompositorOperation.h b/source/blender/compositor/operations/COM_CompositorOperation.h index 882e50b4922..ae94e974db0 100644 --- a/source/blender/compositor/operations/COM_CompositorOperation.h +++ b/source/blender/compositor/operations/COM_CompositorOperation.h @@ -71,6 +71,6 @@ public: void initExecution(); void deinitExecution(); const CompositorPriority getRenderPriority() const { return COM_PRIORITY_MEDIUM; } - void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]); + void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); }; #endif diff --git a/source/blender/compositor/operations/COM_ConvertColorProfileOperation.cpp b/source/blender/compositor/operations/COM_ConvertColorProfileOperation.cpp index c7272d461d6..79ce149e790 100644 --- a/source/blender/compositor/operations/COM_ConvertColorProfileOperation.cpp +++ b/source/blender/compositor/operations/COM_ConvertColorProfileOperation.cpp @@ -38,11 +38,11 @@ void ConvertColorProfileOperation::initExecution() this->m_inputOperation = this->getInputSocketReader(0); } -void ConvertColorProfileOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void ConvertColorProfileOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float color[4]; this->m_inputOperation->read(color, x, y, sampler); - IMB_buffer_float_from_float(outputValue, color, 4, this->m_toProfile, this->m_fromProfile, this->m_predivided, 1, 1, 0, 0); + IMB_buffer_float_from_float(output, color, 4, this->m_toProfile, this->m_fromProfile, this->m_predivided, 1, 1, 0, 0); } void ConvertColorProfileOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_ConvertColorProfileOperation.h b/source/blender/compositor/operations/COM_ConvertColorProfileOperation.h index 09d96a92d95..a8cbc613fb8 100644 --- a/source/blender/compositor/operations/COM_ConvertColorProfileOperation.h +++ b/source/blender/compositor/operations/COM_ConvertColorProfileOperation.h @@ -59,7 +59,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_ConvertColorToBWOperation.cpp b/source/blender/compositor/operations/COM_ConvertColorToBWOperation.cpp index 4da09a69a15..9cff5e8eaa6 100644 --- a/source/blender/compositor/operations/COM_ConvertColorToBWOperation.cpp +++ b/source/blender/compositor/operations/COM_ConvertColorToBWOperation.cpp @@ -34,11 +34,11 @@ void ConvertColorToBWOperation::initExecution() this->m_inputOperation = this->getInputSocketReader(0); } -void ConvertColorToBWOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void ConvertColorToBWOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor[4]; this->m_inputOperation->read(&inputColor[0], x, y, sampler); - outputValue[0] = rgb_to_bw(inputColor); + output[0] = rgb_to_bw(inputColor); } void ConvertColorToBWOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_ConvertColorToBWOperation.h b/source/blender/compositor/operations/COM_ConvertColorToBWOperation.h index a9951af2e3b..963bd32a2f6 100644 --- a/source/blender/compositor/operations/COM_ConvertColorToBWOperation.h +++ b/source/blender/compositor/operations/COM_ConvertColorToBWOperation.h @@ -44,7 +44,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_ConvertColorToValueProg.cpp b/source/blender/compositor/operations/COM_ConvertColorToValueProg.cpp index 17bd34d51b0..3a65519864a 100644 --- a/source/blender/compositor/operations/COM_ConvertColorToValueProg.cpp +++ b/source/blender/compositor/operations/COM_ConvertColorToValueProg.cpp @@ -34,11 +34,11 @@ void ConvertColorToValueProg::initExecution() this->m_inputOperation = this->getInputSocketReader(0); } -void ConvertColorToValueProg::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void ConvertColorToValueProg::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor[4]; this->m_inputOperation->read(&inputColor[0], x, y, sampler); - outputValue[0] = (inputColor[0] + inputColor[1] + inputColor[2]) / 3.0f; + output[0] = (inputColor[0] + inputColor[1] + inputColor[2]) / 3.0f; } void ConvertColorToValueProg::deinitExecution() diff --git a/source/blender/compositor/operations/COM_ConvertColorToValueProg.h b/source/blender/compositor/operations/COM_ConvertColorToValueProg.h index 6a20d4bf27a..5c25d5d0540 100644 --- a/source/blender/compositor/operations/COM_ConvertColorToValueProg.h +++ b/source/blender/compositor/operations/COM_ConvertColorToValueProg.h @@ -44,7 +44,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_ConvertColorToVectorOperation.cpp b/source/blender/compositor/operations/COM_ConvertColorToVectorOperation.cpp index ec1f0fd37e4..a9b8cbb4272 100644 --- a/source/blender/compositor/operations/COM_ConvertColorToVectorOperation.cpp +++ b/source/blender/compositor/operations/COM_ConvertColorToVectorOperation.cpp @@ -34,9 +34,9 @@ void ConvertColorToVectorOperation::initExecution() this->m_inputOperation = this->getInputSocketReader(0); } -void ConvertColorToVectorOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void ConvertColorToVectorOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { - this->m_inputOperation->read(outputValue, x, y, sampler); + this->m_inputOperation->read(output, x, y, sampler); } void ConvertColorToVectorOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_ConvertColorToVectorOperation.h b/source/blender/compositor/operations/COM_ConvertColorToVectorOperation.h index 861807db8db..93644cb5d1c 100644 --- a/source/blender/compositor/operations/COM_ConvertColorToVectorOperation.h +++ b/source/blender/compositor/operations/COM_ConvertColorToVectorOperation.h @@ -44,7 +44,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.cpp b/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.cpp index efe641b1fe5..88289f12ebb 100644 --- a/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.cpp +++ b/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.cpp @@ -72,7 +72,7 @@ void ConvertDepthToRadiusOperation::initExecution() } } -void ConvertDepthToRadiusOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void ConvertDepthToRadiusOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputValue[4]; float z; @@ -94,9 +94,11 @@ void ConvertDepthToRadiusOperation::executePixel(float *outputValue, float x, fl if (radius > this->m_maxRadius) { radius = this->m_maxRadius; } - outputValue[0] = radius; + output[0] = radius; + } + else { + output[0] = 0.0f; } - else outputValue[0] = 0.0f; } void ConvertDepthToRadiusOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.h b/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.h index 4f80ef69f43..d5a1fd72cbf 100644 --- a/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.h +++ b/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.h @@ -54,7 +54,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_ConvertHSVToRGBOperation.cpp b/source/blender/compositor/operations/COM_ConvertHSVToRGBOperation.cpp index 4b42de26f59..65907a8e537 100644 --- a/source/blender/compositor/operations/COM_ConvertHSVToRGBOperation.cpp +++ b/source/blender/compositor/operations/COM_ConvertHSVToRGBOperation.cpp @@ -35,12 +35,12 @@ void ConvertHSVToRGBOperation::initExecution() this->m_inputOperation = this->getInputSocketReader(0); } -void ConvertHSVToRGBOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void ConvertHSVToRGBOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor[4]; this->m_inputOperation->read(inputColor, x, y, sampler); - hsv_to_rgb(inputColor[0], inputColor[1], inputColor[2], &outputValue[0], &outputValue[1], &outputValue[2]); - outputValue[3] = inputColor[3]; + hsv_to_rgb_v(inputColor, output); + output[3] = inputColor[3]; } void ConvertHSVToRGBOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_ConvertHSVToRGBOperation.h b/source/blender/compositor/operations/COM_ConvertHSVToRGBOperation.h index 28ce70170a0..17419ca2a05 100644 --- a/source/blender/compositor/operations/COM_ConvertHSVToRGBOperation.h +++ b/source/blender/compositor/operations/COM_ConvertHSVToRGBOperation.h @@ -44,7 +44,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_ConvertKeyToPremulOperation.cpp b/source/blender/compositor/operations/COM_ConvertKeyToPremulOperation.cpp index 787b1a4547c..4497db52a0f 100644 --- a/source/blender/compositor/operations/COM_ConvertKeyToPremulOperation.cpp +++ b/source/blender/compositor/operations/COM_ConvertKeyToPremulOperation.cpp @@ -35,7 +35,7 @@ void ConvertKeyToPremulOperation::initExecution() this->m_inputColor = getInputSocketReader(0); } -void ConvertKeyToPremulOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void ConvertKeyToPremulOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputValue[4]; float alpha; @@ -43,10 +43,10 @@ void ConvertKeyToPremulOperation::executePixel(float *outputValue, float x, floa this->m_inputColor->read(inputValue, x, y, sampler); alpha = inputValue[3]; - mul_v3_v3fl(outputValue, inputValue, alpha); + mul_v3_v3fl(output, inputValue, alpha); /* never touches the alpha */ - outputValue[3] = alpha; + output[3] = alpha; } void ConvertKeyToPremulOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_ConvertKeyToPremulOperation.h b/source/blender/compositor/operations/COM_ConvertKeyToPremulOperation.h index a1a8836a690..502674e26db 100644 --- a/source/blender/compositor/operations/COM_ConvertKeyToPremulOperation.h +++ b/source/blender/compositor/operations/COM_ConvertKeyToPremulOperation.h @@ -40,7 +40,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); void initExecution(); void deinitExecution(); diff --git a/source/blender/compositor/operations/COM_ConvertPremulToKeyOperation.cpp b/source/blender/compositor/operations/COM_ConvertPremulToKeyOperation.cpp index 22cfdd2f572..b92da4c324f 100644 --- a/source/blender/compositor/operations/COM_ConvertPremulToKeyOperation.cpp +++ b/source/blender/compositor/operations/COM_ConvertPremulToKeyOperation.cpp @@ -35,7 +35,7 @@ void ConvertPremulToKeyOperation::initExecution() this->m_inputColor = getInputSocketReader(0); } -void ConvertPremulToKeyOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void ConvertPremulToKeyOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputValue[4]; float alpha; @@ -44,14 +44,14 @@ void ConvertPremulToKeyOperation::executePixel(float *outputValue, float x, floa alpha = inputValue[3]; if (fabsf(alpha) < 1e-5f) { - zero_v3(outputValue); + zero_v3(output); } else { - mul_v3_v3fl(outputValue, inputValue, 1.0f / alpha); + mul_v3_v3fl(output, inputValue, 1.0f / alpha); } /* never touches the alpha */ - outputValue[3] = alpha; + output[3] = alpha; } void ConvertPremulToKeyOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_ConvertPremulToKeyOperation.h b/source/blender/compositor/operations/COM_ConvertPremulToKeyOperation.h index fb83a06c25d..04a9965858d 100644 --- a/source/blender/compositor/operations/COM_ConvertPremulToKeyOperation.h +++ b/source/blender/compositor/operations/COM_ConvertPremulToKeyOperation.h @@ -40,7 +40,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); void initExecution(); void deinitExecution(); diff --git a/source/blender/compositor/operations/COM_ConvertRGBToHSVOperation.cpp b/source/blender/compositor/operations/COM_ConvertRGBToHSVOperation.cpp index 8478eac75b0..3c7a9d5fd50 100644 --- a/source/blender/compositor/operations/COM_ConvertRGBToHSVOperation.cpp +++ b/source/blender/compositor/operations/COM_ConvertRGBToHSVOperation.cpp @@ -35,12 +35,12 @@ void ConvertRGBToHSVOperation::initExecution() this->m_inputOperation = this->getInputSocketReader(0); } -void ConvertRGBToHSVOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void ConvertRGBToHSVOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor[4]; this->m_inputOperation->read(inputColor, x, y, sampler); - rgb_to_hsv(inputColor[0], inputColor[1], inputColor[2], &outputValue[0], &outputValue[1], &outputValue[2]); - outputValue[3] = inputColor[3]; + rgb_to_hsv_v(inputColor, output); + output[3] = inputColor[3]; } void ConvertRGBToHSVOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_ConvertRGBToHSVOperation.h b/source/blender/compositor/operations/COM_ConvertRGBToHSVOperation.h index 09f6c7e48a6..fdc8dfed31b 100644 --- a/source/blender/compositor/operations/COM_ConvertRGBToHSVOperation.h +++ b/source/blender/compositor/operations/COM_ConvertRGBToHSVOperation.h @@ -44,7 +44,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_ConvertRGBToYCCOperation.cpp b/source/blender/compositor/operations/COM_ConvertRGBToYCCOperation.cpp index 52aa1d7a123..6f6dffdc72b 100644 --- a/source/blender/compositor/operations/COM_ConvertRGBToYCCOperation.cpp +++ b/source/blender/compositor/operations/COM_ConvertRGBToYCCOperation.cpp @@ -50,7 +50,7 @@ void ConvertRGBToYCCOperation::setMode(int mode) } } -void ConvertRGBToYCCOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void ConvertRGBToYCCOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor[4]; float color[3]; @@ -60,8 +60,8 @@ void ConvertRGBToYCCOperation::executePixel(float *outputValue, float x, float y /* divided by 255 to normalize for viewing in */ /* R,G,B --> Y,Cb,Cr */ - mul_v3_v3fl(outputValue, color, 1.0f / 255.0f); - outputValue[3] = inputColor[3]; + mul_v3_v3fl(output, color, 1.0f / 255.0f); + output[3] = inputColor[3]; } void ConvertRGBToYCCOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_ConvertRGBToYCCOperation.h b/source/blender/compositor/operations/COM_ConvertRGBToYCCOperation.h index 7f4eb6d7318..3f85555f3bb 100644 --- a/source/blender/compositor/operations/COM_ConvertRGBToYCCOperation.h +++ b/source/blender/compositor/operations/COM_ConvertRGBToYCCOperation.h @@ -48,7 +48,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_ConvertRGBToYUVOperation.cpp b/source/blender/compositor/operations/COM_ConvertRGBToYUVOperation.cpp index 2206a066a37..8ce9e150080 100644 --- a/source/blender/compositor/operations/COM_ConvertRGBToYUVOperation.cpp +++ b/source/blender/compositor/operations/COM_ConvertRGBToYUVOperation.cpp @@ -34,12 +34,12 @@ void ConvertRGBToYUVOperation::initExecution() this->m_inputOperation = this->getInputSocketReader(0); } -void ConvertRGBToYUVOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void ConvertRGBToYUVOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor[4]; this->m_inputOperation->read(inputColor, x, y, sampler); - rgb_to_yuv(inputColor[0], inputColor[1], inputColor[2], &outputValue[0], &outputValue[1], &outputValue[2]); - outputValue[3] = inputColor[3]; + rgb_to_yuv(inputColor[0], inputColor[1], inputColor[2], &output[0], &output[1], &output[2]); + output[3] = inputColor[3]; } void ConvertRGBToYUVOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_ConvertRGBToYUVOperation.h b/source/blender/compositor/operations/COM_ConvertRGBToYUVOperation.h index f7b3da800b3..97d57f657ec 100644 --- a/source/blender/compositor/operations/COM_ConvertRGBToYUVOperation.h +++ b/source/blender/compositor/operations/COM_ConvertRGBToYUVOperation.h @@ -43,7 +43,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_ConvertValueToColorProg.cpp b/source/blender/compositor/operations/COM_ConvertValueToColorProg.cpp index 330ffd00acb..98e7650aa56 100644 --- a/source/blender/compositor/operations/COM_ConvertValueToColorProg.cpp +++ b/source/blender/compositor/operations/COM_ConvertValueToColorProg.cpp @@ -33,14 +33,12 @@ void ConvertValueToColorProg::initExecution() this->m_inputProgram = this->getInputSocketReader(0); } -void ConvertValueToColorProg::executePixel(float *color, float x, float y, PixelSampler sampler) +void ConvertValueToColorProg::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputValue[4]; this->m_inputProgram->read(inputValue, x, y, sampler); - color[0] = inputValue[0]; - color[1] = inputValue[0]; - color[2] = inputValue[0]; - color[3] = 1.0f; + output[0] = output[1] = output[2] = inputValue[0]; + output[3] = 1.0f; } void ConvertValueToColorProg::deinitExecution() diff --git a/source/blender/compositor/operations/COM_ConvertValueToColorProg.h b/source/blender/compositor/operations/COM_ConvertValueToColorProg.h index 2fa5edcf09b..f0f6cfb8fd2 100644 --- a/source/blender/compositor/operations/COM_ConvertValueToColorProg.h +++ b/source/blender/compositor/operations/COM_ConvertValueToColorProg.h @@ -37,7 +37,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_ConvertValueToVectorOperation.cpp b/source/blender/compositor/operations/COM_ConvertValueToVectorOperation.cpp index 54a5b0dbd0e..411409d263c 100644 --- a/source/blender/compositor/operations/COM_ConvertValueToVectorOperation.cpp +++ b/source/blender/compositor/operations/COM_ConvertValueToVectorOperation.cpp @@ -34,14 +34,14 @@ void ConvertValueToVectorOperation::initExecution() this->m_inputOperation = this->getInputSocketReader(0); } -void ConvertValueToVectorOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void ConvertValueToVectorOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float input[4]; this->m_inputOperation->read(input, x, y, sampler); - outputValue[0] = input[0]; - outputValue[1] = input[0]; - outputValue[2] = input[0]; - outputValue[3] = 0.0f; + output[0] = input[0]; + output[1] = input[0]; + output[2] = input[0]; + output[3] = 0.0f; } void ConvertValueToVectorOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_ConvertValueToVectorOperation.h b/source/blender/compositor/operations/COM_ConvertValueToVectorOperation.h index c0936a32eb5..da45848ca34 100644 --- a/source/blender/compositor/operations/COM_ConvertValueToVectorOperation.h +++ b/source/blender/compositor/operations/COM_ConvertValueToVectorOperation.h @@ -44,7 +44,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_ConvertVectorToColorOperation.cpp b/source/blender/compositor/operations/COM_ConvertVectorToColorOperation.cpp index 9fb9a2e0705..78cb706c32d 100644 --- a/source/blender/compositor/operations/COM_ConvertVectorToColorOperation.cpp +++ b/source/blender/compositor/operations/COM_ConvertVectorToColorOperation.cpp @@ -34,10 +34,10 @@ void ConvertVectorToColorOperation::initExecution() this->m_inputOperation = this->getInputSocketReader(0); } -void ConvertVectorToColorOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void ConvertVectorToColorOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { - this->m_inputOperation->read(outputValue, x, y, sampler); - outputValue[3] = 1.0f; + this->m_inputOperation->read(output, x, y, sampler); + output[3] = 1.0f; } void ConvertVectorToColorOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_ConvertVectorToColorOperation.h b/source/blender/compositor/operations/COM_ConvertVectorToColorOperation.h index a062c452a91..9ef5f8fece3 100644 --- a/source/blender/compositor/operations/COM_ConvertVectorToColorOperation.h +++ b/source/blender/compositor/operations/COM_ConvertVectorToColorOperation.h @@ -44,7 +44,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_ConvertVectorToValueOperation.cpp b/source/blender/compositor/operations/COM_ConvertVectorToValueOperation.cpp index 23b552f1dbe..a3612414029 100644 --- a/source/blender/compositor/operations/COM_ConvertVectorToValueOperation.cpp +++ b/source/blender/compositor/operations/COM_ConvertVectorToValueOperation.cpp @@ -34,11 +34,11 @@ void ConvertVectorToValueOperation::initExecution() this->m_inputOperation = this->getInputSocketReader(0); } -void ConvertVectorToValueOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void ConvertVectorToValueOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float input[4]; this->m_inputOperation->read(input, x, y, sampler); - outputValue[0] = (input[0] + input[1] + input[2]) / 3.0f; + output[0] = (input[0] + input[1] + input[2]) / 3.0f; } void ConvertVectorToValueOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_ConvertVectorToValueOperation.h b/source/blender/compositor/operations/COM_ConvertVectorToValueOperation.h index b662f3eed6c..e42f235a12b 100644 --- a/source/blender/compositor/operations/COM_ConvertVectorToValueOperation.h +++ b/source/blender/compositor/operations/COM_ConvertVectorToValueOperation.h @@ -44,7 +44,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_ConvertYCCToRGBOperation.cpp b/source/blender/compositor/operations/COM_ConvertYCCToRGBOperation.cpp index 88a7e7dedd9..8f9eaf49ea4 100644 --- a/source/blender/compositor/operations/COM_ConvertYCCToRGBOperation.cpp +++ b/source/blender/compositor/operations/COM_ConvertYCCToRGBOperation.cpp @@ -50,7 +50,7 @@ void ConvertYCCToRGBOperation::setMode(int mode) } } -void ConvertYCCToRGBOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void ConvertYCCToRGBOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor[4]; this->m_inputOperation->read(inputColor, x, y, sampler); @@ -59,8 +59,8 @@ void ConvertYCCToRGBOperation::executePixel(float *outputValue, float x, float y /* R,G,B --> Y,Cb,Cr */ mul_v3_fl(inputColor, 255.0f); - ycc_to_rgb(inputColor[0], inputColor[1], inputColor[2], &outputValue[0], &outputValue[1], &outputValue[2], this->m_mode); - outputValue[3] = inputColor[3]; + ycc_to_rgb(inputColor[0], inputColor[1], inputColor[2], &output[0], &output[1], &output[2], this->m_mode); + output[3] = inputColor[3]; } void ConvertYCCToRGBOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_ConvertYCCToRGBOperation.h b/source/blender/compositor/operations/COM_ConvertYCCToRGBOperation.h index a8e03bcb807..0a8b67e0bee 100644 --- a/source/blender/compositor/operations/COM_ConvertYCCToRGBOperation.h +++ b/source/blender/compositor/operations/COM_ConvertYCCToRGBOperation.h @@ -48,7 +48,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_ConvertYUVToRGBOperation.cpp b/source/blender/compositor/operations/COM_ConvertYUVToRGBOperation.cpp index 1a5e7cbf2a6..197c7f9f043 100644 --- a/source/blender/compositor/operations/COM_ConvertYUVToRGBOperation.cpp +++ b/source/blender/compositor/operations/COM_ConvertYUVToRGBOperation.cpp @@ -34,12 +34,12 @@ void ConvertYUVToRGBOperation::initExecution() this->m_inputOperation = this->getInputSocketReader(0); } -void ConvertYUVToRGBOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void ConvertYUVToRGBOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor[4]; this->m_inputOperation->read(inputColor, x, y, sampler); - yuv_to_rgb(inputColor[0], inputColor[1], inputColor[2], &outputValue[0], &outputValue[1], &outputValue[2]); - outputValue[3] = inputColor[3]; + yuv_to_rgb(inputColor[0], inputColor[1], inputColor[2], &output[0], &output[1], &output[2]); + output[3] = inputColor[3]; } void ConvertYUVToRGBOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_ConvertYUVToRGBOperation.h b/source/blender/compositor/operations/COM_ConvertYUVToRGBOperation.h index 80321ae37d2..ee11ef8df60 100644 --- a/source/blender/compositor/operations/COM_ConvertYUVToRGBOperation.h +++ b/source/blender/compositor/operations/COM_ConvertYUVToRGBOperation.h @@ -43,7 +43,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cpp b/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cpp index 90bda5c8d2c..657126d458c 100644 --- a/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cpp +++ b/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cpp @@ -28,9 +28,9 @@ ConvolutionEdgeFilterOperation::ConvolutionEdgeFilterOperation() : ConvolutionFi /* pass */ } -void ConvolutionEdgeFilterOperation::executePixel(float *color, int x, int y, void *data) +void ConvolutionEdgeFilterOperation::executePixel(float output[4], int x, int y, void *data) { - float in1[4], in2[4], res1[4], res2[4]; + float in1[4], in2[4], res1[4] = {0.0}, res2[4] = {0.0}; int x1 = x - 1; int x2 = x; @@ -48,16 +48,7 @@ void ConvolutionEdgeFilterOperation::executePixel(float *color, int x, int y, vo float value[4]; this->m_inputValueOperation->read(value, x2, y2, NULL); float mval = 1.0f - value[0]; - - res1[0] = 0.0f; - res1[1] = 0.0f; - res1[2] = 0.0f; - res1[3] = 0.0f; - res2[0] = 0.0f; - res2[1] = 0.0f; - res2[2] = 0.0f; - res2[3] = 0.0f; - + this->m_inputOperation->read(in1, x1, y1, NULL); madd_v3_v3fl(res1, in1, this->m_filter[0]); madd_v3_v3fl(res2, in1, this->m_filter[0]); @@ -94,13 +85,13 @@ void ConvolutionEdgeFilterOperation::executePixel(float *color, int x, int y, vo madd_v3_v3fl(res1, in1, this->m_filter[8]); madd_v3_v3fl(res2, in1, this->m_filter[8]); - color[0] = sqrt(res1[0] * res1[0] + res2[0] * res2[0]); - color[1] = sqrt(res1[1] * res1[1] + res2[1] * res2[1]); - color[2] = sqrt(res1[2] * res1[2] + res2[2] * res2[2]); + output[0] = sqrt(res1[0] * res1[0] + res2[0] * res2[0]); + output[1] = sqrt(res1[1] * res1[1] + res2[1] * res2[1]); + output[2] = sqrt(res1[2] * res1[2] + res2[2] * res2[2]); - color[0] = color[0] * value[0] + in2[0] * mval; - color[1] = color[1] * value[0] + in2[1] * mval; - color[2] = color[2] * value[0] + in2[2] * mval; + output[0] = output[0] * value[0] + in2[0] * mval; + output[1] = output[1] * value[0] + in2[1] * mval; + output[2] = output[2] * value[0] + in2[2] * mval; - color[3] = in2[3]; + output[3] = in2[3]; } diff --git a/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.h b/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.h index b96b8785524..c666dc2cd42 100644 --- a/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.h +++ b/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.h @@ -28,7 +28,7 @@ class ConvolutionEdgeFilterOperation : public ConvolutionFilterOperation { public: ConvolutionEdgeFilterOperation(); - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); }; #endif diff --git a/source/blender/compositor/operations/COM_ConvolutionFilterOperation.cpp b/source/blender/compositor/operations/COM_ConvolutionFilterOperation.cpp index 6c1e434ab41..fd593b39dcd 100644 --- a/source/blender/compositor/operations/COM_ConvolutionFilterOperation.cpp +++ b/source/blender/compositor/operations/COM_ConvolutionFilterOperation.cpp @@ -67,7 +67,7 @@ void ConvolutionFilterOperation::deinitExecution() } -void ConvolutionFilterOperation::executePixel(float *color, int x, int y, void *data) +void ConvolutionFilterOperation::executePixel(float output[4], int x, int y, void *data) { float in1[4]; float in2[4]; @@ -87,30 +87,30 @@ void ConvolutionFilterOperation::executePixel(float *color, int x, int y, void * this->m_inputValueOperation->read(value, x2, y2, NULL); const float mval = 1.0f - value[0]; - zero_v4(color); + zero_v4(output); this->m_inputOperation->read(in1, x1, y1, NULL); - madd_v4_v4fl(color, in1, this->m_filter[0]); + madd_v4_v4fl(output, in1, this->m_filter[0]); this->m_inputOperation->read(in1, x2, y1, NULL); - madd_v4_v4fl(color, in1, this->m_filter[1]); + madd_v4_v4fl(output, in1, this->m_filter[1]); this->m_inputOperation->read(in1, x3, y1, NULL); - madd_v4_v4fl(color, in1, this->m_filter[2]); + madd_v4_v4fl(output, in1, this->m_filter[2]); this->m_inputOperation->read(in1, x1, y2, NULL); - madd_v4_v4fl(color, in1, this->m_filter[3]); + madd_v4_v4fl(output, in1, this->m_filter[3]); this->m_inputOperation->read(in2, x2, y2, NULL); - madd_v4_v4fl(color, in2, this->m_filter[4]); + madd_v4_v4fl(output, in2, this->m_filter[4]); this->m_inputOperation->read(in1, x3, y2, NULL); - madd_v4_v4fl(color, in1, this->m_filter[5]); + madd_v4_v4fl(output, in1, this->m_filter[5]); this->m_inputOperation->read(in1, x1, y3, NULL); - madd_v4_v4fl(color, in1, this->m_filter[6]); + madd_v4_v4fl(output, in1, this->m_filter[6]); this->m_inputOperation->read(in1, x2, y3, NULL); - madd_v4_v4fl(color, in1, this->m_filter[7]); + madd_v4_v4fl(output, in1, this->m_filter[7]); this->m_inputOperation->read(in1, x3, y3, NULL); - madd_v4_v4fl(color, in1, this->m_filter[8]); + madd_v4_v4fl(output, in1, this->m_filter[8]); - color[0] = color[0] * value[0] + in2[0] * mval; - color[1] = color[1] * value[0] + in2[1] * mval; - color[2] = color[2] * value[0] + in2[2] * mval; - color[3] = color[3] * value[0] + in2[3] * mval; + output[0] = output[0] * value[0] + in2[0] * mval; + output[1] = output[1] * value[0] + in2[1] * mval; + output[2] = output[2] * value[0] + in2[2] * mval; + output[3] = output[3] * value[0] + in2[3] * mval; } bool ConvolutionFilterOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) diff --git a/source/blender/compositor/operations/COM_ConvolutionFilterOperation.h b/source/blender/compositor/operations/COM_ConvolutionFilterOperation.h index 88455730c0e..4c192481ba1 100644 --- a/source/blender/compositor/operations/COM_ConvolutionFilterOperation.h +++ b/source/blender/compositor/operations/COM_ConvolutionFilterOperation.h @@ -39,7 +39,7 @@ public: ConvolutionFilterOperation(); void set3x3Filter(float f1, float f2, float f3, float f4, float f5, float f6, float f7, float f8, float f9); bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); void initExecution(); void deinitExecution(); diff --git a/source/blender/compositor/operations/COM_CropOperation.cpp b/source/blender/compositor/operations/COM_CropOperation.cpp index efbc331e7d3..c33bd2544ac 100644 --- a/source/blender/compositor/operations/COM_CropOperation.cpp +++ b/source/blender/compositor/operations/COM_CropOperation.cpp @@ -73,13 +73,13 @@ CropOperation::CropOperation() : CropBaseOperation() /* pass */ } -void CropOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void CropOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { if ((x < this->m_xmax && x >= this->m_xmin) && (y < this->m_ymax && y >= this->m_ymin)) { - this->m_inputOperation->read(color, x, y, sampler); + this->m_inputOperation->read(output, x, y, sampler); } else { - zero_v4(color); + zero_v4(output); } } @@ -100,7 +100,7 @@ bool CropImageOperation::determineDependingAreaOfInterest(rcti *input, ReadBuffe return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output); } -void CropImageOperation::determineResolution(unsigned int resolution[], unsigned int preferedResolution[]) +void CropImageOperation::determineResolution(unsigned int resolution[2], unsigned int preferedResolution[2]) { NodeOperation::determineResolution(resolution, preferedResolution); updateArea(); @@ -108,7 +108,7 @@ void CropImageOperation::determineResolution(unsigned int resolution[], unsigned resolution[1] = this->m_ymax - this->m_ymin; } -void CropImageOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void CropImageOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { - this->m_inputOperation->read(color, (x + this->m_xmin), (y + this->m_ymin), sampler); + this->m_inputOperation->read(output, (x + this->m_xmin), (y + this->m_ymin), sampler); } diff --git a/source/blender/compositor/operations/COM_CropOperation.h b/source/blender/compositor/operations/COM_CropOperation.h index 78644536143..ddc7f855bf1 100644 --- a/source/blender/compositor/operations/COM_CropOperation.h +++ b/source/blender/compositor/operations/COM_CropOperation.h @@ -48,7 +48,7 @@ class CropOperation : public CropBaseOperation { private: public: CropOperation(); - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; class CropImageOperation : public CropBaseOperation { @@ -56,8 +56,8 @@ private: public: CropImageOperation(); bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); - void determineResolution(unsigned int resolution[], unsigned int preferedResolution[]); - void executePixel(float *color, float x, float y, PixelSampler sampler); + void determineResolution(unsigned int resolution[2], unsigned int preferedResolution[2]); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/compositor/operations/COM_DifferenceMatteOperation.cpp b/source/blender/compositor/operations/COM_DifferenceMatteOperation.cpp index a95d1eec290..e23eb26f527 100644 --- a/source/blender/compositor/operations/COM_DifferenceMatteOperation.cpp +++ b/source/blender/compositor/operations/COM_DifferenceMatteOperation.cpp @@ -44,7 +44,7 @@ void DifferenceMatteOperation::deinitExecution() this->m_inputImage2Program = NULL; } -void DifferenceMatteOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void DifferenceMatteOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inColor1[4]; float inColor2[4]; @@ -66,7 +66,7 @@ void DifferenceMatteOperation::executePixel(float *outputValue, float x, float y /* make 100% transparent */ if (difference < tolerance) { - outputValue[0] = 0.0f; + output[0] = 0.0f; } /*in the falloff region, make partially transparent */ else if (difference < falloff + tolerance) { @@ -74,15 +74,15 @@ void DifferenceMatteOperation::executePixel(float *outputValue, float x, float y alpha = difference / falloff; /*only change if more transparent than before */ if (alpha < inColor1[3]) { - outputValue[0] = alpha; + output[0] = alpha; } else { /* leave as before */ - outputValue[0] = inColor1[3]; + output[0] = inColor1[3]; } } else { /* foreground object */ - outputValue[0] = inColor1[3]; + output[0] = inColor1[3]; } } diff --git a/source/blender/compositor/operations/COM_DifferenceMatteOperation.h b/source/blender/compositor/operations/COM_DifferenceMatteOperation.h index acec6ebf193..e7d881cbbd5 100644 --- a/source/blender/compositor/operations/COM_DifferenceMatteOperation.h +++ b/source/blender/compositor/operations/COM_DifferenceMatteOperation.h @@ -43,7 +43,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); void initExecution(); void deinitExecution(); diff --git a/source/blender/compositor/operations/COM_DilateErodeOperation.cpp b/source/blender/compositor/operations/COM_DilateErodeOperation.cpp index 0890bc75049..5e70187557b 100644 --- a/source/blender/compositor/operations/COM_DilateErodeOperation.cpp +++ b/source/blender/compositor/operations/COM_DilateErodeOperation.cpp @@ -60,7 +60,7 @@ void *DilateErodeThresholdOperation::initializeTileData(rcti *rect) return buffer; } -void DilateErodeThresholdOperation::executePixel(float *color, int x, int y, void *data) +void DilateErodeThresholdOperation::executePixel(float output[4], int x, int y, void *data) { float inputValue[4]; const float sw = this->m__switch; @@ -117,28 +117,28 @@ void DilateErodeThresholdOperation::executePixel(float *color, int x, int y, voi const float delta = distance - pixelvalue; if (delta >= 0.0f) { if (delta >= inset) { - color[0] = 1.0f; + output[0] = 1.0f; } else { - color[0] = delta / inset; + output[0] = delta / inset; } } else { - color[0] = 0.0f; + output[0] = 0.0f; } } else { const float delta = -distance + pixelvalue; if (delta < 0.0f) { if (delta < -inset) { - color[0] = 1.0f; + output[0] = 1.0f; } else { - color[0] = (-delta) / inset; + output[0] = (-delta) / inset; } } else { - color[0] = 0.0f; + output[0] = 0.0f; } } } @@ -185,7 +185,7 @@ void *DilateDistanceOperation::initializeTileData(rcti *rect) return buffer; } -void DilateDistanceOperation::executePixel(float *color, int x, int y, void *data) +void DilateDistanceOperation::executePixel(float output[4], int x, int y, void *data) { const float distance = this->m_distance; const float mindist = distance * distance; @@ -214,7 +214,7 @@ void DilateDistanceOperation::executePixel(float *color, int x, int y, void *dat offset += 4; } } - color[0] = value; + output[0] = value; } void DilateDistanceOperation::deinitExecution() @@ -259,7 +259,7 @@ ErodeDistanceOperation::ErodeDistanceOperation() : DilateDistanceOperation() /* pass */ } -void ErodeDistanceOperation::executePixel(float *color, int x, int y, void *data) +void ErodeDistanceOperation::executePixel(float output[4], int x, int y, void *data) { const float distance = this->m_distance; const float mindist = distance * distance; @@ -288,7 +288,7 @@ void ErodeDistanceOperation::executePixel(float *color, int x, int y, void *data offset += 4; } } - color[0] = value; + output[0] = value; } void ErodeDistanceOperation::executeOpenCL(OpenCLDevice *device, @@ -374,9 +374,9 @@ void *DilateStepOperation::initializeTileData(rcti *rect) } -void DilateStepOperation::executePixel(float *color, int x, int y, void *data) +void DilateStepOperation::executePixel(float output[4], int x, int y, void *data) { - color[0] = this->m_cached_buffer[y * this->getWidth() + x]; + output[0] = this->m_cached_buffer[y * this->getWidth() + x]; } void DilateStepOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_DilateErodeOperation.h b/source/blender/compositor/operations/COM_DilateErodeOperation.h index bd044e79fbe..47480d47c3b 100644 --- a/source/blender/compositor/operations/COM_DilateErodeOperation.h +++ b/source/blender/compositor/operations/COM_DilateErodeOperation.h @@ -47,7 +47,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); /** * Initialize the execution @@ -83,7 +83,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); /** * Initialize the execution @@ -111,7 +111,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); void executeOpenCL(OpenCLDevice *device, MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, @@ -135,7 +135,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_DirectionalBlurOperation.cpp b/source/blender/compositor/operations/COM_DirectionalBlurOperation.cpp index 34bf9db77ce..23289429bfd 100644 --- a/source/blender/compositor/operations/COM_DirectionalBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_DirectionalBlurOperation.cpp @@ -66,7 +66,7 @@ void DirectionalBlurOperation::initExecution() } -void DirectionalBlurOperation::executePixel(float *color, int x, int y, void *data) +void DirectionalBlurOperation::executePixel(float output[4], int x, int y, void *data) { const int iterations = pow(2.0f, this->m_data->iter); float col[4] = {0, 0, 0, 0}; @@ -98,7 +98,7 @@ void DirectionalBlurOperation::executePixel(float *color, int x, int y, void *da lsc += this->m_sc; } - mul_v4_v4fl(color, col2, 1.0f / (iterations+1)); + mul_v4_v4fl(output, col2, 1.0f / (iterations + 1)); } void DirectionalBlurOperation::executeOpenCL(OpenCLDevice *device, diff --git a/source/blender/compositor/operations/COM_DirectionalBlurOperation.h b/source/blender/compositor/operations/COM_DirectionalBlurOperation.h index 4de435a1418..e13a13116db 100644 --- a/source/blender/compositor/operations/COM_DirectionalBlurOperation.h +++ b/source/blender/compositor/operations/COM_DirectionalBlurOperation.h @@ -40,7 +40,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_DisplaceOperation.cpp b/source/blender/compositor/operations/COM_DisplaceOperation.cpp index 018df78cb65..39f0ac7874b 100644 --- a/source/blender/compositor/operations/COM_DisplaceOperation.cpp +++ b/source/blender/compositor/operations/COM_DisplaceOperation.cpp @@ -54,7 +54,7 @@ void DisplaceOperation::initExecution() * in order to take effect */ #define DISPLACE_EPSILON 0.01f -void DisplaceOperation::executePixel(float *color, int x, int y, void *data) +void DisplaceOperation::executePixel(float output[4], int x, int y, void *data) { float inVector[4]; float inScale[4]; @@ -96,7 +96,7 @@ void DisplaceOperation::executePixel(float *color, int x, int y, void *data) dyt = signf(dyt) * maxf(fabsf(dyt), DISPLACE_EPSILON) / this->getHeight(); /* EWA filtering */ - this->m_inputColorProgram->read(color, u, v, dxt, dyt); + this->m_inputColorProgram->read(output, u, v, dxt, dyt); } void DisplaceOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_DisplaceOperation.h b/source/blender/compositor/operations/COM_DisplaceOperation.h index 0e5b042aea5..daf54294aa1 100644 --- a/source/blender/compositor/operations/COM_DisplaceOperation.h +++ b/source/blender/compositor/operations/COM_DisplaceOperation.h @@ -48,7 +48,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_DisplaceSimpleOperation.cpp b/source/blender/compositor/operations/COM_DisplaceSimpleOperation.cpp index a93e39085c5..560bbbdd244 100644 --- a/source/blender/compositor/operations/COM_DisplaceSimpleOperation.cpp +++ b/source/blender/compositor/operations/COM_DisplaceSimpleOperation.cpp @@ -53,7 +53,7 @@ void DisplaceSimpleOperation::initExecution() * in order to take effect */ #define DISPLACE_EPSILON 0.01f -void DisplaceSimpleOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void DisplaceSimpleOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inVector[4]; float inScale[4]; @@ -82,7 +82,7 @@ void DisplaceSimpleOperation::executePixel(float *color, float x, float y, Pixel CLAMP(u, 0.f, this->getWidth() - 1.f); CLAMP(v, 0.f, this->getHeight() - 1.f); - this->m_inputColorProgram->read(color, u, v, sampler); + this->m_inputColorProgram->read(output, u, v, sampler); } void DisplaceSimpleOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_DisplaceSimpleOperation.h b/source/blender/compositor/operations/COM_DisplaceSimpleOperation.h index 81adc7be366..989cf8a1f67 100644 --- a/source/blender/compositor/operations/COM_DisplaceSimpleOperation.h +++ b/source/blender/compositor/operations/COM_DisplaceSimpleOperation.h @@ -48,7 +48,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_DistanceMatteOperation.cpp b/source/blender/compositor/operations/COM_DistanceMatteOperation.cpp index 197e8b07918..b65b5e0f224 100644 --- a/source/blender/compositor/operations/COM_DistanceMatteOperation.cpp +++ b/source/blender/compositor/operations/COM_DistanceMatteOperation.cpp @@ -44,7 +44,7 @@ void DistanceMatteOperation::deinitExecution() this->m_inputKeyProgram = NULL; } -void DistanceMatteOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void DistanceMatteOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inKey[4]; float inImage[4]; @@ -68,7 +68,7 @@ void DistanceMatteOperation::executePixel(float *outputValue, float x, float y, /*make 100% transparent */ if (distance < tolerance) { - outputValue[0] = 0.f; + output[0] = 0.f; } /*in the falloff region, make partially transparent */ else if (distance < falloff + tolerance) { @@ -76,15 +76,15 @@ void DistanceMatteOperation::executePixel(float *outputValue, float x, float y, alpha = distance / falloff; /*only change if more transparent than before */ if (alpha < inImage[3]) { - outputValue[0] = alpha; + output[0] = alpha; } else { /* leave as before */ - outputValue[0] = inImage[3]; + output[0] = inImage[3]; } } else { /* leave as before */ - outputValue[0] = inImage[3]; + output[0] = inImage[3]; } } diff --git a/source/blender/compositor/operations/COM_DistanceMatteOperation.h b/source/blender/compositor/operations/COM_DistanceMatteOperation.h index 6fe16c7fdff..a176e5da888 100644 --- a/source/blender/compositor/operations/COM_DistanceMatteOperation.h +++ b/source/blender/compositor/operations/COM_DistanceMatteOperation.h @@ -42,7 +42,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); void initExecution(); void deinitExecution(); diff --git a/source/blender/compositor/operations/COM_DotproductOperation.cpp b/source/blender/compositor/operations/COM_DotproductOperation.cpp index 559d97d6056..1439dfa404a 100644 --- a/source/blender/compositor/operations/COM_DotproductOperation.cpp +++ b/source/blender/compositor/operations/COM_DotproductOperation.cpp @@ -45,11 +45,11 @@ void DotproductOperation::deinitExecution() /** @todo: current implementation is the inverse of a dotproduct. not 'logically' correct */ -void DotproductOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void DotproductOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float input1[4]; float input2[4]; this->m_input1Operation->read(input1, x, y, sampler); this->m_input2Operation->read(input2, x, y, sampler); - color[0] = -(input1[0] * input2[0] + input1[1] * input2[1] + input1[2] * input2[2]); + output[0] = -(input1[0] * input2[0] + input1[1] * input2[1] + input1[2] * input2[2]); } diff --git a/source/blender/compositor/operations/COM_DotproductOperation.h b/source/blender/compositor/operations/COM_DotproductOperation.h index 6ff6f622a50..31588207504 100644 --- a/source/blender/compositor/operations/COM_DotproductOperation.h +++ b/source/blender/compositor/operations/COM_DotproductOperation.h @@ -31,7 +31,7 @@ private: SocketReader *m_input2Operation; public: DotproductOperation(); - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); void initExecution(); void deinitExecution(); diff --git a/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp b/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp index 847e5817675..d5daace059d 100644 --- a/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp +++ b/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp @@ -1280,11 +1280,11 @@ void *DoubleEdgeMaskOperation::initializeTileData(rcti *rect) unlockMutex(); return this->m_cachedInstance; } -void DoubleEdgeMaskOperation::executePixel(float *color, int x, int y, void *data) +void DoubleEdgeMaskOperation::executePixel(float output[4], int x, int y, void *data) { float *buffer = (float *)data; int index = (y * this->getWidth() + x); - copy_v4_v4(color, buffer + index); + copy_v4_v4(output, buffer + index); } void DoubleEdgeMaskOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.h b/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.h index 32e5a07cfdc..528aae7218f 100644 --- a/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.h +++ b/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.h @@ -42,7 +42,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_EllipseMaskOperation.cpp b/source/blender/compositor/operations/COM_EllipseMaskOperation.cpp index c3cbaaaf2fc..9ab21e2d5bd 100644 --- a/source/blender/compositor/operations/COM_EllipseMaskOperation.cpp +++ b/source/blender/compositor/operations/COM_EllipseMaskOperation.cpp @@ -44,7 +44,7 @@ void EllipseMaskOperation::initExecution() this->m_aspectRatio = ((float)this->getWidth()) / this->getHeight(); } -void EllipseMaskOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void EllipseMaskOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputMask[4]; float inputValue[4]; @@ -74,40 +74,40 @@ void EllipseMaskOperation::executePixel(float *color, float x, float y, PixelSam switch (this->m_maskType) { case CMP_NODE_MASKTYPE_ADD: if (inside) { - color[0] = max(inputMask[0], inputValue[0]); + output[0] = max(inputMask[0], inputValue[0]); } else { - color[0] = inputMask[0]; + output[0] = inputMask[0]; } break; case CMP_NODE_MASKTYPE_SUBTRACT: if (inside) { - color[0] = inputMask[0] - inputValue[0]; - CLAMP(color[0], 0, 1); + output[0] = inputMask[0] - inputValue[0]; + CLAMP(output[0], 0, 1); } else { - color[0] = inputMask[0]; + output[0] = inputMask[0]; } break; case CMP_NODE_MASKTYPE_MULTIPLY: if (inside) { - color[0] = inputMask[0] * inputValue[0]; + output[0] = inputMask[0] * inputValue[0]; } else { - color[0] = 0; + output[0] = 0; } break; case CMP_NODE_MASKTYPE_NOT: if (inside) { if (inputMask[0] > 0.0f) { - color[0] = 0; + output[0] = 0; } else { - color[0] = inputValue[0]; + output[0] = inputValue[0]; } } else { - color[0] = inputMask[0]; + output[0] = inputMask[0]; } break; } diff --git a/source/blender/compositor/operations/COM_EllipseMaskOperation.h b/source/blender/compositor/operations/COM_EllipseMaskOperation.h index fce3c93bba6..ed74e6b43db 100644 --- a/source/blender/compositor/operations/COM_EllipseMaskOperation.h +++ b/source/blender/compositor/operations/COM_EllipseMaskOperation.h @@ -45,7 +45,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp b/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp index a7b5b5de6b5..2b2928c98db 100644 --- a/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp @@ -31,10 +31,10 @@ FastGaussianBlurOperation::FastGaussianBlurOperation() : BlurBaseOperation(COM_D this->m_iirgaus = NULL; } -void FastGaussianBlurOperation::executePixel(float *color, int x, int y, void *data) +void FastGaussianBlurOperation::executePixel(float output[4], int x, int y, void *data) { MemoryBuffer *newData = (MemoryBuffer *)data; - newData->read(color, x, y); + newData->read(output, x, y); } bool FastGaussianBlurOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) @@ -233,10 +233,10 @@ FastGaussianBlurValueOperation::FastGaussianBlurValueOperation() : NodeOperation setComplex(true); } -void FastGaussianBlurValueOperation::executePixel(float *color, int x, int y, void *data) +void FastGaussianBlurValueOperation::executePixel(float output[4], int x, int y, void *data) { MemoryBuffer *newData = (MemoryBuffer *)data; - newData->read(color, x, y); + newData->read(output, x, y); } bool FastGaussianBlurValueOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) diff --git a/source/blender/compositor/operations/COM_FastGaussianBlurOperation.h b/source/blender/compositor/operations/COM_FastGaussianBlurOperation.h index 32dc428c21c..58bf1d4f596 100644 --- a/source/blender/compositor/operations/COM_FastGaussianBlurOperation.h +++ b/source/blender/compositor/operations/COM_FastGaussianBlurOperation.h @@ -34,7 +34,7 @@ private: public: FastGaussianBlurOperation(); bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); static void IIR_gauss(MemoryBuffer *src, float sigma, unsigned int channel, unsigned int xy); void *initializeTileData(rcti *rect); @@ -62,7 +62,7 @@ private: public: FastGaussianBlurValueOperation(); bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); void *initializeTileData(rcti *rect); void deinitExecution(); diff --git a/source/blender/compositor/operations/COM_FlipOperation.cpp b/source/blender/compositor/operations/COM_FlipOperation.cpp index 939d05fffbf..526eba34d86 100644 --- a/source/blender/compositor/operations/COM_FlipOperation.cpp +++ b/source/blender/compositor/operations/COM_FlipOperation.cpp @@ -42,12 +42,12 @@ void FlipOperation::deinitExecution() } -void FlipOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void FlipOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float nx = this->m_flipX ? this->getWidth() - 1 - x : x; float ny = this->m_flipY ? this->getHeight() - 1 - y : y; - this->m_inputOperation->read(color, nx, ny, sampler); + this->m_inputOperation->read(output, nx, ny, sampler); } bool FlipOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) diff --git a/source/blender/compositor/operations/COM_FlipOperation.h b/source/blender/compositor/operations/COM_FlipOperation.h index a13f7ecf752..018617cea8a 100644 --- a/source/blender/compositor/operations/COM_FlipOperation.h +++ b/source/blender/compositor/operations/COM_FlipOperation.h @@ -33,7 +33,7 @@ private: public: FlipOperation(); bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); void initExecution(); void deinitExecution(); diff --git a/source/blender/compositor/operations/COM_GammaCorrectOperation.cpp b/source/blender/compositor/operations/COM_GammaCorrectOperation.cpp index a4cc03ac380..af990f4f3e0 100644 --- a/source/blender/compositor/operations/COM_GammaCorrectOperation.cpp +++ b/source/blender/compositor/operations/COM_GammaCorrectOperation.cpp @@ -34,7 +34,7 @@ void GammaCorrectOperation::initExecution() this->m_inputProgram = this->getInputSocketReader(0); } -void GammaCorrectOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void GammaCorrectOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor[4]; this->m_inputProgram->read(inputColor, x, y, sampler); @@ -45,18 +45,18 @@ void GammaCorrectOperation::executePixel(float *color, float x, float y, PixelSa } /* check for negative to avoid nan's */ - color[0] = inputColor[0] > 0.0f ? inputColor[0] * inputColor[0] : 0.0f; - color[1] = inputColor[1] > 0.0f ? inputColor[1] * inputColor[1] : 0.0f; - color[2] = inputColor[2] > 0.0f ? inputColor[2] * inputColor[2] : 0.0f; + output[0] = inputColor[0] > 0.0f ? inputColor[0] * inputColor[0] : 0.0f; + output[1] = inputColor[1] > 0.0f ? inputColor[1] * inputColor[1] : 0.0f; + output[2] = inputColor[2] > 0.0f ? inputColor[2] * inputColor[2] : 0.0f; inputColor[0] *= inputColor[3]; inputColor[1] *= inputColor[3]; inputColor[2] *= inputColor[3]; - color[0] = inputColor[0]; - color[1] = inputColor[1]; - color[2] = inputColor[2]; - color[3] = inputColor[3]; + output[0] = inputColor[0]; + output[1] = inputColor[1]; + output[2] = inputColor[2]; + output[3] = inputColor[3]; } void GammaCorrectOperation::deinitExecution() @@ -75,7 +75,7 @@ void GammaUncorrectOperation::initExecution() this->m_inputProgram = this->getInputSocketReader(0); } -void GammaUncorrectOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void GammaUncorrectOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor[4]; this->m_inputProgram->read(inputColor, x, y, sampler); @@ -86,18 +86,18 @@ void GammaUncorrectOperation::executePixel(float *color, float x, float y, Pixel inputColor[2] /= inputColor[3]; } - color[0] = inputColor[0] > 0.0f ? sqrtf(inputColor[0]) : 0.0f; - color[1] = inputColor[1] > 0.0f ? sqrtf(inputColor[1]) : 0.0f; - color[2] = inputColor[2] > 0.0f ? sqrtf(inputColor[2]) : 0.0f; + output[0] = inputColor[0] > 0.0f ? sqrtf(inputColor[0]) : 0.0f; + output[1] = inputColor[1] > 0.0f ? sqrtf(inputColor[1]) : 0.0f; + output[2] = inputColor[2] > 0.0f ? sqrtf(inputColor[2]) : 0.0f; inputColor[0] *= inputColor[3]; inputColor[1] *= inputColor[3]; inputColor[2] *= inputColor[3]; - color[0] = inputColor[0]; - color[1] = inputColor[1]; - color[2] = inputColor[2]; - color[3] = inputColor[3]; + output[0] = inputColor[0]; + output[1] = inputColor[1]; + output[2] = inputColor[2]; + output[3] = inputColor[3]; } void GammaUncorrectOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_GammaCorrectOperation.h b/source/blender/compositor/operations/COM_GammaCorrectOperation.h index 2d4f2ea89d9..514855b4f56 100644 --- a/source/blender/compositor/operations/COM_GammaCorrectOperation.h +++ b/source/blender/compositor/operations/COM_GammaCorrectOperation.h @@ -38,7 +38,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution @@ -64,7 +64,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_GammaOperation.cpp b/source/blender/compositor/operations/COM_GammaOperation.cpp index 40c2ee0a1d4..326031c5984 100644 --- a/source/blender/compositor/operations/COM_GammaOperation.cpp +++ b/source/blender/compositor/operations/COM_GammaOperation.cpp @@ -37,7 +37,7 @@ void GammaOperation::initExecution() this->m_inputGammaProgram = this->getInputSocketReader(1); } -void GammaOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void GammaOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputValue[4]; float inputGamma[4]; @@ -46,11 +46,11 @@ void GammaOperation::executePixel(float *color, float x, float y, PixelSampler s this->m_inputGammaProgram->read(inputGamma, x, y, sampler); const float gamma = inputGamma[0]; /* check for negative to avoid nan's */ - color[0] = inputValue[0] > 0.0f ? powf(inputValue[0], gamma) : inputValue[0]; - color[1] = inputValue[1] > 0.0f ? powf(inputValue[1], gamma) : inputValue[1]; - color[2] = inputValue[2] > 0.0f ? powf(inputValue[2], gamma) : inputValue[2]; + output[0] = inputValue[0] > 0.0f ? powf(inputValue[0], gamma) : inputValue[0]; + output[1] = inputValue[1] > 0.0f ? powf(inputValue[1], gamma) : inputValue[1]; + output[2] = inputValue[2] > 0.0f ? powf(inputValue[2], gamma) : inputValue[2]; - color[3] = inputValue[3]; + output[3] = inputValue[3]; } void GammaOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_GammaOperation.h b/source/blender/compositor/operations/COM_GammaOperation.h index 8fc2599cba9..4482f7be34a 100644 --- a/source/blender/compositor/operations/COM_GammaOperation.h +++ b/source/blender/compositor/operations/COM_GammaOperation.h @@ -39,7 +39,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp index 9865c87cb07..935bfcac6c7 100644 --- a/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp @@ -90,7 +90,7 @@ BLI_INLINE float finv_test(const float f, const bool test) return (LIKELY(test == false)) ? f : 1.0f - f; } -void GaussianAlphaXBlurOperation::executePixel(float *color, int x, int y, void *data) +void GaussianAlphaXBlurOperation::executePixel(float output[4], int x, int y, void *data) { const bool do_invert = this->m_do_subtract; MemoryBuffer *inputBuffer = (MemoryBuffer *)data; @@ -148,7 +148,7 @@ void GaussianAlphaXBlurOperation::executePixel(float *color, int x, int y, void /* blend between the max value and gauss blue - gives nice feather */ const float value_blur = alpha_accum / multiplier_accum; const float value_final = (value_max * distfacinv_max) + (value_blur * (1.0f - distfacinv_max)); - color[0] = finv_test(value_final, do_invert); + output[0] = finv_test(value_final, do_invert); } void GaussianAlphaXBlurOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.h b/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.h index 6ea8b7e4371..21e80c5daf5 100644 --- a/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.h +++ b/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.h @@ -40,7 +40,7 @@ public: /** * @brief the inner loop of this program */ - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); /** * @brief initialize the execution diff --git a/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp index 323a381c869..375f1bcf07c 100644 --- a/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp @@ -90,7 +90,7 @@ BLI_INLINE float finv_test(const float f, const bool test) return (LIKELY(test == false)) ? f : 1.0f - f; } -void GaussianAlphaYBlurOperation::executePixel(float *color, int x, int y, void *data) +void GaussianAlphaYBlurOperation::executePixel(float output[4], int x, int y, void *data) { const bool do_invert = this->m_do_subtract; MemoryBuffer *inputBuffer = (MemoryBuffer *)data; @@ -148,7 +148,7 @@ void GaussianAlphaYBlurOperation::executePixel(float *color, int x, int y, void /* blend between the max value and gauss blue - gives nice feather */ const float value_blur = alpha_accum / multiplier_accum; const float value_final = (value_max * distfacinv_max) + (value_blur * (1.0f - distfacinv_max)); - color[0] = finv_test(value_final, do_invert); + output[0] = finv_test(value_final, do_invert); } void GaussianAlphaYBlurOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.h b/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.h index 050b0c384cb..cb8b2e048ce 100644 --- a/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.h +++ b/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.h @@ -40,7 +40,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); /** * @brief initialize the execution diff --git a/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp index 74043e187bc..d97d2f15ded 100644 --- a/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp @@ -112,7 +112,7 @@ void GaussianBokehBlurOperation::updateGauss() } } -void GaussianBokehBlurOperation::executePixel(float *color, int x, int y, void *data) +void GaussianBokehBlurOperation::executePixel(float output[4], int x, int y, void *data) { float tempColor[4]; tempColor[0] = 0; @@ -152,7 +152,7 @@ void GaussianBokehBlurOperation::executePixel(float *color, int x, int y, void * } } - mul_v4_v4fl(color, tempColor, 1.0f / multiplier_accum); + mul_v4_v4fl(output, tempColor, 1.0f / multiplier_accum); } void GaussianBokehBlurOperation::deinitExecution() @@ -262,7 +262,7 @@ void GaussianBlurReferenceOperation::updateGauss() m_maintabs[i] = make_gausstab(i + 1); } -void GaussianBlurReferenceOperation::executePixel(float *color, int x, int y, void *data) +void GaussianBlurReferenceOperation::executePixel(float output[4], int x, int y, void *data) { MemoryBuffer *memorybuffer = (MemoryBuffer *)data; float *buffer = memorybuffer->getBuffer(); @@ -285,7 +285,7 @@ void GaussianBlurReferenceOperation::executePixel(float *color, int x, int y, vo else if (refrady < 1) refrady = 1; if (refradx == 1 && refrady == 1) { - memorybuffer->readNoCheck(color, x, y); + memorybuffer->readNoCheck(output, x, y); } else { int minxr = x - refradx < 0 ? -x : -refradx; @@ -314,10 +314,10 @@ void GaussianBlurReferenceOperation::executePixel(float *color, int x, int y, vo } } sum = 1.0f / sum; - color[0] = rval * sum; - color[1] = gval * sum; - color[2] = bval * sum; - color[3] = aval * sum; + output[0] = rval * sum; + output[1] = gval * sum; + output[2] = bval * sum; + output[3] = aval * sum; } } diff --git a/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.h b/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.h index 45140855464..9fcf1e10e6a 100644 --- a/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.h +++ b/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.h @@ -39,7 +39,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); /** * Deinitialize the execution @@ -66,7 +66,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); /** * Deinitialize the execution diff --git a/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp index 1cf675a769a..01c85738822 100644 --- a/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp @@ -73,7 +73,7 @@ void GaussianXBlurOperation::updateGauss() } } -void GaussianXBlurOperation::executePixel(float *color, int x, int y, void *data) +void GaussianXBlurOperation::executePixel(float output[4], int x, int y, void *data) { float color_accum[4] = {0.0f, 0.0f, 0.0f, 0.0f}; float multiplier_accum = 0.0f; @@ -101,7 +101,7 @@ void GaussianXBlurOperation::executePixel(float *color, int x, int y, void *data multiplier_accum += multiplier; bufferindex += offsetadd; } - mul_v4_v4fl(color, color_accum, 1.0f / multiplier_accum); + mul_v4_v4fl(output, color_accum, 1.0f / multiplier_accum); } void GaussianXBlurOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_GaussianXBlurOperation.h b/source/blender/compositor/operations/COM_GaussianXBlurOperation.h index a4a0dc655e2..4c3786b0810 100644 --- a/source/blender/compositor/operations/COM_GaussianXBlurOperation.h +++ b/source/blender/compositor/operations/COM_GaussianXBlurOperation.h @@ -36,7 +36,7 @@ public: /** * @brief the inner loop of this program */ - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); /** * @brief initialize the execution diff --git a/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp index 135dcf60872..298b4660c6a 100644 --- a/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp @@ -73,7 +73,7 @@ void GaussianYBlurOperation::updateGauss() } } -void GaussianYBlurOperation::executePixel(float *color, int x, int y, void *data) +void GaussianYBlurOperation::executePixel(float output[4], int x, int y, void *data) { float color_accum[4] = {0.0f, 0.0f, 0.0f, 0.0f}; float multiplier_accum = 0.0f; @@ -102,7 +102,7 @@ void GaussianYBlurOperation::executePixel(float *color, int x, int y, void *data madd_v4_v4fl(color_accum, &buffer[bufferindex], multiplier); multiplier_accum += multiplier; } - mul_v4_v4fl(color, color_accum, 1.0f / multiplier_accum); + mul_v4_v4fl(output, color_accum, 1.0f / multiplier_accum); } void GaussianYBlurOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_GaussianYBlurOperation.h b/source/blender/compositor/operations/COM_GaussianYBlurOperation.h index e3e0d8891d3..69dcb7e48fb 100644 --- a/source/blender/compositor/operations/COM_GaussianYBlurOperation.h +++ b/source/blender/compositor/operations/COM_GaussianYBlurOperation.h @@ -36,7 +36,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); /** * @brief initialize the execution diff --git a/source/blender/compositor/operations/COM_GlareThresholdOperation.cpp b/source/blender/compositor/operations/COM_GlareThresholdOperation.cpp index 7f32618d2af..1c7d2659c39 100644 --- a/source/blender/compositor/operations/COM_GlareThresholdOperation.cpp +++ b/source/blender/compositor/operations/COM_GlareThresholdOperation.cpp @@ -30,7 +30,7 @@ GlareThresholdOperation::GlareThresholdOperation() : NodeOperation() this->m_inputProgram = NULL; } -void GlareThresholdOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) +void GlareThresholdOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) { NodeOperation::determineResolution(resolution, preferredResolution); resolution[0] = resolution[0] / (1 << this->m_settings->quality); @@ -42,19 +42,19 @@ void GlareThresholdOperation::initExecution() this->m_inputProgram = this->getInputSocketReader(0); } -void GlareThresholdOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void GlareThresholdOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { const float threshold = this->m_settings->threshold; - this->m_inputProgram->read(color, x, y, sampler); - if (rgb_to_luma_y(color) >= threshold) { - color[0] -= threshold, color[1] -= threshold, color[2] -= threshold; - color[0] = MAX2(color[0], 0.0f); - color[1] = MAX2(color[1], 0.0f); - color[2] = MAX2(color[2], 0.0f); + this->m_inputProgram->read(output, x, y, sampler); + if (rgb_to_luma_y(output) >= threshold) { + output[0] -= threshold, output[1] -= threshold, output[2] -= threshold; + output[0] = max(output[0], 0.0f); + output[1] = max(output[1], 0.0f); + output[2] = max(output[2], 0.0f); } else { - zero_v3(color); + zero_v3(output); } } diff --git a/source/blender/compositor/operations/COM_GlareThresholdOperation.h b/source/blender/compositor/operations/COM_GlareThresholdOperation.h index faba6c6c47c..44f9db6a483 100644 --- a/source/blender/compositor/operations/COM_GlareThresholdOperation.h +++ b/source/blender/compositor/operations/COM_GlareThresholdOperation.h @@ -42,7 +42,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution @@ -58,6 +58,6 @@ public: this->m_settings = settings; } - void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]); + void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); }; #endif diff --git a/source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.cpp b/source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.cpp index df3d00278c3..57d43f67c9b 100644 --- a/source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.cpp +++ b/source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.cpp @@ -45,7 +45,7 @@ void HueSaturationValueCorrectOperation::initExecution() this->m_inputProgram = this->getInputSocketReader(0); } -void HueSaturationValueCorrectOperation::executePixel(float *output, float x, float y, PixelSampler sampler) +void HueSaturationValueCorrectOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float hsv[4], f; diff --git a/source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.h b/source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.h index ba565a9f752..5e57d09a51e 100644 --- a/source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.h +++ b/source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.h @@ -37,7 +37,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *Vector, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_IDMaskOperation.cpp b/source/blender/compositor/operations/COM_IDMaskOperation.cpp index daa2ac9299e..4b9bcb118e7 100644 --- a/source/blender/compositor/operations/COM_IDMaskOperation.cpp +++ b/source/blender/compositor/operations/COM_IDMaskOperation.cpp @@ -33,13 +33,13 @@ void IDMaskOperation::initExecution() this->m_inputProgram = this->getInputSocketReader(0); } -void IDMaskOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void IDMaskOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputValue[4]; this->m_inputProgram->read(inputValue, x, y, sampler); const float a = (inputValue[0] == this->m_objectIndex) ? 1.0f : 0.0f; - color[0] = a; + output[0] = a; } void IDMaskOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_IDMaskOperation.h b/source/blender/compositor/operations/COM_IDMaskOperation.h index 9d356536499..68c5cf4c1dc 100644 --- a/source/blender/compositor/operations/COM_IDMaskOperation.h +++ b/source/blender/compositor/operations/COM_IDMaskOperation.h @@ -39,7 +39,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_ImageOperation.cpp b/source/blender/compositor/operations/COM_ImageOperation.cpp index 36cc6ca8d6d..4ec5643c0bb 100644 --- a/source/blender/compositor/operations/COM_ImageOperation.cpp +++ b/source/blender/compositor/operations/COM_ImageOperation.cpp @@ -94,7 +94,7 @@ void BaseImageOperation::deinitExecution() this->m_imageBuffer = NULL; } -void BaseImageOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) +void BaseImageOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) { ImBuf *stackbuf = getImBuf(); @@ -107,32 +107,32 @@ void BaseImageOperation::determineResolution(unsigned int resolution[], unsigned } } -void ImageOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void ImageOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { if (this->m_imageBuffer == NULL || x < 0 || y < 0 || x >= this->getWidth() || y >= this->getHeight() ) { - zero_v4(color); + zero_v4(output); } else { switch (sampler) { case COM_PS_NEAREST: - neareast_interpolation_color(this->m_buffer, NULL, color, x, y); + neareast_interpolation_color(this->m_buffer, NULL, output, x, y); break; case COM_PS_BILINEAR: - bilinear_interpolation_color(this->m_buffer, NULL, color, x, y); + bilinear_interpolation_color(this->m_buffer, NULL, output, x, y); break; case COM_PS_BICUBIC: - bicubic_interpolation_color(this->m_buffer, NULL, color, x, y); + bicubic_interpolation_color(this->m_buffer, NULL, output, x, y); break; } } } -void ImageAlphaOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void ImageAlphaOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float tempcolor[4]; if (this->m_imageBuffer == NULL || x < 0 || y < 0 || x >= this->getWidth() || y >= this->getHeight() ) { - color[0] = 0.0f; + output[0] = 0.0f; } else { tempcolor[3] = 1.0f; @@ -147,17 +147,17 @@ void ImageAlphaOperation::executePixel(float *color, float x, float y, PixelSamp bicubic_interpolation_color(this->m_buffer, NULL, tempcolor, x, y); break; } - color[0] = tempcolor[3]; + output[0] = tempcolor[3]; } } -void ImageDepthOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void ImageDepthOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { if (this->m_depthBuffer == NULL || x < 0 || y < 0 || x >= this->getWidth() || y >= this->getHeight() ) { - color[0] = 0.0f; + output[0] = 0.0f; } else { int offset = y * this->m_width + x; - color[0] = this->m_depthBuffer[offset]; + output[0] = this->m_depthBuffer[offset]; } } diff --git a/source/blender/compositor/operations/COM_ImageOperation.h b/source/blender/compositor/operations/COM_ImageOperation.h index ed7b10cd4f5..e75e7daa186 100644 --- a/source/blender/compositor/operations/COM_ImageOperation.h +++ b/source/blender/compositor/operations/COM_ImageOperation.h @@ -53,7 +53,7 @@ protected: /** * Determine the output resolution. The resolution is retrieved from the Renderer */ - void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]); + void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); virtual ImBuf *getImBuf(); @@ -72,7 +72,7 @@ public: * Constructor */ ImageOperation(); - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; class ImageAlphaOperation : public BaseImageOperation { public: @@ -80,7 +80,7 @@ public: * Constructor */ ImageAlphaOperation(); - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; class ImageDepthOperation : public BaseImageOperation { public: @@ -88,6 +88,6 @@ public: * Constructor */ ImageDepthOperation(); - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/compositor/operations/COM_InpaintOperation.cpp b/source/blender/compositor/operations/COM_InpaintOperation.cpp index 6e198f223f9..e586dded8db 100644 --- a/source/blender/compositor/operations/COM_InpaintOperation.cpp +++ b/source/blender/compositor/operations/COM_InpaintOperation.cpp @@ -240,11 +240,11 @@ void *InpaintSimpleOperation::initializeTileData(rcti *rect) return this->m_cached_buffer; } -void InpaintSimpleOperation::executePixel(float *color, int x, int y, void *data) +void InpaintSimpleOperation::executePixel(float output[4], int x, int y, void *data) { this->clamp_xy(x, y); - copy_v3_v3(color, this->get_pixel(x, y)); - color[3] = 1.0f; + copy_v3_v3(output, this->get_pixel(x, y)); + output[3] = 1.0f; } void InpaintSimpleOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_InpaintOperation.h b/source/blender/compositor/operations/COM_InpaintOperation.h index 2f066e19065..59465ed3432 100644 --- a/source/blender/compositor/operations/COM_InpaintOperation.h +++ b/source/blender/compositor/operations/COM_InpaintOperation.h @@ -45,7 +45,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_InvertOperation.cpp b/source/blender/compositor/operations/COM_InvertOperation.cpp index 0802d2d2523..9c2dd825709 100644 --- a/source/blender/compositor/operations/COM_InvertOperation.cpp +++ b/source/blender/compositor/operations/COM_InvertOperation.cpp @@ -39,7 +39,7 @@ void InvertOperation::initExecution() this->m_inputColorProgram = this->getInputSocketReader(1); } -void InvertOperation::executePixel(float *out, float x, float y, PixelSampler sampler) +void InvertOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputValue[4]; float inputColor[4]; @@ -50,18 +50,18 @@ void InvertOperation::executePixel(float *out, float x, float y, PixelSampler sa const float invertedValue = 1.0f - value; if (this->m_color) { - out[0] = (1.0f - inputColor[0]) * value + inputColor[0] * invertedValue; - out[1] = (1.0f - inputColor[1]) * value + inputColor[1] * invertedValue; - out[2] = (1.0f - inputColor[2]) * value + inputColor[2] * invertedValue; + output[0] = (1.0f - inputColor[0]) * value + inputColor[0] * invertedValue; + output[1] = (1.0f - inputColor[1]) * value + inputColor[1] * invertedValue; + output[2] = (1.0f - inputColor[2]) * value + inputColor[2] * invertedValue; } else { - copy_v3_v3(out, inputColor); + copy_v3_v3(output, inputColor); } if (this->m_alpha) - out[3] = (1.0f - inputColor[3]) * value + inputColor[3] * invertedValue; + output[3] = (1.0f - inputColor[3]) * value + inputColor[3] * invertedValue; else - out[3] = inputColor[3]; + output[3] = inputColor[3]; } diff --git a/source/blender/compositor/operations/COM_InvertOperation.h b/source/blender/compositor/operations/COM_InvertOperation.h index 46a5d80b04a..7fded7bb1e4 100644 --- a/source/blender/compositor/operations/COM_InvertOperation.h +++ b/source/blender/compositor/operations/COM_InvertOperation.h @@ -42,7 +42,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_KeyingBlurOperation.cpp b/source/blender/compositor/operations/COM_KeyingBlurOperation.cpp index 00ea5877d63..9fb9efe4fc7 100644 --- a/source/blender/compositor/operations/COM_KeyingBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_KeyingBlurOperation.cpp @@ -46,7 +46,7 @@ void *KeyingBlurOperation::initializeTileData(rcti *rect) return buffer; } -void KeyingBlurOperation::executePixel(float *color, int x, int y, void *data) +void KeyingBlurOperation::executePixel(float output[4], int x, int y, void *data) { MemoryBuffer *inputBuffer = (MemoryBuffer *)data; float *buffer = inputBuffer->getBuffer(); @@ -85,7 +85,7 @@ void KeyingBlurOperation::executePixel(float *color, int x, int y, void *data) average /= (float) count; - color[0] = average; + output[0] = average; } bool KeyingBlurOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) diff --git a/source/blender/compositor/operations/COM_KeyingBlurOperation.h b/source/blender/compositor/operations/COM_KeyingBlurOperation.h index aaacf66a656..a1c56cc9c07 100644 --- a/source/blender/compositor/operations/COM_KeyingBlurOperation.h +++ b/source/blender/compositor/operations/COM_KeyingBlurOperation.h @@ -47,7 +47,7 @@ public: void *initializeTileData(rcti *rect); - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); }; diff --git a/source/blender/compositor/operations/COM_KeyingClipOperation.cpp b/source/blender/compositor/operations/COM_KeyingClipOperation.cpp index d8afaceb37b..909eeed8937 100644 --- a/source/blender/compositor/operations/COM_KeyingClipOperation.cpp +++ b/source/blender/compositor/operations/COM_KeyingClipOperation.cpp @@ -51,7 +51,7 @@ void *KeyingClipOperation::initializeTileData(rcti *rect) return buffer; } -void KeyingClipOperation::executePixel(float *color, int x, int y, void *data) +void KeyingClipOperation::executePixel(float output[4], int x, int y, void *data) { const int delta = this->m_kernelRadius; const float tolerance = this->m_kernelTolerance; @@ -92,20 +92,20 @@ void KeyingClipOperation::executePixel(float *color, int x, int y, void *data) if (this->m_isEdgeMatte) { if (ok) - color[0] = 0.0f; + output[0] = 0.0f; else - color[0] = 1.0f; + output[0] = 1.0f; } else { - color[0] = value; + output[0] = value; if (ok) { - if (color[0] < this->m_clipBlack) - color[0] = 0.0f; - else if (color[0] >= this->m_clipWhite) - color[0] = 1.0f; + if (output[0] < this->m_clipBlack) + output[0] = 0.0f; + else if (output[0] >= this->m_clipWhite) + output[0] = 1.0f; else - color[0] = (color[0] - this->m_clipBlack) / (this->m_clipWhite - this->m_clipBlack); + output[0] = (output[0] - this->m_clipBlack) / (this->m_clipWhite - this->m_clipBlack); } } } diff --git a/source/blender/compositor/operations/COM_KeyingClipOperation.h b/source/blender/compositor/operations/COM_KeyingClipOperation.h index eacbccc0818..d79bd14b900 100644 --- a/source/blender/compositor/operations/COM_KeyingClipOperation.h +++ b/source/blender/compositor/operations/COM_KeyingClipOperation.h @@ -51,7 +51,7 @@ public: void *initializeTileData(rcti *rect); - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); }; diff --git a/source/blender/compositor/operations/COM_KeyingDespillOperation.cpp b/source/blender/compositor/operations/COM_KeyingDespillOperation.cpp index 2f3fa2bd72a..4426666f100 100644 --- a/source/blender/compositor/operations/COM_KeyingDespillOperation.cpp +++ b/source/blender/compositor/operations/COM_KeyingDespillOperation.cpp @@ -65,7 +65,7 @@ void KeyingDespillOperation::deinitExecution() this->m_screenReader = NULL; } -void KeyingDespillOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void KeyingDespillOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float pixelColor[4]; float screenColor[4]; @@ -85,12 +85,9 @@ void KeyingDespillOperation::executePixel(float *color, float x, float y, PixelS average_value = this->m_colorBalance * pixelColor[min_channel] + (1.0f - this->m_colorBalance) * pixelColor[max_channel]; amount = (pixelColor[screen_primary_channel] - average_value); - color[0] = pixelColor[0]; - color[1] = pixelColor[1]; - color[2] = pixelColor[2]; - color[3] = pixelColor[3]; + copy_v4_v4(output, pixelColor); if (this->m_despillFactor * amount > 0) { - color[screen_primary_channel] = pixelColor[screen_primary_channel] - this->m_despillFactor * amount; + output[screen_primary_channel] = pixelColor[screen_primary_channel] - this->m_despillFactor * amount; } } diff --git a/source/blender/compositor/operations/COM_KeyingDespillOperation.h b/source/blender/compositor/operations/COM_KeyingDespillOperation.h index c6e489057c3..18e771b14f1 100644 --- a/source/blender/compositor/operations/COM_KeyingDespillOperation.h +++ b/source/blender/compositor/operations/COM_KeyingDespillOperation.h @@ -45,7 +45,7 @@ public: void setDespillFactor(float value) {this->m_despillFactor = value;} void setColorBalance(float value) {this->m_colorBalance = value;} - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/compositor/operations/COM_KeyingOperation.cpp b/source/blender/compositor/operations/COM_KeyingOperation.cpp index ed9e4f1df16..35138cf0b92 100644 --- a/source/blender/compositor/operations/COM_KeyingOperation.cpp +++ b/source/blender/compositor/operations/COM_KeyingOperation.cpp @@ -77,7 +77,7 @@ void KeyingOperation::deinitExecution() this->m_screenReader = NULL; } -void KeyingOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void KeyingOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float pixelColor[4]; float screenColor[4]; @@ -93,7 +93,7 @@ void KeyingOperation::executePixel(float *color, float x, float y, PixelSampler * because saturation and falloff calculation is based on the fact * that pixels are not overexposured */ - color[0] = 1.0f; + output[0] = 1.0f; } else { float saturation = get_pixel_saturation(pixelColor, this->m_screenBalance, primary_channel); @@ -103,19 +103,19 @@ void KeyingOperation::executePixel(float *color, float x, float y, PixelSampler /* means main channel of pixel is different from screen, * assume this is completely a foreground */ - color[0] = 1.0f; + output[0] = 1.0f; } else if (saturation >= screen_saturation) { /* matched main channels and higher saturation on pixel * is treated as completely background */ - color[0] = 0.0f; + output[0] = 0.0f; } else { /* nice alpha falloff on edges */ float distance = 1.0f - saturation / screen_saturation; - color[0] = distance; + output[0] = distance; } } } diff --git a/source/blender/compositor/operations/COM_KeyingOperation.h b/source/blender/compositor/operations/COM_KeyingOperation.h index 5ca4db7fc75..fcff9243dfc 100644 --- a/source/blender/compositor/operations/COM_KeyingOperation.h +++ b/source/blender/compositor/operations/COM_KeyingOperation.h @@ -49,7 +49,7 @@ public: void setScreenBalance(float value) {this->m_screenBalance = value;} - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/compositor/operations/COM_KeyingScreenOperation.cpp b/source/blender/compositor/operations/COM_KeyingScreenOperation.cpp index 050aa3391d5..c9b129d8dcf 100644 --- a/source/blender/compositor/operations/COM_KeyingScreenOperation.cpp +++ b/source/blender/compositor/operations/COM_KeyingScreenOperation.cpp @@ -280,7 +280,7 @@ void KeyingScreenOperation::deinitializeTileData(rcti *rect, void *data) MEM_freeN(tile_data); } -void KeyingScreenOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) +void KeyingScreenOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) { resolution[0] = 0; resolution[1] = 0; @@ -298,12 +298,12 @@ void KeyingScreenOperation::determineResolution(unsigned int resolution[], unsig } } -void KeyingScreenOperation::executePixel(float *color, int x, int y, void *data) +void KeyingScreenOperation::executePixel(float output[4], int x, int y, void *data) { - color[0] = 0.0f; - color[1] = 0.0f; - color[2] = 0.0f; - color[3] = 1.0f; + output[0] = 0.0f; + output[1] = 0.0f; + output[2] = 0.0f; + output[3] = 1.0f; if (this->m_movieClip && data) { TriangulationData *triangulation = this->m_cachedTriangulation; @@ -324,9 +324,9 @@ void KeyingScreenOperation::executePixel(float *color, int x, int y, void *data) if (barycentric_coords_v2(a->co, b->co, c->co, co, w)) { if (barycentric_inside_triangle_v2(w)) { - color[0] = a->color[0] * w[0] + b->color[0] * w[1] + c->color[0] * w[2]; - color[1] = a->color[1] * w[0] + b->color[1] * w[1] + c->color[1] * w[2]; - color[2] = a->color[2] * w[0] + b->color[2] * w[1] + c->color[2] * w[2]; + output[0] = a->color[0] * w[0] + b->color[0] * w[1] + c->color[0] * w[2]; + output[1] = a->color[1] * w[0] + b->color[1] * w[1] + c->color[1] * w[2]; + output[2] = a->color[2] * w[0] + b->color[2] * w[1] + c->color[2] * w[2]; break; } diff --git a/source/blender/compositor/operations/COM_KeyingScreenOperation.h b/source/blender/compositor/operations/COM_KeyingScreenOperation.h index 04e47e6e77f..8b1128a4da3 100644 --- a/source/blender/compositor/operations/COM_KeyingScreenOperation.h +++ b/source/blender/compositor/operations/COM_KeyingScreenOperation.h @@ -62,7 +62,7 @@ protected: /** * Determine the output resolution. The resolution is retrieved from the Renderer */ - void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]); + void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); TriangulationData *buildVoronoiTriangulation(); @@ -79,7 +79,7 @@ public: void setTrackingObject(const char *object) {strncpy(this->m_trackingObject, object, sizeof(this->m_trackingObject));} void setFramenumber(int framenumber) {this->m_framenumber = framenumber;} - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); }; #endif diff --git a/source/blender/compositor/operations/COM_LuminanceMatteOperation.cpp b/source/blender/compositor/operations/COM_LuminanceMatteOperation.cpp index 31aae18992b..4c65113ee70 100644 --- a/source/blender/compositor/operations/COM_LuminanceMatteOperation.cpp +++ b/source/blender/compositor/operations/COM_LuminanceMatteOperation.cpp @@ -40,7 +40,7 @@ void LuminanceMatteOperation::deinitExecution() this->m_inputImageProgram = NULL; } -void LuminanceMatteOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void LuminanceMatteOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inColor[4]; @@ -52,7 +52,7 @@ void LuminanceMatteOperation::executePixel(float *outputValue, float x, float y, this->m_inputImageProgram->read(inColor, x, y, sampler); /* one line thread-friend algorithm: - * outputValue[0] = max(inputValue[3], min(high, max(low, ((inColor[0]-low)/(high-low)))) + * output[0] = max(inputValue[3], min(high, max(low, ((inColor[0]-low)/(high-low)))) */ /* test range */ @@ -73,11 +73,11 @@ void LuminanceMatteOperation::executePixel(float *outputValue, float x, float y, /* don't make something that was more transparent less transparent */ if (alpha < inColor[3]) { - outputValue[0] = alpha; + output[0] = alpha; } else { /* leave now it was before */ - outputValue[0] = inColor[3]; + output[0] = inColor[3]; } } diff --git a/source/blender/compositor/operations/COM_LuminanceMatteOperation.h b/source/blender/compositor/operations/COM_LuminanceMatteOperation.h index c1ab628f787..009a1e8825e 100644 --- a/source/blender/compositor/operations/COM_LuminanceMatteOperation.h +++ b/source/blender/compositor/operations/COM_LuminanceMatteOperation.h @@ -41,7 +41,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); void initExecution(); void deinitExecution(); diff --git a/source/blender/compositor/operations/COM_MapUVOperation.cpp b/source/blender/compositor/operations/COM_MapUVOperation.cpp index a5f503a669b..1a441b0ac9a 100644 --- a/source/blender/compositor/operations/COM_MapUVOperation.cpp +++ b/source/blender/compositor/operations/COM_MapUVOperation.cpp @@ -40,7 +40,7 @@ void MapUVOperation::initExecution() this->m_inputUVProgram = this->getInputSocketReader(1); } -void MapUVOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void MapUVOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputUV[4]; float uv_a[4], uv_b[4]; @@ -52,7 +52,7 @@ void MapUVOperation::executePixel(float *color, float x, float y, PixelSampler s this->m_inputUVProgram->read(inputUV, x, y, sampler); if (inputUV[2] == 0.f) { - zero_v4(color); + zero_v4(output); return; } /* adaptive sampling, red (U) channel */ @@ -107,11 +107,11 @@ void MapUVOperation::executePixel(float *color, float x, float y, PixelSampler s u = inputUV[0] * this->m_inputColorProgram->getWidth(); v = inputUV[1] * this->m_inputColorProgram->getHeight(); - this->m_inputColorProgram->read(color, u, v, dx, dy); + this->m_inputColorProgram->read(output, u, v, dx, dy); /* "premul" */ if (alpha < 1.0f) { - mul_v4_fl(color, alpha); + mul_v4_fl(output, alpha); } } diff --git a/source/blender/compositor/operations/COM_MapUVOperation.h b/source/blender/compositor/operations/COM_MapUVOperation.h index ae042f60789..c8356c1a7ad 100644 --- a/source/blender/compositor/operations/COM_MapUVOperation.h +++ b/source/blender/compositor/operations/COM_MapUVOperation.h @@ -45,7 +45,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_MapValueOperation.cpp b/source/blender/compositor/operations/COM_MapValueOperation.cpp index 96e586ccef8..7acc431f7b5 100644 --- a/source/blender/compositor/operations/COM_MapValueOperation.cpp +++ b/source/blender/compositor/operations/COM_MapValueOperation.cpp @@ -34,7 +34,7 @@ void MapValueOperation::initExecution() this->m_inputOperation = this->getInputSocketReader(0); } -void MapValueOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MapValueOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float src[4]; this->m_inputOperation->read(src, x, y, sampler); @@ -47,7 +47,7 @@ void MapValueOperation::executePixel(float *outputValue, float x, float y, Pixel if (value > texmap->max[0]) value = texmap->max[0]; - outputValue[0] = value; + output[0] = value; } void MapValueOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_MapValueOperation.h b/source/blender/compositor/operations/COM_MapValueOperation.h index a2664c32a4e..418d6d9bf4d 100644 --- a/source/blender/compositor/operations/COM_MapValueOperation.h +++ b/source/blender/compositor/operations/COM_MapValueOperation.h @@ -45,7 +45,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_MaskOperation.cpp b/source/blender/compositor/operations/COM_MaskOperation.cpp index 1812b7372bb..a156dfc1d99 100644 --- a/source/blender/compositor/operations/COM_MaskOperation.cpp +++ b/source/blender/compositor/operations/COM_MaskOperation.cpp @@ -109,7 +109,7 @@ void MaskOperation::deinitExecution() } } -void MaskOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) +void MaskOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) { if (this->m_maskWidth == 0 || this->m_maskHeight == 0) { NodeOperation::determineResolution(resolution, preferredResolution); @@ -127,29 +127,30 @@ void MaskOperation::determineResolution(unsigned int resolution[], unsigned int } } -void MaskOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void MaskOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { - const float xy[2] = {x * this->m_maskWidthInv, y * this->m_maskHeightInv}; + const float xy[2] = {x * this->m_maskWidthInv, + y * this->m_maskHeightInv}; if (this->m_rasterMaskHandleTot == 1) { if (this->m_rasterMaskHandles[0]) { - color[0] = BKE_maskrasterize_handle_sample(this->m_rasterMaskHandles[0], xy); + output[0] = BKE_maskrasterize_handle_sample(this->m_rasterMaskHandles[0], xy); } else { - color[0] = 0.0f; + output[0] = 0.0f; } } else { /* incase loop below fails */ - color[0] = 0.0f; + output[0] = 0.0f; for (unsigned int i = 0; i < this->m_rasterMaskHandleTot; i++) { if (this->m_rasterMaskHandles[i]) { - color[0] += BKE_maskrasterize_handle_sample(this->m_rasterMaskHandles[i], xy); + output[0] += BKE_maskrasterize_handle_sample(this->m_rasterMaskHandles[i], xy); } } /* until we get better falloff */ - color[0] /= this->m_rasterMaskHandleTot; + output[0] /= this->m_rasterMaskHandleTot; } } diff --git a/source/blender/compositor/operations/COM_MaskOperation.h b/source/blender/compositor/operations/COM_MaskOperation.h index 6e1735bcf9d..2de71afcfa7 100644 --- a/source/blender/compositor/operations/COM_MaskOperation.h +++ b/source/blender/compositor/operations/COM_MaskOperation.h @@ -56,7 +56,7 @@ protected: /** * Determine the output resolution. The resolution is retrieved from the Renderer */ - void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]); + void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); public: MaskOperation(); @@ -83,7 +83,7 @@ public: void setMotionBlurSamples(int samples) { this->m_rasterMaskHandleTot = min(max(1, samples), CMP_NODE_MASK_MBLUR_SAMPLES_MAX); } void setMotionBlurShutter(float shutter) { this->m_frame_shutter = shutter; } - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/compositor/operations/COM_MathBaseOperation.cpp b/source/blender/compositor/operations/COM_MathBaseOperation.cpp index 4644dce572d..7039689aa5f 100644 --- a/source/blender/compositor/operations/COM_MathBaseOperation.cpp +++ b/source/blender/compositor/operations/COM_MathBaseOperation.cpp @@ -48,10 +48,10 @@ void MathBaseOperation::deinitExecution() this->m_inputValue2Operation = NULL; } -void MathBaseOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) +void MathBaseOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) { InputSocket *socket; - unsigned int tempPreferredResolution[] = {0, 0}; + unsigned int tempPreferredResolution[2] = {0, 0}; unsigned int tempResolution[2]; socket = this->getInputSocket(0); @@ -72,7 +72,7 @@ void MathBaseOperation::clampIfNeeded(float *color) } } -void MathAddOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MathAddOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputValue1[4]; float inputValue2[4]; @@ -80,12 +80,12 @@ void MathAddOperation::executePixel(float *outputValue, float x, float y, PixelS this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler); this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler); - outputValue[0] = inputValue1[0] + inputValue2[0]; + output[0] = inputValue1[0] + inputValue2[0]; - clampIfNeeded(outputValue); + clampIfNeeded(output); } -void MathSubtractOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MathSubtractOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputValue1[4]; float inputValue2[4]; @@ -93,12 +93,12 @@ void MathSubtractOperation::executePixel(float *outputValue, float x, float y, P this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler); this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler); - outputValue[0] = inputValue1[0] - inputValue2[0]; + output[0] = inputValue1[0] - inputValue2[0]; - clampIfNeeded(outputValue); + clampIfNeeded(output); } -void MathMultiplyOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MathMultiplyOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputValue1[4]; float inputValue2[4]; @@ -106,12 +106,12 @@ void MathMultiplyOperation::executePixel(float *outputValue, float x, float y, P this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler); this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler); - outputValue[0] = inputValue1[0] * inputValue2[0]; + output[0] = inputValue1[0] * inputValue2[0]; - clampIfNeeded(outputValue); + clampIfNeeded(output); } -void MathDivideOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MathDivideOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputValue1[4]; float inputValue2[4]; @@ -120,14 +120,14 @@ void MathDivideOperation::executePixel(float *outputValue, float x, float y, Pix this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler); if (inputValue2[0] == 0) /* We don't want to divide by zero. */ - outputValue[0] = 0.0; + output[0] = 0.0; else - outputValue[0] = inputValue1[0] / inputValue2[0]; + output[0] = inputValue1[0] / inputValue2[0]; - clampIfNeeded(outputValue); + clampIfNeeded(output); } -void MathSineOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MathSineOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputValue1[4]; float inputValue2[4]; @@ -135,12 +135,12 @@ void MathSineOperation::executePixel(float *outputValue, float x, float y, Pixel this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler); this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler); - outputValue[0] = sin(inputValue1[0]); + output[0] = sin(inputValue1[0]); - clampIfNeeded(outputValue); + clampIfNeeded(output); } -void MathCosineOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MathCosineOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputValue1[4]; float inputValue2[4]; @@ -148,12 +148,12 @@ void MathCosineOperation::executePixel(float *outputValue, float x, float y, Pix this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler); this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler); - outputValue[0] = cos(inputValue1[0]); + output[0] = cos(inputValue1[0]); - clampIfNeeded(outputValue); + clampIfNeeded(output); } -void MathTangentOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MathTangentOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputValue1[4]; float inputValue2[4]; @@ -161,12 +161,12 @@ void MathTangentOperation::executePixel(float *outputValue, float x, float y, Pi this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler); this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler); - outputValue[0] = tan(inputValue1[0]); + output[0] = tan(inputValue1[0]); - clampIfNeeded(outputValue); + clampIfNeeded(output); } -void MathArcSineOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MathArcSineOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputValue1[4]; float inputValue2[4]; @@ -175,14 +175,14 @@ void MathArcSineOperation::executePixel(float *outputValue, float x, float y, Pi this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler); if (inputValue1[0] <= 1 && inputValue1[0] >= -1) - outputValue[0] = asin(inputValue1[0]); + output[0] = asin(inputValue1[0]); else - outputValue[0] = 0.0; + output[0] = 0.0; - clampIfNeeded(outputValue); + clampIfNeeded(output); } -void MathArcCosineOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MathArcCosineOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputValue1[4]; float inputValue2[4]; @@ -191,14 +191,14 @@ void MathArcCosineOperation::executePixel(float *outputValue, float x, float y, this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler); if (inputValue1[0] <= 1 && inputValue1[0] >= -1) - outputValue[0] = acos(inputValue1[0]); + output[0] = acos(inputValue1[0]); else - outputValue[0] = 0.0; + output[0] = 0.0; - clampIfNeeded(outputValue); + clampIfNeeded(output); } -void MathArcTangentOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MathArcTangentOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputValue1[4]; float inputValue2[4]; @@ -206,12 +206,12 @@ void MathArcTangentOperation::executePixel(float *outputValue, float x, float y, this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler); this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler); - outputValue[0] = atan(inputValue1[0]); + output[0] = atan(inputValue1[0]); - clampIfNeeded(outputValue); + clampIfNeeded(output); } -void MathPowerOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MathPowerOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputValue1[4]; float inputValue2[4]; @@ -220,23 +220,23 @@ void MathPowerOperation::executePixel(float *outputValue, float x, float y, Pixe this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler); if (inputValue1[0] >= 0) { - outputValue[0] = pow(inputValue1[0], inputValue2[0]); + output[0] = pow(inputValue1[0], inputValue2[0]); } else { float y_mod_1 = fmod(inputValue2[0], 1); /* if input value is not nearly an integer, fall back to zero, nicer than straight rounding */ if (y_mod_1 > 0.999f || y_mod_1 < 0.001f) { - outputValue[0] = pow(inputValue1[0], floorf(inputValue2[0] + 0.5f)); + output[0] = pow(inputValue1[0], floorf(inputValue2[0] + 0.5f)); } else { - outputValue[0] = 0.0; + output[0] = 0.0; } } - clampIfNeeded(outputValue); + clampIfNeeded(output); } -void MathLogarithmOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MathLogarithmOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputValue1[4]; float inputValue2[4]; @@ -245,14 +245,14 @@ void MathLogarithmOperation::executePixel(float *outputValue, float x, float y, this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler); if (inputValue1[0] > 0 && inputValue2[0] > 0) - outputValue[0] = log(inputValue1[0]) / log(inputValue2[0]); + output[0] = log(inputValue1[0]) / log(inputValue2[0]); else - outputValue[0] = 0.0; + output[0] = 0.0; - clampIfNeeded(outputValue); + clampIfNeeded(output); } -void MathMinimumOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MathMinimumOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputValue1[4]; float inputValue2[4]; @@ -260,12 +260,12 @@ void MathMinimumOperation::executePixel(float *outputValue, float x, float y, Pi this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler); this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler); - outputValue[0] = min(inputValue1[0], inputValue2[0]); + output[0] = min(inputValue1[0], inputValue2[0]); - clampIfNeeded(outputValue); + clampIfNeeded(output); } -void MathMaximumOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MathMaximumOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputValue1[4]; float inputValue2[4]; @@ -273,12 +273,12 @@ void MathMaximumOperation::executePixel(float *outputValue, float x, float y, Pi this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler); this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler); - outputValue[0] = max(inputValue1[0], inputValue2[0]); + output[0] = max(inputValue1[0], inputValue2[0]); - clampIfNeeded(outputValue); + clampIfNeeded(output); } -void MathRoundOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MathRoundOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputValue1[4]; float inputValue2[4]; @@ -286,12 +286,12 @@ void MathRoundOperation::executePixel(float *outputValue, float x, float y, Pixe this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler); this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler); - outputValue[0] = round(inputValue1[0]); + output[0] = round(inputValue1[0]); - clampIfNeeded(outputValue); + clampIfNeeded(output); } -void MathLessThanOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MathLessThanOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputValue1[4]; float inputValue2[4]; @@ -299,12 +299,12 @@ void MathLessThanOperation::executePixel(float *outputValue, float x, float y, P this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler); this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler); - outputValue[0] = inputValue1[0] < inputValue2[0] ? 1.0f : 0.0f; + output[0] = inputValue1[0] < inputValue2[0] ? 1.0f : 0.0f; - clampIfNeeded(outputValue); + clampIfNeeded(output); } -void MathGreaterThanOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MathGreaterThanOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputValue1[4]; float inputValue2[4]; @@ -312,9 +312,9 @@ void MathGreaterThanOperation::executePixel(float *outputValue, float x, float y this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler); this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler); - outputValue[0] = inputValue1[0] > inputValue2[0] ? 1.0f : 0.0f; + output[0] = inputValue1[0] > inputValue2[0] ? 1.0f : 0.0f; - clampIfNeeded(outputValue); + clampIfNeeded(output); } diff --git a/source/blender/compositor/operations/COM_MathBaseOperation.h b/source/blender/compositor/operations/COM_MathBaseOperation.h index 8fc6c762b16..b492d06a697 100644 --- a/source/blender/compositor/operations/COM_MathBaseOperation.h +++ b/source/blender/compositor/operations/COM_MathBaseOperation.h @@ -50,7 +50,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler) = 0; + void executePixel(float output[4], float x, float y, PixelSampler sampler) = 0; /** * Initialize the execution @@ -65,7 +65,7 @@ public: /** * Determine resolution */ - void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]); + void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); void setUseClamp(bool value) { this->m_useClamp = value; } }; @@ -73,88 +73,88 @@ public: class MathAddOperation : public MathBaseOperation { public: MathAddOperation() : MathBaseOperation() {} - void executePixel(float *outputValue, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; class MathSubtractOperation : public MathBaseOperation { public: MathSubtractOperation() : MathBaseOperation() {} - void executePixel(float *outputValue, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; class MathMultiplyOperation : public MathBaseOperation { public: MathMultiplyOperation() : MathBaseOperation() {} - void executePixel(float *outputValue, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; class MathDivideOperation : public MathBaseOperation { public: MathDivideOperation() : MathBaseOperation() {} - void executePixel(float *outputValue, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; class MathSineOperation : public MathBaseOperation { public: MathSineOperation() : MathBaseOperation() {} - void executePixel(float *outputValue, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; class MathCosineOperation : public MathBaseOperation { public: MathCosineOperation() : MathBaseOperation() {} - void executePixel(float *outputValue, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; class MathTangentOperation : public MathBaseOperation { public: MathTangentOperation() : MathBaseOperation() {} - void executePixel(float *outputValue, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; class MathArcSineOperation : public MathBaseOperation { public: MathArcSineOperation() : MathBaseOperation() {} - void executePixel(float *outputValue, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; class MathArcCosineOperation : public MathBaseOperation { public: MathArcCosineOperation() : MathBaseOperation() {} - void executePixel(float *outputValue, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; class MathArcTangentOperation : public MathBaseOperation { public: MathArcTangentOperation() : MathBaseOperation() {} - void executePixel(float *outputValue, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; class MathPowerOperation : public MathBaseOperation { public: MathPowerOperation() : MathBaseOperation() {} - void executePixel(float *outputValue, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; class MathLogarithmOperation : public MathBaseOperation { public: MathLogarithmOperation() : MathBaseOperation() {} - void executePixel(float *outputValue, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; class MathMinimumOperation : public MathBaseOperation { public: MathMinimumOperation() : MathBaseOperation() {} - void executePixel(float *outputValue, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; class MathMaximumOperation : public MathBaseOperation { public: MathMaximumOperation() : MathBaseOperation() {} - void executePixel(float *outputValue, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; class MathRoundOperation : public MathBaseOperation { public: MathRoundOperation() : MathBaseOperation() {} - void executePixel(float *outputValue, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; class MathLessThanOperation : public MathBaseOperation { public: MathLessThanOperation() : MathBaseOperation() {} - void executePixel(float *outputValue, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; class MathGreaterThanOperation : public MathBaseOperation { public: MathGreaterThanOperation() : MathBaseOperation() {} - void executePixel(float *outputValue, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/compositor/operations/COM_MixAddOperation.cpp b/source/blender/compositor/operations/COM_MixAddOperation.cpp index b49c65cc010..be737f22280 100644 --- a/source/blender/compositor/operations/COM_MixAddOperation.cpp +++ b/source/blender/compositor/operations/COM_MixAddOperation.cpp @@ -27,7 +27,7 @@ MixAddOperation::MixAddOperation() : MixBaseOperation() /* pass */ } -void MixAddOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MixAddOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor1[4]; float inputColor2[4]; @@ -42,11 +42,11 @@ void MixAddOperation::executePixel(float *outputValue, float x, float y, PixelSa if (this->useValueAlphaMultiply()) { value *= inputColor2[3]; } - outputValue[0] = inputColor1[0] + value * inputColor2[0]; - outputValue[1] = inputColor1[1] + value * inputColor2[1]; - outputValue[2] = inputColor1[2] + value * inputColor2[2]; - outputValue[3] = inputColor1[3]; + output[0] = inputColor1[0] + value * inputColor2[0]; + output[1] = inputColor1[1] + value * inputColor2[1]; + output[2] = inputColor1[2] + value * inputColor2[2]; + output[3] = inputColor1[3]; - clampIfNeeded(outputValue); + clampIfNeeded(output); } diff --git a/source/blender/compositor/operations/COM_MixAddOperation.h b/source/blender/compositor/operations/COM_MixAddOperation.h index 8fc41706073..5a52846e847 100644 --- a/source/blender/compositor/operations/COM_MixAddOperation.h +++ b/source/blender/compositor/operations/COM_MixAddOperation.h @@ -39,7 +39,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/compositor/operations/COM_MixBaseOperation.cpp b/source/blender/compositor/operations/COM_MixBaseOperation.cpp index 9f9c432895e..2d40629e764 100644 --- a/source/blender/compositor/operations/COM_MixBaseOperation.cpp +++ b/source/blender/compositor/operations/COM_MixBaseOperation.cpp @@ -42,7 +42,7 @@ void MixBaseOperation::initExecution() this->m_inputColor2Operation = this->getInputSocketReader(2); } -void MixBaseOperation::executePixel(float *outputColor, float x, float y, PixelSampler sampler) +void MixBaseOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor1[4]; float inputColor2[4]; @@ -57,10 +57,10 @@ void MixBaseOperation::executePixel(float *outputColor, float x, float y, PixelS value *= inputColor2[3]; } float valuem = 1.0f - value; - outputColor[0] = valuem * (inputColor1[0]) + value * (inputColor2[0]); - outputColor[1] = valuem * (inputColor1[1]) + value * (inputColor2[1]); - outputColor[2] = valuem * (inputColor1[2]) + value * (inputColor2[2]); - outputColor[3] = inputColor1[3]; + output[0] = valuem * (inputColor1[0]) + value * (inputColor2[0]); + output[1] = valuem * (inputColor1[1]) + value * (inputColor2[1]); + output[2] = valuem * (inputColor1[2]) + value * (inputColor2[2]); + output[3] = inputColor1[3]; } void MixBaseOperation::deinitExecution() @@ -70,10 +70,10 @@ void MixBaseOperation::deinitExecution() this->m_inputColor2Operation = NULL; } -void MixBaseOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) +void MixBaseOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) { InputSocket *socket; - unsigned int tempPreferredResolution[] = {0, 0}; + unsigned int tempPreferredResolution[2] = {0, 0}; unsigned int tempResolution[2]; socket = this->getInputSocket(1); diff --git a/source/blender/compositor/operations/COM_MixBaseOperation.h b/source/blender/compositor/operations/COM_MixBaseOperation.h index 0a8ed4fa0e1..4b466d193d6 100644 --- a/source/blender/compositor/operations/COM_MixBaseOperation.h +++ b/source/blender/compositor/operations/COM_MixBaseOperation.h @@ -59,7 +59,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution @@ -71,7 +71,7 @@ public: */ void deinitExecution(); - void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]); + void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); void setUseValueAlphaMultiply(const bool value) { this->m_valueAlphaMultiply = value; } bool useValueAlphaMultiply() { return this->m_valueAlphaMultiply; } diff --git a/source/blender/compositor/operations/COM_MixBlendOperation.cpp b/source/blender/compositor/operations/COM_MixBlendOperation.cpp index 090343e8450..0ca7d460064 100644 --- a/source/blender/compositor/operations/COM_MixBlendOperation.cpp +++ b/source/blender/compositor/operations/COM_MixBlendOperation.cpp @@ -27,7 +27,7 @@ MixBlendOperation::MixBlendOperation() : MixBaseOperation() /* pass */ } -void MixBlendOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MixBlendOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor1[4]; float inputColor2[4]; @@ -43,10 +43,10 @@ void MixBlendOperation::executePixel(float *outputValue, float x, float y, Pixel value *= inputColor2[3]; } float valuem = 1.0f - value; - outputValue[0] = valuem * (inputColor1[0]) + value * (inputColor2[0]); - outputValue[1] = valuem * (inputColor1[1]) + value * (inputColor2[1]); - outputValue[2] = valuem * (inputColor1[2]) + value * (inputColor2[2]); - outputValue[3] = inputColor1[3]; + output[0] = valuem * (inputColor1[0]) + value * (inputColor2[0]); + output[1] = valuem * (inputColor1[1]) + value * (inputColor2[1]); + output[2] = valuem * (inputColor1[2]) + value * (inputColor2[2]); + output[3] = inputColor1[3]; - clampIfNeeded(outputValue); + clampIfNeeded(output); } diff --git a/source/blender/compositor/operations/COM_MixBlendOperation.h b/source/blender/compositor/operations/COM_MixBlendOperation.h index 6073ca1fc52..ce3f187a5e2 100644 --- a/source/blender/compositor/operations/COM_MixBlendOperation.h +++ b/source/blender/compositor/operations/COM_MixBlendOperation.h @@ -39,7 +39,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/compositor/operations/COM_MixBurnOperation.cpp b/source/blender/compositor/operations/COM_MixBurnOperation.cpp index fbb3cb7b27b..5cfe38766bc 100644 --- a/source/blender/compositor/operations/COM_MixBurnOperation.cpp +++ b/source/blender/compositor/operations/COM_MixBurnOperation.cpp @@ -27,7 +27,7 @@ MixBurnOperation::MixBurnOperation() : MixBaseOperation() /* pass */ } -void MixBurnOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MixBurnOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor1[4]; float inputColor2[4]; @@ -45,45 +45,45 @@ void MixBurnOperation::executePixel(float *outputValue, float x, float y, PixelS tmp = valuem + value * inputColor2[0]; if (tmp <= 0.0f) - outputValue[0] = 0.0f; + output[0] = 0.0f; else { tmp = 1.0f - (1.0f - inputColor1[0]) / tmp; if (tmp < 0.0f) - outputValue[0] = 0.0f; + output[0] = 0.0f; else if (tmp > 1.0f) - outputValue[0] = 1.0f; + output[0] = 1.0f; else - outputValue[0] = tmp; + output[0] = tmp; } tmp = valuem + value * inputColor2[1]; if (tmp <= 0.0f) - outputValue[1] = 0.0f; + output[1] = 0.0f; else { tmp = 1.0f - (1.0f - inputColor1[1]) / tmp; if (tmp < 0.0f) - outputValue[1] = 0.0f; + output[1] = 0.0f; else if (tmp > 1.0f) - outputValue[1] = 1.0f; + output[1] = 1.0f; else - outputValue[1] = tmp; + output[1] = tmp; } tmp = valuem + value * inputColor2[2]; if (tmp <= 0.0f) - outputValue[2] = 0.0f; + output[2] = 0.0f; else { tmp = 1.0f - (1.0f - inputColor1[2]) / tmp; if (tmp < 0.0f) - outputValue[2] = 0.0f; + output[2] = 0.0f; else if (tmp > 1.0f) - outputValue[2] = 1.0f; + output[2] = 1.0f; else - outputValue[2] = tmp; + output[2] = tmp; } - outputValue[3] = inputColor1[3]; + output[3] = inputColor1[3]; - clampIfNeeded(outputValue); + clampIfNeeded(output); } diff --git a/source/blender/compositor/operations/COM_MixBurnOperation.h b/source/blender/compositor/operations/COM_MixBurnOperation.h index 88435f05503..131ccfa2130 100644 --- a/source/blender/compositor/operations/COM_MixBurnOperation.h +++ b/source/blender/compositor/operations/COM_MixBurnOperation.h @@ -39,7 +39,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/compositor/operations/COM_MixColorOperation.cpp b/source/blender/compositor/operations/COM_MixColorOperation.cpp index 378cfbd9b6c..f8aca92abc7 100644 --- a/source/blender/compositor/operations/COM_MixColorOperation.cpp +++ b/source/blender/compositor/operations/COM_MixColorOperation.cpp @@ -31,7 +31,7 @@ MixColorOperation::MixColorOperation() : MixBaseOperation() /* pass */ } -void MixColorOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MixColorOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor1[4]; float inputColor2[4]; @@ -53,12 +53,12 @@ void MixColorOperation::executePixel(float *outputValue, float x, float y, Pixel float tmpr, tmpg, tmpb; rgb_to_hsv(inputColor1[0], inputColor1[1], inputColor1[2], &rH, &rS, &rV); hsv_to_rgb(colH, colS, rV, &tmpr, &tmpg, &tmpb); - outputValue[0] = valuem * (inputColor1[0]) + value * tmpr; - outputValue[1] = valuem * (inputColor1[1]) + value * tmpg; - outputValue[2] = valuem * (inputColor1[2]) + value * tmpb; + output[0] = valuem * (inputColor1[0]) + value * tmpr; + output[1] = valuem * (inputColor1[1]) + value * tmpg; + output[2] = valuem * (inputColor1[2]) + value * tmpb; } - outputValue[3] = inputColor1[3]; + output[3] = inputColor1[3]; - clampIfNeeded(outputValue); + clampIfNeeded(output); } diff --git a/source/blender/compositor/operations/COM_MixColorOperation.h b/source/blender/compositor/operations/COM_MixColorOperation.h index fb91a426f40..1409d726f03 100644 --- a/source/blender/compositor/operations/COM_MixColorOperation.h +++ b/source/blender/compositor/operations/COM_MixColorOperation.h @@ -39,7 +39,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/compositor/operations/COM_MixDarkenOperation.cpp b/source/blender/compositor/operations/COM_MixDarkenOperation.cpp index 68f9c023733..5b79f4c95ac 100644 --- a/source/blender/compositor/operations/COM_MixDarkenOperation.cpp +++ b/source/blender/compositor/operations/COM_MixDarkenOperation.cpp @@ -27,7 +27,7 @@ MixDarkenOperation::MixDarkenOperation() : MixBaseOperation() /* pass */ } -void MixDarkenOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MixDarkenOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor1[4]; float inputColor2[4]; @@ -43,17 +43,17 @@ void MixDarkenOperation::executePixel(float *outputValue, float x, float y, Pixe float valuem = 1.0f - value; float tmp; tmp = inputColor2[0] + ((1.0f - inputColor2[0]) * valuem); - if (tmp < inputColor1[0]) outputValue[0] = tmp; - else outputValue[0] = inputColor1[0]; + if (tmp < inputColor1[0]) output[0] = tmp; + else output[0] = inputColor1[0]; tmp = inputColor2[1] + ((1.0f - inputColor2[1]) * valuem); - if (tmp < inputColor1[1]) outputValue[1] = tmp; - else outputValue[1] = inputColor1[1]; + if (tmp < inputColor1[1]) output[1] = tmp; + else output[1] = inputColor1[1]; tmp = inputColor2[2] + ((1.0f - inputColor2[2]) * valuem); - if (tmp < inputColor1[2]) outputValue[2] = tmp; - else outputValue[2] = inputColor1[2]; + if (tmp < inputColor1[2]) output[2] = tmp; + else output[2] = inputColor1[2]; - outputValue[3] = inputColor1[3]; + output[3] = inputColor1[3]; - clampIfNeeded(outputValue); + clampIfNeeded(output); } diff --git a/source/blender/compositor/operations/COM_MixDarkenOperation.h b/source/blender/compositor/operations/COM_MixDarkenOperation.h index 8b5afaecbd5..f9c35fa364b 100644 --- a/source/blender/compositor/operations/COM_MixDarkenOperation.h +++ b/source/blender/compositor/operations/COM_MixDarkenOperation.h @@ -39,7 +39,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/compositor/operations/COM_MixDifferenceOperation.cpp b/source/blender/compositor/operations/COM_MixDifferenceOperation.cpp index 48964e8b78b..d2c1e5e428f 100644 --- a/source/blender/compositor/operations/COM_MixDifferenceOperation.cpp +++ b/source/blender/compositor/operations/COM_MixDifferenceOperation.cpp @@ -28,7 +28,7 @@ MixDifferenceOperation::MixDifferenceOperation() : MixBaseOperation() /* pass */ } -void MixDifferenceOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MixDifferenceOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor1[4]; float inputColor2[4]; @@ -42,11 +42,11 @@ void MixDifferenceOperation::executePixel(float *outputValue, float x, float y, value *= inputColor2[3]; } float valuem = 1.0f - value; - outputValue[0] = valuem * inputColor1[0] + value *fabsf(inputColor1[0] - inputColor2[0]); - outputValue[1] = valuem * inputColor1[1] + value *fabsf(inputColor1[1] - inputColor2[1]); - outputValue[2] = valuem * inputColor1[2] + value *fabsf(inputColor1[2] - inputColor2[2]); - outputValue[3] = inputColor1[3]; + output[0] = valuem * inputColor1[0] + value *fabsf(inputColor1[0] - inputColor2[0]); + output[1] = valuem * inputColor1[1] + value *fabsf(inputColor1[1] - inputColor2[1]); + output[2] = valuem * inputColor1[2] + value *fabsf(inputColor1[2] - inputColor2[2]); + output[3] = inputColor1[3]; - clampIfNeeded(outputValue); + clampIfNeeded(output); } diff --git a/source/blender/compositor/operations/COM_MixDifferenceOperation.h b/source/blender/compositor/operations/COM_MixDifferenceOperation.h index f4ad5d07586..7e4bf3c675c 100644 --- a/source/blender/compositor/operations/COM_MixDifferenceOperation.h +++ b/source/blender/compositor/operations/COM_MixDifferenceOperation.h @@ -39,7 +39,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/compositor/operations/COM_MixDivideOperation.cpp b/source/blender/compositor/operations/COM_MixDivideOperation.cpp index d9d2383001b..fdb1618b6e6 100644 --- a/source/blender/compositor/operations/COM_MixDivideOperation.cpp +++ b/source/blender/compositor/operations/COM_MixDivideOperation.cpp @@ -27,7 +27,7 @@ MixDivideOperation::MixDivideOperation() : MixBaseOperation() /* pass */ } -void MixDivideOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MixDivideOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor1[4]; float inputColor2[4]; @@ -43,20 +43,20 @@ void MixDivideOperation::executePixel(float *outputValue, float x, float y, Pixe float valuem = 1.0f - value; if (inputColor2[0] != 0.0f) - outputValue[0] = valuem * (inputColor1[0]) + value * (inputColor1[0]) / inputColor2[0]; + output[0] = valuem * (inputColor1[0]) + value * (inputColor1[0]) / inputColor2[0]; else - outputValue[0] = 0.0f; + output[0] = 0.0f; if (inputColor2[1] != 0.0f) - outputValue[1] = valuem * (inputColor1[1]) + value * (inputColor1[1]) / inputColor2[1]; + output[1] = valuem * (inputColor1[1]) + value * (inputColor1[1]) / inputColor2[1]; else - outputValue[1] = 0.0f; + output[1] = 0.0f; if (inputColor2[2] != 0.0f) - outputValue[2] = valuem * (inputColor1[2]) + value * (inputColor1[2]) / inputColor2[2]; + output[2] = valuem * (inputColor1[2]) + value * (inputColor1[2]) / inputColor2[2]; else - outputValue[2] = 0.0f; + output[2] = 0.0f; - outputValue[3] = inputColor1[3]; + output[3] = inputColor1[3]; - clampIfNeeded(outputValue); + clampIfNeeded(output); } diff --git a/source/blender/compositor/operations/COM_MixDivideOperation.h b/source/blender/compositor/operations/COM_MixDivideOperation.h index 8f94fc2d510..f543265075b 100644 --- a/source/blender/compositor/operations/COM_MixDivideOperation.h +++ b/source/blender/compositor/operations/COM_MixDivideOperation.h @@ -39,7 +39,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/compositor/operations/COM_MixDodgeOperation.cpp b/source/blender/compositor/operations/COM_MixDodgeOperation.cpp index 34c6e4043f2..87f60df8e1b 100644 --- a/source/blender/compositor/operations/COM_MixDodgeOperation.cpp +++ b/source/blender/compositor/operations/COM_MixDodgeOperation.cpp @@ -27,7 +27,7 @@ MixDodgeOperation::MixDodgeOperation() : MixBaseOperation() /* pass */ } -void MixDodgeOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MixDodgeOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor1[4]; float inputColor2[4]; @@ -45,50 +45,50 @@ void MixDodgeOperation::executePixel(float *outputValue, float x, float y, Pixel if (inputColor1[0] != 0.0f) { tmp = 1.0f - value * inputColor2[0]; if (tmp <= 0.0f) - outputValue[0] = 1.0f; + output[0] = 1.0f; else { tmp = inputColor1[0] / tmp; if (tmp > 1.0f) - outputValue[0] = 1.0f; + output[0] = 1.0f; else - outputValue[0] = tmp; + output[0] = tmp; } } else - outputValue[0] = 0.0f; + output[0] = 0.0f; if (inputColor1[1] != 0.0f) { tmp = 1.0f - value * inputColor2[1]; if (tmp <= 0.0f) - outputValue[1] = 1.0f; + output[1] = 1.0f; else { tmp = inputColor1[1] / tmp; if (tmp > 1.0f) - outputValue[1] = 1.0f; + output[1] = 1.0f; else - outputValue[1] = tmp; + output[1] = tmp; } } else - outputValue[1] = 0.0f; + output[1] = 0.0f; if (inputColor1[2] != 0.0f) { tmp = 1.0f - value * inputColor2[2]; if (tmp <= 0.0f) - outputValue[2] = 1.0f; + output[2] = 1.0f; else { tmp = inputColor1[2] / tmp; if (tmp > 1.0f) - outputValue[2] = 1.0f; + output[2] = 1.0f; else - outputValue[2] = tmp; + output[2] = tmp; } } else - outputValue[2] = 0.0f; + output[2] = 0.0f; - outputValue[3] = inputColor1[3]; + output[3] = inputColor1[3]; - clampIfNeeded(outputValue); + clampIfNeeded(output); } diff --git a/source/blender/compositor/operations/COM_MixDodgeOperation.h b/source/blender/compositor/operations/COM_MixDodgeOperation.h index f99a82dca8d..9a285c675c5 100644 --- a/source/blender/compositor/operations/COM_MixDodgeOperation.h +++ b/source/blender/compositor/operations/COM_MixDodgeOperation.h @@ -39,7 +39,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/compositor/operations/COM_MixGlareOperation.cpp b/source/blender/compositor/operations/COM_MixGlareOperation.cpp index 4a569404ddc..b6a9aa3da3c 100644 --- a/source/blender/compositor/operations/COM_MixGlareOperation.cpp +++ b/source/blender/compositor/operations/COM_MixGlareOperation.cpp @@ -27,7 +27,7 @@ MixGlareOperation::MixGlareOperation() : MixBaseOperation() /* pass */ } -void MixGlareOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MixGlareOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor1[4]; float inputColor2[4]; @@ -40,10 +40,10 @@ void MixGlareOperation::executePixel(float *outputValue, float x, float y, Pixel value = inputValue[0]; float mf = 2.f - 2.f * fabsf(value - 0.5f); - outputValue[0] = mf * ((inputColor1[0]) + value * (inputColor2[0] - inputColor1[0])); - outputValue[1] = mf * ((inputColor1[1]) + value * (inputColor2[1] - inputColor1[1])); - outputValue[2] = mf * ((inputColor1[2]) + value * (inputColor2[2] - inputColor1[2])); - outputValue[3] = inputColor1[3]; + output[0] = mf * ((inputColor1[0]) + value * (inputColor2[0] - inputColor1[0])); + output[1] = mf * ((inputColor1[1]) + value * (inputColor2[1] - inputColor1[1])); + output[2] = mf * ((inputColor1[2]) + value * (inputColor2[2] - inputColor1[2])); + output[3] = inputColor1[3]; - clampIfNeeded(outputValue); + clampIfNeeded(output); } diff --git a/source/blender/compositor/operations/COM_MixGlareOperation.h b/source/blender/compositor/operations/COM_MixGlareOperation.h index 23b9f2420a0..99d478e347d 100644 --- a/source/blender/compositor/operations/COM_MixGlareOperation.h +++ b/source/blender/compositor/operations/COM_MixGlareOperation.h @@ -39,7 +39,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/compositor/operations/COM_MixHueOperation.cpp b/source/blender/compositor/operations/COM_MixHueOperation.cpp index 3745f502709..5688d6b26f0 100644 --- a/source/blender/compositor/operations/COM_MixHueOperation.cpp +++ b/source/blender/compositor/operations/COM_MixHueOperation.cpp @@ -31,7 +31,7 @@ MixHueOperation::MixHueOperation() : MixBaseOperation() /* pass */ } -void MixHueOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MixHueOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor1[4]; float inputColor2[4]; @@ -53,11 +53,11 @@ void MixHueOperation::executePixel(float *outputValue, float x, float y, PixelSa float tmpr, tmpg, tmpb; rgb_to_hsv(inputColor1[0], inputColor1[1], inputColor1[2], &rH, &rS, &rV); hsv_to_rgb(colH, rS, rV, &tmpr, &tmpg, &tmpb); - outputValue[0] = valuem * (inputColor1[0]) + value * tmpr; - outputValue[1] = valuem * (inputColor1[1]) + value * tmpg; - outputValue[2] = valuem * (inputColor1[2]) + value * tmpb; + output[0] = valuem * (inputColor1[0]) + value * tmpr; + output[1] = valuem * (inputColor1[1]) + value * tmpg; + output[2] = valuem * (inputColor1[2]) + value * tmpb; } - outputValue[3] = inputColor1[3]; + output[3] = inputColor1[3]; - clampIfNeeded(outputValue); + clampIfNeeded(output); } diff --git a/source/blender/compositor/operations/COM_MixHueOperation.h b/source/blender/compositor/operations/COM_MixHueOperation.h index 1c8eadabbbd..d9864bbe3dc 100644 --- a/source/blender/compositor/operations/COM_MixHueOperation.h +++ b/source/blender/compositor/operations/COM_MixHueOperation.h @@ -39,7 +39,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/compositor/operations/COM_MixLightenOperation.cpp b/source/blender/compositor/operations/COM_MixLightenOperation.cpp index 868459db8bf..9eb45a783f8 100644 --- a/source/blender/compositor/operations/COM_MixLightenOperation.cpp +++ b/source/blender/compositor/operations/COM_MixLightenOperation.cpp @@ -27,7 +27,7 @@ MixLightenOperation::MixLightenOperation() : MixBaseOperation() /* pass */ } -void MixLightenOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MixLightenOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor1[4]; float inputColor2[4]; @@ -42,16 +42,16 @@ void MixLightenOperation::executePixel(float *outputValue, float x, float y, Pix } float tmp; tmp = value * inputColor2[0]; - if (tmp > inputColor1[0]) outputValue[0] = tmp; - else outputValue[0] = inputColor1[0]; + if (tmp > inputColor1[0]) output[0] = tmp; + else output[0] = inputColor1[0]; tmp = value * inputColor2[1]; - if (tmp > inputColor1[1]) outputValue[1] = tmp; - else outputValue[1] = inputColor1[1]; + if (tmp > inputColor1[1]) output[1] = tmp; + else output[1] = inputColor1[1]; tmp = value * inputColor2[2]; - if (tmp > inputColor1[2]) outputValue[2] = tmp; - else outputValue[2] = inputColor1[2]; - outputValue[3] = inputColor1[3]; + if (tmp > inputColor1[2]) output[2] = tmp; + else output[2] = inputColor1[2]; + output[3] = inputColor1[3]; - clampIfNeeded(outputValue); + clampIfNeeded(output); } diff --git a/source/blender/compositor/operations/COM_MixLightenOperation.h b/source/blender/compositor/operations/COM_MixLightenOperation.h index d03ab317035..5f08a067e11 100644 --- a/source/blender/compositor/operations/COM_MixLightenOperation.h +++ b/source/blender/compositor/operations/COM_MixLightenOperation.h @@ -39,6 +39,6 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/compositor/operations/COM_MixLinearLightOperation.cpp b/source/blender/compositor/operations/COM_MixLinearLightOperation.cpp index 2fff05fbbc9..ee7dcc9fe28 100644 --- a/source/blender/compositor/operations/COM_MixLinearLightOperation.cpp +++ b/source/blender/compositor/operations/COM_MixLinearLightOperation.cpp @@ -27,7 +27,7 @@ MixLinearLightOperation::MixLinearLightOperation() : MixBaseOperation() /* pass */ } -void MixLinearLightOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MixLinearLightOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor1[4]; float inputColor2[4]; @@ -41,19 +41,19 @@ void MixLinearLightOperation::executePixel(float *outputValue, float x, float y, value *= inputColor2[3]; } if (inputColor2[0] > 0.5f) - outputValue[0] = inputColor1[0] + value * (2.0f * (inputColor2[0] - 0.5f)); + output[0] = inputColor1[0] + value * (2.0f * (inputColor2[0] - 0.5f)); else - outputValue[0] = inputColor1[0] + value * (2.0f * (inputColor2[0]) - 1.0f); + output[0] = inputColor1[0] + value * (2.0f * (inputColor2[0]) - 1.0f); if (inputColor2[1] > 0.5f) - outputValue[1] = inputColor1[1] + value * (2.0f * (inputColor2[1] - 0.5f)); + output[1] = inputColor1[1] + value * (2.0f * (inputColor2[1] - 0.5f)); else - outputValue[1] = inputColor1[1] + value * (2.0f * (inputColor2[1]) - 1.0f); + output[1] = inputColor1[1] + value * (2.0f * (inputColor2[1]) - 1.0f); if (inputColor2[2] > 0.5f) - outputValue[2] = inputColor1[2] + value * (2.0f * (inputColor2[2] - 0.5f)); + output[2] = inputColor1[2] + value * (2.0f * (inputColor2[2] - 0.5f)); else - outputValue[2] = inputColor1[2] + value * (2.0f * (inputColor2[2]) - 1.0f); + output[2] = inputColor1[2] + value * (2.0f * (inputColor2[2]) - 1.0f); - outputValue[3] = inputColor1[3]; + output[3] = inputColor1[3]; - clampIfNeeded(outputValue); + clampIfNeeded(output); } diff --git a/source/blender/compositor/operations/COM_MixLinearLightOperation.h b/source/blender/compositor/operations/COM_MixLinearLightOperation.h index 7a9acbe00b0..35451a9f3db 100644 --- a/source/blender/compositor/operations/COM_MixLinearLightOperation.h +++ b/source/blender/compositor/operations/COM_MixLinearLightOperation.h @@ -39,7 +39,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/compositor/operations/COM_MixMultiplyOperation.cpp b/source/blender/compositor/operations/COM_MixMultiplyOperation.cpp index 911c0c83b90..e53addb7041 100644 --- a/source/blender/compositor/operations/COM_MixMultiplyOperation.cpp +++ b/source/blender/compositor/operations/COM_MixMultiplyOperation.cpp @@ -27,7 +27,7 @@ MixMultiplyOperation::MixMultiplyOperation() : MixBaseOperation() /* pass */ } -void MixMultiplyOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MixMultiplyOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor1[4]; float inputColor2[4]; @@ -42,11 +42,11 @@ void MixMultiplyOperation::executePixel(float *outputValue, float x, float y, Pi value *= inputColor2[3]; } float valuem = 1.0f - value; - outputValue[0] = inputColor1[0] * (valuem + value * inputColor2[0]); - outputValue[1] = inputColor1[1] * (valuem + value * inputColor2[1]); - outputValue[2] = inputColor1[2] * (valuem + value * inputColor2[2]); - outputValue[3] = inputColor1[3]; + output[0] = inputColor1[0] * (valuem + value * inputColor2[0]); + output[1] = inputColor1[1] * (valuem + value * inputColor2[1]); + output[2] = inputColor1[2] * (valuem + value * inputColor2[2]); + output[3] = inputColor1[3]; - clampIfNeeded(outputValue); + clampIfNeeded(output); } diff --git a/source/blender/compositor/operations/COM_MixMultiplyOperation.h b/source/blender/compositor/operations/COM_MixMultiplyOperation.h index ab7d06aecf6..cdd56bd2f39 100644 --- a/source/blender/compositor/operations/COM_MixMultiplyOperation.h +++ b/source/blender/compositor/operations/COM_MixMultiplyOperation.h @@ -39,7 +39,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/compositor/operations/COM_MixOverlayOperation.cpp b/source/blender/compositor/operations/COM_MixOverlayOperation.cpp index ba7a86a80a7..09a9d3cbc4f 100644 --- a/source/blender/compositor/operations/COM_MixOverlayOperation.cpp +++ b/source/blender/compositor/operations/COM_MixOverlayOperation.cpp @@ -27,7 +27,7 @@ MixOverlayOperation::MixOverlayOperation() : MixBaseOperation() /* pass */ } -void MixOverlayOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MixOverlayOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor1[4]; float inputColor2[4]; @@ -44,25 +44,25 @@ void MixOverlayOperation::executePixel(float *outputValue, float x, float y, Pix float valuem = 1.0f - value; if (inputColor1[0] < 0.5f) { - outputValue[0] = inputColor1[0] * (valuem + 2.0f * value * inputColor2[0]); + output[0] = inputColor1[0] * (valuem + 2.0f * value * inputColor2[0]); } else { - outputValue[0] = 1.0f - (valuem + 2.0f * value * (1.0f - inputColor2[0])) * (1.0f - inputColor1[0]); + output[0] = 1.0f - (valuem + 2.0f * value * (1.0f - inputColor2[0])) * (1.0f - inputColor1[0]); } if (inputColor1[1] < 0.5f) { - outputValue[1] = inputColor1[1] * (valuem + 2.0f * value * inputColor2[1]); + output[1] = inputColor1[1] * (valuem + 2.0f * value * inputColor2[1]); } else { - outputValue[1] = 1.0f - (valuem + 2.0f * value * (1.0f - inputColor2[1])) * (1.0f - inputColor1[1]); + output[1] = 1.0f - (valuem + 2.0f * value * (1.0f - inputColor2[1])) * (1.0f - inputColor1[1]); } if (inputColor1[2] < 0.5f) { - outputValue[2] = inputColor1[2] * (valuem + 2.0f * value * inputColor2[2]); + output[2] = inputColor1[2] * (valuem + 2.0f * value * inputColor2[2]); } else { - outputValue[2] = 1.0f - (valuem + 2.0f * value * (1.0f - inputColor2[2])) * (1.0f - inputColor1[2]); + output[2] = 1.0f - (valuem + 2.0f * value * (1.0f - inputColor2[2])) * (1.0f - inputColor1[2]); } - outputValue[3] = inputColor1[3]; + output[3] = inputColor1[3]; - clampIfNeeded(outputValue); + clampIfNeeded(output); } diff --git a/source/blender/compositor/operations/COM_MixOverlayOperation.h b/source/blender/compositor/operations/COM_MixOverlayOperation.h index d31396f471b..4f2c08ce95f 100644 --- a/source/blender/compositor/operations/COM_MixOverlayOperation.h +++ b/source/blender/compositor/operations/COM_MixOverlayOperation.h @@ -39,7 +39,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/compositor/operations/COM_MixSaturationOperation.cpp b/source/blender/compositor/operations/COM_MixSaturationOperation.cpp index 403dac57615..401ad8d4247 100644 --- a/source/blender/compositor/operations/COM_MixSaturationOperation.cpp +++ b/source/blender/compositor/operations/COM_MixSaturationOperation.cpp @@ -31,7 +31,7 @@ MixSaturationOperation::MixSaturationOperation() : MixBaseOperation() /* pass */ } -void MixSaturationOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MixSaturationOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor1[4]; float inputColor2[4]; @@ -51,9 +51,9 @@ void MixSaturationOperation::executePixel(float *outputValue, float x, float y, if (rS != 0.0f) { float colH, colS, colV; rgb_to_hsv(inputColor2[0], inputColor2[1], inputColor2[2], &colH, &colS, &colV); - hsv_to_rgb(rH, (valuem * rS + value * colS), rV, &outputValue[0], &outputValue[1], &outputValue[2]); + hsv_to_rgb(rH, (valuem * rS + value * colS), rV, &output[0], &output[1], &output[2]); } - outputValue[3] = inputColor1[3]; + output[3] = inputColor1[3]; - clampIfNeeded(outputValue); + clampIfNeeded(output); } diff --git a/source/blender/compositor/operations/COM_MixSaturationOperation.h b/source/blender/compositor/operations/COM_MixSaturationOperation.h index f89f03c0e18..c690db38daf 100644 --- a/source/blender/compositor/operations/COM_MixSaturationOperation.h +++ b/source/blender/compositor/operations/COM_MixSaturationOperation.h @@ -39,7 +39,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/compositor/operations/COM_MixScreenOperation.cpp b/source/blender/compositor/operations/COM_MixScreenOperation.cpp index 781bc87ece7..671ffd3303c 100644 --- a/source/blender/compositor/operations/COM_MixScreenOperation.cpp +++ b/source/blender/compositor/operations/COM_MixScreenOperation.cpp @@ -27,7 +27,7 @@ MixScreenOperation::MixScreenOperation() : MixBaseOperation() /* pass */ } -void MixScreenOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MixScreenOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor1[4]; float inputColor2[4]; @@ -43,11 +43,11 @@ void MixScreenOperation::executePixel(float *outputValue, float x, float y, Pixe } float valuem = 1.0f - value; - outputValue[0] = 1.0f - (valuem + value * (1.0f - inputColor2[0])) * (1.0f - inputColor1[0]); - outputValue[1] = 1.0f - (valuem + value * (1.0f - inputColor2[1])) * (1.0f - inputColor1[1]); - outputValue[2] = 1.0f - (valuem + value * (1.0f - inputColor2[2])) * (1.0f - inputColor1[2]); - outputValue[3] = inputColor1[3]; + output[0] = 1.0f - (valuem + value * (1.0f - inputColor2[0])) * (1.0f - inputColor1[0]); + output[1] = 1.0f - (valuem + value * (1.0f - inputColor2[1])) * (1.0f - inputColor1[1]); + output[2] = 1.0f - (valuem + value * (1.0f - inputColor2[2])) * (1.0f - inputColor1[2]); + output[3] = inputColor1[3]; - clampIfNeeded(outputValue); + clampIfNeeded(output); } diff --git a/source/blender/compositor/operations/COM_MixScreenOperation.h b/source/blender/compositor/operations/COM_MixScreenOperation.h index 843adc870f8..5ba3cf769bb 100644 --- a/source/blender/compositor/operations/COM_MixScreenOperation.h +++ b/source/blender/compositor/operations/COM_MixScreenOperation.h @@ -39,6 +39,6 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/compositor/operations/COM_MixSoftLightOperation.cpp b/source/blender/compositor/operations/COM_MixSoftLightOperation.cpp index b1374aa7f32..604881ae47f 100644 --- a/source/blender/compositor/operations/COM_MixSoftLightOperation.cpp +++ b/source/blender/compositor/operations/COM_MixSoftLightOperation.cpp @@ -27,7 +27,7 @@ MixSoftLightOperation::MixSoftLightOperation() : MixBaseOperation() /* pass */ } -void MixSoftLightOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) \ +void MixSoftLightOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) \ { float inputColor1[4]; float inputColor2[4]; @@ -48,11 +48,11 @@ void MixSoftLightOperation::executePixel(float *outputValue, float x, float y, P scg = 1.0f - (1.0f - inputColor2[1]) * (1.0f - inputColor1[1]); scb = 1.0f - (1.0f - inputColor2[2]) * (1.0f - inputColor1[2]); - outputValue[0] = valuem * (inputColor1[0]) + value * (((1.0f - inputColor1[0]) * inputColor2[0] * (inputColor1[0])) + (inputColor1[0] * scr)); - outputValue[1] = valuem * (inputColor1[1]) + value * (((1.0f - inputColor1[1]) * inputColor2[1] * (inputColor1[1])) + (inputColor1[1] * scg)); - outputValue[2] = valuem * (inputColor1[2]) + value * (((1.0f - inputColor1[2]) * inputColor2[2] * (inputColor1[2])) + (inputColor1[2] * scb)); - outputValue[3] = inputColor1[3]; + output[0] = valuem * (inputColor1[0]) + value * (((1.0f - inputColor1[0]) * inputColor2[0] * (inputColor1[0])) + (inputColor1[0] * scr)); + output[1] = valuem * (inputColor1[1]) + value * (((1.0f - inputColor1[1]) * inputColor2[1] * (inputColor1[1])) + (inputColor1[1] * scg)); + output[2] = valuem * (inputColor1[2]) + value * (((1.0f - inputColor1[2]) * inputColor2[2] * (inputColor1[2])) + (inputColor1[2] * scb)); + output[3] = inputColor1[3]; - clampIfNeeded(outputValue); + clampIfNeeded(output); } diff --git a/source/blender/compositor/operations/COM_MixSoftLightOperation.h b/source/blender/compositor/operations/COM_MixSoftLightOperation.h index 570cf2cb6ef..55f6a70791a 100644 --- a/source/blender/compositor/operations/COM_MixSoftLightOperation.h +++ b/source/blender/compositor/operations/COM_MixSoftLightOperation.h @@ -39,7 +39,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/compositor/operations/COM_MixSubtractOperation.cpp b/source/blender/compositor/operations/COM_MixSubtractOperation.cpp index f7b558e5c7a..a446dfe4e54 100644 --- a/source/blender/compositor/operations/COM_MixSubtractOperation.cpp +++ b/source/blender/compositor/operations/COM_MixSubtractOperation.cpp @@ -27,7 +27,7 @@ MixSubtractOperation::MixSubtractOperation() : MixBaseOperation() /* pass */ } -void MixSubtractOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MixSubtractOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor1[4]; float inputColor2[4]; @@ -40,11 +40,11 @@ void MixSubtractOperation::executePixel(float *outputValue, float x, float y, Pi if (this->useValueAlphaMultiply()) { value *= inputColor2[3]; } - outputValue[0] = inputColor1[0] - value * (inputColor2[0]); - outputValue[1] = inputColor1[1] - value * (inputColor2[1]); - outputValue[2] = inputColor1[2] - value * (inputColor2[2]); - outputValue[3] = inputColor1[3]; + output[0] = inputColor1[0] - value * (inputColor2[0]); + output[1] = inputColor1[1] - value * (inputColor2[1]); + output[2] = inputColor1[2] - value * (inputColor2[2]); + output[3] = inputColor1[3]; - clampIfNeeded(outputValue); + clampIfNeeded(output); } diff --git a/source/blender/compositor/operations/COM_MixSubtractOperation.h b/source/blender/compositor/operations/COM_MixSubtractOperation.h index a9198cf3400..046d8d4949b 100644 --- a/source/blender/compositor/operations/COM_MixSubtractOperation.h +++ b/source/blender/compositor/operations/COM_MixSubtractOperation.h @@ -39,7 +39,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/compositor/operations/COM_MixValueOperation.cpp b/source/blender/compositor/operations/COM_MixValueOperation.cpp index 8f8d3305ee9..caefdf024cc 100644 --- a/source/blender/compositor/operations/COM_MixValueOperation.cpp +++ b/source/blender/compositor/operations/COM_MixValueOperation.cpp @@ -31,7 +31,7 @@ MixValueOperation::MixValueOperation() : MixBaseOperation() /* pass */ } -void MixValueOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MixValueOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor1[4]; float inputColor2[4]; @@ -50,8 +50,8 @@ void MixValueOperation::executePixel(float *outputValue, float x, float y, Pixel float colH, colS, colV; rgb_to_hsv(inputColor1[0], inputColor1[1], inputColor1[2], &rH, &rS, &rV); rgb_to_hsv(inputColor2[0], inputColor2[1], inputColor2[2], &colH, &colS, &colV); - hsv_to_rgb(rH, rS, (valuem * rV + value * colV), &outputValue[0], &outputValue[1], &outputValue[2]); - outputValue[3] = inputColor1[3]; + hsv_to_rgb(rH, rS, (valuem * rV + value * colV), &output[0], &output[1], &output[2]); + output[3] = inputColor1[3]; - clampIfNeeded(outputValue); + clampIfNeeded(output); } diff --git a/source/blender/compositor/operations/COM_MixValueOperation.h b/source/blender/compositor/operations/COM_MixValueOperation.h index 06316afcd73..6c3f3ce8072 100644 --- a/source/blender/compositor/operations/COM_MixValueOperation.h +++ b/source/blender/compositor/operations/COM_MixValueOperation.h @@ -39,6 +39,6 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/compositor/operations/COM_MovieClipAttributeOperation.cpp b/source/blender/compositor/operations/COM_MovieClipAttributeOperation.cpp index 14d7fa7e649..0d2de47bc4f 100644 --- a/source/blender/compositor/operations/COM_MovieClipAttributeOperation.cpp +++ b/source/blender/compositor/operations/COM_MovieClipAttributeOperation.cpp @@ -33,7 +33,7 @@ MovieClipAttributeOperation::MovieClipAttributeOperation() : NodeOperation() this->m_attribute = MCA_X; } -void MovieClipAttributeOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void MovieClipAttributeOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { if (!this->m_valueSet) { float loc[2], scale, angle; @@ -61,10 +61,10 @@ void MovieClipAttributeOperation::executePixel(float *outputValue, float x, floa } this->m_valueSet = true; } - outputValue[0] = this->m_value; + output[0] = this->m_value; } -void MovieClipAttributeOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) +void MovieClipAttributeOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) { resolution[0] = preferredResolution[0]; resolution[1] = preferredResolution[1]; diff --git a/source/blender/compositor/operations/COM_MovieClipAttributeOperation.h b/source/blender/compositor/operations/COM_MovieClipAttributeOperation.h index 28028ab6fd4..f894626d534 100644 --- a/source/blender/compositor/operations/COM_MovieClipAttributeOperation.h +++ b/source/blender/compositor/operations/COM_MovieClipAttributeOperation.h @@ -51,8 +51,8 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); - void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]); + void executePixel(float output[4], float x, float y, PixelSampler sampler); + void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); void setMovieClip(MovieClip *clip) { this->m_clip = clip; } void setFramenumber(int framenumber) { this->m_framenumber = framenumber; } diff --git a/source/blender/compositor/operations/COM_MovieClipOperation.cpp b/source/blender/compositor/operations/COM_MovieClipOperation.cpp index ea267830b86..b73db74b061 100644 --- a/source/blender/compositor/operations/COM_MovieClipOperation.cpp +++ b/source/blender/compositor/operations/COM_MovieClipOperation.cpp @@ -76,7 +76,7 @@ void MovieClipOperation::deinitExecution() } } -void MovieClipOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) +void MovieClipOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) { resolution[0] = 0; resolution[1] = 0; @@ -91,21 +91,21 @@ void MovieClipOperation::determineResolution(unsigned int resolution[], unsigned } } -void MovieClipOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void MovieClipOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { if (this->m_movieClipBuffer == NULL || x < 0 || y < 0 || x >= this->getWidth() || y >= this->getHeight() ) { - zero_v4(color); + zero_v4(output); } else { switch (sampler) { case COM_PS_NEAREST: - neareast_interpolation_color(this->m_movieClipBuffer, NULL, color, x, y); + neareast_interpolation_color(this->m_movieClipBuffer, NULL, output, x, y); break; case COM_PS_BILINEAR: - bilinear_interpolation_color(this->m_movieClipBuffer, NULL, color, x, y); + bilinear_interpolation_color(this->m_movieClipBuffer, NULL, output, x, y); break; case COM_PS_BICUBIC: - bicubic_interpolation_color(this->m_movieClipBuffer, NULL, color, x, y); + bicubic_interpolation_color(this->m_movieClipBuffer, NULL, output, x, y); break; } } diff --git a/source/blender/compositor/operations/COM_MovieClipOperation.h b/source/blender/compositor/operations/COM_MovieClipOperation.h index 6ca10e2fa9d..7cce42f6727 100644 --- a/source/blender/compositor/operations/COM_MovieClipOperation.h +++ b/source/blender/compositor/operations/COM_MovieClipOperation.h @@ -47,7 +47,7 @@ protected: /** * Determine the output resolution. The resolution is retrieved from the Renderer */ - void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]); + void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); public: MovieClipOperation(); @@ -59,7 +59,7 @@ public: void setCacheFrame(bool value) { this->m_cacheFrame = value; } void setFramenumber(int framenumber) { this->m_framenumber = framenumber; } - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/compositor/operations/COM_MovieDistortionOperation.cpp b/source/blender/compositor/operations/COM_MovieDistortionOperation.cpp index 964d4352bc0..8150e3eda75 100644 --- a/source/blender/compositor/operations/COM_MovieDistortionOperation.cpp +++ b/source/blender/compositor/operations/COM_MovieDistortionOperation.cpp @@ -78,16 +78,16 @@ void MovieDistortionOperation::deinitExecution() } -void MovieDistortionOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void MovieDistortionOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { if (this->m_cache != NULL) { float u, v; this->m_cache->getUV(&this->m_movieClip->tracking, x, y, &u, &v); - this->m_inputOperation->read(color, u, v, sampler); + this->m_inputOperation->read(output, u, v, sampler); } else { - this->m_inputOperation->read(color, x, y, sampler); + this->m_inputOperation->read(output, x, y, sampler); } } diff --git a/source/blender/compositor/operations/COM_MovieDistortionOperation.h b/source/blender/compositor/operations/COM_MovieDistortionOperation.h index 8cd9e98da2d..a58349f9324 100644 --- a/source/blender/compositor/operations/COM_MovieDistortionOperation.h +++ b/source/blender/compositor/operations/COM_MovieDistortionOperation.h @@ -130,7 +130,7 @@ protected: public: MovieDistortionOperation(bool distortion); bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); void initExecution(); void deinitExecution(); diff --git a/source/blender/compositor/operations/COM_MultilayerImageOperation.cpp b/source/blender/compositor/operations/COM_MultilayerImageOperation.cpp index 27214acd0d4..af0d5161835 100644 --- a/source/blender/compositor/operations/COM_MultilayerImageOperation.cpp +++ b/source/blender/compositor/operations/COM_MultilayerImageOperation.cpp @@ -43,59 +43,56 @@ ImBuf *MultilayerBaseOperation::getImBuf() return NULL; } -void MultilayerColorOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void MultilayerColorOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { int yi = y; int xi = x; if (this->m_imageBuffer == NULL || xi < 0 || yi < 0 || (unsigned int)xi >= this->getWidth() || (unsigned int)yi >= this->getHeight() ) { - color[0] = 0.0f; - color[1] = 0.0f; - color[2] = 0.0f; - color[3] = 0.0f; + zero_v4(output); } else { if (this->m_numberOfChannels == 4) { switch (sampler) { case COM_PS_NEAREST: - neareast_interpolation_color(this->m_buffer, NULL, color, x, y); + neareast_interpolation_color(this->m_buffer, NULL, output, x, y); break; case COM_PS_BILINEAR: - bilinear_interpolation_color(this->m_buffer, NULL, color, x, y); + bilinear_interpolation_color(this->m_buffer, NULL, output, x, y); break; case COM_PS_BICUBIC: - bicubic_interpolation_color(this->m_buffer, NULL, color, x, y); + bicubic_interpolation_color(this->m_buffer, NULL, output, x, y); break; } } else { int offset = (yi * this->getWidth() + xi) * 3; - copy_v3_v3(color, &this->m_imageBuffer[offset]); + copy_v3_v3(output, &this->m_imageBuffer[offset]); } } } -void MultilayerValueOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void MultilayerValueOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { int yi = y; int xi = x; if (this->m_imageBuffer == NULL || xi < 0 || yi < 0 || (unsigned int)xi >= this->getWidth() || (unsigned int)yi >= this->getHeight() ) { - color[0] = 0.0f; + output[0] = 0.0f; } else { float result = this->m_imageBuffer[yi * this->getWidth() + xi]; - color[0] = result; + output[0] = result; } } -void MultilayerVectorOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void MultilayerVectorOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { int yi = y; int xi = x; if (this->m_imageBuffer == NULL || xi < 0 || yi < 0 || (unsigned int)xi >= this->getWidth() || (unsigned int)yi >= this->getHeight() ) { - color[0] = 0.0f; + output[0] = 0.0f; } else { int offset = (yi * this->getWidth() + xi) * 3; - copy_v3_v3(color, &this->m_imageBuffer[offset]); + copy_v3_v3(output, &this->m_imageBuffer[offset]); } } diff --git a/source/blender/compositor/operations/COM_MultilayerImageOperation.h b/source/blender/compositor/operations/COM_MultilayerImageOperation.h index 82bd8c455df..3c498e962b5 100644 --- a/source/blender/compositor/operations/COM_MultilayerImageOperation.h +++ b/source/blender/compositor/operations/COM_MultilayerImageOperation.h @@ -46,7 +46,7 @@ public: MultilayerColorOperation(int pass) : MultilayerBaseOperation(pass) { this->addOutputSocket(COM_DT_COLOR); } - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; class MultilayerValueOperation : public MultilayerBaseOperation { @@ -54,7 +54,7 @@ public: MultilayerValueOperation(int pass) : MultilayerBaseOperation(pass) { this->addOutputSocket(COM_DT_VALUE); } - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; class MultilayerVectorOperation : public MultilayerBaseOperation { @@ -62,7 +62,7 @@ public: MultilayerVectorOperation(int pass) : MultilayerBaseOperation(pass) { this->addOutputSocket(COM_DT_VECTOR); } - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/compositor/operations/COM_NormalizeOperation.cpp b/source/blender/compositor/operations/COM_NormalizeOperation.cpp index 02ea7f2b257..5f7ac6bb9ca 100644 --- a/source/blender/compositor/operations/COM_NormalizeOperation.cpp +++ b/source/blender/compositor/operations/COM_NormalizeOperation.cpp @@ -35,15 +35,14 @@ void NormalizeOperation::initExecution() NodeOperation::initMutex(); } -void NormalizeOperation::executePixel(float *color, int x, int y, void *data) +void NormalizeOperation::executePixel(float output[4], int x, int y, void *data) { /* using generic two floats struct to store x: min y: mult */ NodeTwoFloats *minmult = (NodeTwoFloats *)data; - float output[4]; this->m_imageReader->read(output, x, y, NULL); - color[0] = (output[0] - minmult->x) * minmult->y; + output[0] = (output[0] - minmult->x) * minmult->y; } void NormalizeOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_NormalizeOperation.h b/source/blender/compositor/operations/COM_NormalizeOperation.h index f36d69a3018..32f39a4d9ca 100644 --- a/source/blender/compositor/operations/COM_NormalizeOperation.h +++ b/source/blender/compositor/operations/COM_NormalizeOperation.h @@ -47,7 +47,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_OpenCLKernels.cl b/source/blender/compositor/operations/COM_OpenCLKernels.cl index 9a89fe21414..7366db19444 100644 --- a/source/blender/compositor/operations/COM_OpenCLKernels.cl +++ b/source/blender/compositor/operations/COM_OpenCLKernels.cl @@ -78,7 +78,7 @@ __kernel void bokehBlurKernel(__read_only image2d_t boundingBox, __read_only ima __kernel void defocusKernel(__read_only image2d_t inputImage, __read_only image2d_t bokehImage, __read_only image2d_t inputSize, __write_only image2d_t output, int2 offsetInput, int2 offsetOutput, - int step, int maxBlur, float threshold, int2 dimension, int2 offset) + int step, int maxBlurScalar, float threshold, int2 dimension, int2 offset, float scalar) { float4 color = {1.0f, 0.0f, 0.0f, 1.0f}; int2 coords = {get_global_id(0), get_global_id(1)}; @@ -92,14 +92,14 @@ __kernel void defocusKernel(__read_only image2d_t inputImage, __read_only image2 float4 multiplier_accum = {1.0f, 1.0f, 1.0f, 1.0f}; float4 color_accum; - int minx = max(realCoordinate.s0 - maxBlur, 0); - int miny = max(realCoordinate.s1 - maxBlur, 0); - int maxx = min(realCoordinate.s0 + maxBlur, dimension.s0); - int maxy = min(realCoordinate.s1 + maxBlur, dimension.s1); + int minx = max(realCoordinate.s0 - maxBlurScalar, 0); + int miny = max(realCoordinate.s1 - maxBlurScalar, 0); + int maxx = min(realCoordinate.s0 + maxBlurScalar, dimension.s0); + int maxy = min(realCoordinate.s1 + maxBlurScalar, dimension.s1); { int2 inputCoordinate = realCoordinate - offsetInput; - float size_center = read_imagef(inputSize, SAMPLER_NEAREST, inputCoordinate).s0; + float size_center = read_imagef(inputSize, SAMPLER_NEAREST, inputCoordinate).s0 * scalar; color_accum = read_imagef(inputImage, SAMPLER_NEAREST, inputCoordinate); readColor = color_accum; @@ -111,7 +111,7 @@ __kernel void defocusKernel(__read_only image2d_t inputImage, __read_only image2 float dx = nx - realCoordinate.s0; if (dx != 0 || dy != 0) { inputCoordinate.s0 = nx - offsetInput.s0; - size = read_imagef(inputSize, SAMPLER_NEAREST, inputCoordinate).s0; + size = read_imagef(inputSize, SAMPLER_NEAREST, inputCoordinate).s0 * scalar; if (size > threshold) { if (size >= fabs(dx) && size >= fabs(dy)) { float2 uv = {256.0f + dx * 255.0f / size, diff --git a/source/blender/compositor/operations/COM_PreviewOperation.cpp b/source/blender/compositor/operations/COM_PreviewOperation.cpp index a400402417b..aff374cdded 100644 --- a/source/blender/compositor/operations/COM_PreviewOperation.cpp +++ b/source/blender/compositor/operations/COM_PreviewOperation.cpp @@ -110,7 +110,7 @@ bool PreviewOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferO return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output); } -void PreviewOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) +void PreviewOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) { NodeOperation::determineResolution(resolution, preferredResolution); int width = resolution[0]; diff --git a/source/blender/compositor/operations/COM_PreviewOperation.h b/source/blender/compositor/operations/COM_PreviewOperation.h index 7183ea64fff..ffd80ff27af 100644 --- a/source/blender/compositor/operations/COM_PreviewOperation.h +++ b/source/blender/compositor/operations/COM_PreviewOperation.h @@ -45,7 +45,7 @@ public: const CompositorPriority getRenderPriority() const; void executeRegion(rcti *rect, unsigned int tileNumber); - void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]); + void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); void setbNode(bNode *node) { this->m_node = node; } bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); bool isPreviewOperation() { return true; } diff --git a/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp b/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp index 00ad319e3b7..7e854f01213 100644 --- a/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp +++ b/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp @@ -47,7 +47,7 @@ void *ProjectorLensDistortionOperation::initializeTileData(rcti *rect) return buffer; } -void ProjectorLensDistortionOperation::executePixel(float *color, int x, int y, void *data) +void ProjectorLensDistortionOperation::executePixel(float output[4], int x, int y, void *data) { float inputValue[4]; const float height = this->getHeight(); @@ -56,12 +56,12 @@ void ProjectorLensDistortionOperation::executePixel(float *color, int x, int y, const float u = (x + 0.5f) / width; MemoryBuffer *inputBuffer = (MemoryBuffer *)data; inputBuffer->readCubic(inputValue, (u * width + this->m_kr2) - 0.5f, v * height - 0.5f); - color[0] = inputValue[0]; + output[0] = inputValue[0]; inputBuffer->read(inputValue, x, y); - color[1] = inputValue[1]; + output[1] = inputValue[1]; inputBuffer->readCubic(inputValue, (u * width - this->m_kr2) - 0.5f, v * height - 0.5f); - color[2] = inputValue[2]; - color[3] = 1.0f; + output[2] = inputValue[2]; + output[3] = 1.0f; } void ProjectorLensDistortionOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.h b/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.h index ac64b35ed32..3c910815efc 100644 --- a/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.h +++ b/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.h @@ -44,7 +44,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_ReadBufferOperation.cpp b/source/blender/compositor/operations/COM_ReadBufferOperation.cpp index 2473ad8303e..a2385f79c04 100644 --- a/source/blender/compositor/operations/COM_ReadBufferOperation.cpp +++ b/source/blender/compositor/operations/COM_ReadBufferOperation.cpp @@ -36,7 +36,7 @@ void *ReadBufferOperation::initializeTileData(rcti *rect) return m_buffer; } -void ReadBufferOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) +void ReadBufferOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) { if (this->m_memoryProxy != NULL) { WriteBufferOperation *operation = this->m_memoryProxy->getWriteBufferOperation(); @@ -49,19 +49,19 @@ void ReadBufferOperation::determineResolution(unsigned int resolution[], unsigne } } } -void ReadBufferOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void ReadBufferOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { if (sampler == COM_PS_NEAREST) { - m_buffer->read(color, x, y); + m_buffer->read(output, x, y); } else { - m_buffer->readCubic(color, x, y); + m_buffer->readCubic(output, x, y); } } -void ReadBufferOperation::executePixel(float *color, float x, float y, float dx, float dy) +void ReadBufferOperation::executePixel(float output[4], float x, float y, float dx, float dy) { - m_buffer->readEWA(color, x, y, dx, dy); + m_buffer->readEWA(output, x, y, dx, dy); } bool ReadBufferOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) diff --git a/source/blender/compositor/operations/COM_ReadBufferOperation.h b/source/blender/compositor/operations/COM_ReadBufferOperation.h index f52b732b076..7958a4aee6b 100644 --- a/source/blender/compositor/operations/COM_ReadBufferOperation.h +++ b/source/blender/compositor/operations/COM_ReadBufferOperation.h @@ -36,11 +36,11 @@ public: int isBufferOperation() { return true; } void setMemoryProxy(MemoryProxy *memoryProxy) { this->m_memoryProxy = memoryProxy; } MemoryProxy *getMemoryProxy() { return this->m_memoryProxy; } - void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]); + void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); void *initializeTileData(rcti *rect); - void executePixel(float *color, float x, float y, PixelSampler sampler); - void executePixel(float *color, float x, float y, float dx, float dy); + void executePixel(float output[4], float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, float dx, float dy); const bool isReadBufferOperation() const { return true; } void setOffset(unsigned int offset) { this->m_offset = offset; } unsigned int getOffset() { return this->m_offset; } diff --git a/source/blender/compositor/operations/COM_RenderLayersAlphaProg.cpp b/source/blender/compositor/operations/COM_RenderLayersAlphaProg.cpp index 908c3d11b06..74cb506d264 100644 --- a/source/blender/compositor/operations/COM_RenderLayersAlphaProg.cpp +++ b/source/blender/compositor/operations/COM_RenderLayersAlphaProg.cpp @@ -27,7 +27,7 @@ RenderLayersAlphaProg::RenderLayersAlphaProg() : RenderLayersBaseProg(SCE_PASS_C this->addOutputSocket(COM_DT_VALUE); } -void RenderLayersAlphaProg::executePixel(float *output, float x, float y, PixelSampler sampler) +void RenderLayersAlphaProg::executePixel(float output[4], float x, float y, PixelSampler sampler) { int ix = x; int iy = y; diff --git a/source/blender/compositor/operations/COM_RenderLayersAlphaProg.h b/source/blender/compositor/operations/COM_RenderLayersAlphaProg.h index 1733f3bd3ba..36668bc9338 100644 --- a/source/blender/compositor/operations/COM_RenderLayersAlphaProg.h +++ b/source/blender/compositor/operations/COM_RenderLayersAlphaProg.h @@ -28,7 +28,7 @@ class RenderLayersAlphaProg : public RenderLayersBaseProg { public: RenderLayersAlphaProg(); - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; diff --git a/source/blender/compositor/operations/COM_RenderLayersBaseProg.cpp b/source/blender/compositor/operations/COM_RenderLayersBaseProg.cpp index a036e8e7231..a4015c6283f 100644 --- a/source/blender/compositor/operations/COM_RenderLayersBaseProg.cpp +++ b/source/blender/compositor/operations/COM_RenderLayersBaseProg.cpp @@ -69,7 +69,7 @@ void RenderLayersBaseProg::initExecution() } } -void RenderLayersBaseProg::executePixel(float *output, float x, float y, PixelSampler sampler) +void RenderLayersBaseProg::executePixel(float output[4], float x, float y, PixelSampler sampler) { int ix = x; int iy = y; @@ -100,7 +100,7 @@ void RenderLayersBaseProg::deinitExecution() this->m_inputBuffer = NULL; } -void RenderLayersBaseProg::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) +void RenderLayersBaseProg::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) { Scene *sce = this->getScene(); Render *re = (sce) ? RE_GetRender(sce->id.name) : NULL; diff --git a/source/blender/compositor/operations/COM_RenderLayersBaseProg.h b/source/blender/compositor/operations/COM_RenderLayersBaseProg.h index ead1eb183b3..ea57d4bc421 100644 --- a/source/blender/compositor/operations/COM_RenderLayersBaseProg.h +++ b/source/blender/compositor/operations/COM_RenderLayersBaseProg.h @@ -73,7 +73,7 @@ protected: /** * Determine the output resolution. The resolution is retrieved from the Renderer */ - void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]); + void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); /** * retrieve the reference to the float buffer of the renderer. @@ -92,7 +92,7 @@ public: short getLayerId() { return this->m_layerId; } void initExecution(); void deinitExecution(); - void executePixel(float *output, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/compositor/operations/COM_RotateOperation.cpp b/source/blender/compositor/operations/COM_RotateOperation.cpp index a39828e4560..422c5b93484 100644 --- a/source/blender/compositor/operations/COM_RotateOperation.cpp +++ b/source/blender/compositor/operations/COM_RotateOperation.cpp @@ -68,14 +68,14 @@ inline void RotateOperation::ensureDegree() } -void RotateOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void RotateOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { ensureDegree(); const float dy = y - this->m_centerY; const float dx = x - this->m_centerX; const float nx = this->m_centerX + (this->m_cosine * dx + this->m_sine * dy); const float ny = this->m_centerY + (-this->m_sine * dx + this->m_cosine * dy); - this->m_imageSocket->read(color, nx, ny, sampler); + this->m_imageSocket->read(output, nx, ny, sampler); } bool RotateOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) diff --git a/source/blender/compositor/operations/COM_RotateOperation.h b/source/blender/compositor/operations/COM_RotateOperation.h index d011ac0ecc9..292f0743a44 100644 --- a/source/blender/compositor/operations/COM_RotateOperation.h +++ b/source/blender/compositor/operations/COM_RotateOperation.h @@ -38,7 +38,7 @@ private: public: RotateOperation(); bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); void initExecution(); void deinitExecution(); void setDoDegree2RadConversion(bool abool) { this->m_doDegree2RadConversion = abool; } diff --git a/source/blender/compositor/operations/COM_ScaleOperation.cpp b/source/blender/compositor/operations/COM_ScaleOperation.cpp index 23c13518b1d..276b2f54b6e 100644 --- a/source/blender/compositor/operations/COM_ScaleOperation.cpp +++ b/source/blender/compositor/operations/COM_ScaleOperation.cpp @@ -57,7 +57,7 @@ void ScaleOperation::deinitExecution() } -void ScaleOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void ScaleOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { #ifdef USE_FORCE_BILINEAR sampler = COM_PS_BILINEAR; @@ -74,7 +74,7 @@ void ScaleOperation::executePixel(float *color, float x, float y, PixelSampler s float nx = this->m_centerX + (x - this->m_centerX) / scx; float ny = this->m_centerY + (y - this->m_centerY) / scy; - this->m_inputOperation->read(color, nx, ny, sampler); + this->m_inputOperation->read(output, nx, ny, sampler); } bool ScaleOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) @@ -127,7 +127,7 @@ void ScaleAbsoluteOperation::deinitExecution() } -void ScaleAbsoluteOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void ScaleAbsoluteOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { #ifdef USE_FORCE_BILINEAR sampler = COM_PS_BILINEAR; @@ -151,7 +151,7 @@ void ScaleAbsoluteOperation::executePixel(float *color, float x, float y, PixelS float nx = this->m_centerX + (x - this->m_centerX) / relativeXScale; float ny = this->m_centerY + (y - this->m_centerY) / relativeYScale; - this->m_inputOperation->read(color, nx, ny, sampler); + this->m_inputOperation->read(output, nx, ny, sampler); } bool ScaleAbsoluteOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) @@ -248,7 +248,7 @@ void ScaleFixedSizeOperation::deinitExecution() } -void ScaleFixedSizeOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void ScaleFixedSizeOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { #ifdef USE_FORCE_BILINEAR sampler = COM_PS_BILINEAR; @@ -257,10 +257,10 @@ void ScaleFixedSizeOperation::executePixel(float *color, float x, float y, Pixel if (this->m_is_offset) { float nx = ((x - this->m_offsetX) * this->m_relX); float ny = ((y - this->m_offsetY) * this->m_relY); - this->m_inputOperation->read(color, nx, ny, sampler); + this->m_inputOperation->read(output, nx, ny, sampler); } else { - this->m_inputOperation->read(color, x * this->m_relX, y * this->m_relY, sampler); + this->m_inputOperation->read(output, x * this->m_relX, y * this->m_relY, sampler); } } @@ -276,7 +276,7 @@ bool ScaleFixedSizeOperation::determineDependingAreaOfInterest(rcti *input, Read return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output); } -void ScaleFixedSizeOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) +void ScaleFixedSizeOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) { unsigned int nr[2]; nr[0] = this->m_newWidth; diff --git a/source/blender/compositor/operations/COM_ScaleOperation.h b/source/blender/compositor/operations/COM_ScaleOperation.h index 075fb6e7064..4239ff063fb 100644 --- a/source/blender/compositor/operations/COM_ScaleOperation.h +++ b/source/blender/compositor/operations/COM_ScaleOperation.h @@ -35,7 +35,7 @@ private: public: ScaleOperation(); bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); void initExecution(); void deinitExecution(); @@ -51,7 +51,7 @@ class ScaleAbsoluteOperation : public NodeOperation { public: ScaleAbsoluteOperation(); bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); void initExecution(); void deinitExecution(); @@ -75,8 +75,8 @@ class ScaleFixedSizeOperation : public NodeOperation { public: ScaleFixedSizeOperation(); bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); - void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]); - void executePixel(float *color, float x, float y, PixelSampler sampler); + void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); + void executePixel(float output[4], float x, float y, PixelSampler sampler); void initExecution(); void deinitExecution(); diff --git a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp index f8628be3ff8..584d3049f6b 100644 --- a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp +++ b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp @@ -55,7 +55,7 @@ void *ScreenLensDistortionOperation::initializeTileData(rcti *rect) return buffer; } -void ScreenLensDistortionOperation::executePixel(float *outputColor, int x, int y, void *data) +void ScreenLensDistortionOperation::executePixel(float output[4], int x, int y, void *data) { const float height = this->getHeight(); const float width = this->getWidth(); @@ -126,18 +126,15 @@ void ScreenLensDistortionOperation::executePixel(float *outputColor, int x, int } } - if (dr) outputColor[0] = 2.0f * tc[0] / (float)dr; - if (dg) outputColor[1] = 2.0f * tc[1] / (float)dg; - if (db) outputColor[2] = 2.0f * tc[2] / (float)db; + if (dr) output[0] = 2.0f * tc[0] / (float)dr; + if (dg) output[1] = 2.0f * tc[1] / (float)dg; + if (db) output[2] = 2.0f * tc[2] / (float)db; /* set alpha */ - outputColor[3] = 1.0f; + output[3] = 1.0f; } else { - outputColor[0] = 0.0f; - outputColor[1] = 0.0f; - outputColor[2] = 0.0f; - outputColor[3] = 0.0f; + zero_v4(output); } } diff --git a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.h b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.h index a88717a116e..cfbdaacb41e 100644 --- a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.h +++ b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.h @@ -49,7 +49,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_SeparateChannelOperation.cpp b/source/blender/compositor/operations/COM_SeparateChannelOperation.cpp index 0b080dcc426..9fc266cce86 100644 --- a/source/blender/compositor/operations/COM_SeparateChannelOperation.cpp +++ b/source/blender/compositor/operations/COM_SeparateChannelOperation.cpp @@ -39,9 +39,9 @@ void SeparateChannelOperation::deinitExecution() } -void SeparateChannelOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void SeparateChannelOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float input[4]; this->m_inputOperation->read(input, x, y, sampler); - color[0] = input[this->m_channel]; + output[0] = input[this->m_channel]; } diff --git a/source/blender/compositor/operations/COM_SeparateChannelOperation.h b/source/blender/compositor/operations/COM_SeparateChannelOperation.h index 01fee3ca57d..f964df5df02 100644 --- a/source/blender/compositor/operations/COM_SeparateChannelOperation.h +++ b/source/blender/compositor/operations/COM_SeparateChannelOperation.h @@ -31,7 +31,7 @@ private: int m_channel; public: SeparateChannelOperation(); - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); void initExecution(); void deinitExecution(); diff --git a/source/blender/compositor/operations/COM_SetAlphaOperation.cpp b/source/blender/compositor/operations/COM_SetAlphaOperation.cpp index 0f707473f9d..fc6cfa455f3 100644 --- a/source/blender/compositor/operations/COM_SetAlphaOperation.cpp +++ b/source/blender/compositor/operations/COM_SetAlphaOperation.cpp @@ -38,14 +38,14 @@ void SetAlphaOperation::initExecution() this->m_inputAlpha = getInputSocketReader(1); } -void SetAlphaOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void SetAlphaOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float alphaInput[4]; - this->m_inputColor->read(outputValue, x, y, sampler); + this->m_inputColor->read(output, x, y, sampler); this->m_inputAlpha->read(alphaInput, x, y, sampler); - outputValue[3] = alphaInput[0]; + output[3] = alphaInput[0]; } void SetAlphaOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_SetAlphaOperation.h b/source/blender/compositor/operations/COM_SetAlphaOperation.h index 3d8eb5b9493..1ec4a7aeacf 100644 --- a/source/blender/compositor/operations/COM_SetAlphaOperation.h +++ b/source/blender/compositor/operations/COM_SetAlphaOperation.h @@ -43,7 +43,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); void initExecution(); void deinitExecution(); diff --git a/source/blender/compositor/operations/COM_SetColorOperation.cpp b/source/blender/compositor/operations/COM_SetColorOperation.cpp index 0665073840c..7aa2a8a27cd 100644 --- a/source/blender/compositor/operations/COM_SetColorOperation.cpp +++ b/source/blender/compositor/operations/COM_SetColorOperation.cpp @@ -27,15 +27,15 @@ SetColorOperation::SetColorOperation() : NodeOperation() this->addOutputSocket(COM_DT_COLOR); } -void SetColorOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void SetColorOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { - outputValue[0] = this->m_channel1; - outputValue[1] = this->m_channel2; - outputValue[2] = this->m_channel3; - outputValue[3] = this->m_channel4; + output[0] = this->m_channel1; + output[1] = this->m_channel2; + output[2] = this->m_channel3; + output[3] = this->m_channel4; } -void SetColorOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) +void SetColorOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) { resolution[0] = preferredResolution[0]; resolution[1] = preferredResolution[1]; diff --git a/source/blender/compositor/operations/COM_SetColorOperation.h b/source/blender/compositor/operations/COM_SetColorOperation.h index 72708800f1e..374390b45a4 100644 --- a/source/blender/compositor/operations/COM_SetColorOperation.h +++ b/source/blender/compositor/operations/COM_SetColorOperation.h @@ -61,9 +61,9 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); - void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]); + void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); const bool isSetOperation() const { return true; } }; diff --git a/source/blender/compositor/operations/COM_SetSamplerOperation.cpp b/source/blender/compositor/operations/COM_SetSamplerOperation.cpp index f7c1ef8f6f5..343b5973f7e 100644 --- a/source/blender/compositor/operations/COM_SetSamplerOperation.cpp +++ b/source/blender/compositor/operations/COM_SetSamplerOperation.cpp @@ -37,7 +37,7 @@ void SetSamplerOperation::deinitExecution() this->m_reader = NULL; } -void SetSamplerOperation::executePixel(float *output, float x, float y, PixelSampler sampler) +void SetSamplerOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { this->m_reader->read(output, x, y, this->m_sampler); } diff --git a/source/blender/compositor/operations/COM_SetSamplerOperation.h b/source/blender/compositor/operations/COM_SetSamplerOperation.h index 7b53cd8d38e..c94e174fc81 100644 --- a/source/blender/compositor/operations/COM_SetSamplerOperation.h +++ b/source/blender/compositor/operations/COM_SetSamplerOperation.h @@ -44,7 +44,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); void initExecution(); void deinitExecution(); }; diff --git a/source/blender/compositor/operations/COM_SetValueOperation.cpp b/source/blender/compositor/operations/COM_SetValueOperation.cpp index d88257226f5..c5ce3e4c09c 100644 --- a/source/blender/compositor/operations/COM_SetValueOperation.cpp +++ b/source/blender/compositor/operations/COM_SetValueOperation.cpp @@ -27,12 +27,12 @@ SetValueOperation::SetValueOperation() : NodeOperation() this->addOutputSocket(COM_DT_VALUE); } -void SetValueOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void SetValueOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { - outputValue[0] = this->m_value; + output[0] = this->m_value; } -void SetValueOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) +void SetValueOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) { resolution[0] = preferredResolution[0]; resolution[1] = preferredResolution[1]; diff --git a/source/blender/compositor/operations/COM_SetValueOperation.h b/source/blender/compositor/operations/COM_SetValueOperation.h index a2c3e8eaa0b..3ddc667bc7e 100644 --- a/source/blender/compositor/operations/COM_SetValueOperation.h +++ b/source/blender/compositor/operations/COM_SetValueOperation.h @@ -46,8 +46,8 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); - void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]); + void executePixel(float output[4], float x, float y, PixelSampler sampler); + void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); const bool isSetOperation() const { return true; } }; diff --git a/source/blender/compositor/operations/COM_SetVectorOperation.cpp b/source/blender/compositor/operations/COM_SetVectorOperation.cpp index 651add0453f..d5c665e81f5 100644 --- a/source/blender/compositor/operations/COM_SetVectorOperation.cpp +++ b/source/blender/compositor/operations/COM_SetVectorOperation.cpp @@ -28,15 +28,15 @@ SetVectorOperation::SetVectorOperation() : NodeOperation() this->addOutputSocket(COM_DT_VECTOR); } -void SetVectorOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void SetVectorOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { - outputValue[0] = this->m_x; - outputValue[1] = this->m_y; - outputValue[2] = this->m_z; - outputValue[3] = this->m_w; + output[0] = this->m_x; + output[1] = this->m_y; + output[2] = this->m_z; + output[3] = this->m_w; } -void SetVectorOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) +void SetVectorOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) { resolution[0] = preferredResolution[0]; resolution[1] = preferredResolution[1]; diff --git a/source/blender/compositor/operations/COM_SetVectorOperation.h b/source/blender/compositor/operations/COM_SetVectorOperation.h index 0868213a109..e9d6a163e9f 100644 --- a/source/blender/compositor/operations/COM_SetVectorOperation.h +++ b/source/blender/compositor/operations/COM_SetVectorOperation.h @@ -54,9 +54,9 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); - void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]); + void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); const bool isSetOperation() const { return true; } void setVector(float vector[3]) { diff --git a/source/blender/compositor/operations/COM_SocketProxyOperation.cpp b/source/blender/compositor/operations/COM_SocketProxyOperation.cpp index 0e670d9268e..ac2cee8eb44 100644 --- a/source/blender/compositor/operations/COM_SocketProxyOperation.cpp +++ b/source/blender/compositor/operations/COM_SocketProxyOperation.cpp @@ -39,9 +39,9 @@ void SocketProxyOperation::deinitExecution() this->m_inputOperation = NULL; } -void SocketProxyOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void SocketProxyOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { if (this->m_inputOperation) { - this->m_inputOperation->read(color, x, y, sampler); + this->m_inputOperation->read(output, x, y, sampler); } } diff --git a/source/blender/compositor/operations/COM_SocketProxyOperation.h b/source/blender/compositor/operations/COM_SocketProxyOperation.h index 219483aa92d..a37384455ca 100644 --- a/source/blender/compositor/operations/COM_SocketProxyOperation.h +++ b/source/blender/compositor/operations/COM_SocketProxyOperation.h @@ -30,7 +30,7 @@ private: SocketReader *m_inputOperation; public: SocketProxyOperation(DataType type); - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); void initExecution(); void deinitExecution(); diff --git a/source/blender/compositor/operations/COM_TextureOperation.cpp b/source/blender/compositor/operations/COM_TextureOperation.cpp index 5a32bcb76ac..f8d6c0cfc01 100644 --- a/source/blender/compositor/operations/COM_TextureOperation.cpp +++ b/source/blender/compositor/operations/COM_TextureOperation.cpp @@ -53,7 +53,7 @@ void TextureBaseOperation::deinitExecution() this->m_inputOffset = NULL; } -void TextureBaseOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) +void TextureBaseOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) { if (preferredResolution[0] == 0 || preferredResolution[1] == 0) { int width = this->m_rd->xsch * this->m_rd->size / 100; @@ -67,16 +67,16 @@ void TextureBaseOperation::determineResolution(unsigned int resolution[], unsign } } -void TextureAlphaOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void TextureAlphaOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { - TextureBaseOperation::executePixel(color, x, y, sampler); - color[0] = color[3]; - color[1] = 0.0f; - color[2] = 0.0f; - color[3] = 0.0f; + TextureBaseOperation::executePixel(output, x, y, sampler); + output[0] = output[3]; + output[1] = 0.0f; + output[2] = 0.0f; + output[3] = 0.0f; } -void TextureBaseOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void TextureBaseOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { TexResult texres = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, NULL}; float textureSize[4]; @@ -98,14 +98,16 @@ void TextureBaseOperation::executePixel(float *color, float x, float y, PixelSam retval = multitex_ext(this->m_texture, vec, NULL, NULL, 0, &texres); if (texres.talpha) - color[3] = texres.ta; + output[3] = texres.ta; else - color[3] = texres.tin; + output[3] = texres.tin; if ((retval & TEX_RGB)) { - color[0] = texres.tr; - color[1] = texres.tg; - color[2] = texres.tb; + output[0] = texres.tr; + output[1] = texres.tg; + output[2] = texres.tb; + } + else { + output[0] = output[1] = output[2] = output[3]; } - else color[0] = color[1] = color[2] = color[3]; } diff --git a/source/blender/compositor/operations/COM_TextureOperation.h b/source/blender/compositor/operations/COM_TextureOperation.h index 3631f8d24ff..f8435ecdaa2 100644 --- a/source/blender/compositor/operations/COM_TextureOperation.h +++ b/source/blender/compositor/operations/COM_TextureOperation.h @@ -51,7 +51,7 @@ protected: /** * Determine the output resolution. The resolution is retrieved from the Renderer */ - void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]); + void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); /** * Constructor @@ -59,7 +59,7 @@ protected: TextureBaseOperation(); public: - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); void setTexture(Tex *texture) { this->m_texture = texture; } void initExecution(); @@ -75,7 +75,7 @@ public: class TextureAlphaOperation : public TextureBaseOperation { public: TextureAlphaOperation(); - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; diff --git a/source/blender/compositor/operations/COM_TonemapOperation.cpp b/source/blender/compositor/operations/COM_TonemapOperation.cpp index 0dc30ebfcb9..2d944b70f75 100644 --- a/source/blender/compositor/operations/COM_TonemapOperation.cpp +++ b/source/blender/compositor/operations/COM_TonemapOperation.cpp @@ -41,11 +41,10 @@ void TonemapOperation::initExecution() NodeOperation::initMutex(); } -void TonemapOperation::executePixel(float *color, int x, int y, void *data) +void TonemapOperation::executePixel(float output[4], int x, int y, void *data) { AvgLogLum *avg = (AvgLogLum *)data; - float output[4]; this->m_imageReader->read(output, x, y, NULL); mul_v3_fl(output, avg->al); float dr = output[0] + this->m_data->offset; @@ -56,14 +55,12 @@ void TonemapOperation::executePixel(float *color, int x, int y, void *data) output[2] /= ((db == 0.f) ? 1.0f : db); const float igm = avg->igm; if (igm != 0.0f) { - output[0] = powf(MAX2(output[0], 0.0f), igm); - output[1] = powf(MAX2(output[1], 0.0f), igm); - output[2] = powf(MAX2(output[2], 0.0f), igm); + output[0] = powf(max(output[0], 0.0f), igm); + output[1] = powf(max(output[1], 0.0f), igm); + output[2] = powf(max(output[2], 0.0f), igm); } - - copy_v4_v4(color, output); } -void PhotoreceptorTonemapOperation::executePixel(float *color, int x, int y, void *data) +void PhotoreceptorTonemapOperation::executePixel(float output[4], int x, int y, void *data) { AvgLogLum *avg = (AvgLogLum *)data; NodeTonemap *ntm = this->m_data; @@ -72,7 +69,6 @@ void PhotoreceptorTonemapOperation::executePixel(float *color, int x, int y, voi const float m = (ntm->m > 0.0f) ? ntm->m : (0.3f + 0.7f * powf(avg->auto_key, 1.4f)); const float ic = 1.0f - ntm->c, ia = 1.0f - ntm->a; - float output[4]; this->m_imageReader->read(output, x, y, NULL); const float L = rgb_to_luma_y(output); @@ -88,8 +84,6 @@ void PhotoreceptorTonemapOperation::executePixel(float *color, int x, int y, voi I_g = avg->cav[2] + ic * (avg->lav - avg->cav[2]); I_a = I_l + ia * (I_g - I_l); output[2] /= (output[2] + powf(f * I_a, m)); - - copy_v4_v4(color, output); } void TonemapOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_TonemapOperation.h b/source/blender/compositor/operations/COM_TonemapOperation.h index 4e591276c76..843bf89dc92 100644 --- a/source/blender/compositor/operations/COM_TonemapOperation.h +++ b/source/blender/compositor/operations/COM_TonemapOperation.h @@ -64,7 +64,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); /** * Initialize the execution @@ -97,7 +97,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); }; #endif diff --git a/source/blender/compositor/operations/COM_TrackPositionOperation.cpp b/source/blender/compositor/operations/COM_TrackPositionOperation.cpp index 869ec71614a..d41d1c128da 100644 --- a/source/blender/compositor/operations/COM_TrackPositionOperation.cpp +++ b/source/blender/compositor/operations/COM_TrackPositionOperation.cpp @@ -101,17 +101,17 @@ void TrackPositionOperation::initExecution() } } -void TrackPositionOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler) +void TrackPositionOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { - outputValue[0] = this->m_markerPos[this->m_axis] - this->m_relativePos[this->m_axis]; + output[0] = this->m_markerPos[this->m_axis] - this->m_relativePos[this->m_axis]; if (this->m_axis == 0) - outputValue[0] *= this->m_width; + output[0] *= this->m_width; else - outputValue[0] *= this->m_height; + output[0] *= this->m_height; } -void TrackPositionOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) +void TrackPositionOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) { resolution[0] = preferredResolution[0]; resolution[1] = preferredResolution[1]; diff --git a/source/blender/compositor/operations/COM_TrackPositionOperation.h b/source/blender/compositor/operations/COM_TrackPositionOperation.h index fe4f703d26c..3a9e6f25cd9 100644 --- a/source/blender/compositor/operations/COM_TrackPositionOperation.h +++ b/source/blender/compositor/operations/COM_TrackPositionOperation.h @@ -60,7 +60,7 @@ protected: /** * Determine the output resolution. The resolution is retrieved from the Renderer */ - void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]); + void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); public: TrackPositionOperation(); @@ -75,7 +75,7 @@ public: void initExecution(); - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); const bool isSetOperation() const { return true; } }; diff --git a/source/blender/compositor/operations/COM_TranslateOperation.cpp b/source/blender/compositor/operations/COM_TranslateOperation.cpp index fda50ac24d1..761f55a1455 100644 --- a/source/blender/compositor/operations/COM_TranslateOperation.cpp +++ b/source/blender/compositor/operations/COM_TranslateOperation.cpp @@ -50,10 +50,10 @@ void TranslateOperation::deinitExecution() } -void TranslateOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void TranslateOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { ensureDelta(); - this->m_inputOperation->read(color, x - this->getDeltaX(), y - this->getDeltaY(), sampler); + this->m_inputOperation->read(output, x - this->getDeltaX(), y - this->getDeltaY(), sampler); } bool TranslateOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) diff --git a/source/blender/compositor/operations/COM_TranslateOperation.h b/source/blender/compositor/operations/COM_TranslateOperation.h index 83e3befdfeb..faaadb1ced2 100644 --- a/source/blender/compositor/operations/COM_TranslateOperation.h +++ b/source/blender/compositor/operations/COM_TranslateOperation.h @@ -36,7 +36,7 @@ private: public: TranslateOperation(); bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); void initExecution(); void deinitExecution(); diff --git a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp index f7712f675f2..7ccc91072bc 100644 --- a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp @@ -45,6 +45,7 @@ VariableSizeBokehBlurOperation::VariableSizeBokehBlurOperation() : NodeOperation this->m_inputSizeProgram = NULL; this->m_maxBlur = 32.0f; this->m_threshold = 1.0f; + this->m_do_size_scale = false; #ifdef COM_DEFOCUS_SEARCH this->m_inputSearchProgram = NULL; #endif @@ -66,7 +67,7 @@ struct VariableSizeBokehBlurTileData MemoryBuffer *color; MemoryBuffer *bokeh; MemoryBuffer *size; - int maxBlur; + int maxBlurScalar; }; void *VariableSizeBokehBlurOperation::initializeTileData(rcti *rect) @@ -79,8 +80,12 @@ void *VariableSizeBokehBlurOperation::initializeTileData(rcti *rect) rcti rect2; this->determineDependingAreaOfInterest(rect, (ReadBufferOperation *)this->m_inputSizeProgram, &rect2); - data->maxBlur = (int)data->size->getMaximumValue(&rect2); - CLAMP(data->maxBlur, 1.0f, this->m_maxBlur); + + const float max_dim = max(m_width, m_height); + const float scalar = this->m_do_size_scale ? (max_dim / 100.0f) : 1.0f; + + data->maxBlurScalar = (int)(data->size->getMaximumValue(&rect2) * scalar); + CLAMP(data->maxBlurScalar, 1.0f, this->m_maxBlur); return data; } @@ -90,7 +95,7 @@ void VariableSizeBokehBlurOperation::deinitializeTileData(rcti *rect, void *data delete result; } -void VariableSizeBokehBlurOperation::executePixel(float *color, int x, int y, void *data) +void VariableSizeBokehBlurOperation::executePixel(float output[4], int x, int y, void *data) { VariableSizeBokehBlurTileData *tileData = (VariableSizeBokehBlurTileData *)data; MemoryBuffer *inputProgramBuffer = tileData->color; @@ -103,7 +108,13 @@ void VariableSizeBokehBlurOperation::executePixel(float *color, int x, int y, vo float tempSize[4]; float multiplier_accum[4]; float color_accum[4]; - int maxBlur = tileData->maxBlur; + + const float max_dim = max(m_width, m_height); + const float scalar = this->m_do_size_scale ? (max_dim / 100.0f) : 1.0f; + int maxBlurScalar = tileData->maxBlurScalar; + + BLI_assert(inputBokehBuffer->getWidth() == COM_BLUR_BOKEH_PIXELS); + BLI_assert(inputBokehBuffer->getHeight() == COM_BLUR_BOKEH_PIXELS); #ifdef COM_DEFOCUS_SEARCH float search[4]; @@ -113,10 +124,10 @@ void VariableSizeBokehBlurOperation::executePixel(float *color, int x, int y, vo int maxx = search[2]; int maxy = search[3]; #else - int minx = max(x - maxBlur, 0); - int miny = max(y - maxBlur, 0); - int maxx = min(x + maxBlur, (int)m_width); - int maxy = min(y + maxBlur, (int)m_height); + int minx = max(x - maxBlurScalar, 0); + int miny = max(y - maxBlurScalar, 0); + int maxx = min(x + maxBlurScalar, (int)m_width); + int maxy = min(y + maxBlurScalar, (int)m_height); #endif { inputSizeBuffer->readNoCheck(tempSize, x, y); @@ -124,7 +135,7 @@ void VariableSizeBokehBlurOperation::executePixel(float *color, int x, int y, vo copy_v4_v4(color_accum, readColor); copy_v4_fl(multiplier_accum, 1.0f); - float size_center = tempSize[0]; + float size_center = tempSize[0] * scalar; const int addXStep = QualityStepHelper::getStep() * COM_NUMBER_OF_CHANNELS; @@ -135,12 +146,13 @@ void VariableSizeBokehBlurOperation::executePixel(float *color, int x, int y, vo int offsetNxNy = offsetNy + (minx * COM_NUMBER_OF_CHANNELS); for (int nx = minx; nx < maxx; nx += QualityStepHelper::getStep()) { if (nx != x || ny != y) { - float size = inputSizeFloatBuffer[offsetNxNy]; + float size = inputSizeFloatBuffer[offsetNxNy] * scalar; if (size > this->m_threshold) { float dx = nx - x; if (size > fabsf(dx) && size > fabsf(dy)) { - float uv[2] = {256.0f + (dx / size) * 255.0f, - 256.0f + (dy / size) * 255.0f}; + float uv[2] = { + (float)(COM_BLUR_BOKEH_PIXELS / 2) + (dx / size) * (float)((COM_BLUR_BOKEH_PIXELS / 2) - 1), + (float)(COM_BLUR_BOKEH_PIXELS / 2) + (dy / size) * (float)((COM_BLUR_BOKEH_PIXELS / 2) - 1)}; inputBokehBuffer->readNoCheck(bokeh, uv[0], uv[1]); madd_v4_v4v4(color_accum, bokeh, &inputProgramFloatBuffer[offsetNxNy]); add_v4_v4(multiplier_accum, bokeh); @@ -152,10 +164,10 @@ void VariableSizeBokehBlurOperation::executePixel(float *color, int x, int y, vo } } - color[0] = color_accum[0] / multiplier_accum[0]; - color[1] = color_accum[1] / multiplier_accum[1]; - color[2] = color_accum[2] / multiplier_accum[2]; - color[3] = color_accum[3] / multiplier_accum[3]; + output[0] = color_accum[0] / multiplier_accum[0]; + output[1] = color_accum[1] / multiplier_accum[1]; + output[2] = color_accum[2] / multiplier_accum[2]; + output[3] = color_accum[3] / multiplier_accum[3]; /* blend in out values over the threshold, otherwise we get sharp, ugly transitions */ if ((size_center > this->m_threshold) && @@ -163,7 +175,7 @@ void VariableSizeBokehBlurOperation::executePixel(float *color, int x, int y, vo { /* factor from 0-1 */ float fac = (size_center - this->m_threshold) / this->m_threshold; - interp_v4_v4v4(color, readColor, color, fac); + interp_v4_v4v4(output, readColor, output, fac); } } @@ -181,7 +193,11 @@ void VariableSizeBokehBlurOperation::executeOpenCL(OpenCLDevice *device, cl_float threshold = this->m_threshold; MemoryBuffer *sizeMemoryBuffer = (MemoryBuffer *)this->m_inputSizeProgram->getInputMemoryBuffer(inputMemoryBuffers); - maxBlur = (cl_int)sizeMemoryBuffer->getMaximumValue(); + + const float max_dim = max(m_width, m_height); + cl_float scalar = this->m_do_size_scale ? (max_dim / 100.0f) : 1.0f; + + maxBlur = (cl_int)sizeMemoryBuffer->getMaximumValue() * scalar; maxBlur = MIN2(maxBlur, this->m_maxBlur); device->COM_clAttachMemoryBufferToKernelParameter(defocusKernel, 0, -1, clMemToCleanUp, inputMemoryBuffers, this->m_inputProgram); @@ -192,9 +208,10 @@ void VariableSizeBokehBlurOperation::executeOpenCL(OpenCLDevice *device, clSetKernelArg(defocusKernel, 6, sizeof(cl_int), &step); clSetKernelArg(defocusKernel, 7, sizeof(cl_int), &maxBlur); clSetKernelArg(defocusKernel, 8, sizeof(cl_float), &threshold); - device->COM_clAttachSizeToKernelParameter(defocusKernel, 9, this); + clSetKernelArg(defocusKernel, 9, sizeof(cl_float), &scalar); + device->COM_clAttachSizeToKernelParameter(defocusKernel, 10, this); - device->COM_clEnqueueRange(defocusKernel, outputMemoryBuffer, 10, this); + device->COM_clEnqueueRange(defocusKernel, outputMemoryBuffer, 11, this); } void VariableSizeBokehBlurOperation::deinitExecution() @@ -212,13 +229,17 @@ bool VariableSizeBokehBlurOperation::determineDependingAreaOfInterest(rcti *inpu rcti newInput; rcti bokehInput; - newInput.xmax = input->xmax + this->m_maxBlur + 2; - newInput.xmin = input->xmin - this->m_maxBlur + 2; - newInput.ymax = input->ymax + this->m_maxBlur - 2; - newInput.ymin = input->ymin - this->m_maxBlur - 2; - bokehInput.xmax = 512; + const float max_dim = max(m_width, m_height); + const float scalar = this->m_do_size_scale ? (max_dim / 100.0f) : 1.0f; + int maxBlurScalar = this->m_maxBlur * scalar; + + newInput.xmax = input->xmax + maxBlurScalar + 2; + newInput.xmin = input->xmin - maxBlurScalar + 2; + newInput.ymax = input->ymax + maxBlurScalar - 2; + newInput.ymin = input->ymin - maxBlurScalar - 2; + bokehInput.xmax = COM_BLUR_BOKEH_PIXELS; bokehInput.xmin = 0; - bokehInput.ymax = 512; + bokehInput.ymax = COM_BLUR_BOKEH_PIXELS; bokehInput.ymin = 0; @@ -317,7 +338,7 @@ voi *InverseSearchRadiusOperation::initializeTileData(rcti *rect) return data; } -void InverseSearchRadiusOperation::executePixel(float *color, int x, int y, void *data) +void InverseSearchRadiusOperation::executePixel(float output[4], int x, int y, void *data) { MemoryBuffer *buffer = (MemoryBuffer *)data; buffer->readNoCheck(color, x, y); @@ -336,7 +357,7 @@ void InverseSearchRadiusOperation::deinitExecution() this->m_inputRadius = NULL; } -void InverseSearchRadiusOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) +void InverseSearchRadiusOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) { NodeOperation::determineResolution(resolution, preferredResolution); resolution[0] = resolution[0] / DIVIDER; diff --git a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h index f53d54f8c2c..d4025692549 100644 --- a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h +++ b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h @@ -31,6 +31,7 @@ class VariableSizeBokehBlurOperation : public NodeOperation, public QualityStepH private: int m_maxBlur; float m_threshold; + bool m_do_size_scale; /* scale size, matching 'BokehBlurNode' */ SocketReader *m_inputProgram; SocketReader *m_inputBokehProgram; SocketReader *m_inputSizeProgram; @@ -44,7 +45,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); /** * Initialize the execution @@ -66,6 +67,8 @@ public: void setThreshold(float threshold) { this->m_threshold = threshold; } + void setDoScaleSize(bool scale_size) { this->m_do_size_scale = scale_size; } + void executeOpenCL(OpenCLDevice *device, MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, MemoryBuffer **inputMemoryBuffers, list *clMemToCleanUp, list *clKernelsToCleanUp); }; @@ -82,7 +85,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data); + void executePixel(float output[4], int x, int y, MemoryBuffer *inputBuffers[], void *data); /** * Initialize the execution @@ -97,7 +100,7 @@ public: void deinitExecution(); bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output); - void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]); + void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); void setMaxBlur(int maxRadius) { this->m_maxBlur = maxRadius; } }; diff --git a/source/blender/compositor/operations/COM_VectorBlurOperation.cpp b/source/blender/compositor/operations/COM_VectorBlurOperation.cpp index 134597531c2..ebf3b772b3b 100644 --- a/source/blender/compositor/operations/COM_VectorBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_VectorBlurOperation.cpp @@ -52,11 +52,11 @@ void VectorBlurOperation::initExecution() } -void VectorBlurOperation::executePixel(float *color, int x, int y, void *data) +void VectorBlurOperation::executePixel(float output[4], int x, int y, void *data) { float *buffer = (float *) data; int index = (y * this->getWidth() + x) * COM_NUMBER_OF_CHANNELS; - copy_v4_v4(color, &buffer[index]); + copy_v4_v4(output, &buffer[index]); } void VectorBlurOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_VectorBlurOperation.h b/source/blender/compositor/operations/COM_VectorBlurOperation.h index 2743baf8500..4c6fca3cf83 100644 --- a/source/blender/compositor/operations/COM_VectorBlurOperation.h +++ b/source/blender/compositor/operations/COM_VectorBlurOperation.h @@ -48,7 +48,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, int x, int y, void *data); + void executePixel(float output[4], int x, int y, void *data); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_VectorCurveOperation.cpp b/source/blender/compositor/operations/COM_VectorCurveOperation.cpp index ed86c842fc9..d0a077fed61 100644 --- a/source/blender/compositor/operations/COM_VectorCurveOperation.cpp +++ b/source/blender/compositor/operations/COM_VectorCurveOperation.cpp @@ -43,7 +43,7 @@ void VectorCurveOperation::initExecution() this->m_inputProgram = this->getInputSocketReader(0); } -void VectorCurveOperation::executePixel(float *output, float x, float y, PixelSampler sampler) +void VectorCurveOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float input[4]; diff --git a/source/blender/compositor/operations/COM_VectorCurveOperation.h b/source/blender/compositor/operations/COM_VectorCurveOperation.h index b76f8880fc6..6a1f916c60b 100644 --- a/source/blender/compositor/operations/COM_VectorCurveOperation.h +++ b/source/blender/compositor/operations/COM_VectorCurveOperation.h @@ -37,7 +37,7 @@ public: /** * the inner loop of this program */ - void executePixel(float *Vector, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); /** * Initialize the execution diff --git a/source/blender/compositor/operations/COM_WriteBufferOperation.cpp b/source/blender/compositor/operations/COM_WriteBufferOperation.cpp index 06ec5b51efd..273c10b60ac 100644 --- a/source/blender/compositor/operations/COM_WriteBufferOperation.cpp +++ b/source/blender/compositor/operations/COM_WriteBufferOperation.cpp @@ -40,9 +40,9 @@ WriteBufferOperation::~WriteBufferOperation() } } -void WriteBufferOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void WriteBufferOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { - this->m_input->read(color, x, y, sampler); + this->m_input->read(output, x, y, sampler); } void WriteBufferOperation::initExecution() diff --git a/source/blender/compositor/operations/COM_WriteBufferOperation.h b/source/blender/compositor/operations/COM_WriteBufferOperation.h index f1632689dbe..d89444045d4 100644 --- a/source/blender/compositor/operations/COM_WriteBufferOperation.h +++ b/source/blender/compositor/operations/COM_WriteBufferOperation.h @@ -38,7 +38,7 @@ public: ~WriteBufferOperation(); int isBufferOperation() { return true; } MemoryProxy *getMemoryProxy() { return this->m_memoryProxy; } - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); const bool isWriteBufferOperation() const { return true; } void executeRegion(rcti *rect, unsigned int tileNumber); diff --git a/source/blender/compositor/operations/COM_ZCombineOperation.cpp b/source/blender/compositor/operations/COM_ZCombineOperation.cpp index 28dbcd9f017..7e23e7290f8 100644 --- a/source/blender/compositor/operations/COM_ZCombineOperation.cpp +++ b/source/blender/compositor/operations/COM_ZCombineOperation.cpp @@ -46,7 +46,7 @@ void ZCombineOperation::initExecution() this->m_depth2Reader = this->getInputSocketReader(3); } -void ZCombineOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void ZCombineOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float depth1[4]; float depth2[4]; @@ -54,13 +54,13 @@ void ZCombineOperation::executePixel(float *color, float x, float y, PixelSample this->m_depth1Reader->read(depth1, x, y, sampler); this->m_depth2Reader->read(depth2, x, y, sampler); if (depth1[0] < depth2[0]) { - this->m_image1Reader->read(color, x, y, sampler); + this->m_image1Reader->read(output, x, y, sampler); } else { - this->m_image2Reader->read(color, x, y, sampler); + this->m_image2Reader->read(output, x, y, sampler); } } -void ZCombineAlphaOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void ZCombineAlphaOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float depth1[4]; float depth2[4]; @@ -79,10 +79,10 @@ void ZCombineAlphaOperation::executePixel(float *color, float x, float y, PixelS } float fac = color1[3]; float ifac = 1.0f - fac; - color[0] = color1[0] + ifac * color2[0]; - color[1] = color1[1] + ifac * color2[1]; - color[2] = color1[2] + ifac * color2[2]; - color[3] = MAX2(color1[3], color2[3]); + output[0] = color1[0] + ifac * color2[0]; + output[1] = color1[1] + ifac * color2[1]; + output[2] = color1[2] + ifac * color2[2]; + output[3] = MAX2(color1[3], color2[3]); } void ZCombineOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_ZCombineOperation.h b/source/blender/compositor/operations/COM_ZCombineOperation.h index 9ee0899ee28..61ceca340f7 100644 --- a/source/blender/compositor/operations/COM_ZCombineOperation.h +++ b/source/blender/compositor/operations/COM_ZCombineOperation.h @@ -47,11 +47,11 @@ public: /** * the inner loop of this program */ - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; class ZCombineAlphaOperation : public ZCombineOperation { - void executePixel(float *color, float x, float y, PixelSampler sampler); + void executePixel(float output[4], float x, float y, PixelSampler sampler); }; #endif diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 6db8960977a..13c48c7f51d 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -5301,7 +5301,7 @@ void MESH_OT_convex_hull(wmOperatorType *ot) /* api callbacks */ ot->exec = edbm_convex_hull_exec; - ot->poll = EM_view3d_poll; + ot->poll = ED_operator_editmesh; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 47d6bf62c91..9cda4900c8d 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -2685,7 +2685,7 @@ static int view3d_zoom_border_invoke(bContext *C, wmOperator *op, wmEvent *event void VIEW3D_OT_zoom_border(wmOperatorType *ot) { /* identifiers */ - ot->name = "Border Zoom"; + ot->name = "Zoom to Border"; ot->description = "Zoom in the view to the nearest object contained in the border"; ot->idname = "VIEW3D_OT_zoom_border";