Changeset 2761


Ignore:
Timestamp:
Aug 24, 2008, 1:58:45 AM (12 years ago)
Author:
Sam Hocevar
Message:
  • Add the "halftone" dithering method, which uses classical halftone (aka. clustered ordered dither). Halftoning levels aren't terribly well supported yet, though.
Location:
libpipi/trunk/pipi
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • libpipi/trunk/pipi/Makefile.am

    r2759 r2761  
    6767        dither/ediff.c \
    6868        dither/ordered.c \
     69        dither/halftone.c \
    6970        dither/ostromoukhov.c \
    7071        dither/dbs.c \
  • libpipi/trunk/pipi/context.c

    r2759 r2761  
    113113            ctx->nimages--;
    114114        }
     115        else if(!strncmp(method, "halftone", 8))
     116        {
     117            double r, angle = .0;
     118            method = strchr(method, ':');
     119            if(!method)
     120                return -1;
     121            r = atof(method + 1);
     122            method = strchr(method + 1, ':');
     123            if(method)
     124                angle = atof(method + 1);
     125            if(r < 1.)
     126                r = 1.;
     127            dst = pipi_dither_halftone(src, r, angle);
     128        }
    115129        else if(!strcmp(method, "random"))
    116130            dst = pipi_dither_random(src);
  • libpipi/trunk/pipi/pipi.h

    r2759 r2761  
    151151                                       pipi_scan_t);
    152152extern pipi_image_t *pipi_dither_ordered(pipi_image_t *, pipi_image_t *);
     153extern pipi_image_t *pipi_dither_halftone(pipi_image_t *, double, double);
    153154extern pipi_image_t *pipi_dither_random(pipi_image_t *);
    154155extern pipi_image_t *pipi_dither_ostromoukhov(pipi_image_t *, pipi_scan_t);
Note: See TracChangeset for help on using the changeset viewer.