Changeset 2758 for libpipi


Ignore:
Timestamp:
Aug 23, 2008, 3:07:35 PM (12 years ago)
Author:
Sam Hocevar
Message:
  • Add pipi_dither_ediff(), a generic error diffusion dithering algorithm that uses an image as the error diffusion kernel.
Location:
libpipi/trunk/pipi
Files:
1 added
3 edited

Legend:

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

    r2753 r2758  
    6565
    6666dither_sources = \
     67        dither/ediff.c \
    6768        dither/floydsteinberg.c \
    6869        dither/jajuni.c \
  • libpipi/trunk/pipi/context.c

    r2755 r2758  
    101101        else if(!strcmp(method, "sost"))
    102102            dst = pipi_dither_ostromoukhov(src, 1);
     103        else if(!strcmp(method, "ediff"))
     104        {
     105            if(ctx->nimages < 2)
     106                return -1;
     107            dst = pipi_dither_ediff(ctx->images[ctx->nimages - 2], src, 0);
     108            pipi_free(ctx->images[ctx->nimages - 2]);
     109            ctx->nimages--;
     110        }
    103111        else if(!strcmp(method, "ordered"))
    104112        {
  • libpipi/trunk/pipi/pipi.h

    r2754 r2758  
    148148extern pipi_image_t *pipi_reduce(pipi_image_t *, int, double const *);
    149149
     150extern pipi_image_t *pipi_dither_ediff(pipi_image_t *, pipi_image_t *,
     151                                       pipi_scan_t);
    150152extern pipi_image_t *pipi_dither_floydsteinberg(pipi_image_t *, pipi_scan_t);
    151153extern pipi_image_t *pipi_dither_jajuni(pipi_image_t *, pipi_scan_t);
Note: See TracChangeset for help on using the changeset viewer.