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>2012-08-10 18:07:24 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-08-10 18:07:24 +0400
commit94a3945cf9de0913b75f83b26e2e62b3bc1b0c07 (patch)
tree89aeabd20d883137b69815d9580f3bc108531a7e /source/blender/compositor/operations/COM_MultilayerImageOperation.cpp
parente8772477894a6fd8c09488b488fdcc1af432da1b (diff)
code cleanup: compositor - define size for executePixel function output float array
Diffstat (limited to 'source/blender/compositor/operations/COM_MultilayerImageOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_MultilayerImageOperation.cpp27
1 files changed, 12 insertions, 15 deletions
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]);
}
}