|
|
@@ -17,11 +17,12 @@ int main(int argc, char *argv[]) |
|
|
|
fprintf(stderr, "%s: too few arguments\n", argv[0]); |
|
|
|
fprintf(stderr, "Usage: %s <src> <method> <dest>\n", argv[0]); |
|
|
|
fprintf(stderr, "Where <method> is one of:\n"); |
|
|
|
fprintf(stderr, " 1 Floyd-Steinberg (raster)\n"); |
|
|
|
fprintf(stderr, " 2 Floyd-Steinberg (serpentine)\n"); |
|
|
|
fprintf(stderr, " 3 Ostromoukhov (raster)\n"); |
|
|
|
fprintf(stderr, " 4 Ostromoukhov (serpentine)\n"); |
|
|
|
fprintf(stderr, " 5 Direct binary search\n"); |
|
|
|
fprintf(stderr, " 1 random dithering\n"); |
|
|
|
fprintf(stderr, " 2 Floyd-Steinberg (raster)\n"); |
|
|
|
fprintf(stderr, " 3 Floyd-Steinberg (serpentine)\n"); |
|
|
|
fprintf(stderr, " 4 Ostromoukhov (raster)\n"); |
|
|
|
fprintf(stderr, " 5 Ostromoukhov (serpentine)\n"); |
|
|
|
fprintf(stderr, " 6 Direct binary search\n"); |
|
|
|
return EXIT_FAILURE; |
|
|
|
} |
|
|
|
|
|
|
@@ -32,24 +33,27 @@ int main(int argc, char *argv[]) |
|
|
|
|
|
|
|
switch(atoi(argv[2])) |
|
|
|
{ |
|
|
|
case 6: |
|
|
|
case 7: |
|
|
|
newimg = pipi_dither_dbs(img); |
|
|
|
break; |
|
|
|
case 5: |
|
|
|
case 6: |
|
|
|
newimg = pipi_dither_ostromoukhov(img, PIPI_SCAN_SERPENTINE); |
|
|
|
break; |
|
|
|
case 4: |
|
|
|
case 5: |
|
|
|
newimg = pipi_dither_ostromoukhov(img, PIPI_SCAN_RASTER); |
|
|
|
break; |
|
|
|
case 3: |
|
|
|
case 4: |
|
|
|
newimg = pipi_dither_floydsteinberg(img, PIPI_SCAN_SERPENTINE); |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
case 3: |
|
|
|
newimg = pipi_dither_floydsteinberg(img, PIPI_SCAN_RASTER); |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
newimg = pipi_dither_ordered(img); |
|
|
|
break; |
|
|
|
case 1: |
|
|
|
default: |
|
|
|
newimg = pipi_dither_ordered(img); |
|
|
|
newimg = pipi_dither_random(img); |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|