git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2666 92316355-f0b4-4df1-b90c-862c8a59935fremotes/tiles
@@ -33,18 +33,24 @@ int main(int argc, char *argv[]) | |||||
switch(atoi(argv[2])) | switch(atoi(argv[2])) | ||||
{ | { | ||||
case 6: | case 6: | ||||
newimg = pipi_dbs(img); break; | |||||
newimg = pipi_dither_dbs(img); | |||||
break; | |||||
case 5: | case 5: | ||||
newimg = pipi_ostromoukhov(img, PIPI_SCAN_SERPENTINE); break; | |||||
newimg = pipi_dither_ostromoukhov(img, PIPI_SCAN_SERPENTINE); | |||||
break; | |||||
case 4: | case 4: | ||||
newimg = pipi_ostromoukhov(img, PIPI_SCAN_RASTER); break; | |||||
newimg = pipi_dither_ostromoukhov(img, PIPI_SCAN_RASTER); | |||||
break; | |||||
case 3: | case 3: | ||||
newimg = pipi_floydsteinberg(img, PIPI_SCAN_SERPENTINE); break; | |||||
newimg = pipi_dither_floydsteinberg(img, PIPI_SCAN_SERPENTINE); | |||||
break; | |||||
case 2: | case 2: | ||||
newimg = pipi_floydsteinberg(img, PIPI_SCAN_RASTER); break; | |||||
newimg = pipi_dither_floydsteinberg(img, PIPI_SCAN_RASTER); | |||||
break; | |||||
case 1: | case 1: | ||||
default: | default: | ||||
newimg = pipi_dither_ordered(img); break; | |||||
newimg = pipi_dither_ordered(img); | |||||
break; | |||||
} | } | ||||
pipi_free(img); | pipi_free(img); | ||||
@@ -52,7 +52,7 @@ int main(int argc, char *argv[]) | |||||
img = pipi_load(argv[1]); | img = pipi_load(argv[1]); | ||||
pipi_getpixels(img, PIPI_PIXELS_Y_F); | pipi_getpixels(img, PIPI_PIXELS_Y_F); | ||||
gauss = pipi_gaussian_blur(img, sigma); | gauss = pipi_gaussian_blur(img, sigma); | ||||
dither = pipi_floydsteinberg(img, PIPI_SCAN_RASTER); | |||||
dither = pipi_dither_floydsteinberg(img, PIPI_SCAN_RASTER); | |||||
pipi_free(img); | pipi_free(img); | ||||
/* Compute the standard error */ | /* Compute the standard error */ | ||||
@@ -35,7 +35,7 @@ | |||||
/* FIXME: though the algorithm is supposed to stop, we do not have a real, | /* FIXME: though the algorithm is supposed to stop, we do not have a real, | ||||
* guaranteed stop condition here. */ | * 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 kernel[NN * NN]; | ||||
double t = 0.; | double t = 0.; | ||||
@@ -22,7 +22,7 @@ | |||||
#include "pipi.h" | #include "pipi.h" | ||||
#include "pipi_internals.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_image_t *dst; | ||||
pipi_pixels_t *srcp, *dstp; | pipi_pixels_t *srcp, *dstp; | ||||
@@ -66,7 +66,7 @@ static int const table[][3] = | |||||
{385, 112, 103}, {65, 18, 17}, {395, 104, 101}, {4, 1, 1} | {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_image_t *dst; | ||||
pipi_pixels_t *srcp, *dstp; | pipi_pixels_t *srcp, *dstp; | ||||
@@ -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 *, | extern pipi_image_t *pipi_gaussian_blur_ext(pipi_image_t *, | ||||
float, float, float, float); | 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_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_dither_24to16(pipi_image_t *); | ||||
extern void pipi_test(pipi_image_t *); | extern void pipi_test(pipi_image_t *); | ||||