瀏覽代碼

* Prefix dithering functions with _dither_ to avoid namespace cluttering.

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2666 92316355-f0b4-4df1-b90c-862c8a59935f
remotes/tiles
sam 16 年之前
父節點
當前提交
41efcdecc0
共有 6 個檔案被更改,包括 19 行新增13 行删除
  1. +12
    -6
      examples/dither.c
  2. +1
    -1
      examples/edd.c
  3. +1
    -1
      pipi/dither/dbs.c
  4. +1
    -1
      pipi/dither/floydsteinberg.c
  5. +1
    -1
      pipi/dither/ostromoukhov.c
  6. +3
    -3
      pipi/pipi.h

+ 12
- 6
examples/dither.c 查看文件

@@ -33,18 +33,24 @@ int main(int argc, char *argv[])
switch(atoi(argv[2]))
{
case 6:
newimg = pipi_dbs(img); break;
newimg = pipi_dither_dbs(img);
break;
case 5:
newimg = pipi_ostromoukhov(img, PIPI_SCAN_SERPENTINE); break;
newimg = pipi_dither_ostromoukhov(img, PIPI_SCAN_SERPENTINE);
break;
case 4:
newimg = pipi_ostromoukhov(img, PIPI_SCAN_RASTER); break;
newimg = pipi_dither_ostromoukhov(img, PIPI_SCAN_RASTER);
break;
case 3:
newimg = pipi_floydsteinberg(img, PIPI_SCAN_SERPENTINE); break;
newimg = pipi_dither_floydsteinberg(img, PIPI_SCAN_SERPENTINE);
break;
case 2:
newimg = pipi_floydsteinberg(img, PIPI_SCAN_RASTER); break;
newimg = pipi_dither_floydsteinberg(img, PIPI_SCAN_RASTER);
break;
case 1:
default:
newimg = pipi_dither_ordered(img); break;
newimg = pipi_dither_ordered(img);
break;
}

pipi_free(img);


+ 1
- 1
examples/edd.c 查看文件

@@ -52,7 +52,7 @@ int main(int argc, char *argv[])
img = pipi_load(argv[1]);
pipi_getpixels(img, PIPI_PIXELS_Y_F);
gauss = pipi_gaussian_blur(img, sigma);
dither = pipi_floydsteinberg(img, PIPI_SCAN_RASTER);
dither = pipi_dither_floydsteinberg(img, PIPI_SCAN_RASTER);
pipi_free(img);

/* Compute the standard error */


+ 1
- 1
pipi/dither/dbs.c 查看文件

@@ -35,7 +35,7 @@
/* FIXME: though the algorithm is supposed to stop, we do not have a real,
* guaranteed stop condition here. */

pipi_image_t *pipi_dbs(pipi_image_t *src)
pipi_image_t *pipi_dither_dbs(pipi_image_t *src)
{
double kernel[NN * NN];
double t = 0.;


+ 1
- 1
pipi/dither/floydsteinberg.c 查看文件

@@ -22,7 +22,7 @@
#include "pipi.h"
#include "pipi_internals.h"

pipi_image_t *pipi_floydsteinberg(pipi_image_t *src, pipi_scan_t scan)
pipi_image_t *pipi_dither_floydsteinberg(pipi_image_t *src, pipi_scan_t scan)
{
pipi_image_t *dst;
pipi_pixels_t *srcp, *dstp;


+ 1
- 1
pipi/dither/ostromoukhov.c 查看文件

@@ -66,7 +66,7 @@ static int const table[][3] =
{385, 112, 103}, {65, 18, 17}, {395, 104, 101}, {4, 1, 1}
};

pipi_image_t *pipi_ostromoukhov(pipi_image_t *src, pipi_scan_t scan)
pipi_image_t *pipi_dither_ostromoukhov(pipi_image_t *src, pipi_scan_t scan)
{
pipi_image_t *dst;
pipi_pixels_t *srcp, *dstp;


+ 3
- 3
pipi/pipi.h 查看文件

@@ -78,10 +78,10 @@ extern pipi_image_t *pipi_gaussian_blur(pipi_image_t *, float);
extern pipi_image_t *pipi_gaussian_blur_ext(pipi_image_t *,
float, float, float, float);

extern pipi_image_t *pipi_floydsteinberg(pipi_image_t *, pipi_scan_t);
extern pipi_image_t *pipi_dither_floydsteinberg(pipi_image_t *, pipi_scan_t);
extern pipi_image_t *pipi_dither_ordered(pipi_image_t *);
extern pipi_image_t *pipi_ostromoukhov(pipi_image_t *, pipi_scan_t);
extern pipi_image_t *pipi_dbs(pipi_image_t *);
extern pipi_image_t *pipi_dither_ostromoukhov(pipi_image_t *, pipi_scan_t);
extern pipi_image_t *pipi_dither_dbs(pipi_image_t *);
extern void pipi_dither_24to16(pipi_image_t *);

extern void pipi_test(pipi_image_t *);


Loading…
取消
儲存