Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-04-17 07:17:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-17 07:21:24 +0300
commite12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch)
tree8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/compositor/operations/COM_MathBaseOperation.cpp
parentb3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff)
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/compositor/operations/COM_MathBaseOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_MathBaseOperation.cpp505
1 files changed, 287 insertions, 218 deletions
diff --git a/source/blender/compositor/operations/COM_MathBaseOperation.cpp b/source/blender/compositor/operations/COM_MathBaseOperation.cpp
index 5bcb71a8dfc..b3251d32005 100644
--- a/source/blender/compositor/operations/COM_MathBaseOperation.cpp
+++ b/source/blender/compositor/operations/COM_MathBaseOperation.cpp
@@ -23,379 +23,448 @@ extern "C" {
MathBaseOperation::MathBaseOperation() : NodeOperation()
{
- this->addInputSocket(COM_DT_VALUE);
- this->addInputSocket(COM_DT_VALUE);
- this->addOutputSocket(COM_DT_VALUE);
- this->m_inputValue1Operation = NULL;
- this->m_inputValue2Operation = NULL;
- this->m_useClamp = false;
+ this->addInputSocket(COM_DT_VALUE);
+ this->addInputSocket(COM_DT_VALUE);
+ this->addOutputSocket(COM_DT_VALUE);
+ this->m_inputValue1Operation = NULL;
+ this->m_inputValue2Operation = NULL;
+ this->m_useClamp = false;
}
void MathBaseOperation::initExecution()
{
- this->m_inputValue1Operation = this->getInputSocketReader(0);
- this->m_inputValue2Operation = this->getInputSocketReader(1);
+ this->m_inputValue1Operation = this->getInputSocketReader(0);
+ this->m_inputValue2Operation = this->getInputSocketReader(1);
}
-
void MathBaseOperation::deinitExecution()
{
- this->m_inputValue1Operation = NULL;
- this->m_inputValue2Operation = NULL;
+ this->m_inputValue1Operation = NULL;
+ this->m_inputValue2Operation = NULL;
}
-void MathBaseOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
+void MathBaseOperation::determineResolution(unsigned int resolution[2],
+ unsigned int preferredResolution[2])
{
- NodeOperationInput *socket;
- unsigned int tempPreferredResolution[2] = {0, 0};
- unsigned int tempResolution[2];
-
- socket = this->getInputSocket(0);
- socket->determineResolution(tempResolution, tempPreferredResolution);
- if ((tempResolution[0] != 0) && (tempResolution[1] != 0)) {
- this->setResolutionInputSocketIndex(0);
- }
- else {
- this->setResolutionInputSocketIndex(1);
- }
- NodeOperation::determineResolution(resolution, preferredResolution);
+ NodeOperationInput *socket;
+ unsigned int tempPreferredResolution[2] = {0, 0};
+ unsigned int tempResolution[2];
+
+ socket = this->getInputSocket(0);
+ socket->determineResolution(tempResolution, tempPreferredResolution);
+ if ((tempResolution[0] != 0) && (tempResolution[1] != 0)) {
+ this->setResolutionInputSocketIndex(0);
+ }
+ else {
+ this->setResolutionInputSocketIndex(1);
+ }
+ NodeOperation::determineResolution(resolution, preferredResolution);
}
void MathBaseOperation::clampIfNeeded(float *color)
{
- if (this->m_useClamp) {
- CLAMP(color[0], 0.0f, 1.0f);
- }
+ if (this->m_useClamp) {
+ CLAMP(color[0], 0.0f, 1.0f);
+ }
}
void MathAddOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
- float inputValue1[4];
- float inputValue2[4];
+ float inputValue1[4];
+ float inputValue2[4];
- this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
- this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
+ this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
+ this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
- output[0] = inputValue1[0] + inputValue2[0];
+ output[0] = inputValue1[0] + inputValue2[0];
- clampIfNeeded(output);
+ clampIfNeeded(output);
}
-void MathSubtractOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
+void MathSubtractOperation::executePixelSampled(float output[4],
+ float x,
+ float y,
+ PixelSampler sampler)
{
- float inputValue1[4];
- float inputValue2[4];
+ float inputValue1[4];
+ float inputValue2[4];
- this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
- this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
+ this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
+ this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
- output[0] = inputValue1[0] - inputValue2[0];
+ output[0] = inputValue1[0] - inputValue2[0];
- clampIfNeeded(output);
+ clampIfNeeded(output);
}
-void MathMultiplyOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
+void MathMultiplyOperation::executePixelSampled(float output[4],
+ float x,
+ float y,
+ PixelSampler sampler)
{
- float inputValue1[4];
- float inputValue2[4];
+ float inputValue1[4];
+ float inputValue2[4];
- this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
- this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
+ this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
+ this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
- output[0] = inputValue1[0] * inputValue2[0];
+ output[0] = inputValue1[0] * inputValue2[0];
- clampIfNeeded(output);
+ clampIfNeeded(output);
}
-void MathDivideOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
+void MathDivideOperation::executePixelSampled(float output[4],
+ float x,
+ float y,
+ PixelSampler sampler)
{
- float inputValue1[4];
- float inputValue2[4];
+ float inputValue1[4];
+ float inputValue2[4];
- this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
- this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
+ this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
+ this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
- if (inputValue2[0] == 0) /* We don't want to divide by zero. */
- output[0] = 0.0;
- else
- output[0] = inputValue1[0] / inputValue2[0];
+ if (inputValue2[0] == 0) /* We don't want to divide by zero. */
+ output[0] = 0.0;
+ else
+ output[0] = inputValue1[0] / inputValue2[0];
- clampIfNeeded(output);
+ clampIfNeeded(output);
}
-void MathSineOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
+void MathSineOperation::executePixelSampled(float output[4],
+ float x,
+ float y,
+ PixelSampler sampler)
{
- float inputValue1[4];
- float inputValue2[4];
+ float inputValue1[4];
+ float inputValue2[4];
- this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
- this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
+ this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
+ this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
- output[0] = sin(inputValue1[0]);
+ output[0] = sin(inputValue1[0]);
- clampIfNeeded(output);
+ clampIfNeeded(output);
}
-void MathCosineOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
+void MathCosineOperation::executePixelSampled(float output[4],
+ float x,
+ float y,
+ PixelSampler sampler)
{
- float inputValue1[4];
- float inputValue2[4];
+ float inputValue1[4];
+ float inputValue2[4];
- this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
- this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
+ this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
+ this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
- output[0] = cos(inputValue1[0]);
+ output[0] = cos(inputValue1[0]);
- clampIfNeeded(output);
+ clampIfNeeded(output);
}
-void MathTangentOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
+void MathTangentOperation::executePixelSampled(float output[4],
+ float x,
+ float y,
+ PixelSampler sampler)
{
- float inputValue1[4];
- float inputValue2[4];
+ float inputValue1[4];
+ float inputValue2[4];
- this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
- this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
+ this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
+ this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
- output[0] = tan(inputValue1[0]);
+ output[0] = tan(inputValue1[0]);
- clampIfNeeded(output);
+ clampIfNeeded(output);
}
-void MathArcSineOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
+void MathArcSineOperation::executePixelSampled(float output[4],
+ float x,
+ float y,
+ PixelSampler sampler)
{
- float inputValue1[4];
- float inputValue2[4];
+ float inputValue1[4];
+ float inputValue2[4];
- this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
- this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
+ this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
+ this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
- if (inputValue1[0] <= 1 && inputValue1[0] >= -1)
- output[0] = asin(inputValue1[0]);
- else
- output[0] = 0.0;
+ if (inputValue1[0] <= 1 && inputValue1[0] >= -1)
+ output[0] = asin(inputValue1[0]);
+ else
+ output[0] = 0.0;
- clampIfNeeded(output);
+ clampIfNeeded(output);
}
-void MathArcCosineOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
+void MathArcCosineOperation::executePixelSampled(float output[4],
+ float x,
+ float y,
+ PixelSampler sampler)
{
- float inputValue1[4];
- float inputValue2[4];
+ float inputValue1[4];
+ float inputValue2[4];
- this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
- this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
+ this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
+ this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
- if (inputValue1[0] <= 1 && inputValue1[0] >= -1)
- output[0] = acos(inputValue1[0]);
- else
- output[0] = 0.0;
+ if (inputValue1[0] <= 1 && inputValue1[0] >= -1)
+ output[0] = acos(inputValue1[0]);
+ else
+ output[0] = 0.0;
- clampIfNeeded(output);
+ clampIfNeeded(output);
}
-void MathArcTangentOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
+void MathArcTangentOperation::executePixelSampled(float output[4],
+ float x,
+ float y,
+ PixelSampler sampler)
{
- float inputValue1[4];
- float inputValue2[4];
+ float inputValue1[4];
+ float inputValue2[4];
- this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
- this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
+ this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
+ this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
- output[0] = atan(inputValue1[0]);
+ output[0] = atan(inputValue1[0]);
- clampIfNeeded(output);
+ clampIfNeeded(output);
}
-void MathPowerOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
+void MathPowerOperation::executePixelSampled(float output[4],
+ float x,
+ float y,
+ PixelSampler sampler)
{
- float inputValue1[4];
- float inputValue2[4];
-
- this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
- this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
-
- if (inputValue1[0] >= 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) {
- output[0] = pow(inputValue1[0], floorf(inputValue2[0] + 0.5f));
- }
- else {
- output[0] = 0.0;
- }
- }
-
- clampIfNeeded(output);
+ float inputValue1[4];
+ float inputValue2[4];
+
+ this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
+ this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
+
+ if (inputValue1[0] >= 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) {
+ output[0] = pow(inputValue1[0], floorf(inputValue2[0] + 0.5f));
+ }
+ else {
+ output[0] = 0.0;
+ }
+ }
+
+ clampIfNeeded(output);
}
-void MathLogarithmOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
+void MathLogarithmOperation::executePixelSampled(float output[4],
+ float x,
+ float y,
+ PixelSampler sampler)
{
- float inputValue1[4];
- float inputValue2[4];
+ float inputValue1[4];
+ float inputValue2[4];
- this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
- this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
+ this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
+ this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
- if (inputValue1[0] > 0 && inputValue2[0] > 0)
- output[0] = log(inputValue1[0]) / log(inputValue2[0]);
- else
- output[0] = 0.0;
+ if (inputValue1[0] > 0 && inputValue2[0] > 0)
+ output[0] = log(inputValue1[0]) / log(inputValue2[0]);
+ else
+ output[0] = 0.0;
- clampIfNeeded(output);
+ clampIfNeeded(output);
}
-void MathMinimumOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
+void MathMinimumOperation::executePixelSampled(float output[4],
+ float x,
+ float y,
+ PixelSampler sampler)
{
- float inputValue1[4];
- float inputValue2[4];
+ float inputValue1[4];
+ float inputValue2[4];
- this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
- this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
+ this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
+ this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
- output[0] = min(inputValue1[0], inputValue2[0]);
+ output[0] = min(inputValue1[0], inputValue2[0]);
- clampIfNeeded(output);
+ clampIfNeeded(output);
}
-void MathMaximumOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
+void MathMaximumOperation::executePixelSampled(float output[4],
+ float x,
+ float y,
+ PixelSampler sampler)
{
- float inputValue1[4];
- float inputValue2[4];
+ float inputValue1[4];
+ float inputValue2[4];
- this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
- this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
+ this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
+ this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
- output[0] = max(inputValue1[0], inputValue2[0]);
+ output[0] = max(inputValue1[0], inputValue2[0]);
- clampIfNeeded(output);
+ clampIfNeeded(output);
}
-void MathRoundOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
+void MathRoundOperation::executePixelSampled(float output[4],
+ float x,
+ float y,
+ PixelSampler sampler)
{
- float inputValue1[4];
- float inputValue2[4];
+ float inputValue1[4];
+ float inputValue2[4];
- this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
- this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
+ this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
+ this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
- output[0] = round(inputValue1[0]);
+ output[0] = round(inputValue1[0]);
- clampIfNeeded(output);
+ clampIfNeeded(output);
}
-void MathLessThanOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
+void MathLessThanOperation::executePixelSampled(float output[4],
+ float x,
+ float y,
+ PixelSampler sampler)
{
- float inputValue1[4];
- float inputValue2[4];
+ float inputValue1[4];
+ float inputValue2[4];
- this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
- this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
+ this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
+ this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
- output[0] = inputValue1[0] < inputValue2[0] ? 1.0f : 0.0f;
+ output[0] = inputValue1[0] < inputValue2[0] ? 1.0f : 0.0f;
- clampIfNeeded(output);
+ clampIfNeeded(output);
}
-void MathGreaterThanOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
+void MathGreaterThanOperation::executePixelSampled(float output[4],
+ float x,
+ float y,
+ PixelSampler sampler)
{
- float inputValue1[4];
- float inputValue2[4];
+ float inputValue1[4];
+ float inputValue2[4];
- this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
- this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
+ this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
+ this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
- output[0] = inputValue1[0] > inputValue2[0] ? 1.0f : 0.0f;
+ output[0] = inputValue1[0] > inputValue2[0] ? 1.0f : 0.0f;
- clampIfNeeded(output);
+ clampIfNeeded(output);
}
-void MathModuloOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
+void MathModuloOperation::executePixelSampled(float output[4],
+ float x,
+ float y,
+ PixelSampler sampler)
{
- float inputValue1[4];
- float inputValue2[4];
+ float inputValue1[4];
+ float inputValue2[4];
- this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
- this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
+ this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
+ this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
- if (inputValue2[0] == 0)
- output[0] = 0.0;
- else
- output[0] = fmod(inputValue1[0], inputValue2[0]);
+ if (inputValue2[0] == 0)
+ output[0] = 0.0;
+ else
+ output[0] = fmod(inputValue1[0], inputValue2[0]);
- clampIfNeeded(output);
+ clampIfNeeded(output);
}
-void MathAbsoluteOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
+void MathAbsoluteOperation::executePixelSampled(float output[4],
+ float x,
+ float y,
+ PixelSampler sampler)
{
- float inputValue1[4];
+ float inputValue1[4];
- this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
+ this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
- output[0] = fabs(inputValue1[0]);
+ output[0] = fabs(inputValue1[0]);
- clampIfNeeded(output);
+ clampIfNeeded(output);
}
-void MathArcTan2Operation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
+void MathArcTan2Operation::executePixelSampled(float output[4],
+ float x,
+ float y,
+ PixelSampler sampler)
{
- float inputValue1[4];
- float inputValue2[4];
+ float inputValue1[4];
+ float inputValue2[4];
- this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
- this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
+ this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
+ this->m_inputValue2Operation->readSampled(inputValue2, x, y, sampler);
- output[0] = atan2(inputValue1[0], inputValue2[0]);
+ output[0] = atan2(inputValue1[0], inputValue2[0]);
- clampIfNeeded(output);
+ clampIfNeeded(output);
}
-void MathFloorOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
+void MathFloorOperation::executePixelSampled(float output[4],
+ float x,
+ float y,
+ PixelSampler sampler)
{
- float inputValue1[4];
+ float inputValue1[4];
- this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
+ this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
- output[0] = floor(inputValue1[0]);
+ output[0] = floor(inputValue1[0]);
- clampIfNeeded(output);
+ clampIfNeeded(output);
}
-void MathCeilOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
+void MathCeilOperation::executePixelSampled(float output[4],
+ float x,
+ float y,
+ PixelSampler sampler)
{
- float inputValue1[4];
+ float inputValue1[4];
- this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
+ this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
- output[0] = ceil(inputValue1[0]);
+ output[0] = ceil(inputValue1[0]);
- clampIfNeeded(output);
+ clampIfNeeded(output);
}
-void MathFractOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
+void MathFractOperation::executePixelSampled(float output[4],
+ float x,
+ float y,
+ PixelSampler sampler)
{
- float inputValue1[4];
+ float inputValue1[4];
- this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
+ this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
- output[0] = inputValue1[0] - floor(inputValue1[0]);
+ output[0] = inputValue1[0] - floor(inputValue1[0]);
- clampIfNeeded(output);
+ clampIfNeeded(output);
}
-void MathSqrtOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
+void MathSqrtOperation::executePixelSampled(float output[4],
+ float x,
+ float y,
+ PixelSampler sampler)
{
- float inputValue1[4];
+ float inputValue1[4];
- this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
+ this->m_inputValue1Operation->readSampled(inputValue1, x, y, sampler);
- if (inputValue1[0] > 0)
- output[0] = sqrt(inputValue1[0]);
- else
- output[0] = 0.0f;
+ if (inputValue1[0] > 0)
+ output[0] = sqrt(inputValue1[0]);
+ else
+ output[0] = 0.0f;
- clampIfNeeded(output);
+ clampIfNeeded(output);
}