Bläddra i källkod

* 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 år sedan
förälder
incheckning
8996a532df
1 ändrade filer med 12 tillägg och 6 borttagningar
  1. +12
    -6
      pipi/filter/blur.c

+ 12
- 6
pipi/filter/blur.c Visa fil

@@ -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;


Laddar…
Avbryt
Spara