diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-08-10 18:07:24 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-08-10 18:07:24 +0400 |
commit | 94a3945cf9de0913b75f83b26e2e62b3bc1b0c07 (patch) | |
tree | 89aeabd20d883137b69815d9580f3bc108531a7e /source/blender/compositor/operations/COM_ImageOperation.cpp | |
parent | e8772477894a6fd8c09488b488fdcc1af432da1b (diff) |
code cleanup: compositor - define size for executePixel function output float array
Diffstat (limited to 'source/blender/compositor/operations/COM_ImageOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_ImageOperation.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/compositor/operations/COM_ImageOperation.cpp b/source/blender/compositor/operations/COM_ImageOperation.cpp index c15bb1dc5e6..4ec5643c0bb 100644 --- a/source/blender/compositor/operations/COM_ImageOperation.cpp +++ b/source/blender/compositor/operations/COM_ImageOperation.cpp @@ -107,32 +107,32 @@ void BaseImageOperation::determineResolution(unsigned int resolution[2], unsigne } } -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]; } } |