瀏覽代碼

* convolution_template.h: disambiguate parentheses.

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2741 92316355-f0b4-4df1-b90c-862c8a59935f
remotes/tiles
sam 16 年之前
父節點
當前提交
8e5b11ae39
共有 1 個檔案被更改,包括 8 行新增8 行删除
  1. +8
    -8
      pipi/filter/convolution_template.h

+ 8
- 8
pipi/filter/convolution_template.h 查看文件

@@ -57,13 +57,13 @@ static pipi_image_t *FUNC1(pipi_image_t *src, int m, int n, double mat[])
for(j = 0; j < n; j++)
{
y2 = y + j - n / 2;
if(y2 < 0) y2 = FLAG_WRAP ? (h - 1 - (-y2 - 1) % h) : 0;
if(y2 < 0) y2 = FLAG_WRAP ? h - 1 - ((-y2 - 1) % h) : 0;
else if(y2 >= h) y2 = FLAG_WRAP ? y2 % h : h - 1;

for(i = 0; i < m; i++)
{
x2 = x + i - m / 2;
if(x2 < 0) x2 = FLAG_WRAP ? (w - 1 - (-x2 - 1) % w) : 0;
if(x2 < 0) x2 = FLAG_WRAP ? w - 1 - ((-x2 - 1) % w) : 0;
else if(x2 >= w) x2 = FLAG_WRAP ? x2 % w : w - 1;

Y += mat[j * m + i] * srcdata[y2 * w + x2];
@@ -80,7 +80,7 @@ static pipi_image_t *FUNC1(pipi_image_t *src, int m, int n, double mat[])
for(j = 0; j < n; j++)
{
y2 = y + j - n / 2;
if(y2 < 0) y2 = FLAG_WRAP ? (h - 1 - (-y2 - 1) % h) : 0;
if(y2 < 0) y2 = FLAG_WRAP ? h - 1 - ((-y2 - 1) % h) : 0;
else if(y2 >= h) y2 = FLAG_WRAP ? y2 % h : h - 1;

for(i = 0; i < m; i++)
@@ -88,7 +88,7 @@ static pipi_image_t *FUNC1(pipi_image_t *src, int m, int n, double mat[])
double f = mat[j * m + i];

x2 = x + i - m / 2;
if(x2 < 0) x2 = FLAG_WRAP ? (w - 1 - (-x2 - 1) % w) : 0;
if(x2 < 0) x2 = FLAG_WRAP ? w - 1 - ((-x2 - 1) % w) : 0;
else if(x2 >= w) x2 = FLAG_WRAP ? x2 % w : w - 1;

R += f * srcdata[(y2 * w + x2) * 4];
@@ -142,7 +142,7 @@ static pipi_image_t *FUNC2(pipi_image_t *src,
for(i = 0; i < m; i++)
{
x2 = x + i - m / 2;
if(x2 < 0) x2 = FLAG_WRAP ? (w - 1 - (-x2 - 1) % w) : 0;
if(x2 < 0) x2 = FLAG_WRAP ? w - 1 - ((-x2 - 1) % w) : 0;
else if(x2 >= w) x2 = FLAG_WRAP ? x2 % w : w - 1;

Y += hvec[i] * srcdata[y * w + x2];
@@ -160,7 +160,7 @@ static pipi_image_t *FUNC2(pipi_image_t *src,
double f = hvec[i];

x2 = x + i - m / 2;
if(x2 < 0) x2 = FLAG_WRAP ? (w - 1 - (-x2 - 1) % w) : 0;
if(x2 < 0) x2 = FLAG_WRAP ? w - 1 - ((-x2 - 1) % w) : 0;
else if(x2 >= w) x2 = FLAG_WRAP ? x2 % w : w - 1;

R += f * srcdata[(y * w + x2) * 4];
@@ -187,7 +187,7 @@ static pipi_image_t *FUNC2(pipi_image_t *src,
for(j = 0; j < n; j++)
{
y2 = y + j - n / 2;
if(y2 < 0) y2 = FLAG_WRAP ? (h - 1 - (-y2 - 1) % h) : 0;
if(y2 < 0) y2 = FLAG_WRAP ? h - 1 - ((-y2 - 1) % h) : 0;
else if(y2 >= h) y2 = FLAG_WRAP ? y2 % h : h - 1;

Y += vvec[j] * buffer[y2 * w + x];
@@ -205,7 +205,7 @@ static pipi_image_t *FUNC2(pipi_image_t *src,
double f = vvec[j];

y2 = y + j - n / 2;
if(y2 < 0) y2 = FLAG_WRAP ? (h - 1 - (-y2 - 1) % h) : 0;
if(y2 < 0) y2 = FLAG_WRAP ? h - 1 - ((-y2 - 1) % h) : 0;
else if(y2 >= h) y2 = FLAG_WRAP ? y2 % h : h - 1;

R += f * buffer[(y2 * w + x) * 4];


Loading…
取消
儲存