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:
Diffstat (limited to 'source/blender/compositor')
-rw-r--r--source/blender/compositor/intern/COM_CompositorContext.cpp5
-rw-r--r--source/blender/compositor/intern/COM_Converter.cpp10
-rw-r--r--source/blender/compositor/intern/COM_MemoryBuffer.cpp7
-rw-r--r--source/blender/compositor/intern/COM_NodeOperation.cpp51
-rw-r--r--source/blender/compositor/nodes/COM_TimeNode.cpp2
-rw-r--r--source/blender/compositor/operations/COM_AntiAliasOperation.cpp6
-rw-r--r--source/blender/compositor/operations/COM_CompositorOperation.cpp4
-rw-r--r--source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.cpp5
-rw-r--r--source/blender/compositor/operations/COM_CurveBaseOperation.cpp2
-rw-r--r--source/blender/compositor/operations/COM_DenoiseOperation.cpp25
-rw-r--r--source/blender/compositor/operations/COM_DisplaceOperation.cpp13
-rw-r--r--source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp5
-rw-r--r--source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp33
-rw-r--r--source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp46
-rw-r--r--source/blender/compositor/operations/COM_GlareBaseOperation.cpp15
-rw-r--r--source/blender/compositor/operations/COM_GlareGhostOperation.cpp5
-rw-r--r--source/blender/compositor/operations/COM_InpaintOperation.cpp33
-rw-r--r--source/blender/compositor/operations/COM_InpaintOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MapUVOperation.cpp15
-rw-r--r--source/blender/compositor/operations/COM_OutputFileOperation.cpp5
-rw-r--r--source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp5
-rw-r--r--source/blender/compositor/operations/COM_SunBeamsOperation.cpp2
-rw-r--r--source/blender/compositor/operations/COM_VectorBlurOperation.cpp9
-rw-r--r--source/blender/compositor/operations/COM_ViewerOperation.cpp5
24 files changed, 146 insertions, 166 deletions
diff --git a/source/blender/compositor/intern/COM_CompositorContext.cpp b/source/blender/compositor/intern/COM_CompositorContext.cpp
index e572fe7c99e..3d55fcba086 100644
--- a/source/blender/compositor/intern/COM_CompositorContext.cpp
+++ b/source/blender/compositor/intern/COM_CompositorContext.cpp
@@ -36,7 +36,6 @@ int CompositorContext::getFramenumber() const
if (this->m_rd) {
return this->m_rd->cfra;
}
- else {
- return -1; /* this should never happen */
- }
+
+ return -1; /* this should never happen */
}
diff --git a/source/blender/compositor/intern/COM_Converter.cpp b/source/blender/compositor/intern/COM_Converter.cpp
index edfeb3a3a04..60676ee42b7 100644
--- a/source/blender/compositor/intern/COM_Converter.cpp
+++ b/source/blender/compositor/intern/COM_Converter.cpp
@@ -416,19 +416,19 @@ NodeOperation *Converter::convertDataType(NodeOperationOutput *from, NodeOperati
if (fromDatatype == COM_DT_VALUE && toDatatype == COM_DT_COLOR) {
return new ConvertValueToColorOperation();
}
- else if (fromDatatype == COM_DT_VALUE && toDatatype == COM_DT_VECTOR) {
+ if (fromDatatype == COM_DT_VALUE && toDatatype == COM_DT_VECTOR) {
return new ConvertValueToVectorOperation();
}
- else if (fromDatatype == COM_DT_COLOR && toDatatype == COM_DT_VALUE) {
+ if (fromDatatype == COM_DT_COLOR && toDatatype == COM_DT_VALUE) {
return new ConvertColorToValueOperation();
}
- else if (fromDatatype == COM_DT_COLOR && toDatatype == COM_DT_VECTOR) {
+ if (fromDatatype == COM_DT_COLOR && toDatatype == COM_DT_VECTOR) {
return new ConvertColorToVectorOperation();
}
- else if (fromDatatype == COM_DT_VECTOR && toDatatype == COM_DT_VALUE) {
+ if (fromDatatype == COM_DT_VECTOR && toDatatype == COM_DT_VALUE) {
return new ConvertVectorToValueOperation();
}
- else if (fromDatatype == COM_DT_VECTOR && toDatatype == COM_DT_COLOR) {
+ if (fromDatatype == COM_DT_VECTOR && toDatatype == COM_DT_COLOR) {
return new ConvertVectorToColorOperation();
}
diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.cpp b/source/blender/compositor/intern/COM_MemoryBuffer.cpp
index b958314d1b4..f58d7a768cc 100644
--- a/source/blender/compositor/intern/COM_MemoryBuffer.cpp
+++ b/source/blender/compositor/intern/COM_MemoryBuffer.cpp
@@ -136,10 +136,9 @@ float MemoryBuffer::getMaximumValue(rcti *rect)
delete temp;
return result;
}
- else {
- BLI_assert(0);
- return 0.0f;
- }
+
+ BLI_assert(0);
+ return 0.0f;
}
MemoryBuffer::~MemoryBuffer()
diff --git a/source/blender/compositor/intern/COM_NodeOperation.cpp b/source/blender/compositor/intern/COM_NodeOperation.cpp
index fa4b5a07c65..4e3c5d2df6c 100644
--- a/source/blender/compositor/intern/COM_NodeOperation.cpp
+++ b/source/blender/compositor/intern/COM_NodeOperation.cpp
@@ -145,9 +145,8 @@ NodeOperation *NodeOperation::getInputOperation(unsigned int inputSocketIndex)
if (input && input->isConnected()) {
return &input->getLink()->getOperation();
}
- else {
- return NULL;
- }
+
+ return NULL;
}
void NodeOperation::getConnectedInputSockets(Inputs *sockets)
@@ -168,30 +167,29 @@ bool NodeOperation::determineDependingAreaOfInterest(rcti *input,
BLI_rcti_init(output, input->xmin, input->xmax, input->ymin, input->ymax);
return false;
}
- else {
- rcti tempOutput;
- bool first = true;
- for (int i = 0; i < getNumberOfInputSockets(); i++) {
- NodeOperation *inputOperation = this->getInputOperation(i);
- if (inputOperation &&
- inputOperation->determineDependingAreaOfInterest(input, readOperation, &tempOutput)) {
- if (first) {
- output->xmin = tempOutput.xmin;
- output->ymin = tempOutput.ymin;
- output->xmax = tempOutput.xmax;
- output->ymax = tempOutput.ymax;
- first = false;
- }
- else {
- output->xmin = min(output->xmin, tempOutput.xmin);
- output->ymin = min(output->ymin, tempOutput.ymin);
- output->xmax = max(output->xmax, tempOutput.xmax);
- output->ymax = max(output->ymax, tempOutput.ymax);
- }
+
+ rcti tempOutput;
+ bool first = true;
+ for (int i = 0; i < getNumberOfInputSockets(); i++) {
+ NodeOperation *inputOperation = this->getInputOperation(i);
+ if (inputOperation &&
+ inputOperation->determineDependingAreaOfInterest(input, readOperation, &tempOutput)) {
+ if (first) {
+ output->xmin = tempOutput.xmin;
+ output->ymin = tempOutput.ymin;
+ output->xmax = tempOutput.xmax;
+ output->ymax = tempOutput.ymax;
+ first = false;
+ }
+ else {
+ output->xmin = min(output->xmin, tempOutput.xmin);
+ output->ymin = min(output->ymin, tempOutput.ymin);
+ output->xmax = max(output->xmax, tempOutput.xmax);
+ output->ymax = max(output->ymax, tempOutput.ymax);
}
}
- return !first;
}
+ return !first;
}
/*****************
@@ -210,9 +208,8 @@ SocketReader *NodeOperationInput::getReader()
if (isConnected()) {
return &m_link->getOperation();
}
- else {
- return NULL;
- }
+
+ return NULL;
}
void NodeOperationInput::determineResolution(unsigned int resolution[2],
diff --git a/source/blender/compositor/nodes/COM_TimeNode.cpp b/source/blender/compositor/nodes/COM_TimeNode.cpp
index 9722ead0716..247e0d11df6 100644
--- a/source/blender/compositor/nodes/COM_TimeNode.cpp
+++ b/source/blender/compositor/nodes/COM_TimeNode.cpp
@@ -49,7 +49,7 @@ void TimeNode::convertToOperations(NodeConverter &converter,
fac = (context.getFramenumber() - node->custom1) / (float)(node->custom2 - node->custom1);
}
- BKE_curvemapping_initialize((CurveMapping *)node->storage);
+ BKE_curvemapping_init((CurveMapping *)node->storage);
fac = BKE_curvemapping_evaluateF((CurveMapping *)node->storage, 0, fac);
operation->setValue(clamp_f(fac, 0.0f, 1.0f));
converter.addOperation(operation);
diff --git a/source/blender/compositor/operations/COM_AntiAliasOperation.cpp b/source/blender/compositor/operations/COM_AntiAliasOperation.cpp
index 85725cc1d37..2c762323104 100644
--- a/source/blender/compositor/operations/COM_AntiAliasOperation.cpp
+++ b/source/blender/compositor/operations/COM_AntiAliasOperation.cpp
@@ -105,9 +105,9 @@ static int extrapolate9(float *E0,
}
return 1;
}
- else {
- return 0;
- }
+
+ return 0;
+
#undef PEQ
#undef PCPY
}
diff --git a/source/blender/compositor/operations/COM_CompositorOperation.cpp b/source/blender/compositor/operations/COM_CompositorOperation.cpp
index 71cef9dc4da..8d55fe53aa7 100644
--- a/source/blender/compositor/operations/COM_CompositorOperation.cpp
+++ b/source/blender/compositor/operations/COM_CompositorOperation.cpp
@@ -65,11 +65,11 @@ void CompositorOperation::initExecution()
this->m_depthInput = getInputSocketReader(2);
if (this->getWidth() * this->getHeight() != 0) {
this->m_outputBuffer = (float *)MEM_callocN(
- this->getWidth() * this->getHeight() * 4 * sizeof(float), "CompositorOperation");
+ sizeof(float[4]) * this->getWidth() * this->getHeight(), "CompositorOperation");
}
if (this->m_depthInput != NULL) {
this->m_depthBuffer = (float *)MEM_callocN(
- this->getWidth() * this->getHeight() * sizeof(float), "CompositorOperation");
+ sizeof(float) * this->getWidth() * this->getHeight(), "CompositorOperation");
}
}
diff --git a/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.cpp b/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.cpp
index 66043abd951..50f8eab5fbc 100644
--- a/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.cpp
+++ b/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.cpp
@@ -39,9 +39,8 @@ float ConvertDepthToRadiusOperation::determineFocalDistance()
this->m_cam_lens = camera->lens;
return BKE_camera_object_dof_distance(this->m_cameraObject);
}
- else {
- return 10.0f;
- }
+
+ return 10.0f;
}
void ConvertDepthToRadiusOperation::initExecution()
diff --git a/source/blender/compositor/operations/COM_CurveBaseOperation.cpp b/source/blender/compositor/operations/COM_CurveBaseOperation.cpp
index b18e77cf0e3..855f728f7bf 100644
--- a/source/blender/compositor/operations/COM_CurveBaseOperation.cpp
+++ b/source/blender/compositor/operations/COM_CurveBaseOperation.cpp
@@ -35,7 +35,7 @@ CurveBaseOperation::~CurveBaseOperation()
void CurveBaseOperation::initExecution()
{
- BKE_curvemapping_initialize(this->m_curveMapping);
+ BKE_curvemapping_init(this->m_curveMapping);
}
void CurveBaseOperation::deinitExecution()
{
diff --git a/source/blender/compositor/operations/COM_DenoiseOperation.cpp b/source/blender/compositor/operations/COM_DenoiseOperation.cpp
index d9a59002caf..4087056a79d 100644
--- a/source/blender/compositor/operations/COM_DenoiseOperation.cpp
+++ b/source/blender/compositor/operations/COM_DenoiseOperation.cpp
@@ -73,14 +73,13 @@ bool DenoiseOperation::determineDependingAreaOfInterest(rcti * /*input*/,
if (isCached()) {
return false;
}
- else {
- rcti newInput;
- newInput.xmax = this->getWidth();
- newInput.xmin = 0;
- newInput.ymax = this->getHeight();
- newInput.ymin = 0;
- return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
- }
+
+ rcti newInput;
+ newInput.xmax = this->getWidth();
+ newInput.xmin = 0;
+ newInput.ymax = this->getHeight();
+ newInput.ymin = 0;
+ return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
void DenoiseOperation::generateDenoise(float *data,
@@ -106,7 +105,7 @@ void DenoiseOperation::generateDenoise(float *data,
inputTileColor->getWidth(),
inputTileColor->getHeight(),
0,
- 4 * sizeof(float));
+ sizeof(float[4]));
if (inputTileNormal && inputTileNormal->getBuffer()) {
filter.setImage("normal",
inputTileNormal->getBuffer(),
@@ -114,7 +113,7 @@ void DenoiseOperation::generateDenoise(float *data,
inputTileNormal->getWidth(),
inputTileNormal->getHeight(),
0,
- 3 * sizeof(float));
+ sizeof(float[3]));
}
if (inputTileAlbedo && inputTileAlbedo->getBuffer()) {
filter.setImage("albedo",
@@ -123,7 +122,7 @@ void DenoiseOperation::generateDenoise(float *data,
inputTileAlbedo->getWidth(),
inputTileAlbedo->getHeight(),
0,
- 4 * sizeof(float));
+ sizeof(float[4]));
}
filter.setImage("output",
data,
@@ -131,7 +130,7 @@ void DenoiseOperation::generateDenoise(float *data,
inputTileColor->getWidth(),
inputTileColor->getHeight(),
0,
- 4 * sizeof(float));
+ sizeof(float[4]));
BLI_assert(settings);
if (settings) {
@@ -159,5 +158,5 @@ void DenoiseOperation::generateDenoise(float *data,
UNUSED_VARS(inputTileAlbedo, inputTileNormal, settings);
::memcpy(data,
inputBufferColor,
- inputTileColor->getWidth() * inputTileColor->getHeight() * sizeof(float) * 4);
+ sizeof(float[4]) * inputTileColor->getWidth() * inputTileColor->getHeight());
}
diff --git a/source/blender/compositor/operations/COM_DisplaceOperation.cpp b/source/blender/compositor/operations/COM_DisplaceOperation.cpp
index b775bfdee4c..73790447216 100644
--- a/source/blender/compositor/operations/COM_DisplaceOperation.cpp
+++ b/source/blender/compositor/operations/COM_DisplaceOperation.cpp
@@ -74,13 +74,12 @@ bool DisplaceOperation::read_displacement(
r_v = 0.0f;
return false;
}
- else {
- float col[4];
- m_inputVectorProgram->readSampled(col, x, y, COM_PS_BILINEAR);
- r_u = origin[0] - col[0] * xscale;
- r_v = origin[1] - col[1] * yscale;
- return true;
- }
+
+ float col[4];
+ m_inputVectorProgram->readSampled(col, x, y, COM_PS_BILINEAR);
+ r_u = origin[0] - col[0] * xscale;
+ r_v = origin[1] - col[1] * yscale;
+ return true;
}
void DisplaceOperation::pixelTransform(const float xy[2], float r_uv[2], float r_deriv[2][2])
diff --git a/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp b/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp
index 84f7fe2d225..675a402de6f 100644
--- a/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp
+++ b/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp
@@ -1330,9 +1330,8 @@ bool DoubleEdgeMaskOperation::determineDependingAreaOfInterest(rcti * /*input*/,
newInput.ymin = 0;
return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
- else {
- return false;
- }
+
+ return false;
}
void DoubleEdgeMaskOperation::initExecution()
diff --git a/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp b/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp
index 7a6b69d12fa..0ccb959712f 100644
--- a/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp
@@ -47,18 +47,17 @@ bool FastGaussianBlurOperation::determineDependingAreaOfInterest(
if (operation->determineDependingAreaOfInterest(&sizeInput, readOperation, output)) {
return true;
}
- else {
- if (this->m_iirgaus) {
- return false;
- }
- else {
- newInput.xmin = 0;
- newInput.ymin = 0;
- newInput.xmax = this->getWidth();
- newInput.ymax = this->getHeight();
- }
- return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
+
+ if (this->m_iirgaus) {
+ return false;
}
+
+ newInput.xmin = 0;
+ newInput.ymin = 0;
+ newInput.xmax = this->getWidth();
+ newInput.ymax = this->getHeight();
+
+ return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
void FastGaussianBlurOperation::initExecution()
@@ -282,12 +281,12 @@ bool FastGaussianBlurValueOperation::determineDependingAreaOfInterest(
if (this->m_iirgaus) {
return false;
}
- else {
- newInput.xmin = 0;
- newInput.ymin = 0;
- newInput.xmax = this->getWidth();
- newInput.ymax = this->getHeight();
- }
+
+ newInput.xmin = 0;
+ newInput.ymin = 0;
+ newInput.xmax = this->getWidth();
+ newInput.ymax = this->getHeight();
+
return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
diff --git a/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp
index 43e571c4bb7..dd479da864c 100644
--- a/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp
@@ -176,23 +176,22 @@ bool GaussianBokehBlurOperation::determineDependingAreaOfInterest(
if (operation->determineDependingAreaOfInterest(&sizeInput, readOperation, output)) {
return true;
}
+
+ if (this->m_sizeavailable && this->m_gausstab != NULL) {
+ newInput.xmin = 0;
+ newInput.ymin = 0;
+ newInput.xmax = this->getWidth();
+ newInput.ymax = this->getHeight();
+ }
else {
- if (this->m_sizeavailable && this->m_gausstab != NULL) {
- newInput.xmin = 0;
- newInput.ymin = 0;
- newInput.xmax = this->getWidth();
- newInput.ymax = this->getHeight();
- }
- else {
- int addx = this->m_radx;
- int addy = this->m_rady;
- newInput.xmax = input->xmax + addx;
- newInput.xmin = input->xmin - addx;
- newInput.ymax = input->ymax + addy;
- newInput.ymin = input->ymin - addy;
- }
- return BlurBaseOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
+ int addx = this->m_radx;
+ int addy = this->m_rady;
+ newInput.xmax = input->xmax + addx;
+ newInput.xmin = input->xmin - addx;
+ newInput.ymax = input->ymax + addy;
+ newInput.ymin = input->ymin - addy;
}
+ return BlurBaseOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
// reference image
@@ -351,13 +350,12 @@ bool GaussianBlurReferenceOperation::determineDependingAreaOfInterest(
if (operation->determineDependingAreaOfInterest(input, readOperation, output)) {
return true;
}
- else {
- int addx = this->m_data.sizex + 2;
- int addy = this->m_data.sizey + 2;
- newInput.xmax = input->xmax + addx;
- newInput.xmin = input->xmin - addx;
- newInput.ymax = input->ymax + addy;
- newInput.ymin = input->ymin - addy;
- return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
- }
+
+ int addx = this->m_data.sizex + 2;
+ int addy = this->m_data.sizey + 2;
+ newInput.xmax = input->xmax + addx;
+ newInput.xmin = input->xmin - addx;
+ newInput.ymax = input->ymax + addy;
+ newInput.ymin = input->ymin - addy;
+ return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
diff --git a/source/blender/compositor/operations/COM_GlareBaseOperation.cpp b/source/blender/compositor/operations/COM_GlareBaseOperation.cpp
index 593f1eaeefa..278e65a7dfd 100644
--- a/source/blender/compositor/operations/COM_GlareBaseOperation.cpp
+++ b/source/blender/compositor/operations/COM_GlareBaseOperation.cpp
@@ -58,12 +58,11 @@ bool GlareBaseOperation::determineDependingAreaOfInterest(rcti * /*input*/,
if (isCached()) {
return false;
}
- else {
- rcti newInput;
- newInput.xmax = this->getWidth();
- newInput.xmin = 0;
- newInput.ymax = this->getHeight();
- newInput.ymin = 0;
- return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
- }
+
+ rcti newInput;
+ newInput.xmax = this->getWidth();
+ newInput.xmin = 0;
+ newInput.ymax = this->getHeight();
+ newInput.ymin = 0;
+ return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
diff --git a/source/blender/compositor/operations/COM_GlareGhostOperation.cpp b/source/blender/compositor/operations/COM_GlareGhostOperation.cpp
index 9f01cf5d63a..760b833d1e1 100644
--- a/source/blender/compositor/operations/COM_GlareGhostOperation.cpp
+++ b/source/blender/compositor/operations/COM_GlareGhostOperation.cpp
@@ -28,9 +28,8 @@ static float smoothMask(float x, float y)
if ((t = 1.0f - sqrtf(x * x + y * y)) > 0.0f) {
return t;
}
- else {
- return 0.0f;
- }
+
+ return 0.0f;
}
void GlareGhostOperation::generateGlare(float *data, MemoryBuffer *inputTile, NodeGlare *settings)
diff --git a/source/blender/compositor/operations/COM_InpaintOperation.cpp b/source/blender/compositor/operations/COM_InpaintOperation.cpp
index 0967984899d..0555ee24b9b 100644
--- a/source/blender/compositor/operations/COM_InpaintOperation.cpp
+++ b/source/blender/compositor/operations/COM_InpaintOperation.cpp
@@ -34,7 +34,7 @@ InpaintSimpleOperation::InpaintSimpleOperation() : NodeOperation()
this->setComplex(true);
this->m_inputImageProgram = NULL;
this->m_pixelorder = NULL;
- this->m_manhatten_distance = NULL;
+ this->m_manhattan_distance = NULL;
this->m_cached_buffer = NULL;
this->m_cached_buffer_ready = false;
}
@@ -43,7 +43,7 @@ void InpaintSimpleOperation::initExecution()
this->m_inputImageProgram = this->getInputSocketReader(0);
this->m_pixelorder = NULL;
- this->m_manhatten_distance = NULL;
+ this->m_manhattan_distance = NULL;
this->m_cached_buffer = NULL;
this->m_cached_buffer_ready = false;
@@ -85,7 +85,7 @@ int InpaintSimpleOperation::mdist(int x, int y)
ASSERT_XY_RANGE(x, y);
- return this->m_manhatten_distance[y * width + x];
+ return this->m_manhattan_distance[y * width + x];
}
bool InpaintSimpleOperation::next_pixel(int &x, int &y, int &curr, int iters)
@@ -108,11 +108,11 @@ bool InpaintSimpleOperation::next_pixel(int &x, int &y, int &curr, int iters)
return true;
}
-void InpaintSimpleOperation::calc_manhatten_distance()
+void InpaintSimpleOperation::calc_manhattan_distance()
{
int width = this->getWidth();
int height = this->getHeight();
- short *m = this->m_manhatten_distance = (short *)MEM_mallocN(sizeof(short) * width * height,
+ short *m = this->m_manhattan_distance = (short *)MEM_mallocN(sizeof(short) * width * height,
__func__);
int *offsets;
@@ -223,7 +223,7 @@ void *InpaintSimpleOperation::initializeTileData(rcti *rect)
MemoryBuffer *buf = (MemoryBuffer *)this->m_inputImageProgram->initializeTileData(rect);
this->m_cached_buffer = (float *)MEM_dupallocN(buf->getBuffer());
- this->calc_manhatten_distance();
+ this->calc_manhattan_distance();
int curr = 0;
int x, y;
@@ -258,9 +258,9 @@ void InpaintSimpleOperation::deinitExecution()
this->m_pixelorder = NULL;
}
- if (this->m_manhatten_distance) {
- MEM_freeN(this->m_manhatten_distance);
- this->m_manhatten_distance = NULL;
+ if (this->m_manhattan_distance) {
+ MEM_freeN(this->m_manhattan_distance);
+ this->m_manhattan_distance = NULL;
}
this->m_cached_buffer_ready = false;
}
@@ -272,14 +272,13 @@ bool InpaintSimpleOperation::determineDependingAreaOfInterest(rcti * /*input*/,
if (this->m_cached_buffer_ready) {
return false;
}
- else {
- rcti newInput;
- newInput.xmax = getWidth();
- newInput.xmin = 0;
- newInput.ymax = getHeight();
- newInput.ymin = 0;
+ rcti newInput;
- return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
- }
+ newInput.xmax = getWidth();
+ newInput.xmin = 0;
+ newInput.ymax = getHeight();
+ newInput.ymin = 0;
+
+ return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
diff --git a/source/blender/compositor/operations/COM_InpaintOperation.h b/source/blender/compositor/operations/COM_InpaintOperation.h
index 12523d5f064..86f3393e1ea 100644
--- a/source/blender/compositor/operations/COM_InpaintOperation.h
+++ b/source/blender/compositor/operations/COM_InpaintOperation.h
@@ -34,7 +34,7 @@ class InpaintSimpleOperation : public NodeOperation {
int *m_pixelorder;
int m_area_size;
- short *m_manhatten_distance;
+ short *m_manhattan_distance;
public:
InpaintSimpleOperation();
@@ -65,7 +65,7 @@ class InpaintSimpleOperation : public NodeOperation {
rcti *output);
private:
- void calc_manhatten_distance();
+ void calc_manhattan_distance();
void clamp_xy(int &x, int &y);
float *get_pixel(int x, int y);
int mdist(int x, int y);
diff --git a/source/blender/compositor/operations/COM_MapUVOperation.cpp b/source/blender/compositor/operations/COM_MapUVOperation.cpp
index de55c9fb4b8..9101b82202a 100644
--- a/source/blender/compositor/operations/COM_MapUVOperation.cpp
+++ b/source/blender/compositor/operations/COM_MapUVOperation.cpp
@@ -87,14 +87,13 @@ bool MapUVOperation::read_uv(float x, float y, float &r_u, float &r_v, float &r_
r_alpha = 0.0f;
return false;
}
- else {
- float vector[3];
- m_inputUVProgram->readSampled(vector, x, y, COM_PS_BILINEAR);
- r_u = vector[0] * m_inputColorProgram->getWidth();
- r_v = vector[1] * m_inputColorProgram->getHeight();
- r_alpha = vector[2];
- return true;
- }
+
+ float vector[3];
+ m_inputUVProgram->readSampled(vector, x, y, COM_PS_BILINEAR);
+ r_u = vector[0] * m_inputColorProgram->getWidth();
+ r_v = vector[1] * m_inputColorProgram->getHeight();
+ r_alpha = vector[2];
+ return true;
}
void MapUVOperation::pixelTransform(const float xy[2],
diff --git a/source/blender/compositor/operations/COM_OutputFileOperation.cpp b/source/blender/compositor/operations/COM_OutputFileOperation.cpp
index ee3779edcb4..374189a5c50 100644
--- a/source/blender/compositor/operations/COM_OutputFileOperation.cpp
+++ b/source/blender/compositor/operations/COM_OutputFileOperation.cpp
@@ -129,9 +129,8 @@ static float *init_buffer(unsigned int width, unsigned int height, DataType data
int size = get_datatype_size(datatype);
return (float *)MEM_callocN(width * height * size * sizeof(float), "OutputFile buffer");
}
- else {
- return NULL;
- }
+
+ return NULL;
}
static void write_buffer_rect(rcti *rect,
diff --git a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp
index 738c51fc719..b7731a34c91 100644
--- a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp
+++ b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp
@@ -124,9 +124,8 @@ bool ScreenLensDistortionOperation::get_delta(float r_sq,
distort_uv(uv, t, delta);
return true;
}
- else {
- return false;
- }
+
+ return false;
}
void ScreenLensDistortionOperation::accumulate(MemoryBuffer *buffer,
diff --git a/source/blender/compositor/operations/COM_SunBeamsOperation.cpp b/source/blender/compositor/operations/COM_SunBeamsOperation.cpp
index 6f47e0e190b..4a7139537c1 100644
--- a/source/blender/compositor/operations/COM_SunBeamsOperation.cpp
+++ b/source/blender/compositor/operations/COM_SunBeamsOperation.cpp
@@ -172,7 +172,7 @@ template<int fxu, int fxv, int fyu, int fyv> struct BufferLineAccumulator {
return;
}
- /* initialise the iteration variables */
+ /* Initialize the iteration variables. */
float *buffer = init_buffer_iterator(
input, source, co, dist_min, dist_max, x, y, num, v, dv, falloff_factor);
zero_v3(border);
diff --git a/source/blender/compositor/operations/COM_VectorBlurOperation.cpp b/source/blender/compositor/operations/COM_VectorBlurOperation.cpp
index 56e0ab9b93f..1e392b1f991 100644
--- a/source/blender/compositor/operations/COM_VectorBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_VectorBlurOperation.cpp
@@ -115,9 +115,8 @@ bool VectorBlurOperation::determineDependingAreaOfInterest(rcti * /*input*/,
newInput.ymin = 0;
return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
- else {
- return false;
- }
+
+ return false;
}
void VectorBlurOperation::generateVectorBlur(float *data,
@@ -596,7 +595,7 @@ void zbuf_accumulate_vecblur(NodeBlurData *nbd,
float minspeed = (float)nbd->minspeed;
float minspeedsq = minspeed * minspeed;
- minvecbufrect = (float *)MEM_callocN(4 * sizeof(float) * xsize * ysize, "minspeed buf");
+ minvecbufrect = (float *)MEM_callocN(sizeof(float[4]) * xsize * ysize, "minspeed buf");
dvec1 = vecbufrect;
dvec2 = minvecbufrect;
@@ -622,7 +621,7 @@ void zbuf_accumulate_vecblur(NodeBlurData *nbd,
}
/* make vertex buffer with averaged speed and zvalues */
- rectvz = (float *)MEM_callocN(4 * sizeof(float) * (xsize + 1) * (ysize + 1), "vertices");
+ rectvz = (float *)MEM_callocN(sizeof(float[4]) * (xsize + 1) * (ysize + 1), "vertices");
dvz = rectvz;
for (y = 0; y <= ysize; y++) {
diff --git a/source/blender/compositor/operations/COM_ViewerOperation.cpp b/source/blender/compositor/operations/COM_ViewerOperation.cpp
index fc26d6219e1..3d5d50e1c7f 100644
--- a/source/blender/compositor/operations/COM_ViewerOperation.cpp
+++ b/source/blender/compositor/operations/COM_ViewerOperation.cpp
@@ -199,7 +199,6 @@ CompositorPriority ViewerOperation::getRenderPriority() const
if (this->isActiveViewerOutput()) {
return COM_PRIORITY_HIGH;
}
- else {
- return COM_PRIORITY_LOW;
- }
+
+ return COM_PRIORITY_LOW;
}