瀏覽代碼

* blur.c: improve the Gaussian kernel interpolation.

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2737 92316355-f0b4-4df1-b90c-862c8a59935f
remotes/tiles
sam 16 年之前
父節點
當前提交
8996a532df
共有 1 個文件被更改,包括 12 次插入6 次删除
  1. +12
    -6
      pipi/filter/blur.c

+ 12
- 6
pipi/filter/blur.c 查看文件

@@ -71,18 +71,24 @@ pipi_image_t *pipi_gaussian_blur_ext(pipi_image_t *src, float rx, float ry,
{
for(i = -krx; i <= krx; i++)
{
/* FIXME: this level of interpolation sucks. We should
* interpolate on the full NxN grid for better quality. */
static double const samples[] =
{
-.50, -.50, 0.5,
.50, -.50, 0.5,
.0, .0, 1,
-.50, .50, 0.5,
.50, .50, 0.5
-.40, -.40, 0.8,
-.30, .0, 0.9,
-.40, .40, 0.8,
.0, .30, 0.9,
.40, .40, 0.8,
.30, .0, 0.9,
.40, -.40, 0.8,
.0, -.30, 0.9,
};
double u, v, ex, ey, d = 0.;
int k;
unsigned int k;

for(k = 0; k < 5; k++)
for(k = 0; k < sizeof(samples) / sizeof(*samples) / 3; k++)
{
u = ((double)i + samples[k * 3]) * cost
- ((double)j + samples[k * 3 + 1]) * sint + dx;


Loading…
取消
儲存