fix for compositor regression where blur note offset the image one pixel to the top right.

This commit is contained in:
Campbell Barton
2012-11-02 12:44:09 +00:00
parent f8112b40a6
commit 6e17d1a5e0
4 changed files with 4 additions and 4 deletions

View File

@@ -123,7 +123,7 @@ void GaussianAlphaXBlurOperation::executePixel(float output[4], int x, int y, vo
float value_max = finv_test(buffer[(x * 4) + (y * 4 * bufferwidth)], do_invert); /* init with the current color to avoid unneeded lookups */ float value_max = finv_test(buffer[(x * 4) + (y * 4 * bufferwidth)], do_invert); /* init with the current color to avoid unneeded lookups */
float distfacinv_max = 1.0f; /* 0 to 1 */ float distfacinv_max = 1.0f; /* 0 to 1 */
for (int nx = minx; nx < maxx; nx += step) { for (int nx = minx; nx <= maxx; nx += step) {
const int index = (nx - x) + this->m_rad; const int index = (nx - x) + this->m_rad;
float value = finv_test(buffer[bufferindex], do_invert); float value = finv_test(buffer[bufferindex], do_invert);
float multiplier; float multiplier;

View File

@@ -121,7 +121,7 @@ void GaussianAlphaYBlurOperation::executePixel(float output[4], int x, int y, vo
float value_max = finv_test(buffer[(x * 4) + (y * 4 * bufferwidth)], do_invert); /* init with the current color to avoid unneeded lookups */ float value_max = finv_test(buffer[(x * 4) + (y * 4 * bufferwidth)], do_invert); /* init with the current color to avoid unneeded lookups */
float distfacinv_max = 1.0f; /* 0 to 1 */ float distfacinv_max = 1.0f; /* 0 to 1 */
for (int ny = miny; ny < maxy; ny += step) { for (int ny = miny; ny <= maxy; ny += step) {
int bufferindex = ((minx - bufferstartx) * 4) + ((ny - bufferstarty) * 4 * bufferwidth); int bufferindex = ((minx - bufferstartx) * 4) + ((ny - bufferstarty) * 4 * bufferwidth);
const int index = (ny - y) + this->m_rad; const int index = (ny - y) + this->m_rad;

View File

@@ -96,7 +96,7 @@ void GaussianXBlurOperation::executePixel(float output[4], int x, int y, void *d
int step = getStep(); int step = getStep();
int offsetadd = getOffsetAdd(); int offsetadd = getOffsetAdd();
int bufferindex = ((minx - bufferstartx) * 4) + ((miny - bufferstarty) * 4 * bufferwidth); int bufferindex = ((minx - bufferstartx) * 4) + ((miny - bufferstarty) * 4 * bufferwidth);
for (int nx = minx, index = (minx - x) + this->m_rad; nx < maxx; nx += step, index += step) { for (int nx = minx, index = (minx - x) + this->m_rad; nx <= maxx; nx += step, index += step) {
const float multiplier = this->m_gausstab[index]; const float multiplier = this->m_gausstab[index];
madd_v4_v4fl(color_accum, &buffer[bufferindex], multiplier); madd_v4_v4fl(color_accum, &buffer[bufferindex], multiplier);
multiplier_accum += multiplier; multiplier_accum += multiplier;

View File

@@ -96,7 +96,7 @@ void GaussianYBlurOperation::executePixel(float output[4], int x, int y, void *d
int index; int index;
int step = getStep(); int step = getStep();
const int bufferIndexx = ((minx - bufferstartx) * 4); const int bufferIndexx = ((minx - bufferstartx) * 4);
for (int ny = miny; ny < maxy; ny += step) { for (int ny = miny; ny <= maxy; ny += step) {
index = (ny - y) + this->m_rad; index = (ny - y) + this->m_rad;
int bufferindex = bufferIndexx + ((ny - bufferstarty) * 4 * bufferwidth); int bufferindex = bufferIndexx + ((ny - bufferstarty) * 4 * bufferwidth);
const float multiplier = this->m_gausstab[index]; const float multiplier = this->m_gausstab[index];